query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Declares an association between this object and a ChildTblProdPrices object.
public function setTblProdPrices(ChildTblProdPrices $v = null) { if ($v === null) { $this->setProdId(NULL); } else { $this->setProdId($v->getProdId()); } $this->aTblProdPrices = $v; // Add binding for other direction of this 1:1 relationship. if ($v !== null) { $v->setTblProdInfo($this); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setTblProdPricing(ChildTblProdPricing $v = null)\n {\n if ($v === null) {\n $this->setProdPriceId(NULL);\n } else {\n $this->setProdPriceId($v->getProdPriceId());\n }\n\n $this->aTblProdPricing = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblProdPricing object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}", "public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }", "public function getTblProdPrices(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPrices === null && ($this->prod_id !== null)) {\n $this->aTblProdPrices = ChildTblProdPricesQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdPrices->setTblProdInfo($this);\n }\n\n return $this->aTblProdPrices;\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function setProdPriceId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_price_id !== $v) {\n $this->prod_price_id = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_PRICE_ID] = true;\n }\n\n if ($this->aTblProdPricing !== null && $this->aTblProdPricing->getProdPriceId() !== $v) {\n $this->aTblProdPricing = null;\n }\n\n return $this;\n }", "public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }", "public function initialize()\n {\n $this->setSchema(\"atiempo_prod\");\n $this->hasMany('id', 'AcCartaAvalDetalle', 'id_carta', ['alias' => 'AcCartaAvalDetalle']);\n }", "public function prices()\n {\n return $this->hasMany(Price::class);\n }", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }", "public function prices(){\n \t return this->belongsToMany('App\\prices','price_service_time');\n }", "public function getProdPriceId()\n {\n return $this->prod_price_id;\n }", "public function getTblProdPricing(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPricing === null && ($this->prod_price_id !== null)) {\n $this->aTblProdPricing = ChildTblProdPricingQuery::create()->findPk($this->prod_price_id, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblProdPricing->addTblProdInfos($this);\n */\n }\n\n return $this->aTblProdPricing;\n }", "public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }", "public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function prices() {\n return $this->hasMany('Auction_price'); // this matches the Eloquent model\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function __construct()\n\t{\n\t\t$this->has_one['product'] = array('Products_m', 'id', 'product_id');\n\t\t// $this->soft_deletes = TRUE;\n\t\tparent::__construct();\n\t}", "protected function _saveProductTierPrices(array $tierPriceData)\n {\n static $tableName = null;\n\n if (!$tableName) {\n $tableName = $this->_resourceFactory->create()->getTable('catalog_product_entity_tier_price');\n }\n if ($tierPriceData) {\n $tierPriceIn = [];\n $delProductId = [];\n\n foreach ($tierPriceData as $delSku => $tierPriceRows) {\n $productId = $this->skuProcessor->getNewSku($delSku)[$this->getProductEntityLinkField()];\n $delProductId[] = $productId;\n\n foreach ($tierPriceRows as $row) {\n $row[$this->getProductEntityLinkField()] = $productId;\n $tierPriceIn[] = $row;\n }\n }\n if (Import::BEHAVIOR_APPEND != $this->getBehavior()) {\n $this->_connection->delete(\n $tableName,\n $this->_connection->quoteInto(\"{$this->getProductEntityLinkField()} IN (?)\", $delProductId)\n );\n }\n if ($tierPriceIn) {\n $this->_connection->insertOnDuplicate($tableName, $tierPriceIn, ['value']);\n }\n }\n return $this;\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function getPrice(){\n return $this->hasMany(Inventory::class, 'product_id','id');\n}", "public function setProdId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_id !== $v) {\n $this->prod_id = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ID] = true;\n }\n\n if ($this->aTblProdPhotos !== null && $this->aTblProdPhotos->getProdId() !== $v) {\n $this->aTblProdPhotos = null;\n }\n\n if ($this->aTblProdPrices !== null && $this->aTblProdPrices->getProdId() !== $v) {\n $this->aTblProdPrices = null;\n }\n\n if ($this->aTblProdSmaller !== null && $this->aTblProdSmaller->getProdId() !== $v) {\n $this->aTblProdSmaller = null;\n }\n\n return $this;\n }", "function setPrice($classId, $price) {\r\n $data['classPrice'] = $price;\r\n $this->db->where('id', $classId);\r\n $this->db->update('class', $data);\r\n }", "public function originPrices()\n {\n return $this->hasMany('App\\Price', 'origin_country_id');\n }", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function __construct(\\int $id = 0, \\string $name = '', \\int $rimId = 0, \\string $rimType = '',\n \\int $frontDiameter = 0, \\int $backDiameter = 0, Price $price = null){\n parent::__construct($id, $name, $rimId, $rimType, $frontDiameter, $backDiameter);\n $this->setPrice(is_a($price, '\\Prices\\Price') ? $price : new Price());\n }", "public function setTblProdPhotos(ChildTblProdPhotos $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPhotos = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function setProductPrice($product_price){\n $this->product_price = $product_price;\n }", "public function initialize()\n {\n parent::initialize();\n $this->setSchema(\"salesDB\");\n $this->setSource(\"product_category\");\n $this->hasMany('id', 'App\\Models\\Product', 'product_category_id', ['alias' => 'Product']);\n $this->belongsTo('user_updated', 'App\\Models\\User', 'id', ['alias' => 'UserUpdated']);\n $this->belongsTo('user_created', 'App\\Models\\User', 'id', ['alias' => 'UserCreated']);\n $this->belongsTo('client_id', 'App\\Models\\Client', 'id', ['alias' => 'Client']);\n $this->belongsTo('sync_status_id', 'App\\Models\\SyncStatus', 'id', ['alias' => 'SyncStatus']);\n }", "public function setPriceProduct($value)\n {\n $this->priceProduct = $value;\n }", "protected function _construct()\r\n {\r\n $this->_init('ss_price', 'price_id');\r\n }", "function ajouteProdToRub() { \r\n\t\tglobal $R0;\r\n\t\tlist($table,$tableRel,$tableProd,$relRubId_rubId,$relProdId_prodId,$catTitre,$prodTitre) = explode(':',$R0['childRel']);\r\n\t\tlist($relRubId,$rubId) = explode('=',$relRubId_rubId);\r\n\t\tlist($relProdId,$prodId) = explode('=',$relProdId_prodId);\r\n\r\n\t\t$C = new SQL($tableRel);\r\n\t\t$champs = array(array($relRubId,$relProdId,'ordre'),array($this->rub_id,intval($_POST[$prodId]),'999')); // Array champsName // Array champsVal\r\n\t\t$C->insertSql($champs,1);\r\n\t\t$this->info = 'ajout';\r\n\t}", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "public function InsertProductData(){\n\t \n $sReqProd = \"INSERT INTO products (name, description, id_cat) VALUES (:name, :description, :id_cat)\";\n $name = $_SESSION['products']['name'];\n $desc = $_SESSION['products']['desc'];\n $id_cat = $_SESSION['products']['cat'] ;\n\n $sReqPrice = \"INSERT INTO products_prices (name, incl_tax, id_product) VALUES (:pricename, :incl, :id_prod)\";\n $iNbPrices = count($_SESSION['prices']['name_prices']);\n\n // begin transaction\n SPDO::getInstance()->beginTransaction();\n try{\n\n // Insert product\n $insert_prod = SPDO::getInstance()->prepare($sReqProd);\n $insert_prod->bindParam(':name', $name);\n $insert_prod->bindParam(':description', $desc);\n $insert_prod->bindParam('id_cat', $id_cat);\n $insert_prod->execute();\n\n // Insert prices\n $lastIdProd = SPDO::getInstance()->lastInsertId();\n $insert_prices = SPDO::getInstance()->prepare($sReqPrice);\n for ($i=0 ; $i < $iNbPrices ; $i++){\n $insert_prices->bindParam(':pricename', $_SESSION['prices']['name_prices'][$i]);\n $insert_prices->bindParam(':incl', $_SESSION['prices']['prices'][$i]);\n $insert_prices->bindParam(':id_prod', $lastIdProd);\n $insert_prices->execute();\n }\n\n //commit\n SPDO::getInstance()->commit(); \n\n } catch(Excption $e){\n SPDO::getInstance()->rollback();\n unset($_SESSION['products']);\n unset($_SESSION['prices']);\n $this->DisplayResultRqt(false, 'admin.php?p=product&a=create_prod', '', '');\n }\t\t\n \n $this->DisplayResultRqt(true, 'admin.php?p=product&a=create_prod', '', ''); \n unset($_SESSION['products']);\n unset($_SESSION['prices']);\n\n\t}", "public function prices()\n {\n return $this\n ->belongsToMany(PricingGroup::class, PriceListItem::getTableName(), 'item_unit_id', 'pricing_group_id')\n ->withPivot(['price', 'discount_value', 'discount_percent', 'date', 'pricing_group_id']);\n }", "public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}", "public function produtos() \n \t{\n \t\treturn $this->belongsToMany(Produto::class);\n \t}", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function price_rule()\n {\n return $this->belongsToMany('App\\Price_Rule')->withTimestamps();\n }", "public function setProductId($id);", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function products()\n {\n return $this->hasMany('fooCart\\src\\Product', 'tax_id', 'tax_id');\n }", "public function defineRelations()\n {\n return array(\n 'product' => array(static::BELONGS_TO, 'Commerce_ProductRecord', 'required' => true, 'onDelete'=> static::CASCADE),\n 'wishlist' => array(static::BELONGS_TO, 'WishlistRecord', 'required' => true, 'onDelete'=> static::CASCADE)\n );\n }", "public function initialize()\n {\n $this->hasMany('cd_desconto', 'App\\Models\\PdvVendasHasItens', 'cd_desconto', array('alias' => 'PdvVendasHasItens'));\n $this->belongsTo('cd_caixa', 'App\\Models\\PdvCaixa', 'cd_caixa', array('alias' => 'PdvCaixa'));\n $this->belongsTo('cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_unidade_negocio', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('cd_usuario_criacao', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }", "public function getProdRelated()\n {\n return $this->prod_related;\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function Add(){\t\n\t try{\n\t\t $conn = DBConnect::GetConnection();\n\t\t \n\t\t $query=\"INSERT INTO product(product_name,unit_price,image_name,description,category,quantity_in_stock) VALUES \t\t\t\t\t(:name,:uPrice,:imageName,:des,:cate:,qty)\";\n\t\t \n\t\t $st=$conn->prepare($query);\n\t\t \n\t\t $st->bindvalue(\":name\",$this->productName,PDO::PARAM_STR);\n\t\t $st->bindvalue(\":uPrice\",$this->price,PDO::PARAM_INT); /*for the double PARAM type is what?*/\n\t\t $st->bindvalue(\":imageName\",$this->imageName,PDO::PARAM_STR);\n\t\t $st->bindvalue(\":des\",$this->description,PDO::PARAM_STR);\n\t\t $st->bindvalue(\":cate\",$this->cate,PDO::PARAM_STR); //category id->foreign key\n\t\t $st->bindvalue(\":qty\",$this->qty,PDO::PARAM_INT);\n\t\t \n\t\t \n\t\t $st->execute();\n\t\t echo 'Done';\n\t\t \n\t }\n\t catch(PDOException $e){\n\t\t echo 'Fail to connect';\n\t\t echo $e->getMessage();\t \n }\n }", "public function initialize()\n {\n $this->setSchema(\"ieslluis_gestiovfc\");\n $this->setSource(\"lines_comandes\");\n $this->hasMany('ncomanda', 'Comandes', 'numero', ['alias' => 'Comandes']);\n $this->hasMany('producte', 'Productes', 'codi', ['alias' => 'Productes']);\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function categoryProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = cate_id, localKey = cate_id)\n return $this->hasMany('App\\CategoryProductRelation','cate_id','cate_id');\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function stockCost(){\n return $this->belongsTo( StockCost::class, 'pj_stock_cost_parent_id' );\n }", "public function categoryProduct(){\n return $this->hasMany(CategoryProduct::class);\n }", "public function destinationPrices()\n {\n return $this->hasMany('App\\Price', 'destination_country_id');\n }", "public function setPrice($val)\n {\n $this->_propDict[\"price\"] = floatval($val);\n return $this;\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function relations()\n\t{\n\t\t// class name for the relations automatically generated below.\n\t\treturn array(\n\t\t\t'Product' => array(self::BELONGS_TO, '\\Business\\Product', 'idProduct'),\n\t\t);\n\t}", "public function initialize()\n {\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', array('alias' => 'Cargaestudiantes'));\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', array('alias' => 'Datosprofesiona'));\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', NULL);\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', NULL);\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "function setPrice($price)\n {\n $this->price = $price;\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function productOptions()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductOption','sp_id','sp_id');\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class, 'id_product', 'id_product');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "function __construct() \n\t{\n\t\tparent::__construct( 'rt_products', 'id', 'prd' );\n\t}", "public function addProductsFromPartner($vendorId, $productId, $productName, $productDescription, $productImageUrl, $productPrice){\n\n $query = $this->db->prepare(\"INSERT INTO `products` (`vendor_id`, `ext_product_id`, `product_name`, `product_description`, `product_image_url`, `product_price`) VALUES ( ?, ?, ?, ?, ?, ? ) \");\n\n $query->bindValue(1, $vendorId);\n $query->bindValue(2, $productId);\n $query->bindValue(3, $productName);\n $query->bindValue(4, $productDescription);\n $query->bindValue(5, $productImageUrl);\n $query->bindValue(6, $productPrice);\n\n try {\n\n $query->execute();\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;", "public function category_product()\n {\n return $this->belongsTo(Category_product::class);\n }", "public function setDefaultAttributes($id, $price);", "public function initialize()\n {\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', array('alias' => 'Documentosbeneficios'));\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', NULL);\n }", "public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}", "public function initialize()\n {\n $this->hasMany('idprodutoArea', 'App\\Models\\TabelaPrecoHasDesconto', 'produtoArea_idprodutoArea', array('alias' => 'TabelaPrecoHasDesconto'));\n $this->belongsTo('area_cd_area', 'App\\Models\\Area', 'cd_area', array('alias' => 'Area'));\n $this->belongsTo('produto_cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_tabela', 'App\\Models\\TabelaPreco', 'cd_tabela', array('alias' => 'TabelaPreco'));\n $this->belongsTo('unidade_negocio_cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->hasMany('idprodutoArea', 'App\\Models\\TabelaPrecoHasDesconto', 'produtoArea_idprodutoArea', NULL);\n $this->belongsTo('area_cd_area', 'App\\Models\\Area', 'cd_area', array('foreignKey' => true,'alias' => 'Area'));\n $this->belongsTo('produto_cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n $this->belongsTo('cd_tabela', 'App\\Models\\TabelaPreco', 'cd_tabela', array('foreignKey' => true,'alias' => 'TabelaPreco'));\n $this->belongsTo('unidade_negocio_cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('foreignKey' => true,'alias' => 'UnidadeNegocio'));\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function shoppingCarts()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ShoppingCart','sp_id','sp_id');\n }", "public function setProductPrice($price)\n {\n $this->productPrice = $price;\n return $this;\n }", "public function setPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we){\n\t\t\n\t\tif ($this->isPricing($id_ressource, $id_pricing)){\n\t\t\t$this->editPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t\telse{\n\t\t\t$this->addPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t}", "public function product()\n {\n return $this->belongsTo(BaseProduct::class);\n }", "public function setTblShippingCategories(ChildTblShippingCategories $v = null)\n {\n if ($v === null) {\n $this->setProdCategoryShipping(NULL);\n } else {\n $this->setProdCategoryShipping($v->getProdShippingPriceId());\n }\n\n $this->aTblShippingCategories = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblShippingCategories object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function setPrice($price)\n {\n $this->price = $price;\n }", "public function producteur()\n {\n return $this->belongsTo(Producteur::class, 'id_producteur', 'id_producteur');\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function setPriceAttribute($price = null)\n\t{\n\t\t$this->attributes['price'] = floatval($price);\n\t}", "public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)\n {\n $keys = TblProdInfoTableMap::getFieldNames($keyType);\n\n if (array_key_exists($keys[0], $arr)) {\n $this->setProdId($arr[$keys[0]]);\n }\n if (array_key_exists($keys[1], $arr)) {\n $this->setProdPriceId($arr[$keys[1]]);\n }\n if (array_key_exists($keys[2], $arr)) {\n $this->setProdName($arr[$keys[2]]);\n }\n if (array_key_exists($keys[3], $arr)) {\n $this->setProdAlt1($arr[$keys[3]]);\n }\n if (array_key_exists($keys[4], $arr)) {\n $this->setProdAlt2($arr[$keys[4]]);\n }\n if (array_key_exists($keys[5], $arr)) {\n $this->setProdAlt3($arr[$keys[5]]);\n }\n if (array_key_exists($keys[6], $arr)) {\n $this->setProdAlt4($arr[$keys[6]]);\n }\n if (array_key_exists($keys[7], $arr)) {\n $this->setProdCode($arr[$keys[7]]);\n }\n if (array_key_exists($keys[8], $arr)) {\n $this->setProdCategory($arr[$keys[8]]);\n }\n if (array_key_exists($keys[9], $arr)) {\n $this->setProdCategoryShipping($arr[$keys[9]]);\n }\n if (array_key_exists($keys[10], $arr)) {\n $this->setProdWriteup($arr[$keys[10]]);\n }\n if (array_key_exists($keys[11], $arr)) {\n $this->setProdLength($arr[$keys[11]]);\n }\n if (array_key_exists($keys[12], $arr)) {\n $this->setProdWingspan($arr[$keys[12]]);\n }\n if (array_key_exists($keys[13], $arr)) {\n $this->setProdHeight($arr[$keys[13]]);\n }\n if (array_key_exists($keys[14], $arr)) {\n $this->setProdScale($arr[$keys[14]]);\n }\n if (array_key_exists($keys[15], $arr)) {\n $this->setProdLinks($arr[$keys[15]]);\n }\n if (array_key_exists($keys[16], $arr)) {\n $this->setProdLinkdescription($arr[$keys[16]]);\n }\n if (array_key_exists($keys[17], $arr)) {\n $this->setProdFront($arr[$keys[17]]);\n }\n if (array_key_exists($keys[18], $arr)) {\n $this->setProdKeywords($arr[$keys[18]]);\n }\n if (array_key_exists($keys[19], $arr)) {\n $this->setProdKeywordsWriteup($arr[$keys[19]]);\n }\n if (array_key_exists($keys[20], $arr)) {\n $this->setProdTitle($arr[$keys[20]]);\n }\n if (array_key_exists($keys[21], $arr)) {\n $this->setProdDescription($arr[$keys[21]]);\n }\n if (array_key_exists($keys[22], $arr)) {\n $this->setProdGeneral($arr[$keys[22]]);\n }\n if (array_key_exists($keys[23], $arr)) {\n $this->setProdEra($arr[$keys[23]]);\n }\n if (array_key_exists($keys[24], $arr)) {\n $this->setProdCompany($arr[$keys[24]]);\n }\n if (array_key_exists($keys[25], $arr)) {\n $this->setProdRelated($arr[$keys[25]]);\n }\n if (array_key_exists($keys[26], $arr)) {\n $this->setProdRelatedPa($arr[$keys[26]]);\n }\n if (array_key_exists($keys[27], $arr)) {\n $this->setProdRelatedM3($arr[$keys[27]]);\n }\n if (array_key_exists($keys[28], $arr)) {\n $this->setProdRelated2($arr[$keys[28]]);\n }\n if (array_key_exists($keys[29], $arr)) {\n $this->setProdSaveas($arr[$keys[29]]);\n }\n if (array_key_exists($keys[30], $arr)) {\n $this->setProdAircraftreg($arr[$keys[30]]);\n }\n if (array_key_exists($keys[31], $arr)) {\n $this->setMb($arr[$keys[31]]);\n }\n if (array_key_exists($keys[32], $arr)) {\n $this->setPa($arr[$keys[32]]);\n }\n if (array_key_exists($keys[33], $arr)) {\n $this->setM3($arr[$keys[33]]);\n }\n }", "public function products()\n {\n // if the intermediate table is called differently an SQl error is raised\n // to use a custom table name it should be passed to \"belongsToMany\" method as the second argument\n return $this->belongsToMany(Product::class, 'cars__products');\n }", "public function cost(){\n return $this->belongsTo( StockCost::class , 'pj_stock_cost_parent_id' );\n }", "public function Category_id()\n {\n return $this->hasOne(Product::class);\n }", "PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }" ]
[ "0.63016796", "0.6223418", "0.6204816", "0.6000629", "0.59313536", "0.5778192", "0.56525975", "0.5646186", "0.5440802", "0.54381895", "0.5391214", "0.5386854", "0.536747", "0.53599423", "0.5315806", "0.5291904", "0.52196646", "0.5207516", "0.51851255", "0.5033819", "0.4998194", "0.49568936", "0.4949518", "0.49296084", "0.48759788", "0.48715353", "0.48412722", "0.48034155", "0.4801979", "0.48012406", "0.4800804", "0.47785524", "0.47695658", "0.47674268", "0.47639564", "0.476392", "0.47460833", "0.47452533", "0.47441638", "0.47145706", "0.4712817", "0.471008", "0.4681793", "0.46797538", "0.46789443", "0.46736044", "0.4670773", "0.4665555", "0.46617454", "0.4656501", "0.46501863", "0.46378204", "0.46368226", "0.46213365", "0.46213216", "0.46170548", "0.46160048", "0.46148798", "0.46116713", "0.46064025", "0.46042275", "0.46007365", "0.45952633", "0.4594237", "0.4568799", "0.45687357", "0.45681792", "0.45577052", "0.45513728", "0.45482343", "0.4534342", "0.45327243", "0.45324385", "0.45214868", "0.45196104", "0.45160678", "0.4513201", "0.44997436", "0.44957474", "0.44949815", "0.44948637", "0.4493802", "0.4492846", "0.44870785", "0.4486111", "0.44822693", "0.44812554", "0.44800195", "0.44791517", "0.44774687", "0.44681337", "0.44676957", "0.4464506", "0.446059", "0.44599217", "0.44594115", "0.44585687", "0.44540077", "0.44514883", "0.44499213" ]
0.695329
0
Get the associated ChildTblProdPrices object
public function getTblProdPrices(ConnectionInterface $con = null) { if ($this->aTblProdPrices === null && ($this->prod_id !== null)) { $this->aTblProdPrices = ChildTblProdPricesQuery::create()->findPk($this->prod_id, $con); // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association. $this->aTblProdPrices->setTblProdInfo($this); } return $this->aTblProdPrices; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTblProdPricing(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPricing === null && ($this->prod_price_id !== null)) {\n $this->aTblProdPricing = ChildTblProdPricingQuery::create()->findPk($this->prod_price_id, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblProdPricing->addTblProdInfos($this);\n */\n }\n\n return $this->aTblProdPricing;\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function getProdPriceId()\n {\n return $this->prod_price_id;\n }", "public function getProdRelated()\n {\n return $this->prod_related;\n }", "public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}", "public function setTblProdPrices(ChildTblProdPrices $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPrices = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }", "public function getPriceProduct()\n {\n return $this->priceProduct;\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function prices()\n {\n return $this->hasMany(Price::class);\n }", "public function getPriceModel()\n {\n return Mage::getSingleton('catalog/product_type')->priceFactory($this->getTypeId());\n }", "public function getPriceId($id)\n { \n $product = $this->postFactory->create();\n $productPriceById = $product->load($id)->getPrice();\n return $productPriceById;\n }", "public function getProdRelated2()\n {\n return $this->prod_related2;\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function getPrice()\n {\n $price = [ $this->price, $this->price_tax_inc ]; // These prices are in Company Currency\n\n $priceObject = Price::create( $price, Context::getContext()->company->currency );\n\n return $priceObject;\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "function get_child_product($entity_id)\n\t{\n\t\t$relTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_relation');\n\t\t$sql = \"SELECT child_id FROM `\" . $relTable . \"`\n\t\t\t\t\t\tWHERE parent_id = '\" . (int) $entity_id . \"'\";\n\t\t$prods = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n\t\tif ($prods) {\n\t\t\treturn $prods;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function prices(){\n \t return this->belongsToMany('App\\prices','price_service_time');\n }", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }", "public function getPrice()\n {\n return $this->object->Price;\n }", "public function setTblProdPricing(ChildTblProdPricing $v = null)\n {\n if ($v === null) {\n $this->setProdPriceId(NULL);\n } else {\n $this->setProdPriceId($v->getProdPriceId());\n }\n\n $this->aTblProdPricing = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblProdPricing object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }", "function get_product_pricebooks($id)\n\t{\n\t\tglobal $log,$singlepane_view;\n\t\t$log->debug(\"Entering get_product_pricebooks(\".$id.\") method ...\");\n\t\tglobal $mod_strings;\n\t\trequire_once('modules/PriceBooks/PriceBooks.php');\n\t\t$focus = new PriceBooks();\n\t\t$button = '';\n\t\tif($singlepane_view == 'true')\n\t\t\t$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;\n\t\telse\n\t\t\t$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;\n\n\n\t\t$query = \"SELECT ec_pricebook.pricebookid as crmid,\n\t\t\tec_pricebook.*,\n\t\t\tec_pricebookproductrel.productid as prodid\n\t\t\tFROM ec_pricebook\n\t\t\tINNER JOIN ec_pricebookproductrel\n\t\t\t\tON ec_pricebookproductrel.pricebookid = ec_pricebook.pricebookid\n\t\t\tWHERE ec_pricebook.deleted = 0\n\t\t\tAND ec_pricebookproductrel.productid = \".$id;\n\t\t$log->debug(\"Exiting get_product_pricebooks method ...\");\n\t\treturn GetRelatedList('Products','PriceBooks',$focus,$query,$button,$returnset);\n\t}", "public static function loadProductByProId($p_proId)\n {\n $sql = \"select * from products where ProID = $p_proId\";\n $list = DataProviderMain::execQuery($sql);\n if ($row = mysqli_fetch_array($list)) {\n\n //$proId = $row[\"ProID\"];\n //$proId = $p_proId;\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($p_proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n return $p;\n }\n\n return NULL;\n }", "public function getPrice()\n {\n return parent::getPrice();\n }", "public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }", "public function cost(){\n return $this->belongsTo( StockCost::class , 'pj_stock_cost_parent_id' );\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function getPrice()\n {\n $price_is_tax_inc = \\App\\Configuration::get('PRICES_ENTERED_WITH_TAX');\n\n $price = $price_is_tax_inc ? \n $this->price_tax_inc :\n $this->price ;\n\n $priceObject = new \\App\\Price( $price, $price_is_tax_inc, \\App\\Context::getContext()->currency, \\App\\Context::getContext()->currency->conversion_rate);\n\n return $priceObject;\n }", "public function stockCost(){\n return $this->belongsTo( StockCost::class, 'pj_stock_cost_parent_id' );\n }", "public function getPrice(){\n return $this->hasMany(Inventory::class, 'product_id','id');\n}", "public function prices() {\n return $this->hasMany('Auction_price'); // this matches the Eloquent model\n }", "public function getPkProduto()\n {\n return $this->hasOne(Produto::className(), ['id' => 'pk_produto']);\n }", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT ID, PRODUCT_ID, REF, TRANCHEMIN, TRANCHEMAX, PRIX, PRIX2, CREATED_AT, UPDATED_AT FROM degressif_products WHERE ID = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(\\PDO::FETCH_NUM)) {\n $obj = new ChildDegressifProducts();\n $obj->hydrate($row);\n DegressifProductsTableMap::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function get_price() {\n $query = $this->db->query(\"SELECT * FROM price \");\n\n if ($query) {\n return $query->result_array();\n }\n }", "public function getProduct()\r\n {\r\n return $this->item->getParentObject()->getProduct();\r\n }", "public function getPRODUTOS()\n {\n return $this->hasOne(Produto::className(), ['ID' => 'PRODUTOS_ID']);\n }", "public function prices()\n {\n return $this\n ->belongsToMany(PricingGroup::class, PriceListItem::getTableName(), 'item_unit_id', 'pricing_group_id')\n ->withPivot(['price', 'discount_value', 'discount_percent', 'date', 'pricing_group_id']);\n }", "public static function getSellProById($id)\n {\n return DB::table(static::$table)\n ->select('sell_product.*')\n ->where('is_deleted', ACTIVE)\n ->find( $id); \n }", "public function getProductPrice(){\n return $this->product_price;\n }", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "function get_price_object() {\r\n\t\t$price_obj = array (\r\n\t\t\t\t\"Currency\" => false,\r\n\t\t\t\t\"TotalDisplayFare\" => 0,\r\n\t\t\t\t\"PriceBreakup\" => array (\r\n\t\t\t\t\t\t'BasicFare' => 0,\r\n\t\t\t\t\t\t'Tax' => 0,\r\n\t\t\t\t\t\t'AgentCommission' => 0,\r\n\t\t\t\t\t\t'AgentTdsOnCommision' => 0\r\n\t\t\t\t) \r\n\t\t);\r\n\t\treturn $price_obj;\r\n\t}", "public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "function get_product_price($field_product_id){\r\n\r\n $this->load->model('logistics_model');\r\n $result = $this->logistics_model->get_product_price($field_product_id);\r\n $value = $result->price;\r\n echo $value;\r\n }", "public function originPrices()\n {\n return $this->hasMany('App\\Price', 'origin_country_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function getProductNameAndPriceInPartnerOrdersByProductId() {\n\n $query = $this->db->prepare(\"SELECT o.order_id, p.product_name, p.product_price FROM orders o JOIN products p ON o.order_product_id = p.ext_product_id AND o.order_partner_id = p.vendor_id ORDER BY o.order_id\");\n\n try {\n\n $query->execute();\n\n $result = $query->fetchAll();\n return $result;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function getProductPrice()\n {\n }", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "public function GetIdProducto()\n\t{\n\t\treturn $this->idProd;\n\t}", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "public static function loadProductsByCId($p_cId)\n {\n $ret = array();\n\n $sql = \"select * from products where Classify = $p_cId and Quantity >0\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $catId = $row[\"CatID\"];\n //$catId = $p_catId;\n //$classify = $p_cId;\n\n $p = new Products($proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $p_cId);\n array_push($ret, $p);\n }\n\n return $ret;\n }", "public function getPrice()\n {\n if ($this->_calculatePrice || !$this->getData('price')) {\n return $this->getPriceModel()->getPrice($this);\n } else {\n return $this->getData('price');\n }\n }", "public function getGroupPrice()\n {\n return $this->getPriceModel()->getGroupPrice($this);\n }", "public function product_detail()\n {\n return $this->has_one('Product_Detail');\n }", "public function getRelatedProductsByChart()\r\n {\r\n $chartId = $this->getChart()->getId();\r\n return $this->getChart()->getRelatedProductsByChart($chartId);\r\n }", "public function getTblProdPhotos(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPhotos === null && ($this->prod_id !== null)) {\n $this->aTblProdPhotos = ChildTblProdPhotosQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdPhotos->setTblProdInfo($this);\n }\n\n return $this->aTblProdPhotos;\n }", "function getClassPrice($classId) {\r\n $this->db->select('classPrice');\r\n $this->db->where('id', $classId);\r\n\r\n $row = $this->db->get('class')->row();\r\n return $row->classPrice;\r\n }", "public function getProdId()\n {\n return $this->prod_id;\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function getProductD($Id)\r\n {\r\n $result = $this->find('first', array('conditions' => array('ProductDeal.id' => $Id)));\r\n return $result;\r\n }", "public function getPricing() {\r\n\t\t\treturn $this->_pricing;\r\n\t\t}", "public function getParentProductByChildId($ChildProdId)\n {\n $ParentProdArr = DB::table($this->DBTables['Group_Products'] . ' as GP')\n ->join($this->DBTables['Products'] . ' as P', 'GP.parent_productid', '=', 'P.id')\n ->where('P.disable', '=', 0)\n ->where('GP.product_id', '=', (int)$ChildProdId)\n ->select('P.*')\n ->get();\n\n return $ParentProdArr;\n }", "public static function getPrice(&$products_table = NULL, $uid = NULL) {\n Yii::import('application.controllers.ProfileController');\n\n if (!$products_table) { //if it's cart products table\n $table = 'store_cart';\n } else {\n $table = 'temp_order_product_' . (Yii::app()->user->id ? Yii::app()->user->id : 'exchange');\n $query = \"DROP TABLE IF EXISTS {$table};\";\n $query .= \"CREATE TEMPORARY TABLE {$table} (product_id int(11) unsigned, quantity smallint(5) unsigned);\";\n foreach ($products_table as $item) {\n\n if ($item instanceof OrderProduct || $item instanceof stdClass || $item instanceof Cart) {\n $product = Product::model()->findByAttributes(array('id' => (string) $item->product_id));\n } else {\n $product = Product::model()->findByAttributes(array('code' => (string) $item->code));\n }\n\n if ($product) {\n $query .= \"INSERT INTO {$table} VALUES ({$product->id}, {$item->quantity});\";\n } else {\n throw new Exception('Product not found. Product code: ' . $item->code);\n }\n }\n Yii::app()->db->createCommand($query)->execute();\n }\n $query = Yii::app()->db->createCommand()\n ->select('SUM(c.quantity*round(prices.price*(1-greatest(ifnull(disc.percent,0),ifnull(disc1.percent,0),ifnull(disc2.percent,0))/100))) as c_summ, prices.price_id')\n ->from($table . ' c')\n ->join('store_product product', 'c.product_id=product.id')\n ->join('store_product_price prices', 'product.id=prices.product_id')\n ->join('store_price price', 'price.id=prices.price_id')\n ->leftJoin('store_discount disc', \"disc.product_id=0 and disc.actual=1 and (disc.begin_date='0000-00-00' or disc.begin_date<=CURDATE()) and (disc.end_date='0000-00-00' or disc.end_date>=CURDATE())\")\n ->leftJoin('store_product_category cat', 'cat.product_id=product.id')\n ->leftJoin('store_discount_category discat', 'discat.category_id=cat.category_id')\n ->leftJoin('store_discount disc1', \"disc1.product_id=1 and disc1.id=discat.discount_id and disc1.actual=1 and (disc1.begin_date='0000-00-00' or disc1.begin_date<=CURDATE()) and (disc1.end_date='0000-00-00' or disc1.end_date>=CURDATE())\")\n ->leftJoin('store_discount_product dispro', 'dispro.product_id=product.id')\n ->leftJoin('store_discount disc2', \"disc2.product_id=2 and disc2.id=dispro.discount_id and disc2.actual=1 and (disc2.begin_date='0000-00-00' or disc2.begin_date<=CURDATE()) and (disc2.end_date='0000-00-00' or disc2.end_date>=CURDATE())\")\n ->order('price.summ DESC')\n ->group('prices.price_id, price.summ')\n ->having('c_summ>price.summ');\n\n if (!$products_table){\n $sid = ProfileController::getSession();\n $query->where(\"(session_id=:sid AND :sid<>'') OR (user_id=:uid AND :sid<>'')\", array(\n ':sid' => $sid,\n ':uid' => Yii::app()->user->isGuest ? '' : Yii::app()->user->id,\n ));\n }\n\n// $text = $query->getText();\n $row = $query->queryRow();\n if ($row)\n $price = self::model()->findByPk($row['price_id']);\n else\n $price = self::model()->find(array('order' => 'summ'));\n\n if ($products_table)\n Yii::app()->db->createCommand(\"DROP TABLE IF EXISTS {$table};\")->execute();\n\n if ($uid)\n $profile = CustomerProfile::model()->with('price')->findByAttributes(array('user_id' => $uid));\n else\n $profile = ProfileController::getProfile();\n\n if ($profile && $profile->price_id && $profile->price->summ > $price->summ)\n return $profile->price;\n else\n return $price;\n }", "public function getPrice()\n {\n return $this->Price;\n }", "public function product()\n {\n return $this->m_product;\n }", "public function getPrice()\n {\n return $this->get(self::_PRICE);\n }", "public function getTblProdSmaller(ConnectionInterface $con = null)\n {\n if ($this->aTblProdSmaller === null && ($this->prod_id !== null)) {\n $this->aTblProdSmaller = ChildTblProdSmallerQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdSmaller->setTblProdInfo($this);\n }\n\n return $this->aTblProdSmaller;\n }", "public function getPrices()\n {\n }", "public function getProductPrice() {\n\t\t\t$data = request()->all();\n\t\t\t$dataArr = explode('-', $data['idSize']);\n\t\t\t$proAttr = ProductsAttribute::where(['product_id'=>$dataArr[0], 'size'=>$dataArr[1]])->first();\n\t\t\t$productData = [\n\t\t\t\t'sku' \t=> $proAttr->sku, \n\t\t\t\t'price' => $proAttr->price,\n\t\t\t\t'stock' => $proAttr->stock\n\t\t\t]; \n\t\t\treturn $productData;\n\t\t}", "public function getPrices() {\n // get available price information\n $pricesAsDom = $this->product->get(\"SupplyDetail/Price\");\n\n // get child nodes as array\n $pricesAsArray = array_map(array($this,'_childNodes2Array'), $pricesAsDom);\n return $pricesAsArray;\n }", "public function getForeignKey()\n {\n return 'order_product_field_value_id';\n }", "public static function loadProductsTopSale()\n {\n $ret = array();\n $sql = \"select p.ProID,p.ProName,p.Price, SUM(od.quantity) from products p,orderdetails od \n\t\t\t\twhere p.ProID = od.ProId\n\t\t\t\tGROUP BY p.ProID\n\t\t\t\tORDER BY od.quantity DESC limit 0,10\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n //$tinyDes = $row[\"TinyDes\"];\n //$fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n //$quantity = $row[\"Quantity\"];\n //$catId = $row[\"CatID\"];\n //$view = $row[\"NView\"];\n //$dayAdd = $row[\"DayAdd\"];\n //$classify =$row[\"Classify\"];\n\n $p = new Products($proId, $proName, '', '', $price, '', '', '', '', '');\n array_push($ret, $p);\n }\n\n return $ret;\n }", "function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function GetProductAccordingToProductID($productID){\n\t\n\ttry\n\t{\n\t\t$conn = DBConnection::GetConnection();\n\t\t$myquery= \"SELECT product_id,product_name,unit_price,image_name,description,category,quantity_in_stock FROM product where product_id='\".$productID.\"' \";\n\t\t$result= $conn->query($myquery);\n\t\t\n\t\t$p1= new Product();\n\t\tforeach($result as $item){\n\t\t\t\t\t\t\n\t\t\t $p1->productCode =$item[\"product_id\"];\n\t\t\t $p1->productName =$item[\"product_name\"];\n\t\t\t $p1->price =$item[\"unit_price\"];\n\t\t\t $p1->imageName=$item[\"image_name\"];\t\t\t \n\t\t\t $p1->description =$item[\"description\"];\n\t\t\t $p1->cate=$item[\"category\"];\n\t\t\t $p1->qty=$item[\"quantity_in_stock\"];\t\t\t\n\t\t\t\n\t\t}\n\t\t$conn =null;//To close the connection \n\t\treturn $p1;\n\t}\n\tcatch(PDOException $e)\n\t{\n\t\techo 'Fail to connect';\n\t\techo $e->getMessage();\n\t}\t\n\t\t\n\t}", "public function GetSeccion()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"producto_ibfk_1\");\n\t}", "public function getProductPrice() {\n //return the value product price\n return $this->ProductPrice;\n }", "public function getPriceFromDatabase()\n {\n }", "public function getPriceInfo()\n {\n return $this->price_info;\n }", "public function getPriceLists(): ActiveQuery\n {\n return $this->hasMany(PriceList::className(), ['adv_prod_type_id' => 'id']);\n }", "public function OderDetails(){\n\t\treturn $this->hasMany('App\\OrderProduct','ID_Product');\n\t}", "function getPrice()\n {\n return $this->price;\n }", "function getRelatedProdsById($pId){\n\t\t$query = \"SELECT GROUP_CONCAT(DISTINCT relatedto_id ORDER BY relatedto_id ASC SEPARATOR ',') AS prodRelated, GROUP_CONCAT(DISTINCT relatedto_offerid ORDER BY relatedto_offerid ASC SEPARATOR ',') AS offerRelated FROM product_related WHERE `relatedfrom_id`=$pId\";\n\t\t//$data = mysql_query($query);\n\t\t//print_r($data);\n\t\t$result = $this->selectQueryForAssoc($query);\n\t\treturn $result;\t\n\t}", "protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}", "protected function findPkSimple($key, ConnectionInterface $con)\n {\n $sql = 'SELECT prod_shipping_price_id, prod_shipping_name, prod_shipping_description, prod_shipping_asia, prod_shipping_europe, prod_shipping_usa, prod_shipping_canada, prod_shipping_au, prod_shipping_asia_parcel, prod_shipping_europe_parcel, prod_shipping_usa_parcel, prod_shipping_canada_parcel, prod_shipping_au_parcel FROM tbl_prod_shipping WHERE prod_shipping_price_id = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(\\PDO::FETCH_NUM)) {\n /** @var ChildTblProdShipping $obj */\n $obj = new ChildTblProdShipping();\n $obj->hydrate($row);\n TblProdShippingTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function getProduct();", "protected function _getProduto(){\n if (!is_object($this->_produto)){\n $this->_produto = new Vendas_Model_Produto_Mapper();\n }\n return $this->_produto;\n }", "public function cost()\n {\n return $this->hasOne(CostService::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::COST_FOREIGN_KEY);\n }", "public function getDataModel()\n {\n return new Products();\n }", "public function getPrice();", "public function getPrice();" ]
[ "0.6941069", "0.6823047", "0.6805496", "0.6513882", "0.6431518", "0.6427587", "0.63864625", "0.6214919", "0.6198193", "0.6152482", "0.60753256", "0.5975118", "0.59222186", "0.5812921", "0.57905215", "0.5766011", "0.5751223", "0.57447857", "0.5741802", "0.57308674", "0.57257515", "0.5722714", "0.5684744", "0.5678904", "0.5651499", "0.564085", "0.56335366", "0.56173694", "0.56136775", "0.5605341", "0.56017804", "0.56017804", "0.56017804", "0.56017804", "0.5598621", "0.5598558", "0.5582871", "0.55668277", "0.55559194", "0.55427283", "0.5534329", "0.5530238", "0.5518213", "0.55094117", "0.5493087", "0.5488231", "0.54862255", "0.54858726", "0.5460183", "0.5456003", "0.54529226", "0.54515713", "0.544396", "0.54419446", "0.54408836", "0.5435446", "0.54250574", "0.5419093", "0.54157823", "0.54135823", "0.5410791", "0.5409155", "0.54076016", "0.5402583", "0.5394381", "0.53822833", "0.536272", "0.5360971", "0.5358344", "0.5358186", "0.53424615", "0.53331167", "0.53323174", "0.5323529", "0.53233135", "0.5317284", "0.5303779", "0.5302897", "0.53024924", "0.5298696", "0.5293553", "0.5279007", "0.52731264", "0.52714247", "0.52681917", "0.5267265", "0.5264268", "0.52636343", "0.52566105", "0.5248088", "0.5245311", "0.5241349", "0.5240545", "0.52392066", "0.5235859", "0.52233464", "0.5222657", "0.5222026", "0.52189887", "0.52189887" ]
0.7106863
0
Declares an association between this object and a ChildTblProdPricing object.
public function setTblProdPricing(ChildTblProdPricing $v = null) { if ($v === null) { $this->setProdPriceId(NULL); } else { $this->setProdPriceId($v->getProdPriceId()); } $this->aTblProdPricing = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildTblProdPricing object, it will not be re-added. if ($v !== null) { $v->addTblProdInfo($this); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setTblProdPrices(ChildTblProdPrices $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPrices = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function getTblProdPricing(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPricing === null && ($this->prod_price_id !== null)) {\n $this->aTblProdPricing = ChildTblProdPricingQuery::create()->findPk($this->prod_price_id, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblProdPricing->addTblProdInfos($this);\n */\n }\n\n return $this->aTblProdPricing;\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }", "public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }", "public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}", "public function stockCost(){\n return $this->belongsTo( StockCost::class, 'pj_stock_cost_parent_id' );\n }", "public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }", "private function SetPricingDetails()\n\t{\n\t\t$product = $this->productClass->getProduct();\n\n\t\t$GLOBALS['PriceLabel'] = GetLang('Price');\n\n\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t$GLOBALS['ProductPrice'] = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseGL($this->productClass->GetProductCallForPricingLabel());\n\t\t}\n\t\t// If prices are hidden, then we don't need to go any further\n\t\telse if($this->productClass->ArePricesHidden()) {\n\t\t\t$GLOBALS['HidePrice'] = \"display: none;\";\n\t\t\t$GLOBALS['HideRRP'] = 'none';\n\t\t\t$GLOBALS['ProductPrice'] = '';\n\t\t\treturn;\n\t\t}\n\t\telse if (!$this->productClass->IsPurchasingAllowed()) {\n\t\t\t$GLOBALS['ProductPrice'] = GetLang('NA');\n\t\t}\n\t\telse {\n\t\t\t$options = array('strikeRetail' => false);\n\t\t\t$GLOBALS['ProductPrice'] = formatProductDetailsPrice($product, $options);\n\t\t}\n\n\t\t// Determine if we need to show the RRP for this product or not\n\t\t// by comparing the price of the product including any taxes if\n\t\t// there are any\n\t\t$GLOBALS['HideRRP'] = \"none\";\n\t\t$productPrice = $product['prodcalculatedprice'];\n\t\t$retailPrice = $product['prodretailprice'];\n\t\tif($retailPrice) {\n\t\t\t// Get the tax display format\n\t\t\t$displayFormat = getConfig('taxDefaultTaxDisplayProducts');\n\t\t\t$options['displayInclusive'] = $displayFormat;\n\n\t\t\t// Convert to the browsing currency, and apply group discounts\n\t\t\t$productPrice = formatProductPrice($product, $productPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\t\t\t$retailPrice = formatProductPrice($product, $retailPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\n\t\t\tif($productPrice < $retailPrice) {\n\t\t\t\t$GLOBALS['HideRRP'] = '';\n\n\t\t\t\t// Showing call for pricing, so just show the RRP and that's all\n\t\t\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t\t\t$GLOBALS['RetailPrice'] = CurrencyConvertFormatPrice($retailPrice);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// ISC-1057: do not apply customer discount to RRP in this case\n\t\t\t\t\t$retailPrice = formatProductPrice($product, $product['prodretailprice'], array(\n\t\t\t\t\t\t'localeFormat' => false,\n\t\t\t\t\t\t'displayInclusive' => $displayFormat,\n\t\t\t\t\t\t'customerGroup' => 0,\n\t\t\t\t\t));\n\t\t\t\t\t$GLOBALS['RetailPrice'] = '<strike>' . formatPrice($retailPrice) . '</strike>';\n\t\t\t\t\t$GLOBALS['PriceLabel'] = GetLang('YourPrice');\n\t\t\t\t\t$savings = $retailPrice - $productPrice;\n\t\t\t\t\t$string = sprintf(getLang('YouSave'), '<span class=\"YouSaveAmount\">'.formatPrice($savings).'</span>');\n\t\t\t\t\t$GLOBALS['YouSave'] = '<span class=\"YouSave\">'.$string.'</span>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setProdPriceId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_price_id !== $v) {\n $this->prod_price_id = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_PRICE_ID] = true;\n }\n\n if ($this->aTblProdPricing !== null && $this->aTblProdPricing->getProdPriceId() !== $v) {\n $this->aTblProdPricing = null;\n }\n\n return $this;\n }", "public function initialize()\n {\n $this->setSchema(\"atiempo_prod\");\n $this->hasMany('id', 'AcCartaAvalDetalle', 'id_carta', ['alias' => 'AcCartaAvalDetalle']);\n }", "public function cost(){\n return $this->belongsTo( StockCost::class , 'pj_stock_cost_parent_id' );\n }", "public function setPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we){\n\t\t\n\t\tif ($this->isPricing($id_ressource, $id_pricing)){\n\t\t\t$this->editPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t\telse{\n\t\t\t$this->addPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t}", "public function subsidiary(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = subsidiary_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Subsidiary::class);\n\t}", "public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }", "public function product()\n {\n return $this->belongsTo(BaseProduct::class);\n }", "public function getProdPriceId()\n {\n return $this->prod_price_id;\n }", "public function getTblProdPrices(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPrices === null && ($this->prod_id !== null)) {\n $this->aTblProdPrices = ChildTblProdPricesQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdPrices->setTblProdInfo($this);\n }\n\n return $this->aTblProdPrices;\n }", "public function prices(){\n \t return this->belongsToMany('App\\prices','price_service_time');\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function joinPricingRule();", "public function coupon_product()\n {\n return $this->belongsTo(Coupon_product::class);\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "function __construct() \n\t{\n\t\tparent::__construct( 'rt_products', 'id', 'prd' );\n\t}", "public function instancePricing(string $instance_id, Pricing $pricing): QueryInterface;", "public function CommercialComprehensiveBelongsToCommercialClass()\n {\n return $this->belongsTo('App\\MotorInsuranceModels\\CommercialVehicles\\CommercialClass', 'commercial_class_id', 'id');\n }", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function __construct()\n\t{\n\t\t$this->has_one['product'] = array('Products_m', 'id', 'product_id');\n\t\t// $this->soft_deletes = TRUE;\n\t\tparent::__construct();\n\t}", "public function getProdRelated()\n {\n return $this->prod_related;\n }", "public function autoProductDivision()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\AutoProductDivision','sp_id','sp_id');\n }", "function ajouteProdToRub() { \r\n\t\tglobal $R0;\r\n\t\tlist($table,$tableRel,$tableProd,$relRubId_rubId,$relProdId_prodId,$catTitre,$prodTitre) = explode(':',$R0['childRel']);\r\n\t\tlist($relRubId,$rubId) = explode('=',$relRubId_rubId);\r\n\t\tlist($relProdId,$prodId) = explode('=',$relProdId_prodId);\r\n\r\n\t\t$C = new SQL($tableRel);\r\n\t\t$champs = array(array($relRubId,$relProdId,'ordre'),array($this->rub_id,intval($_POST[$prodId]),'999')); // Array champsName // Array champsVal\r\n\t\t$C->insertSql($champs,1);\r\n\t\t$this->info = 'ajout';\r\n\t}", "public function productReservation()\n\t{\n\t\treturn $this->belongsTo('App\\ProductReservation');\n\t}", "public function setPricing(array $pricingData)\n {\n $this->repository->setData($pricingData);\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class, 'id_product', 'id_product');\n }", "public function getPricing() {\r\n\t\t\treturn $this->_pricing;\r\n\t\t}", "public function initialize()\n {\n $this->hasMany('cd_desconto', 'App\\Models\\PdvVendasHasItens', 'cd_desconto', array('alias' => 'PdvVendasHasItens'));\n $this->belongsTo('cd_caixa', 'App\\Models\\PdvCaixa', 'cd_caixa', array('alias' => 'PdvCaixa'));\n $this->belongsTo('cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_unidade_negocio', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('cd_usuario_criacao', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function category_product()\n {\n return $this->belongsTo(Category_product::class);\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function initialize()\n {\n\t\t$this->belongsTo('sfafba_partner_id', 'SfAffiliationPartener', 'sfafpa_id', array('alias' => 'sf_affiliation_partener_partner_id'));\n\n parent::initialize();\n }", "public function getPricing()\n {\n // get current quantity as its the basis for pricing\n $quantity = $this->quantity;\n\n // Get pricing but maintain original unitPrice (only if post-CASS certification quantity drop is less than 10%),\n $adjustments = $this->quantity_adjustment + $this->count_adjustment;\n if ($adjustments < 0) {\n $originalQuantity = 0;\n $originalQuantity = $this->itemAddressFiles()->sum('count');\n $originalQuantity += $this->mail_to_me;\n if ((($originalQuantity + $adjustments) / $originalQuantity) > 0.90) { // (less than 10%)\n $quantity = $originalQuantity;\n }\n }\n\n // Get pricing based on quantity.\n // If quantity is less than minimum quantity required (only if post-CASS certification),\n // then use the minimum quantity required to retrieve pricing\n if ((\n $this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity()\n ) {\n $quantity = $this->getMinimumQuantity();\n }\n\n // Pricing date is based on submission date or now.\n $pricingDate = (!is_null($this->date_submitted) ? $this->date_submitted : time());\n\n if (!is_null($this->product_id) && !is_null($this->product)) {\n $newPricing = $this->product->getPricing(\n $quantity, $pricingDate,\n $this->invoice->getBaseSiteId()\n );\n $oldPricing = $this->getProductPrice();\n // TODO: refactor this pricing history section, it really shouldn't belong in this method\n if (!is_null($newPricing)) {\n $insert = true;\n if (!is_null($oldPricing) && $newPricing->id == $oldPricing->product_price_id) {\n $insert = false;\n }\n if ($insert) {\n try {\n InvoiceItemProductPrice::firstOrCreate(\n [\n 'invoice_item_id' => $this->id,\n 'product_price_id' => $newPricing->id,\n 'date_created' => date('Y-m-d H:i:s', time()),\n 'is_active' => 1\n ]\n );\n } catch (QueryException $e) {\n // TODO: fix this hack (e.g. why do we need integrity constraint on this table )\n if (strpos($e->getMessage(), 'Duplicate entry') === false) {\n throw $e;\n } else {\n Logger::error($e->getMessage());\n }\n }\n\n if (!is_null($oldPricing)) {\n $oldPricing->is_active = 0;\n $oldPricing->save();\n }\n }\n }\n\n return $newPricing;\n }\n if (!is_null($this->data_product_id) && $this->data_product_id != 0) {\n return $this->dataProduct->getPricing($pricingDate, $this->invoice->site_id);\n }\n if (!is_null($this->line_item_id) && $this->line_item_id != 0) {\n return $this->line_item->getPricing($pricingDate, $this->invoice->getBaseSiteId());\n }\n if ($this->isAdHocLineItem() && $this->unit_price) {\n return (object)array('price' => $this->unit_price);\n }\n return null;\n }", "public function setProdId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_id !== $v) {\n $this->prod_id = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ID] = true;\n }\n\n if ($this->aTblProdPhotos !== null && $this->aTblProdPhotos->getProdId() !== $v) {\n $this->aTblProdPhotos = null;\n }\n\n if ($this->aTblProdPrices !== null && $this->aTblProdPrices->getProdId() !== $v) {\n $this->aTblProdPrices = null;\n }\n\n if ($this->aTblProdSmaller !== null && $this->aTblProdSmaller->getProdId() !== $v) {\n $this->aTblProdSmaller = null;\n }\n\n return $this;\n }", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function product() : BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function joinProduct($classId);", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function initialize()\n {\n parent::initialize();\n $this->setSchema(\"salesDB\");\n $this->setSource(\"product_category\");\n $this->hasMany('id', 'App\\Models\\Product', 'product_category_id', ['alias' => 'Product']);\n $this->belongsTo('user_updated', 'App\\Models\\User', 'id', ['alias' => 'UserUpdated']);\n $this->belongsTo('user_created', 'App\\Models\\User', 'id', ['alias' => 'UserCreated']);\n $this->belongsTo('client_id', 'App\\Models\\Client', 'id', ['alias' => 'Client']);\n $this->belongsTo('sync_status_id', 'App\\Models\\SyncStatus', 'id', ['alias' => 'SyncStatus']);\n }", "public function actionAddPricing($id)\n {\n $model = $this->findModel($id);\n\n $motherMatrix = new ServiceAttributeMatrix($model);\n\n return $this->render('add-pricing', [\n 'model' => $model,\n 'motherMatrix' => $motherMatrix,\n ]);\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo('Tricks\\Product');\n\t}", "public function order_product(){\n return $this->hasOne(Order_product::class);\n }", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function createPricingSet()\n {\n $pricingSet = new PricingSet();\n\n //Set default pricing dimension values\n foreach ($this->getPricingSetConfiguration()->getPricingDimensions() as $pricingDimension) {\n $pricingDimension->setDefaultParametersForPricingSet($pricingSet);\n }\n\n return $pricingSet;\n }", "public function product()\n {\n // belongsTo(RelatedModel, foreignKey = product_id, keyOnRelatedModel = id)\n return $this->belongsTo(Product::class);\n }", "public function prices()\n {\n return $this->hasMany(Price::class);\n }", "public function Product()\n\t{\n\t\treturn $this->belongsTo('App\\Product');\n\t}", "public function initialize()\n {\n $this->belongsTo('posicao_id', 'Ecommerce\\Admin\\Models\\Posicao', 'id', array('alias' => 'Posicao'));\n }", "public function product()\n {\n \treturn $this->belongsTo(Product::class);\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function categoryProduct(){\n return $this->hasMany(CategoryProduct::class);\n }", "PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }", "public function productOptions()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductOption','sp_id','sp_id');\n }", "public function initialize()\n {\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('alias' => 'Datospersonales'));\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('foreignKey' => true));\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(config('laravel-inventory.product'));\n }", "public function initialize()\n {\n $this->belongsTo('cons_order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n $this->belongsTo('order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n }", "public function product()\n {\n return $this->belongsTo(Product::Class());\n }", "public function prices()\n {\n return $this\n ->belongsToMany(PricingGroup::class, PriceListItem::getTableName(), 'item_unit_id', 'pricing_group_id')\n ->withPivot(['price', 'discount_value', 'discount_percent', 'date', 'pricing_group_id']);\n }", "public function product()\n {\n return $this->belongsTo('App\\Product');\n\t}", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function quotation()\n {\n return $this->belongsTo('App\\Quotation');\n }", "public function cost()\n {\n return $this->hasOne(CostService::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::COST_FOREIGN_KEY);\n }", "public function producto() {\n return $this->belongsTo(Producto::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function producto() {\n return $this\n ->belongsTo('App\\Producto','idProducto');\n }", "protected function _construct()\r\n {\r\n $this->_init('ss_price', 'price_id');\r\n }", "public function setTblProdPhotos(ChildTblProdPhotos $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPhotos = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Product', 'n_ProductId_FK')->withDefault();\n }", "public function setPurchaseOrder(ChildPurchaseOrder $v = null)\n {\n if ($v === null) {\n $this->setPothnbr('');\n } else {\n $this->setPothnbr($v->getPohdnbr());\n }\n\n $this->aPurchaseOrder = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setPoReceivingHead($this);\n }\n\n\n return $this;\n }", "public function production_plate () {\n\t\treturn $this->belongsTo('App\\ProductionPlate');\n\t}", "public function initialize()\n {\n $this->setSchema(\"binopt\");\n $this->hasMany('id', 'Deposit', 'promo', ['alias' => 'Deposit']);\n }", "public function provincy(){\n return $this->belongsTo('App\\Provincy', 'provincy_id');\n }", "public function variation()\n {\n return $this->belongsTo(ProductVariation::class);\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function purchase()\r\n {\r\n return $this->hasOne('App\\Purchase');\r\n }", "public function pledger()\n {\n return $this->belongsTo(Pledger::class);\n }", "public function prices() {\n return $this->hasMany('Auction_price'); // this matches the Eloquent model\n }", "public function producteur()\n {\n return $this->belongsTo(Producteur::class, 'id_producteur', 'id_producteur');\n }", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function orderBonusBudget()\n {\n return $this->belongsTo('App\\Models\\Ad3d\\OrderBonusBudget\\QcOrderBonusBudget', 'bonus_id', 'bonus_id');\n }", "public function initialize()\n {\n $this->hasMany('idprodutoArea', 'App\\Models\\TabelaPrecoHasDesconto', 'produtoArea_idprodutoArea', array('alias' => 'TabelaPrecoHasDesconto'));\n $this->belongsTo('area_cd_area', 'App\\Models\\Area', 'cd_area', array('alias' => 'Area'));\n $this->belongsTo('produto_cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_tabela', 'App\\Models\\TabelaPreco', 'cd_tabela', array('alias' => 'TabelaPreco'));\n $this->belongsTo('unidade_negocio_cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->hasMany('idprodutoArea', 'App\\Models\\TabelaPrecoHasDesconto', 'produtoArea_idprodutoArea', NULL);\n $this->belongsTo('area_cd_area', 'App\\Models\\Area', 'cd_area', array('foreignKey' => true,'alias' => 'Area'));\n $this->belongsTo('produto_cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n $this->belongsTo('cd_tabela', 'App\\Models\\TabelaPreco', 'cd_tabela', array('foreignKey' => true,'alias' => 'TabelaPreco'));\n $this->belongsTo('unidade_negocio_cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('foreignKey' => true,'alias' => 'UnidadeNegocio'));\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }" ]
[ "0.5932853", "0.589223", "0.57133454", "0.56799984", "0.55095327", "0.5463812", "0.5450568", "0.5410425", "0.52214575", "0.51516396", "0.5081539", "0.5068964", "0.503356", "0.4991991", "0.49831095", "0.4912381", "0.4882917", "0.487314", "0.4843328", "0.4822642", "0.48085475", "0.47920847", "0.47902662", "0.47901443", "0.47868198", "0.47812504", "0.47785068", "0.4776877", "0.47509754", "0.47400898", "0.47367087", "0.47355834", "0.4733047", "0.470828", "0.47066095", "0.468075", "0.466875", "0.46589875", "0.46522328", "0.4646743", "0.46443743", "0.4643921", "0.46399394", "0.4636955", "0.46341893", "0.4633408", "0.46194988", "0.4610201", "0.4599479", "0.4586836", "0.4585585", "0.45849016", "0.45765916", "0.45605528", "0.45523846", "0.4537066", "0.453123", "0.45307407", "0.4524851", "0.45131367", "0.45130154", "0.45108938", "0.44831634", "0.4482767", "0.4479382", "0.4479382", "0.4478136", "0.4474754", "0.44593886", "0.44498608", "0.4449738", "0.44488654", "0.44488072", "0.4439763", "0.44392645", "0.44351193", "0.44339418", "0.44324398", "0.44290954", "0.44275585", "0.44258296", "0.44211745", "0.4417105", "0.4415812", "0.44152224", "0.44150385", "0.44112548", "0.44099003", "0.44043735", "0.44032347", "0.43975422", "0.43904686", "0.43900976", "0.4388688", "0.4386572", "0.43817666", "0.43807545", "0.43762726", "0.43686458", "0.43684822" ]
0.7180729
0
Get the associated ChildTblProdPricing object
public function getTblProdPricing(ConnectionInterface $con = null) { if ($this->aTblProdPricing === null && ($this->prod_price_id !== null)) { $this->aTblProdPricing = ChildTblProdPricingQuery::create()->findPk($this->prod_price_id, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. $this->aTblProdPricing->addTblProdInfos($this); */ } return $this->aTblProdPricing; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPricing() {\r\n\t\t\treturn $this->_pricing;\r\n\t\t}", "public function setTblProdPricing(ChildTblProdPricing $v = null)\n {\n if ($v === null) {\n $this->setProdPriceId(NULL);\n } else {\n $this->setProdPriceId($v->getProdPriceId());\n }\n\n $this->aTblProdPricing = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblProdPricing object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function getProdRelated()\n {\n return $this->prod_related;\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function getTblProdPrices(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPrices === null && ($this->prod_id !== null)) {\n $this->aTblProdPrices = ChildTblProdPricesQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdPrices->setTblProdInfo($this);\n }\n\n return $this->aTblProdPrices;\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function stockCost(){\n return $this->belongsTo( StockCost::class, 'pj_stock_cost_parent_id' );\n }", "public function cost(){\n return $this->belongsTo( StockCost::class , 'pj_stock_cost_parent_id' );\n }", "public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function getProdPriceId()\n {\n return $this->prod_price_id;\n }", "public function getPriceProduct()\n {\n return $this->priceProduct;\n }", "public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}", "public function getPricing()\n {\n // get current quantity as its the basis for pricing\n $quantity = $this->quantity;\n\n // Get pricing but maintain original unitPrice (only if post-CASS certification quantity drop is less than 10%),\n $adjustments = $this->quantity_adjustment + $this->count_adjustment;\n if ($adjustments < 0) {\n $originalQuantity = 0;\n $originalQuantity = $this->itemAddressFiles()->sum('count');\n $originalQuantity += $this->mail_to_me;\n if ((($originalQuantity + $adjustments) / $originalQuantity) > 0.90) { // (less than 10%)\n $quantity = $originalQuantity;\n }\n }\n\n // Get pricing based on quantity.\n // If quantity is less than minimum quantity required (only if post-CASS certification),\n // then use the minimum quantity required to retrieve pricing\n if ((\n $this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity()\n ) {\n $quantity = $this->getMinimumQuantity();\n }\n\n // Pricing date is based on submission date or now.\n $pricingDate = (!is_null($this->date_submitted) ? $this->date_submitted : time());\n\n if (!is_null($this->product_id) && !is_null($this->product)) {\n $newPricing = $this->product->getPricing(\n $quantity, $pricingDate,\n $this->invoice->getBaseSiteId()\n );\n $oldPricing = $this->getProductPrice();\n // TODO: refactor this pricing history section, it really shouldn't belong in this method\n if (!is_null($newPricing)) {\n $insert = true;\n if (!is_null($oldPricing) && $newPricing->id == $oldPricing->product_price_id) {\n $insert = false;\n }\n if ($insert) {\n try {\n InvoiceItemProductPrice::firstOrCreate(\n [\n 'invoice_item_id' => $this->id,\n 'product_price_id' => $newPricing->id,\n 'date_created' => date('Y-m-d H:i:s', time()),\n 'is_active' => 1\n ]\n );\n } catch (QueryException $e) {\n // TODO: fix this hack (e.g. why do we need integrity constraint on this table )\n if (strpos($e->getMessage(), 'Duplicate entry') === false) {\n throw $e;\n } else {\n Logger::error($e->getMessage());\n }\n }\n\n if (!is_null($oldPricing)) {\n $oldPricing->is_active = 0;\n $oldPricing->save();\n }\n }\n }\n\n return $newPricing;\n }\n if (!is_null($this->data_product_id) && $this->data_product_id != 0) {\n return $this->dataProduct->getPricing($pricingDate, $this->invoice->site_id);\n }\n if (!is_null($this->line_item_id) && $this->line_item_id != 0) {\n return $this->line_item->getPricing($pricingDate, $this->invoice->getBaseSiteId());\n }\n if ($this->isAdHocLineItem() && $this->unit_price) {\n return (object)array('price' => $this->unit_price);\n }\n return null;\n }", "public function getPricing($service_id) {\n $stmt = $this->conn->prepare(\"SELECT * FROM `pricing` where service_id = ?\");\n $stmt->bind_param(\"i\", $service_id);\n $stmt->execute();\n $pricing = $stmt->get_result();\n $stmt->close();\n return $pricing;\n }", "public function instancePricing(string $instance_id, Pricing $pricing): QueryInterface;", "public function getProdRelated2()\n {\n return $this->prod_related2;\n }", "public function getPricing($data)\n {\n $query = Price::where('sellable_id', '=', (int)$data['sellable_id']);\n $returnData = $query->where('sellable_type', '=', $data['sellable_type'])\n ->get()\n ->toArray();\n if (!empty($returnData)) {\n return $returnData[0];\n } else {\n return null;\n }\n }", "public function cost()\n {\n return $this->hasOne(CostService::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::COST_FOREIGN_KEY);\n }", "private function getModuleClassByPricingId($package_pricing_id)\n {\n if (!isset($this->Record)) {\n Loader::loadComponents($this, ['Record']);\n }\n\n return $this->Record->select(['modules.*', 'packages.id' => 'package_id'])->from('package_pricing')->\n innerJoin('packages', 'packages.id', '=', 'package_pricing.package_id', false)->\n innerJoin('modules', 'modules.id', '=', 'packages.module_id', false)->\n where('package_pricing.id', '=', $package_pricing_id)->\n fetch();\n }", "public function subsidiary(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = subsidiary_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Subsidiary::class);\n\t}", "public function getPriceId($id)\n { \n $product = $this->postFactory->create();\n $productPriceById = $product->load($id)->getPrice();\n return $productPriceById;\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getPrice()\n {\n return $this->object->Price;\n }", "public function getPrice()\n {\n $price_is_tax_inc = \\App\\Configuration::get('PRICES_ENTERED_WITH_TAX');\n\n $price = $price_is_tax_inc ? \n $this->price_tax_inc :\n $this->price ;\n\n $priceObject = new \\App\\Price( $price, $price_is_tax_inc, \\App\\Context::getContext()->currency, \\App\\Context::getContext()->currency->conversion_rate);\n\n return $priceObject;\n }", "public function getProdRelatedPa()\n {\n return $this->prod_related_pa;\n }", "public function getPriceModel()\n {\n return Mage::getSingleton('catalog/product_type')->priceFactory($this->getTypeId());\n }", "public function getPrice()\n {\n $price = [ $this->price, $this->price_tax_inc ]; // These prices are in Company Currency\n\n $priceObject = Price::create( $price, Context::getContext()->company->currency );\n\n return $priceObject;\n }", "public function getProduct()\r\n {\r\n return $this->item->getParentObject()->getProduct();\r\n }", "public function product_detail()\n {\n return $this->has_one('Product_Detail');\n }", "public function getPrice()\n {\n return parent::getPrice();\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function product()\n {\n return $this->m_product;\n }", "public function setTblProdPrices(ChildTblProdPrices $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPrices = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }", "function get_price_object() {\r\n\t\t$price_obj = array (\r\n\t\t\t\t\"Currency\" => false,\r\n\t\t\t\t\"TotalDisplayFare\" => 0,\r\n\t\t\t\t\"PriceBreakup\" => array (\r\n\t\t\t\t\t\t'BasicFare' => 0,\r\n\t\t\t\t\t\t'Tax' => 0,\r\n\t\t\t\t\t\t'AgentCommission' => 0,\r\n\t\t\t\t\t\t'AgentTdsOnCommision' => 0\r\n\t\t\t\t) \r\n\t\t);\r\n\t\treturn $price_obj;\r\n\t}", "private function SetPricingDetails()\n\t{\n\t\t$product = $this->productClass->getProduct();\n\n\t\t$GLOBALS['PriceLabel'] = GetLang('Price');\n\n\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t$GLOBALS['ProductPrice'] = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseGL($this->productClass->GetProductCallForPricingLabel());\n\t\t}\n\t\t// If prices are hidden, then we don't need to go any further\n\t\telse if($this->productClass->ArePricesHidden()) {\n\t\t\t$GLOBALS['HidePrice'] = \"display: none;\";\n\t\t\t$GLOBALS['HideRRP'] = 'none';\n\t\t\t$GLOBALS['ProductPrice'] = '';\n\t\t\treturn;\n\t\t}\n\t\telse if (!$this->productClass->IsPurchasingAllowed()) {\n\t\t\t$GLOBALS['ProductPrice'] = GetLang('NA');\n\t\t}\n\t\telse {\n\t\t\t$options = array('strikeRetail' => false);\n\t\t\t$GLOBALS['ProductPrice'] = formatProductDetailsPrice($product, $options);\n\t\t}\n\n\t\t// Determine if we need to show the RRP for this product or not\n\t\t// by comparing the price of the product including any taxes if\n\t\t// there are any\n\t\t$GLOBALS['HideRRP'] = \"none\";\n\t\t$productPrice = $product['prodcalculatedprice'];\n\t\t$retailPrice = $product['prodretailprice'];\n\t\tif($retailPrice) {\n\t\t\t// Get the tax display format\n\t\t\t$displayFormat = getConfig('taxDefaultTaxDisplayProducts');\n\t\t\t$options['displayInclusive'] = $displayFormat;\n\n\t\t\t// Convert to the browsing currency, and apply group discounts\n\t\t\t$productPrice = formatProductPrice($product, $productPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\t\t\t$retailPrice = formatProductPrice($product, $retailPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\n\t\t\tif($productPrice < $retailPrice) {\n\t\t\t\t$GLOBALS['HideRRP'] = '';\n\n\t\t\t\t// Showing call for pricing, so just show the RRP and that's all\n\t\t\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t\t\t$GLOBALS['RetailPrice'] = CurrencyConvertFormatPrice($retailPrice);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// ISC-1057: do not apply customer discount to RRP in this case\n\t\t\t\t\t$retailPrice = formatProductPrice($product, $product['prodretailprice'], array(\n\t\t\t\t\t\t'localeFormat' => false,\n\t\t\t\t\t\t'displayInclusive' => $displayFormat,\n\t\t\t\t\t\t'customerGroup' => 0,\n\t\t\t\t\t));\n\t\t\t\t\t$GLOBALS['RetailPrice'] = '<strike>' . formatPrice($retailPrice) . '</strike>';\n\t\t\t\t\t$GLOBALS['PriceLabel'] = GetLang('YourPrice');\n\t\t\t\t\t$savings = $retailPrice - $productPrice;\n\t\t\t\t\t$string = sprintf(getLang('YouSave'), '<span class=\"YouSaveAmount\">'.formatPrice($savings).'</span>');\n\t\t\t\t\t$GLOBALS['YouSave'] = '<span class=\"YouSave\">'.$string.'</span>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public static function loadProductByProId($p_proId)\n {\n $sql = \"select * from products where ProID = $p_proId\";\n $list = DataProviderMain::execQuery($sql);\n if ($row = mysqli_fetch_array($list)) {\n\n //$proId = $row[\"ProID\"];\n //$proId = $p_proId;\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($p_proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n return $p;\n }\n\n return NULL;\n }", "function getClassPrice($classId) {\r\n $this->db->select('classPrice');\r\n $this->db->where('id', $classId);\r\n\r\n $row = $this->db->get('class')->row();\r\n return $row->classPrice;\r\n }", "public function product()\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }", "public function getPkProduto()\n {\n return $this->hasOne(Produto::className(), ['id' => 'pk_produto']);\n }", "function get_child_product($entity_id)\n\t{\n\t\t$relTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_relation');\n\t\t$sql = \"SELECT child_id FROM `\" . $relTable . \"`\n\t\t\t\t\t\tWHERE parent_id = '\" . (int) $entity_id . \"'\";\n\t\t$prods = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n\t\tif ($prods) {\n\t\t\treturn $prods;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function prices()\n {\n return $this\n ->belongsToMany(PricingGroup::class, PriceListItem::getTableName(), 'item_unit_id', 'pricing_group_id')\n ->withPivot(['price', 'discount_value', 'discount_percent', 'date', 'pricing_group_id']);\n }", "public function product()\n {\n return $this->belongsTo(BaseProduct::class);\n }", "public function getTblGeneral(ConnectionInterface $con = null)\n {\n if ($this->aTblGeneral === null && ($this->prod_general !== null)) {\n $this->aTblGeneral = ChildTblGeneralQuery::create()->findPk($this->prod_general, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblGeneral->addTblProdInfos($this);\n */\n }\n\n return $this->aTblGeneral;\n }", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT ID, PRODUCT_ID, REF, TRANCHEMIN, TRANCHEMAX, PRIX, PRIX2, CREATED_AT, UPDATED_AT FROM degressif_products WHERE ID = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(\\PDO::FETCH_NUM)) {\n $obj = new ChildDegressifProducts();\n $obj->hydrate($row);\n DegressifProductsTableMap::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function getProduct()\r\n {\r\n return $this->product;\r\n }", "public function getPricingComponents() {\n\t\treturn $this->pricingComponents;\n\t}", "public function getProduct();", "public function prices(){\n \t return this->belongsToMany('App\\prices','price_service_time');\n }", "public function getProductPrice(){\n return $this->product_price;\n }", "public function getProduct()\n {\n return $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product;\n }", "public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }", "function get_product_price($field_product_id){\r\n\r\n $this->load->model('logistics_model');\r\n $result = $this->logistics_model->get_product_price($field_product_id);\r\n $value = $result->price;\r\n echo $value;\r\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProdId()\n {\n return $this->prod_id;\n }", "protected function _getResourcePurchasedModel()\r\n\t{\r\n\t\treturn $this->getModelFromCache('Brivium_CreResIntegration_Model_Purchased');\r\n\t}", "public function prices()\n {\n return $this->hasMany(Price::class);\n }", "public function getGroupPrice()\n {\n return $this->getPriceModel()->getGroupPrice($this);\n }", "public function get_product()\n {\n return $this->_product;\n }", "public function currency()\n\t{\n\t\treturn $this->belongsTo('App\\Currency','curr_id','curr_id');\n\t}", "public function getProduct() {\r\n return $this->_product;\r\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function getProduct(): Product\n {\n return $this->product;\n }", "public function getPRODUTOS()\n {\n return $this->hasOne(Produto::className(), ['ID' => 'PRODUTOS_ID']);\n }", "public function getDeptsub()\n\t\t{\n\t\t\treturn $this->hasOne(Deptsub::className(), ['DEP_SUB_ID' => 'DEP_SUB_ID']);\n\t\t}", "public function orderBonusBudget()\n {\n return $this->belongsTo('App\\Models\\Ad3d\\OrderBonusBudget\\QcOrderBonusBudget', 'bonus_id', 'bonus_id');\n }", "public function getProductPrice()\n {\n }", "public function product()\n {\n return $this->belongsTo(config('inventory.models.product-variant'), 'product_variant_id');\n }", "public function getPriceInfo()\n {\n return $this->price_info;\n }", "public function provincy(){\n return $this->belongsTo('App\\Provincy', 'provincy_id');\n }", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }", "public function getProduct()\n {\n return isset($this->product) ? $this->product : null;\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "protected function findPkSimple($key, ConnectionInterface $con)\n {\n $sql = 'SELECT prod_shipping_price_id, prod_shipping_name, prod_shipping_description, prod_shipping_asia, prod_shipping_europe, prod_shipping_usa, prod_shipping_canada, prod_shipping_au, prod_shipping_asia_parcel, prod_shipping_europe_parcel, prod_shipping_usa_parcel, prod_shipping_canada_parcel, prod_shipping_au_parcel FROM tbl_prod_shipping WHERE prod_shipping_price_id = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(\\PDO::FETCH_NUM)) {\n /** @var ChildTblProdShipping $obj */\n $obj = new ChildTblProdShipping();\n $obj->hydrate($row);\n TblProdShippingTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function autoProductDivision()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\AutoProductDivision','sp_id','sp_id');\n }", "public function getPrice()\n {\n return $this->Price;\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(Product::class, $this->primaryKey);\n\t}", "public function getProduct() {\n\t\t// if this is just a model made on our end, we might not the serialized product yet\n\t\t// alternatively: newer BillForward may omit serialized product and necessitate a fetch\n\t\tif (!$this->product) {\n\t\t\tif (!$this->productID) {\n\t\t\t\tthrow new Bf_PreconditionFailedException(\"This Bf_ProductRatePlan has neither a 'product' specified, nor a 'productID' by which to obtain said product.\");\n\t\t\t}\n\t\t\t$this->product = Bf_Product::getByID($this->productID);\n\t\t}\n\t\treturn $this->product;\n\t}", "public function product()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Product', 'n_ProductId_FK')->withDefault();\n }", "public function pledger()\n {\n return $this->belongsTo(Pledger::class);\n }", "public function getNewPrice()\n {\n return $this->newPrice instanceof PriceBuilder ? $this->newPrice->build() : $this->newPrice;\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo('Tricks\\Product');\n\t}", "function get_product_pricebooks($id)\n\t{\n\t\tglobal $log,$singlepane_view;\n\t\t$log->debug(\"Entering get_product_pricebooks(\".$id.\") method ...\");\n\t\tglobal $mod_strings;\n\t\trequire_once('modules/PriceBooks/PriceBooks.php');\n\t\t$focus = new PriceBooks();\n\t\t$button = '';\n\t\tif($singlepane_view == 'true')\n\t\t\t$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;\n\t\telse\n\t\t\t$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;\n\n\n\t\t$query = \"SELECT ec_pricebook.pricebookid as crmid,\n\t\t\tec_pricebook.*,\n\t\t\tec_pricebookproductrel.productid as prodid\n\t\t\tFROM ec_pricebook\n\t\t\tINNER JOIN ec_pricebookproductrel\n\t\t\t\tON ec_pricebookproductrel.pricebookid = ec_pricebook.pricebookid\n\t\t\tWHERE ec_pricebook.deleted = 0\n\t\t\tAND ec_pricebookproductrel.productid = \".$id;\n\t\t$log->debug(\"Exiting get_product_pricebooks method ...\");\n\t\treturn GetRelatedList('Products','PriceBooks',$focus,$query,$button,$returnset);\n\t}" ]
[ "0.6585547", "0.64412904", "0.6298926", "0.628615", "0.6239225", "0.62340397", "0.61298776", "0.61049235", "0.60788137", "0.59433645", "0.59053785", "0.5872398", "0.58614546", "0.5850542", "0.57735664", "0.56533194", "0.56014764", "0.5586905", "0.55719686", "0.5564868", "0.55628353", "0.5500416", "0.54838395", "0.5483212", "0.5477757", "0.5477757", "0.5477757", "0.5477757", "0.5458603", "0.5444041", "0.5438238", "0.54124695", "0.5411647", "0.5390408", "0.53667116", "0.53595567", "0.5319966", "0.53155726", "0.5314163", "0.5302546", "0.53015804", "0.5293806", "0.529309", "0.5264636", "0.52516663", "0.52472585", "0.5242604", "0.5235989", "0.52232164", "0.52220625", "0.5222021", "0.5218869", "0.52178866", "0.52178866", "0.52178866", "0.52178866", "0.52178866", "0.52178866", "0.5212021", "0.5208798", "0.52040154", "0.51925695", "0.5192242", "0.51865995", "0.51740044", "0.5173504", "0.5171726", "0.51704603", "0.51649696", "0.51625985", "0.51625985", "0.5157821", "0.5156573", "0.51476735", "0.5146726", "0.51355064", "0.51270187", "0.5122657", "0.5120906", "0.5120216", "0.5117198", "0.51106876", "0.51097643", "0.5103419", "0.5101954", "0.5101487", "0.5100284", "0.5099256", "0.5096622", "0.50962186", "0.5091731", "0.5090849", "0.50882965", "0.50794274", "0.5075797", "0.5075591", "0.50685054", "0.5064001", "0.50565404", "0.50561553" ]
0.7456949
0
Declares an association between this object and a ChildTblProdSmaller object.
public function setTblProdSmaller(ChildTblProdSmaller $v = null) { if ($v === null) { $this->setProdId(NULL); } else { $this->setProdId($v->getProdId()); } $this->aTblProdSmaller = $v; // Add binding for other direction of this 1:1 relationship. if ($v !== null) { $v->setTblProdInfo($this); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTblProdSmaller(ConnectionInterface $con = null)\n {\n if ($this->aTblProdSmaller === null && ($this->prod_id !== null)) {\n $this->aTblProdSmaller = ChildTblProdSmallerQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdSmaller->setTblProdInfo($this);\n }\n\n return $this->aTblProdSmaller;\n }", "public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }", "public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }", "public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }", "public function __construct()\n\t{\n\t\t$this->has_one['product'] = array('Products_m', 'id', 'product_id');\n\t\t// $this->soft_deletes = TRUE;\n\t\tparent::__construct();\n\t}", "public function initialize()\n {\n\t\t$this->belongsTo('sfafba_partner_id', 'SfAffiliationPartener', 'sfafpa_id', array('alias' => 'sf_affiliation_partener_partner_id'));\n\n parent::initialize();\n }", "public function toForeignKey($primaryTable = null, $foreignKey = null, $onDelete = \"CASCADE\", $onUpdate = \"CASCADE\") {\n parent::toForeignKey($primaryTable, $foreignKey, $onDelete, $onUpdate);\n \n if($foreignKey == null) {\n $foreignKey = $this->_currentColumn;\n }\n\n if($primaryTable == null) {\n $otherTableName = explode(\"_\", $foreignKey);\n $otherTableName = $otherTableName[0];\n $primaryTable = $otherTableName;\n }\n\n $class = ucfirst(strtolower($this->_currentTable));\n $secondClass = ucfirst(strtolower($primaryTable));\n\n $this->addClass($class);\n $this->addClass($secondClass);\n \n $column = substr($this->_currentColumn, 0, strlen($this->_currentColumn) - 3);\n\n if($class == $secondClass) {\n \n $belongsToName = \"parent\";\n $hasManyName = \"children\";\n \n \n if($this->_currentColumn == \"instance_id\") {\n $belongsToName = \"instance\";\n $hasManyName = \"revisions\";\n }\n \n \n $belongsTo = array($belongsToName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $hasMany = array($hasManyName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n if($hasManyName == \"revisions\") {\n // if it's a revision relationship sort by revision\n $hasMany[\"order\"] = \"revision desc\";\n } elseif($this->columnExist($this->_currentTable, \"position\")) {\n // if there is a column position sort by this column\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$class][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$class][\"has_many\"]);\n } else {\n \n $belongsTo = array(substr($foreignKey, 0, -3), \"class_name\" => $this->_modelNamespace.$secondClass, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $primaryColumnName = explode(\"_\", $this->_currentTable);\n array_shift($primaryColumnName);\n $primaryColumnName = join(\"_\", $primaryColumnName);\n \n $hasMany = array($primaryColumnName.\"s\", \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n \n if($this->columnExist($this->_currentTable, \"position\")) {\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$secondClass][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$secondClass][\"has_many\"]);\n }\n\n // fluent interface\n return $this;\n }", "public function setParent(self $parent, string $parentAssociationMapping): void;", "public function addProductInfo()\n {\n $attribute = $this->attributeRepository->get('name');\n\n $this->getSelect()->joinLeft(\n ['product_table' => $this->getTable('catalog_product_entity_varchar')],\n \"main_table.product_id = product_table.entity_id AND product_table.store_id = 0\",['product_name' => 'product_table.value']\n )->where('product_table.attribute_id = ?', $attribute->getAttributeId());\n\n return $this;\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function initialize()\n {\n $this->setSchema(\"atiempo_prod\");\n $this->hasMany('id', 'AcCartaAvalDetalle', 'id_carta', ['alias' => 'AcCartaAvalDetalle']);\n }", "public function initialize()\n {\n parent::initialize();\n $this->setSchema(\"salesDB\");\n $this->setSource(\"product_category\");\n $this->hasMany('id', 'App\\Models\\Product', 'product_category_id', ['alias' => 'Product']);\n $this->belongsTo('user_updated', 'App\\Models\\User', 'id', ['alias' => 'UserUpdated']);\n $this->belongsTo('user_created', 'App\\Models\\User', 'id', ['alias' => 'UserCreated']);\n $this->belongsTo('client_id', 'App\\Models\\Client', 'id', ['alias' => 'Client']);\n $this->belongsTo('sync_status_id', 'App\\Models\\SyncStatus', 'id', ['alias' => 'SyncStatus']);\n }", "public function product_detail()\n {\n return $this->has_one('Product_Detail');\n }", "public function product()\n {\n return $this->belongsTo(BaseProduct::class);\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function buildRelations()\n {\n $this->addRelation('Marca', 'Marca', RelationMap::MANY_TO_ONE, array('idmarca' => 'idmarca', ), 'CASCADE', 'CASCADE');\n $this->addRelation('Proveedor', 'Proveedor', RelationMap::MANY_TO_ONE, array('idproveedor' => 'idproveedor', ), 'CASCADE', 'CASCADE');\n }", "public function defineRelations()\n {\n return array(\n 'product' => array(static::BELONGS_TO, 'Commerce_ProductRecord', 'required' => true, 'onDelete'=> static::CASCADE),\n 'wishlist' => array(static::BELONGS_TO, 'WishlistRecord', 'required' => true, 'onDelete'=> static::CASCADE)\n );\n }", "function ajouteProdToRub() { \r\n\t\tglobal $R0;\r\n\t\tlist($table,$tableRel,$tableProd,$relRubId_rubId,$relProdId_prodId,$catTitre,$prodTitre) = explode(':',$R0['childRel']);\r\n\t\tlist($relRubId,$rubId) = explode('=',$relRubId_rubId);\r\n\t\tlist($relProdId,$prodId) = explode('=',$relProdId_prodId);\r\n\r\n\t\t$C = new SQL($tableRel);\r\n\t\t$champs = array(array($relRubId,$relProdId,'ordre'),array($this->rub_id,intval($_POST[$prodId]),'999')); // Array champsName // Array champsVal\r\n\t\t$C->insertSql($champs,1);\r\n\t\t$this->info = 'ajout';\r\n\t}", "public function initialize()\n {\n $this->belongsTo('cons_order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n $this->belongsTo('order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n }", "public function primaryProduct() : object\n {\n return $this->hasOne(Species::class, 'id');\n }", "PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }", "public function joinProduct($classId);", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class, 'id_product', 'id_product');\n }", "function createProduct($parent = null);", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function initialize()\n {\n $this->hasMany('cd_desconto', 'App\\Models\\PdvVendasHasItens', 'cd_desconto', array('alias' => 'PdvVendasHasItens'));\n $this->belongsTo('cd_caixa', 'App\\Models\\PdvCaixa', 'cd_caixa', array('alias' => 'PdvCaixa'));\n $this->belongsTo('cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_unidade_negocio', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('cd_usuario_criacao', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }", "public function productDetail()\n {\n return $this->belongsTo(ProductDetail::class);\n }", "public function initialize()\n {\n $this->setSchema(\"ieslluis_gestiovfc\");\n $this->setSource(\"lines_comandes\");\n $this->hasMany('ncomanda', 'Comandes', 'numero', ['alias' => 'Comandes']);\n $this->hasMany('producte', 'Productes', 'codi', ['alias' => 'Productes']);\n }", "public function autoProductDivision()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\AutoProductDivision','sp_id','sp_id');\n }", "public function belongsToMany($class, $joinTable = null, $localForeignKey = null, $otherForeignKey = null, $localKey = null, $otherKey = null);", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function initialize()\n {\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('alias' => 'Datospersonales'));\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('foreignKey' => true));\n }", "public function product() : BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function withPartneredSmallParcelData($value)\n {\n $this->setPartneredSmallParcelData($value);\n return $this;\n }", "public function getProdRelated()\n {\n return $this->prod_related;\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function associate($entity)\n {\n // The Mapper will retrieve this association within the object model, we won't be using\n // the foreign key attribute inside the parent Entity.\n //\n //$this->parent->setEntityAttribute($this->foreignKey, $entity->getEntityAttribute($this->otherKey));\n //\n // Instead, we'll just add the object to the Entity's attribute\n\n $this->parent->setEntityAttribute($this->relation, $entity->getEntityObject());\n }", "public function attach($p_objid, $p_parent_objid, $p_extradata = null)\n {\n if ($this->obj_exists($p_objid))\n {\n $l_loc_obj_type = $this->get_location_type_by_id($this->get_objTypeID($p_parent_objid));\n\n /* The object can only be attached, if one of these two conditions\n is met:\n\n a) Destination type is a container type\n b) Destination object is the root location object\n */\n if (($l_loc_obj_type && $l_loc_obj_type->num_rows() > 0) || ($p_parent_objid == $this->get_root_location_as_integer()))\n {\n /* Is location entry existent for location category? */\n $l_q = \"SELECT * FROM isys_catg_location_list \" . \"WHERE isys_catg_location_list__isys_obj__id = '\" . $p_objid . \"';\";\n\n $l_dbres = $this->retrieve($l_q);\n\n if ($l_dbres)\n {\n\n /* If not, add one, otherwise rebind entry to new parent */\n $this->m_mptt->action_stack_add(\n ($l_dbres->num_rows() == 0) ? C__MPTT__ACTION_ADD : C__MPTT__ACTION_MOVE,\n [\n \"node_id\" => $p_objid,\n \"parent_id\" => $p_parent_objid\n ]\n );\n\n /* Query for location entry again */\n $l_dbres = $this->retrieve($l_q);\n\n /* Fetch record data */\n $l_entrydata = $l_dbres->get_row();\n\n /* Check for nullentries before updating */\n $l_property = (empty($l_entrydata[\"isys_catg_location_list__property\"])) ? 0 : $l_entrydata[\"isys_catg_location_list__property\"];\n $l_status = (empty($l_entrydata[\"isys_catg_location_list__status\"])) ? 0 : $l_entrydata[\"isys_catg_location_list__status\"];\n\n /* Update location entry */\n $this->m_mptt->action_stack_add(\n C__MPTT__ACTION_UPDATE,\n [\n \"node_id\" => $p_objid,\n \"isys_catg_location_list__title\" => $l_entrydata[\"isys_catg_location_list__title\"],\n \"isys_catg_location_list__description\" => $l_entrydata[\"isys_catg_location_list__description\"],\n \"isys_catg_location_list__lft\" => intval($l_entrydata[\"isys_catg_location_list__lft\"]),\n \"isys_catg_location_list__rgt\" => intval($l_entrydata[\"isys_catg_location_list__rgt\"]),\n \"isys_catg_location_list__property\" => intval($l_property),\n \"isys_catg_location_list__status\" => intval($l_status)\n ]\n );\n\n /* Extra data? */\n if ($p_extradata != null && is_array($p_extradata))\n {\n $l_arrupdate = [\"node_id\" => $p_objid];\n\n foreach ($p_extradata as $l_field => $l_data)\n {\n $l_arrupdate[$l_field] = $l_data;\n }\n\n $this->m_mptt->action_stack_add(\n C__MPTT__ACTION_UPDATE,\n $l_arrupdate\n );\n }\n\n /* Return ID of created / updated record */\n\n return $l_entrydata[\"isys_catg_location_list__id\"];\n }\n }\n else\n {\n\n /* Location not a container*/\n if ($l_loc_obj_type && $l_loc_obj_type->num_rows() <= 0)\n {\n\n $l_row = $this->get_type_by_id($this->get_objTypeID($p_parent_objid));\n\n isys_component_template_infobox::instance()\n ->set_message(\n \"Your destination object is not a container. \" . \"Change your object-type config in order to add objects into \\\"\" . _L(\n $l_row[\"isys_obj_type__title\"]\n ) . \"\\\".\",\n null,\n null,\n null,\n C__LOGBOOK__ALERT_LEVEL__3\n );\n }\n }\n }\n\n return null;\n }", "public function initialize()\n {\n $this->hasMany('idprodutoArea', 'App\\Models\\TabelaPrecoHasDesconto', 'produtoArea_idprodutoArea', array('alias' => 'TabelaPrecoHasDesconto'));\n $this->belongsTo('area_cd_area', 'App\\Models\\Area', 'cd_area', array('alias' => 'Area'));\n $this->belongsTo('produto_cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_tabela', 'App\\Models\\TabelaPreco', 'cd_tabela', array('alias' => 'TabelaPreco'));\n $this->belongsTo('unidade_negocio_cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->hasMany('idprodutoArea', 'App\\Models\\TabelaPrecoHasDesconto', 'produtoArea_idprodutoArea', NULL);\n $this->belongsTo('area_cd_area', 'App\\Models\\Area', 'cd_area', array('foreignKey' => true,'alias' => 'Area'));\n $this->belongsTo('produto_cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n $this->belongsTo('cd_tabela', 'App\\Models\\TabelaPreco', 'cd_tabela', array('foreignKey' => true,'alias' => 'TabelaPreco'));\n $this->belongsTo('unidade_negocio_cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('foreignKey' => true,'alias' => 'UnidadeNegocio'));\n }", "public function attach(&$parent, &$child, $rel_name) {\n\t$parent->save();\n\t$child->save();\n\n\t$rels = $parent->getRelationships($rel_name);\n\t$insert = true;\n\tforeach ($rels as $rel) {\n\t $node = $rel->getEndNode();\n\t if ($node->getProperty('name') == $child->getProperty('name')) {\n\t\t$insert = false;\n\t }\n\t}\n\tif ($insert) {\n\t $parent->relateTo($child, $rel_name)->save();\n\t}\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function initialize()\n {\n $this->hasMany('speler_id', 'Team_spelers', 'speler_id', array('alias' => 'Team_spelers'));\n }", "public function setTblProdPricing(ChildTblProdPricing $v = null)\n {\n if ($v === null) {\n $this->setProdPriceId(NULL);\n } else {\n $this->setProdPriceId($v->getProdPriceId());\n }\n\n $this->aTblProdPricing = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblProdPricing object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function initialize()\n {\n $this->belongsTo('posicao_id', 'Ecommerce\\Admin\\Models\\Posicao', 'id', array('alias' => 'Posicao'));\n }", "public function initialize()\n {\n $this->hasMany('cd', 'ShouhinMrs', 'shu_souko_mr_cd', array('alias' => 'ShouhinMrs'));\n $this->hasMany('cd', 'ShiireMeisaiDts', 'souko_mr_cd', array('alias' => 'ShiireMeisaiDts'));\n $this->hasMany('cd', 'UriageMeisaiDts', 'souko_mr_cd', array('alias' => 'UriageMeisaiDts'));\n $this->belongsTo('tantou_mr_cd', 'TantouMrs', 'cd', array('alias' => 'TantouMrs'));\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function deviceRow() : BelongsTo\n {\n return $this->belongsTo(SprDev::class, 'device');\n }", "public function supplier()\n {\n \treturn $this->belongsTo('App\\Supplier');\n }", "public function OderDetails(){\n\t\treturn $this->hasMany('App\\OrderProduct','ID_Product');\n\t}", "public function relations()\n\t{\n\t\t// class name for the relations automatically generated below.\n\t\treturn array(\n\t\t\t'Product' => array(self::BELONGS_TO, '\\Business\\Product', 'idProduct'),\n\t\t);\n\t}", "public function belongsTo($class, $foreignKey = null, $otherKey = null);", "public function _construct()\n {\n $this->_init('warehouse/warehouse', 'id');\n\t\t//$this->_isPkAutoIncrement = false;\n }", "public function initialize()\n {\n $this->belongsTo('id_categoria_gastos', 'CategoriaGastos', 'id_categoria_gastos', array('alias' => 'CategoriaGastos'));\n $this->belongsTo('id_presupuesto', 'Presupuesto', 'id_presupuesto', array('alias' => 'Presupuesto'));\n }", "public function initialize()\n {\n $this->belongsTo('id_segmentation', 'Entities\\Segmentation', 'id', array('foreignKey' => true, 'alias' => 'Segmentation'));\n $this->belongsTo('id_factor_network', 'Entities\\FactorNetwork', 'id', array('foreignKey' => true, 'alias' => 'FactorNetwork'));\n }", "public function buildRelations()\n {\n $this->addRelation('EmailManagerTrace', '\\\\TheliaEmailManager\\\\Model\\\\EmailManagerTrace', RelationMap::MANY_TO_ONE, array('trace_id' => 'id', ), 'CASCADE', 'RESTRICT');\n $this->addRelation('EmailManagerHistoryEmail', '\\\\TheliaEmailManager\\\\Model\\\\EmailManagerHistoryEmail', RelationMap::ONE_TO_MANY, array('id' => 'history_id', ), 'CASCADE', 'RESTRICT', 'EmailManagerHistoryEmails');\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function products(): MorphToMany;", "public function addRelationM2M($connectortable,$thisid,$mappedid,$connectedtable,$thatid,$cmappedid) {\n\t\t$table = new table($connectedtable);\n\t\t$conntable = new table($connectortable);\n\t\tif (isset($conntable->$mappedid) && isset($conntable->$cmappedid)) {\n\t\t\t\tself::$relations[$this->table][$connectedtable] = new stdClass();\n\t\t\t\tself::$relations[$this->table][$connectedtable]->origKey = $thisid;\n\t\t\t\tself::$relations[$this->table][$connectedtable]->targetKey = $mappedid;\n\t\t\t\tself::$relations[$this->table][$connectedtable]->connector = $connectortable;\n\t\t\t\tself::$relations[$connectedtable][$this->table] = new stdClass();\n\t\t\t\tself::$relations[$connectedtable][$this->table]->origKey = $thatid;\n\t\t\t\tself::$relations[$connectedtable][$this->table]->targetKey = $cmappedid;\n\t\t\t\tself::$relations[$connectedtable][$this->table]->connector = $connectortable;\n\t\t\t\tself::$relations[$connectedtable][$this->table]->type = self::$relations[$this->table][$connectedtable]->type = MANY;\n\t\t}\n\t\telse {\n\t\t\t\tthrow new Exception(\"$mappedid column doesn't exist in $connectortable or $cmappedid column doesn't exist in $connectedtable\");\n\t\t}\n\t\treturn $this;\n\t}", "public function initialize()\n {\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', array('alias' => 'Cargaestudiantes'));\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', array('alias' => 'Datosprofesiona'));\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', NULL);\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', NULL);\n }", "public function productBrandMap(){\n\t\treturn $this->hasOne('App\\ProductBrandMaps','product_id');\n\t}", "public function vendor()\n {\n // A product can only belong to one vendor\n return $this->belongs_to('Vendor');\n }", "public function category_product()\n {\n return $this->belongsTo(Category_product::class);\n }", "function __construct()\n\t{\n parent::__construct();\n\t\t$this->set_table_name(\"shelf\");\n\n\t}", "function __construct(){\n parent::__construct('drq_father_data');\n }", "public function Supplier()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\Supplier');\n\t}", "public function product(): BelongsTo\n {\n return $this->belongsTo(config('laravel-inventory.product'));\n }", "private function prepRelations() : self\n {\n\n // Lvd.\n $maxRId = 0;\n $relationships = [];\n\n // Add Sheets.\n foreach ($this->xlsx->getBook()->getSheets() as $sheet) {\n\n $relationships[] = [\n '@Id' => 'rId' . $sheet->getId(),\n '@Type' => $this->types['sheet'],\n '@Target' => 'worksheets/sheet' . $sheet->getId() . '.xml',\n ];\n\n // Count max ID.\n $maxRId = max($maxRId, $sheet->getId());\n }\n\n // Add the rest of relationships.\n $relationships[] = [\n '@Id' => 'rId' . ( ++$maxRId ),\n '@Type' => $this->types['styles'],\n '@Target' => 'styles.xml',\n ];\n $relationships[] = [\n '@Id' => 'rId' . ( ++$maxRId ),\n '@Type' => $this->types['theme'],\n '@Target' => 'theme/theme1.xml',\n ];\n $relationships[] = [\n '@Id' => 'rId' . ( ++$maxRId ),\n '@Type' => $this->types['sharedStrings'],\n '@Target' => 'sharedStrings.xml',\n ];\n\n // Save.\n $this->array['Relationships']['@@']['Relationship'] = $relationships;\n\n return $this;\n }", "public function subsidiary(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = subsidiary_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Subsidiary::class);\n\t}", "public function supplier()\n\t{\n\t\treturn $this->belongsTo('App\\Supplier');\n\t}", "public function production_plate () {\n\t\treturn $this->belongsTo('App\\ProductionPlate');\n\t}", "public function CommercialComprehensiveBelongsToCommercialClass()\n {\n return $this->belongsTo('App\\MotorInsuranceModels\\CommercialVehicles\\CommercialClass', 'commercial_class_id', 'id');\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function professional(){\n \t\n \treturn $this->belongsTo('App\\Professional');\n }", "public function supplier()\n {\n return $this->belongsTo(Supplier::class);\n }", "public function initialize()\n {\n $this->hasMany('groep_id', 'Gebruikers', 'groep_id', array('alias' => 'Gebruikers'));\n $this->hasMany('groep_id', 'Groep_permissies', 'groep_id', array('alias' => 'Groep_permissies'));\n }", "public function supplier(): \\Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\n {\n return $this->belongsTo('Easy\\Commerce\\Models\\Supplier\\Supplier', 'supplier_id', 'id');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo('Tricks\\Product');\n\t}", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function initialize()\n {\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', array('alias' => 'Documentosbeneficios'));\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', NULL);\n }", "public function supplier()\n {\n return $this->belongsTo(Supplier::class);\n }", "public function order_product(){\n return $this->hasOne(Order_product::class);\n }", "public function product_able()\n {\n return $this->morphTo();\n }", "public function setProdId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_id !== $v) {\n $this->prod_id = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ID] = true;\n }\n\n if ($this->aTblProdPhotos !== null && $this->aTblProdPhotos->getProdId() !== $v) {\n $this->aTblProdPhotos = null;\n }\n\n if ($this->aTblProdPrices !== null && $this->aTblProdPrices->getProdId() !== $v) {\n $this->aTblProdPrices = null;\n }\n\n if ($this->aTblProdSmaller !== null && $this->aTblProdSmaller->getProdId() !== $v) {\n $this->aTblProdSmaller = null;\n }\n\n return $this;\n }", "public function initialize()\n {\n $this->hasMany('id', 'Movie', 'classification_id', array('alias' => 'Movie'));\n }", "public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function productImage(){\n\t\treturn $this->hasmany('App\\ProductImages','product_id');\n\t}", "public function Category_id()\n {\n return $this->hasOne(Product::class);\n }", "public function product()\n {\n \treturn $this->belongsTo(Product::class);\n }", "public function Product()\n\t{\n\t\treturn $this->belongsTo('App\\Product');\n\t}", "public function product()\n {\n return $this->belongsTo(Product::Class());\n }", "public function initialize()\n {\n $this->hasMany('id', 'Message', 'idFil', array('alias' => 'Message'));\n $this->belongsTo('idFil', 'Message', 'id', array('alias' => 'Message'));\n $this->belongsTo('idProjet', 'Projet', 'id', array('alias' => 'Projet'));\n $this->belongsTo('idUser', 'User', 'id', array('alias' => 'User'));\n }", "function set_parent($value) {\n $this->set_mapped_property('parent', $value);\n }", "public function initialize()\n {\n $this->hasMany('id', 'GroupProfile', 'media_id', array('alias' => 'GroupProfile'));\n $this->belongsTo('profile_id', 'Profile', 'id', array('alias' => 'Profile'));\n $this->belongsTo('evenement_id', 'Event', 'id', array('alias' => 'Event'));\n }", "public function initialize()\n {\n $this->belongsTo('id_deuda', 'NbDeudas', 'id_deuda', array('alias' => 'NbDeudas'));\n $this->belongsTo('id_deuda', 'Nbdeudas', 'id_deuda', array('foreignKey' => true));\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function prodi() {\n return $this->belongsTo( 'App\\Prodi', 'kd_prodi', 'kd_prodi' );\n }" ]
[ "0.5755038", "0.54846007", "0.5314013", "0.53102195", "0.51196", "0.51009697", "0.50886047", "0.49849883", "0.4979125", "0.4959543", "0.49168986", "0.48226443", "0.48084807", "0.47947544", "0.47486645", "0.47406623", "0.47361344", "0.47281274", "0.4702288", "0.46898404", "0.4685568", "0.4682122", "0.4652987", "0.46504796", "0.46409628", "0.46402404", "0.46386582", "0.46336344", "0.4632392", "0.46322215", "0.4630962", "0.4629784", "0.46132734", "0.46121657", "0.46045622", "0.46033794", "0.46009362", "0.45959726", "0.45949045", "0.4591446", "0.45913035", "0.4587879", "0.45820427", "0.4568873", "0.45663622", "0.45622215", "0.45591864", "0.45546618", "0.4548968", "0.45456022", "0.45452684", "0.45452094", "0.45434943", "0.45348316", "0.45288292", "0.4526325", "0.45249906", "0.45236003", "0.45133746", "0.45059967", "0.4504701", "0.45039517", "0.44921455", "0.4491206", "0.4488678", "0.4485533", "0.44846004", "0.44841504", "0.4477552", "0.44755146", "0.44740903", "0.44728807", "0.4471746", "0.44706857", "0.44686624", "0.4461189", "0.44548875", "0.4454344", "0.44538596", "0.4452078", "0.44518167", "0.44504923", "0.44473636", "0.4446781", "0.44421047", "0.44398656", "0.44396305", "0.44395703", "0.44361007", "0.44348428", "0.44311672", "0.44271648", "0.4426104", "0.44183153", "0.44110584", "0.44092065", "0.44089696", "0.44079706", "0.44079706", "0.44044113" ]
0.6833271
0
Get the associated ChildTblProdSmaller object
public function getTblProdSmaller(ConnectionInterface $con = null) { if ($this->aTblProdSmaller === null && ($this->prod_id !== null)) { $this->aTblProdSmaller = ChildTblProdSmallerQuery::create()->findPk($this->prod_id, $con); // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association. $this->aTblProdSmaller->setTblProdInfo($this); } return $this->aTblProdSmaller; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setTblProdSmaller(ChildTblProdSmaller $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdSmaller = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function getProdRelated()\n {\n return $this->prod_related;\n }", "public function getParentItemfromDatabase()\n {\n $dataTableName = Data::mapDataType($this->parentType);\n\n\n $dataTable = new $dataTableName();\n\n $parentItem = $this->parentItem = $dataTable->find($this->parentId)->current();\n return $parentItem;\n }", "public function product_detail()\n {\n return $this->has_one('Product_Detail');\n }", "function get_child_product($entity_id)\n\t{\n\t\t$relTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_relation');\n\t\t$sql = \"SELECT child_id FROM `\" . $relTable . \"`\n\t\t\t\t\t\tWHERE parent_id = '\" . (int) $entity_id . \"'\";\n\t\t$prods = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n\t\tif ($prods) {\n\t\t\treturn $prods;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getProduct()\r\n {\r\n return $this->item->getParentObject()->getProduct();\r\n }", "public function getProdRelated2()\n {\n return $this->prod_related2;\n }", "public function primaryProduct() : object\n {\n return $this->hasOne(Species::class, 'id');\n }", "public function GetItem()\r\n\t{\r\n\t\treturn $this->_phreezer->GetManyToOne($this, \"fk_reference_item1\");\r\n\t}", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getParentProductByChildId($ChildProdId)\n {\n $ParentProdArr = DB::table($this->DBTables['Group_Products'] . ' as GP')\n ->join($this->DBTables['Products'] . ' as P', 'GP.parent_productid', '=', 'P.id')\n ->where('P.disable', '=', 0)\n ->where('GP.product_id', '=', (int)$ChildProdId)\n ->select('P.*')\n ->get();\n\n return $ParentProdArr;\n }", "public function getChildProducts(Product $parent);", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function product() {\n return $this->morphTo();\n }", "public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }", "function getClassroomRelatedByClassroomId() {\n\t\t$fk_value = $this->getclassroom_id();\n\t\tif (null === $fk_value) {\n\t\t\treturn null;\n\t\t}\n\t\treturn Classroom::retrieveByPK($fk_value);\n\t}", "public function get_parent();", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "function get_parent() {\n return $this->get_mapped_property('parent');\n }", "public function product()\n {\n return $this->m_product;\n }", "public function getGrandParent();", "public static function loadProductByProId($p_proId)\n {\n $sql = \"select * from products where ProID = $p_proId\";\n $list = DataProviderMain::execQuery($sql);\n if ($row = mysqli_fetch_array($list)) {\n\n //$proId = $row[\"ProID\"];\n //$proId = $p_proId;\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($p_proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n return $p;\n }\n\n return NULL;\n }", "public function productDetail()\n {\n return $this->belongsTo(ProductDetail::class);\n }", "function Product() {\r\n\t\treturn $this->owner;\r\n\t}", "protected function retrieveParent()\n {\n }", "public function getChild()\n {\n return $this->child;\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function getPkProduto()\n {\n return $this->hasOne(Produto::className(), ['id' => 'pk_produto']);\n }", "static function getParentMenu($openSession){\n// \t\t$openSession = null;\n\t\t$consulta = 'select * from menline_parent order by order_line';\n\t\ttry {\n// \t\t\t$openSession = managedConnection::openConnection();\n\t\t\t\t$dao = $openSession->query($consulta);\n\t\t\t\t//Retornamos la lista de Objetos\n// \t\t\tmanagedConnection::closeConnection($openSession);\n\t\t\treturn ($dao);\n\t\t} catch (PDOException $exception) {\n\t\t\techo $exception->getMessage();\n\t\t}\n\t}", "public function getParentSubtype()\n {\n return $this->hasOne(SpaceSubtype::className(), ['id' => 'parent_subtype_id']);\n }", "public function getMotherAttribute()\n {\n return $this->families()->where('type', 'mother')->first();\n }", "public function getParent(){\n\t\treturn $this->father;\n\t}", "public function getProdId()\n {\n return $this->prod_id;\n }", "public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }", "public function stockCost(){\n return $this->belongsTo( StockCost::class, 'pj_stock_cost_parent_id' );\n }", "public function cost(){\n return $this->belongsTo( StockCost::class , 'pj_stock_cost_parent_id' );\n }", "public function getChildProducts($parentProdId)\n {\n $ChildProdArr = DB::table($this->DBTables['Group_Products'] . ' as GP')\n ->join($this->DBTables['Products'] . ' as P', 'GP.product_id', '=', 'P.id')\n ->where('P.disable', '=', 0)\n ->where('GP.parent_productid', '=', (int)$parentProdId)\n ->select('P.*')\n ->get();\n\n return $ChildProdArr;\n }", "public function product()\n {\n return $this->belongsTo(BaseProduct::class);\n }", "PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }", "public function getProductParent($product_id = 0){\n\t $sql = \"SELECT product_id as parent_product_id, model FROM `\".DB_PREFIX.\"product` where product_id = '\" . (int)$product_id . \"'\";\n\t $query = $this->db->query($sql);\n\t return $query->rows;\n\t}", "public function getTblProdPricing(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPricing === null && ($this->prod_price_id !== null)) {\n $this->aTblProdPricing = ChildTblProdPricingQuery::create()->findPk($this->prod_price_id, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblProdPricing->addTblProdInfos($this);\n */\n }\n\n return $this->aTblProdPricing;\n }", "public function GetIdProducto()\n\t{\n\t\treturn $this->idProd;\n\t}", "public static function loadProductsTopSale()\n {\n $ret = array();\n $sql = \"select p.ProID,p.ProName,p.Price, SUM(od.quantity) from products p,orderdetails od \n\t\t\t\twhere p.ProID = od.ProId\n\t\t\t\tGROUP BY p.ProID\n\t\t\t\tORDER BY od.quantity DESC limit 0,10\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n //$tinyDes = $row[\"TinyDes\"];\n //$fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n //$quantity = $row[\"Quantity\"];\n //$catId = $row[\"CatID\"];\n //$view = $row[\"NView\"];\n //$dayAdd = $row[\"DayAdd\"];\n //$classify =$row[\"Classify\"];\n\n $p = new Products($proId, $proName, '', '', $price, '', '', '', '', '');\n array_push($ret, $p);\n }\n\n return $ret;\n }", "function find_childs($child_schema, $child_table, $fkey_column, $fk_id) {\n\t\t$table = new PgObject($this->gui, $child_schema, $child_table);\n\t\t$this->childs[$child_table] = $table->find_where($fkey_column . \" = '\" . $fk_id. \"'\");\n\t\treturn $this->childs[$child_table];\n\t}", "public function getPRODUTOS()\n {\n return $this->hasOne(Produto::className(), ['ID' => 'PRODUTOS_ID']);\n }", "public function getTable()\n {\n return $this->parentTable;\n }", "public function product()\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "abstract protected function extractProductDetail();", "public function bundle()\n {\n return $this->hasOne(ProductBundle::class, 'id','bundle_id');\n }", "public function from_warehouse() {\n return $this->hasOne('App\\Models\\Warehouse', 'PK_NO', 'F_FROM_INV_WAREHOUSE_NO');\n }", "public function getItem()\n {\n return $this->hasOne(CatalogProduct::className(), ['id' => 'item_id']);\n }", "public function OderDetails(){\n\t\treturn $this->hasMany('App\\OrderProduct','ID_Product');\n\t}", "public function parent()\n\t{\n\t\tif( static::$databaseColumnParent !== NULL )\n\t\t{\n\t\t\t$parentColumn = static::$databaseColumnParent;\n\t\t\tif( $this->$parentColumn !== static::$databaseColumnParentRootValue )\n\t\t\t{\n\t\t\t\treturn static::load( $this->$parentColumn );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( isset( static::$parentNodeClass ) )\n\t\t{\n\t\t\t$parentNodeClass = static::$parentNodeClass;\n\t\t\t$parentColumn = static::$parentNodeColumnId;\n\t\t\tif( $this->$parentColumn )\n\t\t\t{\n\t\t\t\treturn $parentNodeClass::load( $this->$parentColumn );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn NULL;\n\t}", "public function fetchMPTypes() {\n\t\t\n\t\t$this->_productTypes = array();\n\t\t$sql = \"SELECT * FROM product_types WHERE parent_ptype_id IS NULL\"; \n\t\t$dbh = $this->_conn->query( $sql);\n\t\n\t\twhile ( $row = $dbh->fetch() )\t{\n\t\t\t\t$this->_productTypes[] = new ProductTypes( $row[\"ptype_id\"], $row[\"parent_ptype_id\"], $row[\"type_name\"] );\n\t\t }\t\n\t\t \n\t\treturn $this->_productTypes;\n\t}", "public function getParent()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$criteria=$owner->getDbCriteria();\n\t\t$alias=$db->quoteColumnName($owner->getTableAlias());\n\n\t\t$criteria->mergeWith(array(\n\t\t\t'condition'=>$alias.'.'.$db->quoteColumnName($this->leftAttribute).'<'.$owner->{$this->leftAttribute}.\n\t\t\t\t' AND '.$alias.'.'.$db->quoteColumnName($this->rightAttribute).'>'.$owner->{$this->rightAttribute},\n\t\t\t'order'=>$alias.'.'.$db->quoteColumnName($this->rightAttribute),\n\t\t));\n\n\t\tif($this->hasManyRoots)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rootAttribute).'='.$owner->{$this->rootAttribute});\n\n\t\treturn $owner->find();\n\t}", "public function getProduct()\n {\n return $this->coreRegistry->registry('product');\n }", "private function getProductModel() {\n if ($this->_productModel == NULL) {\n $this->_productModel = new Product();\n }\n return $this->_productModel;\n }", "public function getProductInfoDetail($id){\r\n \t$db=$this->getAdapter();\r\n \t$sql = \"SELECT p.pro_id,p.cate_id,p.stock_type,p.item_name,p.item_code,p.price_per_qty,p.brand_id,\r\n \tp.photo,p.is_avaliable,p.remark,c.Name,branch_namekh As branch_name\r\n \tFROM ln_ins_product AS p\r\n \tINNER JOIN ln_ins_category AS c ON c.CategoryID=p.cate_id\r\n \tINNER JOIN tb_branch AS b ON b.branch_id=p.brand_id\r\n \tWHERE p.pro_id=\".$id.\" LIMIT 1\";\r\n \t$rows = $db->fetchRow($sql);\r\n \treturn ($rows);\r\n }", "public function getTblProdPhotos(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPhotos === null && ($this->prod_id !== null)) {\n $this->aTblProdPhotos = ChildTblProdPhotosQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdPhotos->setTblProdInfo($this);\n }\n\n return $this->aTblProdPhotos;\n }", "public function findNewProd()\r\n {\r\n $query = $this->getEntityManager()\r\n ->createQuery(\"select m from CondorsTnMallBundle:Produit m ORDER BY m.datecreation DESC \")\r\n ->setMaxResults(5);\r\n\r\n return $query->getResult();\r\n\r\n }", "public function getTblGeneral(ConnectionInterface $con = null)\n {\n if ($this->aTblGeneral === null && ($this->prod_general !== null)) {\n $this->aTblGeneral = ChildTblGeneralQuery::create()->findPk($this->prod_general, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblGeneral->addTblProdInfos($this);\n */\n }\n\n return $this->aTblGeneral;\n }", "public function get_product()\n {\n return $this->_product;\n }", "public function getTopBrandForMaleBaseOnSizeChart(){ \n \n $query = $this->getEntityManager()\n ->createQuery(\"SELECT b FROM LoveThatFitAdminBundle:Brand b\n JOIN b.sizechart sc\n WHERE\n sc.gender='M'\n AND sc.target='Top'\n GROUP BY b.id\");\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }", "public function parent(){\n return $this->where('id', $this->parent_id)->first();\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function getAvailChildProds($parentProdId, $fromDate, $toDate, $extendedDays, $defaultFilterArr,$orderedProdsArr=array(),$selectedFilter = 0)\n {\n// echo $parentProdId.'---'.$extendedDays.'<br />';\n// dd($defaultFilterArr);\n $availableProdsArr = array();\n $getChildProdsArr = $this->getChildProducts($parentProdId);\n\n if (!empty($getChildProdsArr)) {\n /*For handicap*/\n if (empty($defaultFilterArr)) {\n $defaultFilterArr = (!empty(session()->get('defaultFilterArr')) ? session()->get('defaultFilterArr') : Config::get('constants.Default_Filter'));\n }\n /*if($selectedFilter == 60 && $defaultFilterArr[0] == 60){\n $defaultFilterArr[1] = 55;\n $defaultFilterArr[2] = 27;\n $defaultFilterArr[3] = 58;\n $defaultFilterArr[4] = 0;\n }*/\n// $HandicapAttribArr = $this->getProdIDByAttributes($defaultFilterArr[4]);\n\n $FlexAttribArr = $this->getProdIDByAttributes($defaultFilterArr[3]);\n\n $HandAttribArr = $this->getProdIDByAttributes($defaultFilterArr[1]);\n\n $ShaftAttribArr = $this->getProdIDByAttributes($defaultFilterArr[2]);\n\n $GenderAttribArr = $this->getProdIDByAttributes($defaultFilterArr[0]);\n $addedProdArr = array();\n if(count($orderedProdsArr)>0){\n foreach ($orderedProdsArr as $orderedProds){\n array_push($addedProdArr, $orderedProds->product_id);\n }\n }\n// in_array($childArr->id, $HandicapAttribArr)&&\n foreach ($getChildProdsArr as $childArr) {\n if (in_array($childArr->id, $FlexAttribArr) && in_array($childArr->id, $HandAttribArr) && in_array($childArr->id, $ShaftAttribArr) && in_array($childArr->id, $GenderAttribArr) && !in_array($childArr->id, $addedProdArr)) {\n\n $CheckProdArr = $this->checkChildForBooking($childArr->id, $fromDate, $toDate, $extendedDays);\n /*if($parentProdId == '123'){\n echo $childArr->id.' --- '.$fromDate.' ---- '.$toDate.' ---- '.$extendedDays;\n echo '<br />';\n print_r($CheckProdArr);\n echo '<br />';\n }*/\n if (empty($CheckProdArr[0])) {\n $ArrtibSetArr = $this->getProdAttribsByProdId($childArr->id);\n if(count($ArrtibSetArr)>0){\n foreach ($ArrtibSetArr as $attrib){\n if($attrib->attrib_name == 'Handicap'){\n $childArr->handicap = $attrib->value;\n }\n }\n }\n array_push($availableProdsArr, $childArr);\n }\n }\n }\n }\n\n return $availableProdsArr;\n }", "public function getFeaturedProduct(){\n\t\t$sql = \"SELECT * FROM tbl_product WHERE type = '1' ORDER BY pid DESC LIMIT 4\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "protected function _getParentProduct($sParentId)\n {\n if ($sParentId && $this->_oParentProd === null) {\n $this->_oParentProd = false;\n $oProduct = oxNew('oxArticle');\n if (($oProduct->load($sParentId))) {\n $this->_processProduct($oProduct);\n $this->_oParentProd = $oProduct;\n }\n }\n\n return $this->_oParentProd;\n }", "public function prodi() {\n return $this->belongsTo( 'App\\Prodi', 'kd_prodi', 'kd_prodi' );\n }", "public function getproductdetail($prod_id)\n {\n $product = $this->Dbmodel->getproductdata($prod_id); \n return $product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\r\n {\r\n return $this->product;\r\n }", "public function getProduct() {\r\n return $this->_product;\r\n }", "public function retrieveParent() {\n $prepare = $this->database->prepare(\"\n SELECT parent_object\n FROM manuscripts\n WHERE collection = :collection\n AND pointer = :pointer\n LIMIT 1\n \");\n\n $prepare->execute(array(\n \":collection\" => $this->collection,\n \":pointer\" => $this->pointer\n ));\n\n return $prepare->fetchColumn();\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function getProduct()\n {\n return isset($this->product) ? $this->product : null;\n }", "public function parentRecord()\r\n {\r\n return $this->_parent;\r\n }", "public function getProduct()\n {\n return $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product;\n }", "public function product_able()\n {\n return $this->morphTo();\n }", "public function getProduct();", "public function Parent()\n\t{\n\t\treturn Category::findOrFail($this->category_id);\n\t}", "public function deviceRow() : BelongsTo\n {\n return $this->belongsTo(SprDev::class, 'device');\n }", "public function getSubclassId();", "public function getTopBrandForFemaleBaseOnSizeChart(){ \n \n $query = $this->getEntityManager()\n ->createQuery(\"SELECT b FROM LoveThatFitAdminBundle:Brand b\n JOIN b.sizechart sc\n WHERE\n sc.gender='F'\n AND sc.target='Top'\n GROUP BY b.id\");\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }", "function get_info($office_id) {\n $this->db->from('offices');\n $this->db->join('offices_info', 'offices.office_id = offices_info.officeID', 'left');\n $this->db->join('app_files', 'app_files.officeID = offices.office_id', 'left');\n $this->db->where('office_id', $office_id);\n $query = $this->db->get();\n\n if ($query->num_rows() == 1) {\n return $query->row();\n } else {\n //Get empty base parent object, as $massage_id is NOT an customer\n // $obj = new stdClass();\n $obj = $this->get_info_parents(-1);\n\n $fields = $this->db->list_fields('offices_info');\n\n //Get all the fields from items_massages table\n foreach ($fields as $field) {\n //append those fields to base parent object, we we have a complete empty object\n $obj->$field = '';\n }\n\n return $obj;\n }\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function subsidiary(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = subsidiary_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Subsidiary::class);\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('DevProducto');\n }", "public static function getInstance()\r\n {\r\n return Doctrine_Core::getTable('OrderProductDetails');\r\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function getProduct()\n {\n return $this->product;\n }" ]
[ "0.63195765", "0.58784056", "0.55714196", "0.5557377", "0.55366707", "0.55361897", "0.537516", "0.5317671", "0.5232316", "0.5226625", "0.5226625", "0.5226625", "0.5226625", "0.522193", "0.5190114", "0.51654303", "0.5153909", "0.5153823", "0.5143266", "0.5140183", "0.51077807", "0.50969785", "0.5088534", "0.50826865", "0.50705713", "0.50595826", "0.5059423", "0.50487447", "0.5045477", "0.5032566", "0.49750215", "0.49616995", "0.4931836", "0.49308744", "0.4919759", "0.4911545", "0.49034387", "0.4893781", "0.48853266", "0.4882797", "0.48800337", "0.48766598", "0.48758346", "0.48733345", "0.4867517", "0.48614302", "0.48602417", "0.48574373", "0.4850667", "0.4835807", "0.48333773", "0.48326266", "0.48248735", "0.48246756", "0.48195848", "0.48123458", "0.48097092", "0.48001802", "0.47949213", "0.4786355", "0.47854888", "0.47843838", "0.4782501", "0.47782794", "0.47774574", "0.4776438", "0.47729683", "0.4771789", "0.4770382", "0.47698763", "0.47687086", "0.47681177", "0.47621888", "0.47576404", "0.47573888", "0.47573888", "0.47573888", "0.47573888", "0.47573888", "0.47573888", "0.47530398", "0.4746117", "0.47444385", "0.47412658", "0.47399116", "0.47320244", "0.47316864", "0.4727713", "0.4723143", "0.47212887", "0.47162864", "0.47143012", "0.47135013", "0.47112694", "0.47110167", "0.4709648", "0.4707849", "0.4706988", "0.4706233", "0.47030795" ]
0.73373497
0
Declares an association between this object and a ChildTblShippingCategories object.
public function setTblShippingCategories(ChildTblShippingCategories $v = null) { if ($v === null) { $this->setProdCategoryShipping(NULL); } else { $this->setProdCategoryShipping($v->getProdShippingPriceId()); } $this->aTblShippingCategories = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildTblShippingCategories object, it will not be re-added. if ($v !== null) { $v->addTblProdInfo($this); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShippingCategoryId();", "public function getTblShippingCategories(ConnectionInterface $con = null)\n {\n if ($this->aTblShippingCategories === null && ($this->prod_category_shipping !== null)) {\n $this->aTblShippingCategories = ChildTblShippingCategoriesQuery::create()->findPk($this->prod_category_shipping, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblShippingCategories->addTblProdInfos($this);\n */\n }\n\n return $this->aTblShippingCategories;\n }", "public function order_shipping()\n {\n return $this->hasMany('App\\Models\\Sales\\SalesShipping', 'sales_order_id', 'id');\n }", "public function getProdCategoryShipping()\n {\n return $this->prod_category_shipping;\n }", "public function setProdCategoryShipping($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_category_shipping !== $v) {\n $this->prod_category_shipping = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_CATEGORY_SHIPPING] = true;\n }\n\n if ($this->aTblShippingCategories !== null && $this->aTblShippingCategories->getProdShippingPriceId() !== $v) {\n $this->aTblShippingCategories = null;\n }\n\n return $this;\n }", "public function SPShippings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPShipping','sp_id','sp_id');\n }", "public function shipping(): BelongsTo\n {\n return $this->belongsTo(Shipping::class)->withDefault(function($shipping){\n $shipping->sameAsBilling($this->user->customer);\n });\n }", "public function setShipping($shipping);", "public function shippingMethod()\n {\n return $this->belongsTo('App\\ShippingMethod');\n }", "public function shippingMethod()\n {\n return $this->belongsTo('ShippingMethod');\n }", "public function shippingMethod()\n {\n return $this->belongsTo(ShippingMethod::class);\n }", "public function shippingMethod()\n {\n return $this->belongsTo('App\\Models\\ShippingMethod', 'shipping_id', 'id');\n }", "public function gETShipmentIdShippingCategoryRequest($shipment_id)\n {\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling gETShipmentIdShippingCategory'\n );\n }\n\n $resourcePath = '/shipments/{shipmentId}/shipping_category';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\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 shipping(): HasOne\n {\n return $this->hasOne(StripeCustomerShippingDetails::class);\n }", "public function setShipping($shipping)\r\n {\r\n $this->shipping = $shipping;\r\n\r\n return $this;\r\n }", "public function gETSkuIdShippingCategoryRequest($sku_id)\n {\n // verify the required parameter 'sku_id' is set\n if ($sku_id === null || (is_array($sku_id) && count($sku_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $sku_id when calling gETSkuIdShippingCategory'\n );\n }\n\n $resourcePath = '/skus/{skuId}/shipping_category';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($sku_id !== null) {\n $resourcePath = str_replace(\n '{' . 'skuId' . '}',\n ObjectSerializer::toPathValue($sku_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\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 setShipping($shippingAddress)\n {\n $this->_shipping['Name'] = $shippingAddress['shipping_firstname'].' '.$shippingAddress['shipping_lastname'];\n $this->_shipping['Address'] = array('AddressLine' => $shippingAddress['shipping_address1'].' '.$shippingAddress['shipping_address2'],\n 'City' => $shippingAddress['shipping_city'],\n 'StateProvinceCode' => $shippingAddress['shipping_state'],\n 'PostalCode' => $shippingAddress['shipping_zipcode'],\n 'CountryCode' => $shippingAddress['shipping_country'],\n );\n $this->_shipping['address_id'] = $shippingAddress['address_id'];\n $this->_shipping['contact_phone'] = $shippingAddress['contact_phone'];\n $this->_shipping['contact_email'] = $shippingAddress['contact_email'];\n $this->persist();\n }", "public function supplierCategories()\n {\n return $this->hasMany(SupplierCategory::class);\n }", "public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }", "public function shippingaddress()\n {\n return $this->belongsTo('App\\Models\\BookAddress','shipping_address_id');\n }", "public function setShippingCost($shippingCost);", "public function getCategory() {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); // second - field in dependent table\n }", "public function setShipping($shipping)\n {\n $this->shipping = $shipping;\n }", "public function RelationBetweenCategory()\n {\n return $this->hasOne('App\\Models\\Category', 'id', 'category_id');\n }", "public function initialize()\n {\n parent::initialize();\n $this->setSchema(\"salesDB\");\n $this->setSource(\"product_category\");\n $this->hasMany('id', 'App\\Models\\Product', 'product_category_id', ['alias' => 'Product']);\n $this->belongsTo('user_updated', 'App\\Models\\User', 'id', ['alias' => 'UserUpdated']);\n $this->belongsTo('user_created', 'App\\Models\\User', 'id', ['alias' => 'UserCreated']);\n $this->belongsTo('client_id', 'App\\Models\\Client', 'id', ['alias' => 'Client']);\n $this->belongsTo('sync_status_id', 'App\\Models\\SyncStatus', 'id', ['alias' => 'SyncStatus']);\n }", "public function shippingAddress()\n {\n return $this->belongsTo('App\\Address');\n }", "public function setShippingType($shippingType)\n {\n $this->shippingType = $shippingType;\n return $this;\n }", "public function setShipping($shipping)\n {\n $this->shipping = $shipping;\n\n return $this;\n }", "public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}", "public function shoe_category()\n {\n return $this->hasOne(ShoeCategory::class);\n }", "public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }", "public function gETShippingMethodIdShippingCategoryRequest($shipping_method_id)\n {\n // verify the required parameter 'shipping_method_id' is set\n if ($shipping_method_id === null || (is_array($shipping_method_id) && count($shipping_method_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipping_method_id when calling gETShippingMethodIdShippingCategory'\n );\n }\n\n $resourcePath = '/shipping_methods/{shippingMethodId}/shipping_category';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($shipping_method_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shippingMethodId' . '}',\n ObjectSerializer::toPathValue($shipping_method_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\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 subcategory()\n {\n return $this->hasOne('App\\Models\\Category','id','sub_category_id');\n }", "public function sub_categories()\n {\n return $this->hasMany('App\\SubCategory');\n }", "public function subcategories()\r\n {\r\n return $this->hasMany('App\\Models\\SubCategory');\r\n }", "public function getSubCategory(){\n return $this->hasOne(Category::class, 'id','subcategory_id');\n }", "public function Child()\n\t{\n\t\treturn $this->hasMany(Category::class);\n\t}", "public function categoryProduct(){\n return $this->hasMany(CategoryProduct::class);\n }", "public function belongsTo($class, $foreignKey = null, $otherKey = null);", "public function category()\n {\n return $this->hasOne('fooCart\\src\\Category', 'category_id', 'category_id');\n }", "public function Category_id()\n {\n return $this->hasOne(Product::class);\n }", "public function categories(){\n\n return $this->hasMany('App\\Customer');\n }", "public function categoriesSon()\n {\n return $this->hasMany(self::class);\n }", "public function subcategories()\n {\n return $this->hasMany('App\\Models\\Subcategory', 'scat_cat_id', 'cat_id');\n }", "public function hasMany($class, $foreignKey = null, $localKey = null);", "public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }", "public function defineRelations()\n\t{\n\t\treturn [\n\t\t\t'deliveries' => [\n\t\t\t\tstatic::HAS_MANY,\n\t\t\t\t'Courier_DeliveryRecord',\n\t\t\t\t'blueprintId',\n\t\t\t\t'order' => 'dateCreated DESC'\n\t\t\t],\n\t\t];\n\t}", "public function ship()\n {\n return $this->belongsTo('Tradewars\\Ship', 'ship_id');\n }", "public function addShippingMethodsFilter($shippingMethod)\n {\n $this->joinLeft(\n CreateShippingMethodsTable::TABLE_NAME,\n 'main_table.' . CheckoutAttributeInterface::ATTRIBUTE_ID . '='\n . CreateShippingMethodsTable::TABLE_NAME . '.' . CheckoutAttributeInterface::ATTRIBUTE_ID,\n null\n )->addFieldToFilter(\n CreateShippingMethodsTable::TABLE_NAME . '.shipping_method',\n [\n ['null' => true],\n ['eq' => $shippingMethod]\n ]\n );\n\n return $this;\n }", "public function initialize()\n {\n $this->hasMany('id', 'Movie', 'classification_id', array('alias' => 'Movie'));\n }", "public function initialize()\n {\n $this->hasMany(\"id\", \"Hotelsfacility\", \"hotel_id\");\n $this->hasMany(\"id\", \"HotelRoom\", \"hotel_id\");\n $this->belongsTo(\"city_id\", \"City\", \"id\");\n $this->belongsTo(\"province_id\", \"Province\", \"id\");\n $this->belongsTo(\"country_id\", \"Country\", \"id\");\n\n }", "public function subCategoryType()\n {\n return $this->belongsTo(SubCategoryType::class);\n }", "public function subcategory()\n {\n return $this->belongsTo(SubCategory::class);\n }", "public function sub_category()\n {\n\n return $this->hasOne(Category::class, 'id', 'sub_categories_id');\n }", "public function initialize()\n {\n $this->hasMany(\"id\", \"Modules\\Models\\Orders\", \"member_id\", array(\n 'alias' => 'orders'\n ));\n }", "public function deliveryService() {\n return $this->belongsTo(DeliveryService::class);\n }", "public function initialize()\n {\n $this->hasMany('groep_id', 'Gebruikers', 'groep_id', array('alias' => 'Gebruikers'));\n $this->hasMany('groep_id', 'Groep_permissies', 'groep_id', array('alias' => 'Groep_permissies'));\n }", "public function initialize()\n {\n $this->setSchema(\"atiempo_prod\");\n $this->hasMany('id', 'AcCartaAvalDetalle', 'id_carta', ['alias' => 'AcCartaAvalDetalle']);\n }", "public function Category()\n { \n return $this->hasOne('App\\Models\\Category', 'category_id', 'category_id');\n }", "public function toForeignKey($primaryTable = null, $foreignKey = null, $onDelete = \"CASCADE\", $onUpdate = \"CASCADE\") {\n parent::toForeignKey($primaryTable, $foreignKey, $onDelete, $onUpdate);\n \n if($foreignKey == null) {\n $foreignKey = $this->_currentColumn;\n }\n\n if($primaryTable == null) {\n $otherTableName = explode(\"_\", $foreignKey);\n $otherTableName = $otherTableName[0];\n $primaryTable = $otherTableName;\n }\n\n $class = ucfirst(strtolower($this->_currentTable));\n $secondClass = ucfirst(strtolower($primaryTable));\n\n $this->addClass($class);\n $this->addClass($secondClass);\n \n $column = substr($this->_currentColumn, 0, strlen($this->_currentColumn) - 3);\n\n if($class == $secondClass) {\n \n $belongsToName = \"parent\";\n $hasManyName = \"children\";\n \n \n if($this->_currentColumn == \"instance_id\") {\n $belongsToName = \"instance\";\n $hasManyName = \"revisions\";\n }\n \n \n $belongsTo = array($belongsToName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $hasMany = array($hasManyName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n if($hasManyName == \"revisions\") {\n // if it's a revision relationship sort by revision\n $hasMany[\"order\"] = \"revision desc\";\n } elseif($this->columnExist($this->_currentTable, \"position\")) {\n // if there is a column position sort by this column\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$class][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$class][\"has_many\"]);\n } else {\n \n $belongsTo = array(substr($foreignKey, 0, -3), \"class_name\" => $this->_modelNamespace.$secondClass, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $primaryColumnName = explode(\"_\", $this->_currentTable);\n array_shift($primaryColumnName);\n $primaryColumnName = join(\"_\", $primaryColumnName);\n \n $hasMany = array($primaryColumnName.\"s\", \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n \n if($this->columnExist($this->_currentTable, \"position\")) {\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$secondClass][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$secondClass][\"has_many\"]);\n }\n\n // fluent interface\n return $this;\n }", "public function setCartShippingMethodID($shippingMethodId)\n {\n }", "public function category_product()\n {\n return $this->belongsTo(Category_product::class);\n }", "public function productCategoryMap(){\n\t\treturn $this->hasOne('App\\ProductCategoryMaps','product_id');\n\t}", "public function setCategoryIdAttribute($value)\n\t{\n\t\t$this->attributes['category_id'] = ($value) ? $value : null;\n\t}", "public function categoryProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = cate_id, localKey = cate_id)\n return $this->hasMany('App\\CategoryProductRelation','cate_id','cate_id');\n }", "public function categories()\n {\n \treturn $this->hasMany('App\\Category');\n }", "public function shipping_adress()\n {\n return $this->hasOne(shipping_adress::class, 'id', 'shipping_adresses_id');\n }", "public function initialize()\n {\n $this->hasMany(\"province_id\", \"Phoenix\\Models\\Area\", \"province_id\");\n $this->hasMany(\"province_id\", \"Phoenix\\Models\\Academy\", \"province_id\");\n $this->hasMany(\"province_id\", \"Phoenix\\Models\\Members\", \"province_id\");\n }", "public function mainCategory(){\n \treturn $this->hasMany(Category::class,'parent_id');\n }", "public function Category()\n {\n return $this->hasOne('App\\Models\\Category', 'category_id', 'category_id');\n }", "public function initialize()\n {\n $this->belongsTo('id_categoria_gastos', 'CategoriaGastos', 'id_categoria_gastos', array('alias' => 'CategoriaGastos'));\n $this->belongsTo('id_presupuesto', 'Presupuesto', 'id_presupuesto', array('alias' => 'Presupuesto'));\n }", "public function initialize()\n {\n $this->setSchema(\"gxc\");\n $this->hasMany('id', 'App\\Models\\YztIntegral', 'user_id', ['alias' => 'YztIntegral']);\n $this->hasMany('id', 'App\\Models\\YztShopCart', 'user_id', ['alias' => 'YztShopCart']);\n $this->hasMany('id', 'App\\Models\\YztShopComment', 'user_id', ['alias' => 'YztShopComment']);\n $this->hasMany('id', 'App\\Models\\YztShopCommentPraise', 'user_id', ['alias' => 'YztShopCommentPraise']);\n $this->hasMany('id', 'App\\Models\\YztShopLog', 'user_id', ['alias' => 'YztShopLog']);\n $this->hasMany('id', 'App\\Models\\YztShopOrder', 'user_id', ['alias' => 'YztShopOrder']);\n }", "public function setShippingService(ShippingService $service)\n {\n $this->shippingService = $service;\n }", "public function category() {\n # Define an inverse one-to-many relationship.\n \treturn $this->belongsTo('Category');\n }", "public function initialize()\n {\n $this->setSchema(\"ieslluis_gestiovfc\");\n $this->setSource(\"lines_comandes\");\n $this->hasMany('ncomanda', 'Comandes', 'numero', ['alias' => 'Comandes']);\n $this->hasMany('producte', 'Productes', 'codi', ['alias' => 'Productes']);\n }", "public function initialize()\n {\n $this->setSchema(\"bd_diagnostico\");\n $this->setSource(\"categoria\");\n $this->hasMany('id_categoria', 'diag\\cc\\Pregunta', 'id_categoria', ['alias' => 'Pregunta']);\n $this->hasMany('id_categoria', 'diag\\cc\\Visita', 'id_categoria', ['alias' => 'Visita']);\n }", "public function getIddefCategoria()\n {\n return $this->hasOne(DefCategoria::className(), ['iddef_categoria' => 'iddef_categoria']);\n }", "protected function addForeignKeys()\n {\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(InitiativeRecord::tableName(), 'id'),\n InitiativeRecord::tableName(),\n 'id',\n ElementRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'elementId'),\n TargetRecord::tableName(),\n 'elementId',\n InitiativeRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'userId'),\n TargetRecord::tableName(),\n 'userId',\n UserRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n }", "public function add_membership_category()\n {\n $this->modify_object('Booking_membership_category');\n }", "public function getShippingAddresses()\n {\n return $this->morphMany(Address::class, 'addressable', ['type' => Address::TYPE_SHIPPING]);\n }", "public function initialize()\n {\n $this->belongsTo('id_segmentation', 'Entities\\Segmentation', 'id', array('foreignKey' => true, 'alias' => 'Segmentation'));\n $this->belongsTo('id_factor_network', 'Entities\\FactorNetwork', 'id', array('foreignKey' => true, 'alias' => 'FactorNetwork'));\n }", "public function getCategory(){\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function getCategory() \n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); \n }", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function categories()\n {\n return $this->hasMany(\\Hydrofon\\Category::class, 'parent_id');\n }", "public function initialize()\n {\n $this->hasMany('idprodutoArea', 'App\\Models\\TabelaPrecoHasDesconto', 'produtoArea_idprodutoArea', array('alias' => 'TabelaPrecoHasDesconto'));\n $this->belongsTo('area_cd_area', 'App\\Models\\Area', 'cd_area', array('alias' => 'Area'));\n $this->belongsTo('produto_cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_tabela', 'App\\Models\\TabelaPreco', 'cd_tabela', array('alias' => 'TabelaPreco'));\n $this->belongsTo('unidade_negocio_cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->hasMany('idprodutoArea', 'App\\Models\\TabelaPrecoHasDesconto', 'produtoArea_idprodutoArea', NULL);\n $this->belongsTo('area_cd_area', 'App\\Models\\Area', 'cd_area', array('foreignKey' => true,'alias' => 'Area'));\n $this->belongsTo('produto_cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n $this->belongsTo('cd_tabela', 'App\\Models\\TabelaPreco', 'cd_tabela', array('foreignKey' => true,'alias' => 'TabelaPreco'));\n $this->belongsTo('unidade_negocio_cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('foreignKey' => true,'alias' => 'UnidadeNegocio'));\n }", "public function setShipmentItemsAttribute($value): self\n {\n $items = new Collection();\n collect($value)->each(function ($item) use ($items) {\n $items->push(new ShipmentItem($item));\n });\n $this->shipmentItems = $items;\n\n return $this;\n }", "public function initialize()\n {\n $this->belongsTo('cons_order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n $this->belongsTo('order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n }", "public function getForeignKey()\n {\n return 'store_id';\n }", "function __construct()\n {\n $this->_table = \"products_locations_type\"; \n }", "function setCategory($object) { \n /* you can itentify the item with $object->Item->ShopId */ \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 getSubcategory() {\n return $this->hasMany(Subcategory::className(), ['id' => 'subcategory_id'])\n ->viaTable('question_category', ['question_id' => 'id']);\n }", "public function categories() {\n return $this->hasMany(Categories::class, 'parent');\n }", "public function getCategory()\n {\n return $this->hasMany(Category::className(), ['category_id' => 'id']);\n }", "public function ProductCategory()\n {\n return $this->belongsTo('App\\Models\\ProductCategory');\n }", "public function category()\n\t{\n\t\treturn $this->belongsTo('App\\InvoiceItemCategory');\n\t}", "public function getShippingReferenceDomestic(PropelPDO $con = null);", "public function category() {\n return $this->hasOne('App\\Models\\Category', 'id');\n }", "public function initialize()\n {\n $this->hasMany('informacion_id', 'Informacionadicional', 'informacion_id', array('alias' => 'Informacionadicional'));\n $this->belongsTo('informacion_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\n }" ]
[ "0.60233307", "0.585173", "0.5684485", "0.5615994", "0.5429658", "0.5173888", "0.5172341", "0.5149478", "0.51297504", "0.5097469", "0.5013813", "0.4951383", "0.49422163", "0.4922968", "0.4881246", "0.48500246", "0.4848185", "0.4839036", "0.48374784", "0.48279616", "0.47960475", "0.4791598", "0.47858498", "0.47768998", "0.4765359", "0.47632664", "0.47286004", "0.47223687", "0.4713718", "0.47131324", "0.4712001", "0.46941867", "0.46941185", "0.46871275", "0.4685908", "0.46652764", "0.46611935", "0.46393824", "0.46276146", "0.46090078", "0.45919856", "0.4589946", "0.45724556", "0.45714754", "0.45631808", "0.45595747", "0.45506236", "0.4545927", "0.45452678", "0.45221898", "0.44911665", "0.4485801", "0.4478828", "0.44749784", "0.44715017", "0.4470945", "0.4465076", "0.4462799", "0.44593745", "0.44578817", "0.44491163", "0.4446248", "0.4445379", "0.44392893", "0.44333377", "0.443031", "0.44263643", "0.44111475", "0.44109917", "0.44033703", "0.4399679", "0.43976885", "0.43905455", "0.4387751", "0.43869674", "0.4383064", "0.43711057", "0.43658516", "0.43600765", "0.43547627", "0.4353831", "0.434959", "0.43495744", "0.43470863", "0.4345643", "0.43423873", "0.43421823", "0.43391505", "0.4333863", "0.43297178", "0.4328597", "0.4323117", "0.43151906", "0.43060106", "0.42999554", "0.42898005", "0.42886177", "0.42867473", "0.4283137", "0.42812002" ]
0.69599843
0
Get the associated ChildTblShippingCategories object
public function getTblShippingCategories(ConnectionInterface $con = null) { if ($this->aTblShippingCategories === null && ($this->prod_category_shipping !== null)) { $this->aTblShippingCategories = ChildTblShippingCategoriesQuery::create()->findPk($this->prod_category_shipping, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. $this->aTblShippingCategories->addTblProdInfos($this); */ } return $this->aTblShippingCategories; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShippingCategoryId();", "public function getProdCategoryShipping()\n {\n return $this->prod_category_shipping;\n }", "public function getCategory() {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); // second - field in dependent table\n }", "public function setTblShippingCategories(ChildTblShippingCategories $v = null)\n {\n if ($v === null) {\n $this->setProdCategoryShipping(NULL);\n } else {\n $this->setProdCategoryShipping($v->getProdShippingPriceId());\n }\n\n $this->aTblShippingCategories = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblShippingCategories object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }", "public function order_shipping()\n {\n return $this->hasMany('App\\Models\\Sales\\SalesShipping', 'sales_order_id', 'id');\n }", "public function getCategory()\n {\n return $this->hasMany(Category::className(), ['category_id' => 'id']);\n }", "public function getCategory()\n\t\t{\n\t\t\treturn $this->hasOne(Categories::className(), ['id' => 'category_id']);\n\t\t}", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function getShipping();", "public function shippingMethod()\n {\n return $this->belongsTo('ShippingMethod');\n }", "public function getCategory() \n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); \n }", "public function getCategory()\n {\n return $this->hasOne(MgfSelectionCategory::className(), ['id' => 'category_id']);\n }", "public function getSubtotalShipping()\n {\n $this->initializeSubtotals();\n\n return $this->getIfSet('shipping', $this->data->amount->subtotals);\n }", "public function sub_category()\n {\n\n return $this->hasOne(Category::class, 'id', 'sub_categories_id');\n }", "public function getCategory(){\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function getSubCategory(){\n return $this->hasOne(Category::class, 'id','subcategory_id');\n }", "public function category()\n {\n return $this->hasOne('fooCart\\src\\Category', 'category_id', 'category_id');\n }", "public function shippingMethod()\n {\n return $this->belongsTo('App\\Models\\ShippingMethod', 'shipping_id', 'id');\n }", "public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }", "function getCategory() \n {\n return $this->instance->getCategory();\n }", "public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }", "public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }", "public function shippingMethod()\n {\n return $this->belongsTo('App\\ShippingMethod');\n }", "public function getTaxCategoryId();", "public function Child()\n\t{\n\t\treturn $this->hasMany(Category::class);\n\t}", "public function shippingMethod()\n {\n return $this->belongsTo(ShippingMethod::class);\n }", "public function shipping(): BelongsTo\n {\n return $this->belongsTo(Shipping::class)->withDefault(function($shipping){\n $shipping->sameAsBilling($this->user->customer);\n });\n }", "public function categoriesSon()\n {\n return $this->hasMany(self::class);\n }", "public function shoe_category()\n {\n return $this->hasOne(ShoeCategory::class);\n }", "public function SPShippings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPShipping','sp_id','sp_id');\n }", "public function getShipping()\r\n {\r\n return $this->shipping;\r\n }", "protected function childCategoryTC()\n {\n return PostCategory::childCategories()->firstOrFail();\n }", "public function getId(){\n return $this->_sub_cat_id;\n }", "public function subcategory()\n {\n return $this->hasOne('App\\Models\\Category','id','sub_category_id');\n }", "public function supplierCategories()\n {\n return $this->hasMany(SupplierCategory::class);\n }", "public function getCategories()\n {\n return $this->hasMany(Category::class, ['id' => 'category_id'])\n ->viaTable('product_category', ['product_id' => 'id']);\n }", "public function getShipping()\n {\n return $this->shipping;\n }", "public function getShipping()\n {\n return $this->shipping;\n }", "public function getShipping()\n {\n return $this->shipping;\n }", "public function getCategory() {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }", "public function getTaxCategory();", "public function getTaxCategory();", "public function getTaxCategory();", "public function Category()\n {\n return $this->hasOne('App\\Models\\Category', 'category_id', 'category_id');\n }", "public function getCategoryInstance()\n {\n if (!$this->_categoryInstance) {\n $this->_categoryInstance = Mage::getSingleton('fvets_salesrep/category');\n }\n return $this->_categoryInstance;\n }", "public function getCategory()\n {\n }", "public function getProductCategory()\n {\n return $this->hasMany(ProductCategory::className(), ['category_id' => 'id']);\n }", "public function categories() {\n\t\t// sukuria sasaja su Category modeliu:\n\t\treturn $this->hasOne('App\\Category', 'id', 'category');\n\t}", "public function getSub_category(){\n return $this->sub_category;\n }", "public function Category()\n { \n return $this->hasOne('App\\Models\\Category', 'category_id', 'category_id');\n }", "public function getShippingReferenceDomestic(PropelPDO $con = null);", "public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function category()\n {\n\n return $this->hasOne(Category::class, 'id', 'categories_id');\n }", "public function getCategory()\n {\n return $this->hasOne(NewsCategory::className(), ['id' => 'category_id']);\n }", "public function getCategory() {}", "public static function getSponsoredCategory()\n {\n $tableCategory=Category::tableName();\n return CategoriesLevelOne::find()->where([\"$tableCategory.name\"=>'SPONSORED'])->joinWith(['relationParentCategory'])->one();\n }", "public function getCategory();", "public function getCategory();", "public function category() {\n return $this->hasOne('App\\Models\\Category', 'id');\n }", "public function gETShipmentIdShippingCategoryRequest($shipment_id)\n {\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling gETShipmentIdShippingCategory'\n );\n }\n\n $resourcePath = '/shipments/{shipmentId}/shipping_category';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\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 subCategoryType()\n {\n return $this->belongsTo(SubCategoryType::class);\n }", "public function getCategories() {\n $stmt = $this->pdo->prepare(\"SELECT * FROM $this->table WHERE parent is null ORDER BY name ASC\");\n $stmt->setFetchMode(\\PDO::FETCH_CLASS, '\\App\\Model\\Category\\ProductCategoryModel');\n $stmt->execute();\n return $stmt->fetchAll();\n }", "public function Category_id()\n {\n return $this->hasOne(Product::class);\n }", "public function productCategoryMap(){\n\t\treturn $this->hasOne('App\\ProductCategoryMaps','product_id');\n\t}", "public function getShippingDetails();", "public function getShippingList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_shipping');\r\n\t\t$this->db->where('shipping_status', '1');\t\t\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getIdCategory(){\n return $this->idCategory;\n }", "public function category()\n {\n return $this->hasOne('Antares\\Customfields\\Model\\FieldCategory', 'id', 'category_id');\n }", "public function getSubcategory() {\n return $this->hasMany(Subcategory::className(), ['id' => 'subcategory_id'])\n ->viaTable('question_category', ['question_id' => 'id']);\n }", "public function subcategories()\n {\n return $this->hasMany('App\\Models\\Subcategory', 'scat_cat_id', 'cat_id');\n }", "public function get_sitemap()\n\t{\n $this->db->select('*');\n $this->db->join($this->_table_name.'_lang', $this->_table_name.'.id = '.$this->_table_name.'_lang.category_id');\n $categories = parent::get();\n \n return $categories;\n\t}", "public function fetch_subcategory() {\n $this->db->where('parent_id!=', '0');\n $r = $this->db->get('category');\n return $r->result_array();\n }", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(self::tablePrefix().'cms_post_category', ['post_id' => 'id']);\n }", "public function getCategory()\r\n\t{\r\n\t\tif (!empty($this->category))\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t}\r\n\r\n\t\t$pk = $this->getState('category.id');\r\n\r\n\t\t$this->category = JTable::getInstance('Category');\r\n\t\t$this->category->load($pk);\r\n\r\n\t\treturn $this->category;\r\n\t}", "public function category_detail()\n\t{\n\t\treturn $this->hasMany( 'App\\CategoryDetail', 'category_ID' );\n\t}", "private function getShippingClass() {\n $classId = $this->wooData->getShippingClassId();\n $classTerm = get_terms([\n 'taxonomy' => 'product_shipping_class',\n 'include' => $classId,\n 'number' => 1,\n 'hide_empty' => false,\n ]);\n\n if (is_wp_error($classTerm) || !$classTerm) return _wpcc('No shipping class');\n if (is_array($classTerm)) $classTerm = $classTerm[0];\n\n /** @var WP_Term $classTerm */\n return $classTerm->name;\n }", "public function category() {\n # Define an inverse one-to-many relationship.\n \treturn $this->belongsTo('Category');\n }", "public function category()\n {\n return $this->hasOne(Category::class, 'id', 'category_id');\n }", "public function categories()\n {\n return $this->hasMany(\\Hydrofon\\Category::class, 'parent_id');\n }", "private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }", "public function fetch_category(){\n $this->db->where('parent_id', '0');\n $r = $this->db->get('category');\n return $r->result_array();\n }", "public function RelationBetweenCategory()\n {\n return $this->hasOne('App\\Models\\Category', 'id', 'category_id');\n }", "public function categories() {\n return $this->belongsTo(\"Category\", \"category_id\", \"id\");\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('ShopcrawlCategory');\n }", "public function getCategoryFk(): ?Category\n {\n return $this->categoryFk;\n }", "public function subcategories()\n {\n \treturn $this->hasMany('App\\Category', 'parent_id')->where('status', 1);\n }", "public function getShippingOptions()\n { \n $shipping_options = Shipping_option::where('company_id',Auth::id())->get(); \n \n return Datatables::of($shipping_options)\n ->addColumn('action', function ($shipping_option) {\n return '<a href=\"shipping-options/'. Hashids::encode($shipping_option->id).'/edit\" class=\"text-primary\" data-toggle=\"tooltip\" title=\"Edit Shipping Option\"><i class=\"fa fa-edit\"></i></a> \n <a href=\"javascript:void(0)\" class=\"text-danger btn-delete\" data-toggle=\"tooltip\" title=\"Delete Shipping Option\" id=\"'.Hashids::encode($shipping_option->id).'\"><i class=\"fa fa-trash\"></i></a>';\n })\n ->editColumn('id', 'ID: {{$id}}')\n ->rawColumns(['action'])\n ->make(true);\n \n }", "protected function parentCategoryTC()\n {\n return PostCategory::parentCategories()->firstOrFail();\n }", "public function categories() {\n return $this->hasMany(Categories::class, 'parent');\n }", "public function getProdCategory()\n {\n return $this->prod_category;\n }", "public static function getParents()\n {\n $tableCategoriesLevelOne=CategoriesLevelOne::tableName();\n $dependency = new DbDependency;\n $dependency->sql=\"SELECT MAX(id) FROM $tableCategoriesLevelOne\";\n $query=Category::getDb()->cache(function($db)\n {\n return Category::find()->orderBy(\"order_by ASC\")->with(['relationCategoriesLevelOne'])->all();\n }, Yii::$app->params['7_day_cache'], $dependency);\n\n return $query;\n }", "public function getCategoryId();", "public function getParentCategories() {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n\n return $this->fetchAll($select);\n }", "public function get_category(){\n\t\t$this->load->model('seller/product_model');\n\t\t$category = $this->product_model->get_category();\n\t\treturn $category;\n\t}", "public function getCategories(){\n return Category::get();\n }" ]
[ "0.73087746", "0.7071618", "0.60448307", "0.60062724", "0.58968705", "0.5847817", "0.57620245", "0.57533", "0.57533", "0.57349205", "0.57349205", "0.57349205", "0.566958", "0.56336474", "0.56125754", "0.5608226", "0.5597498", "0.5596045", "0.55864865", "0.5584981", "0.55732864", "0.55285746", "0.5516021", "0.54919297", "0.5490949", "0.5490949", "0.5490949", "0.54797536", "0.54794586", "0.5458157", "0.5457112", "0.54545444", "0.5444788", "0.5439445", "0.54366845", "0.5423279", "0.54127544", "0.541104", "0.5408142", "0.5407921", "0.54055995", "0.53959817", "0.53959817", "0.53959817", "0.539167", "0.53893936", "0.53893936", "0.53893936", "0.53617406", "0.5357529", "0.5357087", "0.5352248", "0.5351579", "0.5344194", "0.53424156", "0.5333958", "0.532373", "0.5289657", "0.52829415", "0.5280768", "0.5274572", "0.52711576", "0.52711576", "0.52700126", "0.5260452", "0.52433044", "0.52325666", "0.5231989", "0.52220416", "0.5217284", "0.5201447", "0.5199697", "0.5199202", "0.5194478", "0.51872927", "0.51837003", "0.51818955", "0.51732564", "0.5171472", "0.517051", "0.516943", "0.51613283", "0.51569694", "0.5153353", "0.51490605", "0.51418334", "0.5131858", "0.51252586", "0.51228225", "0.5120781", "0.5119178", "0.51115155", "0.5109229", "0.5108585", "0.5102399", "0.510229", "0.5100391", "0.5096164", "0.50924563", "0.5085405" ]
0.7219948
1
Clears the current object, sets all attributes to their default values and removes outgoing references as well as backreferences (from other objects to this one. Results probably in a database change of those foreign objects when you call `save` there).
public function clear() { if (null !== $this->aTblEra) { $this->aTblEra->removeTblProdInfo($this); } if (null !== $this->aTblGeneral) { $this->aTblGeneral->removeTblProdInfo($this); } if (null !== $this->aTblMenus) { $this->aTblMenus->removeTblProdInfo($this); } if (null !== $this->aTblProdPhotos) { $this->aTblProdPhotos->removeTblProdInfo($this); } if (null !== $this->aTblProdPrices) { $this->aTblProdPrices->removeTblProdInfo($this); } if (null !== $this->aTblProdPricing) { $this->aTblProdPricing->removeTblProdInfo($this); } if (null !== $this->aTblProdSmaller) { $this->aTblProdSmaller->removeTblProdInfo($this); } if (null !== $this->aTblShippingCategories) { $this->aTblShippingCategories->removeTblProdInfo($this); } $this->prod_id = null; $this->prod_price_id = null; $this->prod_name = null; $this->prod_alt1 = null; $this->prod_alt2 = null; $this->prod_alt3 = null; $this->prod_alt4 = null; $this->prod_code = null; $this->prod_category = null; $this->prod_category_shipping = null; $this->prod_writeup = null; $this->prod_length = null; $this->prod_wingspan = null; $this->prod_height = null; $this->prod_scale = null; $this->prod_links = null; $this->prod_linkdescription = null; $this->prod_front = null; $this->prod_keywords = null; $this->prod_keywords_writeup = null; $this->prod_title = null; $this->prod_description = null; $this->prod_general = null; $this->prod_era = null; $this->prod_company = null; $this->prod_related = null; $this->prod_related_pa = null; $this->prod_related_m3 = null; $this->prod_related2 = null; $this->prod_saveas = null; $this->prod_aircraftreg = null; $this->mb = null; $this->pa = null; $this->m3 = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clear()\n {\n $this->id = null;\n $this->name = null;\n $this->is_active = null;\n $this->is_closed = null;\n $this->from_date = null;\n $this->to_date = null;\n $this->sortable_rank = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear()\n\t{\n\t\t$this->id = null;\n\t\t$this->uf_id = null;\n\t\t$this->nome = null;\n\t\t$this->slug = null;\n\t\t$this->longitude = null;\n\t\t$this->latitude = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}", "public function clear()\n\t{\n\t\t$this->venueid = null;\n\t\t$this->address = null;\n\t\t$this->address2 = null;\n\t\t$this->city = null;\n\t\t$this->province = null;\n\t\t$this->country = null;\n\t\t$this->latitude = null;\n\t\t$this->longitude = null;\n\t\t$this->phone = null;\n\t\t$this->name = null;\n\t\t$this->description = null;\n\t\t$this->website = null;\n\t\t$this->twitter = null;\n\t\t$this->facebook = null;\n\t\t$this->rssfeed = null;\n\t\t$this->closed = null;\n\t\t$this->lastfmid = null;\n\t\t$this->slug = null;\n\t\t$this->hasphotos = null;\n\t\t$this->submittedbyuser = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->applyDefaultValues();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}", "function clear()\r\n\t{\r\n\t\t// Clear the all list\r\n\t\t$this->all = array();\r\n\r\n\t\t// Clear errors\r\n\t\t$this->error = new stdClass();\r\n\t\t$this->error->all = array();\r\n\t\t$this->error->string = '';\r\n\r\n\t\t// Clear this objects properties and set blank error messages in case they are accessed\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\t$this->{$field} = NULL;\r\n\t\t\t$this->error->{$field} = '';\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has many\" related objects\r\n\t\tforeach ($this->has_many as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has one\" related objects\r\n\t\tforeach ($this->has_one as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear the query related list\r\n\t\t$this->query_related = array();\r\n\r\n\t\t// Clear and refresh stored values\r\n\t\t$this->stored = new stdClass();\r\n\r\n\t\t$this->_refresh_stored_values();\r\n\t}", "public function clear()\n {\n $this->feature_cvterm_id = null;\n $this->feature_id = null;\n $this->cvterm_id = null;\n $this->pub_id = null;\n $this->is_not = null;\n $this->rank = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear()\n {\n $this->id = null;\n $this->code = null;\n $this->category = null;\n $this->address = null;\n $this->address2 = null;\n $this->zipcode = null;\n $this->city = null;\n $this->geo_coordinate_x = null;\n $this->geo_coordinate_y = null;\n $this->distance_camping = null;\n $this->image = null;\n $this->priority = null;\n $this->tel = null;\n $this->fax = null;\n $this->email = null;\n $this->website = null;\n $this->created_at = null;\n $this->updated_at = null;\n $this->active = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear()\n {\n self::foreignChecks(false);\n $this->model->truncate();\n self::foreignChecks(true);\n }", "public function resetRelations()\n\t{\n\t\t$this->relations = array();\n\t}", "public function clear()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->multiRef = [];\n\n }", "public function clear()\n {\n if (null !== $this->aCakeType) {\n $this->aCakeType->removeArticle($this);\n }\n if (null !== $this->aShape) {\n $this->aShape->removeArticle($this);\n }\n $this->article_id = null;\n $this->description = null;\n $this->price = null;\n $this->creation = null;\n $this->visible = null;\n $this->shape_id = null;\n $this->cake_type_id = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear()\n {\n if (null !== $this->aPublisher) {\n $this->aPublisher->removeBiblio($this);\n }\n if (null !== $this->aLanguage) {\n $this->aLanguage->removeBiblio($this);\n }\n if (null !== $this->aPlace) {\n $this->aPlace->removeBiblio($this);\n }\n if (null !== $this->aFrequency) {\n $this->aFrequency->removeBiblio($this);\n }\n if (null !== $this->aUser) {\n $this->aUser->removeBiblio($this);\n }\n $this->biblio_id = null;\n $this->title = null;\n $this->sor = null;\n $this->edition = null;\n $this->isbn_issn = null;\n $this->publisher_id = null;\n $this->publish_year = null;\n $this->collation = null;\n $this->series_title = null;\n $this->call_number = null;\n $this->language_id = null;\n $this->source = null;\n $this->publish_place_id = null;\n $this->classification = null;\n $this->notes = null;\n $this->image = null;\n $this->file_att = null;\n $this->opac_hide = null;\n $this->promoted = null;\n $this->labels = null;\n $this->frequency_id = null;\n $this->spec_detail_info = null;\n $this->input_date = null;\n $this->last_update = null;\n $this->uid = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function reset()\n {\n $this->id = null;\n $this->attributes = array();\n }", "public function clear()\n {\n if (null !== $this->auserSysRef) {\n $this->auserSysRef->removeIssues($this);\n }\n if (null !== $this->aBooks) {\n $this->aBooks->removeIssues($this);\n }\n $this->id = null;\n $this->_name = null;\n $this->_opendate = null;\n $this->_closedate = null;\n $this->_status = null;\n $this->_infotext = null;\n $this->_forbook = null;\n $this->__user__ = null;\n $this->__config__ = null;\n $this->__split__ = null;\n $this->__parentnode__ = null;\n $this->__sort__ = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n } // if ($deep)\n\n $this->aTblEra = null;\n $this->aTblGeneral = null;\n $this->aTblMenus = null;\n $this->aTblProdPhotos = null;\n $this->aTblProdPrices = null;\n $this->aTblProdPricing = null;\n $this->aTblProdSmaller = null;\n $this->aTblShippingCategories = null;\n }", "public function resetDirty()\n {\n $this->dirty = false;\n $this->dirtyOne = false;\n $this->dirtyMany = false;\n }", "public function clear() {\n\t\t$vars = get_object_vars($this);\n\t\tforeach ($vars as $key => $val) {\n\t\t\t$this->$key = null;\n\t\t}\n\t}", "public function clear() {\n\t\t$this->_where\t\t= array();\n\t\t$this->_order\t\t= array();\n\t\t$this->_isAddingNew\t= false;\n\t\t$this->_currentRow\t= 0;\n\t\t$this->_relationship\t= array();\n\t\t$this->_recordset\t= array();\n\t\t$this->_updateBuffer\t= array();\n\t\t$this->_limit\t\t= NULL;\n\t\t$this->_offset\t\t= NULL;\n\t\t$this->isDirty( false );\n\t}", "public function clear()\n {\n $this->op_prime_id = null;\n $this->op_id = null;\n $this->op_prime_libelle = null;\n $this->op_prime_numero = null;\n $this->gdl_art_id = null;\n $this->operation_prime_currency_id = null;\n $this->operation_prime_r_reward_type_id = null;\n $this->operation_prime_r_reward_expedition_mode_id = null;\n $this->operation_prime_r_reward_transporter_id = null;\n $this->operation_prime_fixed_amount = null;\n $this->operation_prime_product_price_pourcentage = null;\n $this->operation_prime_maximum_amount = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clearRelations(): DataObject\n {\n foreach ($this::RELATIONS as $relationKey => $relation) {\n unset($this->{$relationKey});\n }\n\n return $this;\n }", "public function clear()\n {\n if (null !== $this->aSociete) {\n $this->aSociete->removeCommande($this);\n }\n if (null !== $this->aMTransport) {\n $this->aMTransport->removeCommande($this);\n }\n $this->id_commande = null;\n $this->reference = null;\n $this->soc_id_fk = null;\n $this->transport_fk = null;\n $this->quantite = null;\n $this->prix = null;\n $this->delai = null;\n $this->dte_commande = null;\n $this->priorite = null;\n $this->note = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear()\n\t{\n\t\t$this->co_usuario = null;\n\t\t$this->nu_cpf = null;\n\t\t$this->ds_password = null;\n\t\t$this->no_usuario = null;\n\t\t$this->ds_login = null;\n\t\t$this->dt_ultimo_login = null;\n\t\t$this->ds_email = null;\n\t\t$this->co_perfil = null;\n\t\t$this->nu_celular = null;\n\t\t$this->nu_telefone = null;\n\t\t$this->st_usuario = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->applyDefaultValues();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}", "public function clear()\n {\n $this->id = null;\n $this->createdatetime = null;\n $this->createperson_id = null;\n $this->modifydatetime = null;\n $this->modifyperson_id = null;\n $this->deleted = null;\n $this->class = null;\n $this->group_id = null;\n $this->code = null;\n $this->name = null;\n $this->title = null;\n $this->flatcode = null;\n $this->sex = null;\n $this->age = null;\n $this->age_bu = null;\n $this->age_bc = null;\n $this->age_eu = null;\n $this->age_ec = null;\n $this->office = null;\n $this->showinform = null;\n $this->gentimetable = null;\n $this->service_id = null;\n $this->quotatype_id = null;\n $this->context = null;\n $this->amount = null;\n $this->amountevaluation = null;\n $this->defaultstatus = null;\n $this->defaultdirectiondate = null;\n $this->defaultplannedenddate = null;\n $this->defaultenddate = null;\n $this->defaultexecperson_id = null;\n $this->defaultpersoninevent = null;\n $this->defaultpersonineditor = null;\n $this->maxoccursinevent = null;\n $this->showtime = null;\n $this->ismes = null;\n $this->nomenclativeservice_id = null;\n $this->ispreferable = null;\n $this->prescribedtype_id = null;\n $this->shedule_id = null;\n $this->isrequiredcoordination = null;\n $this->isrequiredtissue = null;\n $this->testtubetype_id = null;\n $this->jobtype_id = null;\n $this->mnem = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear()\n\t{\n\t\t$this->id = null;\n\t\t$this->perfil_id = null;\n\t\t$this->endereco_id = null;\n\t\t$this->cargo_id = null;\n\t\t$this->departamento_id = null;\n\t\t$this->matricula = null;\n\t\t$this->nome = null;\n\t\t$this->email = null;\n\t\t$this->dni = null;\n\t\t$this->data_nascimento = null;\n\t\t$this->data_contratacao = null;\n\t\t$this->celular = null;\n\t\t$this->telefone = null;\n\t\t$this->token = null;\n\t\t$this->nome_usuario = null;\n\t\t$this->senha = null;\n\t\t$this->token_senha = null;\n\t\t$this->token_firebase = null;\n\t\t$this->data_rescisao = null;\n\t\t$this->ativo = null;\n\t\t$this->tipo_acesso = null;\n\t\t$this->estado_civil = null;\n\t\t$this->nivel_acesso = null;\n\t\t$this->usuario_validado = null;\n\t\t$this->sexo = null;\n\t\t$this->data_cadastro = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->applyDefaultValues();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}", "public function clear()\n {\n if (null !== $this->aUserAge) {\n $this->aUserAge->removeUser($this);\n }\n $this->id = null;\n $this->nickname = null;\n $this->email = null;\n $this->age = null;\n $this->sex = null;\n $this->created_at = null;\n $this->updated_at = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear()\n\t{\n\t\t$this->getObject()->clear();\n\t}", "public function clean()\n {\n\n $this->model = null;\n $this->value = null;\n $this->attribute = null;\n $this->data = [];\n\n $this->fkTable = null;\n\n $this->fkQuery = null;\n $this->fkAndQuery = null;\n $this->fkOrQuery = null;\n\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collAssignedPrayersRelatedByAgentId) {\n foreach ($this->collAssignedPrayersRelatedByAgentId as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collAssignedPrayersRelatedByPatientId) {\n foreach ($this->collAssignedPrayersRelatedByPatientId as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPartnerssRelatedByAgentId) {\n foreach ($this->collPartnerssRelatedByAgentId as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPartnerssRelatedByPatientId) {\n foreach ($this->collPartnerssRelatedByPatientId as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPainRatings) {\n foreach ($this->collPainRatings as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collUserDemoss) {\n foreach ($this->collUserDemoss as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPatients) {\n foreach ($this->collPatients as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collAgents) {\n foreach ($this->collAgents as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collAssignedPrayersRelatedByAgentId = null;\n $this->collAssignedPrayersRelatedByPatientId = null;\n $this->collPartnerssRelatedByAgentId = null;\n $this->collPartnerssRelatedByPatientId = null;\n $this->collPainRatings = null;\n $this->collUserDemoss = null;\n $this->collPatients = null;\n $this->collAgents = null;\n $this->aUserAge = null;\n }", "public function clearAttributes ()\n {\n\n $this->attributes = null;\n $this->attributes = array();\n\n }", "public function clear()\n {\n $this->phadtype = null;\n $this->phadid = null;\n $this->phadsubid = null;\n $this->phadsubidseq = null;\n $this->phadcont = null;\n $this->phadintl = null;\n $this->phadtelenbr = null;\n $this->phadteleext = null;\n $this->phadintlnbr = null;\n $this->phadintlext = null;\n $this->phadfaxnbr = null;\n $this->phadifaxnbr = null;\n $this->phadcellnbr = null;\n $this->phadicellnbr = null;\n $this->phadhomenbr = null;\n $this->phadihomenbr = null;\n $this->phadwebaddr = null;\n $this->phademailaddr = null;\n $this->phadname = null;\n $this->phadcontname = null;\n $this->dateupdtd = null;\n $this->timeupdtd = null;\n $this->dummy = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function reset(): void\n {\n $this->data = [];\n $this->relationships = [];\n }", "public function clear()\n {\n $this->shnttype = null;\n $this->shnttypedesc = null;\n $this->oehhnbr = null;\n $this->shntyear = null;\n $this->oedhline = null;\n $this->shntlotser = null;\n $this->shntpickticket = null;\n $this->shntpackticket = null;\n $this->shntinvoice = null;\n $this->shntacknow = null;\n $this->shntseq = null;\n $this->shntnote = null;\n $this->shntkey2 = null;\n $this->shntform = null;\n $this->dateupdtd = null;\n $this->timeupdtd = null;\n $this->dummy = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function afterSave()\n {\n foreach ($this->relations as $rel) {\n if ($this->_settings[$rel['name']][0] === CActiveRecord::HAS_MANY ||\n $this->_settings[$rel['name']][0] === CActiveRecord::HAS_ONE\n ) {\n // If set delete option.\n if (array_key_exists('delete', $rel) && $rel['delete'] === true) {\n // Find all related models with null ID link.\n $deleteModels = call_user_func($this->_settings[$rel['name']][1] . '::model')->findAllByAttributes(array($this->_settings[$rel['name']][2] => null));\n foreach ($deleteModels as $m) {\n $m->delete();\n }\n }\n }\n }\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collCampaignContactGroups) {\n\t\t\t\tforeach ((array) $this->collCampaignContactGroups as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCampaignContacts) {\n\t\t\t\tforeach ((array) $this->collCampaignContacts as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCampaignContactElements) {\n\t\t\t\tforeach ((array) $this->collCampaignContactElements as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCampaignLinks) {\n\t\t\t\tforeach ((array) $this->collCampaignLinks as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collCampaignContactGroups = null;\n\t\t$this->collCampaignContacts = null;\n\t\t$this->collCampaignContactElements = null;\n\t\t$this->collCampaignLinks = null;\n\t\t\t$this->aCampaignTemplate = null;\n\t\t\t$this->asfGuardUserProfile = null;\n\t}", "public function clear()\n {\n $this->idmontacargas = null;\n $this->idsucursal = null;\n $this->montacargas_modelo = null;\n $this->montacargas_marca = null;\n $this->montacargas_c = null;\n $this->montacargas_k = null;\n $this->montacargas_p = null;\n $this->montacargas_t = null;\n $this->montacargas_e = null;\n $this->montacargas_volts = null;\n $this->montacargas_amperaje = null;\n $this->montacargas_nombre = null;\n $this->montacargas_numserie = null;\n $this->montacargas_comprador = null;\n $this->montacargas_ciclosmant = null;\n $this->montacargas_ciclosiniciales = null;\n $this->montacargas_baja = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear() {\n foreach ($this->Fields as $key => $item) {\n $this->$key = null;\n }\n }", "function clearAttributes()\n {\n $this->arrRelations = array();\n return true;\n }", "public function clear()\n {\n if (null !== $this->aPurchaseOrder) {\n $this->aPurchaseOrder->removePoReceivingHead($this);\n }\n if (null !== $this->aWarehouse) {\n $this->aWarehouse->removePoReceivingHead($this);\n }\n $this->pothnbr = null;\n $this->pothstat = null;\n $this->pothrcptdate = null;\n $this->intbwhse = null;\n $this->pothglpd = null;\n $this->pothairship = null;\n $this->potherinreview = null;\n $this->pothexchctry = null;\n $this->pothexchrate = null;\n $this->intbwhseorig = null;\n $this->pothlandcost = null;\n $this->pothrcptnbr = null;\n $this->pothlandbasedon = null;\n $this->pothinvcnbr = null;\n $this->pothinvcdate = null;\n $this->pothfrtamt = null;\n $this->pothmiscamt = null;\n $this->dateupdtd = null;\n $this->timeupdtd = null;\n $this->dummy = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function reset() {\n $this->setEntities([]);\n $this->setLinks([]);\n $this->setMetadata([]);\n $this->setIncludes([]);\n $this->setDynamic();\n $this->setCacheability(new CacheableMetadata());\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->aSekolah instanceof Persistent) {\n $this->aSekolah->clearAllReferences($deep);\n }\n if ($this->aSemester instanceof Persistent) {\n $this->aSemester->clearAllReferences($deep);\n }\n if ($this->aSumberAirRelatedBySumberAirId instanceof Persistent) {\n $this->aSumberAirRelatedBySumberAirId->clearAllReferences($deep);\n }\n if ($this->aSumberAirRelatedBySumberAirMinumId instanceof Persistent) {\n $this->aSumberAirRelatedBySumberAirMinumId->clearAllReferences($deep);\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n $this->aSekolah = null;\n $this->aSemester = null;\n $this->aSumberAirRelatedBySumberAirId = null;\n $this->aSumberAirRelatedBySumberAirMinumId = null;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collExperts) {\n\t\t\t\tforeach ((array) $this->collExperts as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collExpertCategorys) {\n\t\t\t\tforeach ((array) $this->collExpertCategorys as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collHistorys) {\n\t\t\t\tforeach ((array) $this->collHistorys as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collItemRatings) {\n\t\t\t\tforeach ((array) $this->collItemRatings as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collOfferVoucher1s) {\n\t\t\t\tforeach ((array) $this->collOfferVoucher1s as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPurchaseDetails) {\n\t\t\t\tforeach ((array) $this->collPurchaseDetails as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collShoppingCarts) {\n\t\t\t\tforeach ((array) $this->collShoppingCarts as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collShoutsRelatedByPosterId) {\n\t\t\t\tforeach ((array) $this->collShoutsRelatedByPosterId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collShoutsRelatedByRecipientId) {\n\t\t\t\tforeach ((array) $this->collShoutsRelatedByRecipientId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserAwardss) {\n\t\t\t\tforeach ((array) $this->collUserAwardss as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->singleUserGtalk) {\n\t\t\t\t$this->singleUserGtalk->clearAllReferences($deep);\n\t\t\t}\n\t\t\tif ($this->singleUserFb) {\n\t\t\t\t$this->singleUserFb->clearAllReferences($deep);\n\t\t\t}\n\t\t\tif ($this->collUserRates) {\n\t\t\t\tforeach ((array) $this->collUserRates as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->singleUserTutor) {\n\t\t\t\t$this->singleUserTutor->clearAllReferences($deep);\n\t\t\t}\n\t\t\tif ($this->collUserQuestionTags) {\n\t\t\t\tforeach ((array) $this->collUserQuestionTags as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collStudentQuestionsRelatedByStudentId) {\n\t\t\t\tforeach ((array) $this->collStudentQuestionsRelatedByStudentId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collStudentQuestionsRelatedByTutorId) {\n\t\t\t\tforeach ((array) $this->collStudentQuestionsRelatedByTutorId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collWhiteboardSessions) {\n\t\t\t\tforeach ((array) $this->collWhiteboardSessions as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collExperts = null;\n\t\t$this->collExpertCategorys = null;\n\t\t$this->collHistorys = null;\n\t\t$this->collItemRatings = null;\n\t\t$this->collOfferVoucher1s = null;\n\t\t$this->collPurchaseDetails = null;\n\t\t$this->collShoppingCarts = null;\n\t\t$this->collShoutsRelatedByPosterId = null;\n\t\t$this->collShoutsRelatedByRecipientId = null;\n\t\t$this->collUserAwardss = null;\n\t\t$this->singleUserGtalk = null;\n\t\t$this->singleUserFb = null;\n\t\t$this->collUserRates = null;\n\t\t$this->singleUserTutor = null;\n\t\t$this->collUserQuestionTags = null;\n\t\t$this->collStudentQuestionsRelatedByStudentId = null;\n\t\t$this->collStudentQuestionsRelatedByTutorId = null;\n\t\t$this->collWhiteboardSessions = null;\n\t}", "public function reset() {\n\t\t// Get the default values for the class from the table.\n\t\tforeach ($this->getFields() as $k => $v) {\n\t\t\t// If the property is not private, reset it.\n\t\t\tif (strpos($k, '_') !== 0) {\n\t\t\t\t$this->$k = NULL;\n\t\t\t}\n\t\t}\n\t}", "public function unload()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->orm = null;\n\n $this->multiRef = [];\n $this->i18n = null;\n\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collUserExperiences) {\n\t\t\t\tforeach ((array) $this->collUserExperiences as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collOpenids) {\n\t\t\t\tforeach ((array) $this->collOpenids as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collrpxAuths) {\n\t\t\t\tforeach ((array) $this->collrpxAuths as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collQuestions) {\n\t\t\t\tforeach ((array) $this->collQuestions as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collQuestionComments) {\n\t\t\t\tforeach ((array) $this->collQuestionComments as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnswers) {\n\t\t\t\tforeach ((array) $this->collAnswers as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnswerComments) {\n\t\t\t\tforeach ((array) $this->collAnswerComments as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collQuestionVotes) {\n\t\t\t\tforeach ((array) $this->collQuestionVotes as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnswerVotes) {\n\t\t\t\tforeach ((array) $this->collAnswerVotes as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserFavorites) {\n\t\t\t\tforeach ((array) $this->collUserFavorites as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserTags) {\n\t\t\t\tforeach ((array) $this->collUserTags as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCheckInformations) {\n\t\t\t\tforeach ((array) $this->collCheckInformations as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnswerOffensives) {\n\t\t\t\tforeach ((array) $this->collAnswerOffensives as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collQuestionOffensives) {\n\t\t\t\tforeach ((array) $this->collQuestionOffensives as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserAwards) {\n\t\t\t\tforeach ((array) $this->collUserAwards as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMemberReferrals) {\n\t\t\t\tforeach ((array) $this->collMemberReferrals as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collGearCompanyInfos) {\n\t\t\t\tforeach ((array) $this->collGearCompanyInfos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collGearInfos) {\n\t\t\t\tforeach ((array) $this->collGearInfos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collGearReviews) {\n\t\t\t\tforeach ((array) $this->collGearReviews as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserGears) {\n\t\t\t\tforeach ((array) $this->collUserGears as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collOffensives) {\n\t\t\t\tforeach ((array) $this->collOffensives as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collRecentActivitys) {\n\t\t\t\tforeach ((array) $this->collRecentActivitys as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collUserExperiences = null;\n\t\t$this->collOpenids = null;\n\t\t$this->collrpxAuths = null;\n\t\t$this->collQuestions = null;\n\t\t$this->collQuestionComments = null;\n\t\t$this->collAnswers = null;\n\t\t$this->collAnswerComments = null;\n\t\t$this->collQuestionVotes = null;\n\t\t$this->collAnswerVotes = null;\n\t\t$this->collUserFavorites = null;\n\t\t$this->collUserTags = null;\n\t\t$this->collCheckInformations = null;\n\t\t$this->collAnswerOffensives = null;\n\t\t$this->collQuestionOffensives = null;\n\t\t$this->collUserAwards = null;\n\t\t$this->collMemberReferrals = null;\n\t\t$this->collGearCompanyInfos = null;\n\t\t$this->collGearInfos = null;\n\t\t$this->collGearReviews = null;\n\t\t$this->collUserGears = null;\n\t\t$this->collOffensives = null;\n\t\t$this->collRecentActivitys = null;\n\t}", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collArticleHasIngredients) {\n foreach ($this->collArticleHasIngredients as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collOrderHasArticless) {\n foreach ($this->collOrderHasArticless as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPackageHasArticless) {\n foreach ($this->collPackageHasArticless as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collRatings) {\n foreach ($this->collRatings as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collArticleHasIngredients = null;\n $this->collOrderHasArticless = null;\n $this->collPackageHasArticless = null;\n $this->collRatings = null;\n $this->aCakeType = null;\n $this->aShape = null;\n }", "public function clear()\n {\n $this->_id = null;\n $this->_title = null;\n $this->_positions = [];\n $this->_isDefault = null;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collPostBadges) {\n\t\t\t\tforeach ((array) $this->collPostBadges as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collInappropriates) {\n\t\t\t\tforeach ((array) $this->collInappropriates as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostsRelatedByReplicaPostId) {\n\t\t\t\tforeach ((array) $this->collPostsRelatedByReplicaPostId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostPollAnswers) {\n\t\t\t\tforeach ((array) $this->collPostPollAnswers as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostPollVotes) {\n\t\t\t\tforeach ((array) $this->collPostPollVotes as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostVisitss) {\n\t\t\t\tforeach ((array) $this->collPostVisitss as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostDailyStatss) {\n\t\t\t\tforeach ((array) $this->collPostDailyStatss as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostIndexs) {\n\t\t\t\tforeach ((array) $this->collPostIndexs as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collPostBadges = null;\n\t\t$this->collInappropriates = null;\n\t\t$this->collPostsRelatedByReplicaPostId = null;\n\t\t$this->collPostPollAnswers = null;\n\t\t$this->collPostPollVotes = null;\n\t\t$this->collPostVisitss = null;\n\t\t$this->collPostDailyStatss = null;\n\t\t$this->collPostIndexs = null;\n\t\t\t$this->aPartie = null;\n\t\t\t$this->aPostRelatedByReplicaPostId = null;\n\t}", "private function nuke()\n {\n \\lib\\Model\\ModelCache::clear($this);\n $this->__new=true;\n $this->__fields=array();\n $this->__isDirty=false;\n $this->__dirtyFields=array();\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collPurchaseOrderDetailReceivings) {\n foreach ($this->collPurchaseOrderDetailReceivings as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPurchaseOrderDetailLotReceivings) {\n foreach ($this->collPurchaseOrderDetailLotReceivings as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collPurchaseOrderDetailReceivings = null;\n $this->collPurchaseOrderDetailLotReceivings = null;\n $this->aPurchaseOrder = null;\n $this->aWarehouse = null;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collBiblioAuthors) {\n foreach ($this->collBiblioAuthors as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collBiblioTopics) {\n foreach ($this->collBiblioTopics as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collItems) {\n foreach ($this->collItems as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collAuthors) {\n foreach ($this->collAuthors as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collTopics) {\n foreach ($this->collTopics as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collBiblioAuthors = null;\n $this->collBiblioTopics = null;\n $this->collItems = null;\n $this->collAuthors = null;\n $this->collTopics = null;\n $this->aPublisher = null;\n $this->aLanguage = null;\n $this->aPlace = null;\n $this->aFrequency = null;\n $this->aUser = null;\n }", "public function clear()\n {\n $this->sekolah_id = null;\n $this->kategori_tk_id = null;\n $this->klasifikasi_lembaga_id = null;\n $this->sumber_dana_sekolah_id = null;\n $this->fasilitas_layanan_id = null;\n $this->jadwal_pmtas = null;\n $this->lembaga_pengangkat_id = null;\n $this->jadwal_ddtk = null;\n $this->freq_parenting = null;\n $this->bentuk_lembaga_id = null;\n $this->jadwal_kesehatan = null;\n $this->izin_paud = null;\n $this->pencatatan_ddtk = null;\n $this->rujukan_ddtk = null;\n $this->pelaksanaan_parenting = null;\n $this->parenting_kpo = null;\n $this->parenting_kelas = null;\n $this->parenting_kegiatan = null;\n $this->parenting_konsultasi = null;\n $this->parenting_kunjungan = null;\n $this->parenting_lainnya = null;\n $this->nilk = null;\n $this->nilm = null;\n $this->no_penetapan_pnf = null;\n $this->tanggal_penetapan_pnf = null;\n $this->create_date = null;\n $this->last_update = null;\n $this->soft_delete = null;\n $this->last_sync = null;\n $this->updater_id = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear(): void\n {\n $this->debit = null;\n $this->credit = null;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collEnderecos) {\n\t\t\t\tforeach ($this->collEnderecos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMembros) {\n\t\t\t\tforeach ($this->collMembros as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\tif ($this->collEnderecos instanceof PropelCollection) {\n\t\t\t$this->collEnderecos->clearIterator();\n\t\t}\n\t\t$this->collEnderecos = null;\n\t\tif ($this->collMembros instanceof PropelCollection) {\n\t\t\t$this->collMembros->clearIterator();\n\t\t}\n\t\t$this->collMembros = null;\n\t\t$this->aUf = null;\n\t}", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->collOperationPrestationss) {\n foreach ($this->collOperationPrestationss as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collOperationScenariis) {\n foreach ($this->collOperationScenariis as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collLnkOperationPrimeRCountriess) {\n foreach ($this->collLnkOperationPrimeRCountriess as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->aOperations instanceof Persistent) {\n $this->aOperations->clearAllReferences($deep);\n }\n if ($this->aRCurrencies instanceof Persistent) {\n $this->aRCurrencies->clearAllReferences($deep);\n }\n if ($this->aRRewardTypes instanceof Persistent) {\n $this->aRRewardTypes->clearAllReferences($deep);\n }\n if ($this->aRRewardExpeditionModes instanceof Persistent) {\n $this->aRRewardExpeditionModes->clearAllReferences($deep);\n }\n if ($this->aRRewardTransporters instanceof Persistent) {\n $this->aRRewardTransporters->clearAllReferences($deep);\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n if ($this->collOperationPrestationss instanceof PropelCollection) {\n $this->collOperationPrestationss->clearIterator();\n }\n $this->collOperationPrestationss = null;\n if ($this->collOperationScenariis instanceof PropelCollection) {\n $this->collOperationScenariis->clearIterator();\n }\n $this->collOperationScenariis = null;\n if ($this->collLnkOperationPrimeRCountriess instanceof PropelCollection) {\n $this->collLnkOperationPrimeRCountriess->clearIterator();\n }\n $this->collLnkOperationPrimeRCountriess = null;\n $this->aOperations = null;\n $this->aRCurrencies = null;\n $this->aRRewardTypes = null;\n $this->aRRewardExpeditionModes = null;\n $this->aRRewardTransporters = null;\n }", "public function reset()\n\t{\n\t\tparent::reset();\n\n\t\t// Reset the primary key\n\t\t$this->id = null;\n\t}", "public function reset()\n\t{\n\t\tparent::reset();\n\n\t\t// Reset the primary key\n\t\t$this->id = null;\n\t}", "public function clear()\n {\n $this->sekolah_id = null;\n $this->semester_id = null;\n $this->id_ruang = null;\n $this->hari = null;\n $this->bel_ke_01 = null;\n $this->bel_ke_02 = null;\n $this->bel_ke_03 = null;\n $this->bel_ke_04 = null;\n $this->bel_ke_05 = null;\n $this->bel_ke_06 = null;\n $this->bel_ke_07 = null;\n $this->bel_ke_08 = null;\n $this->bel_ke_09 = null;\n $this->bel_ke_10 = null;\n $this->bel_ke_11 = null;\n $this->bel_ke_12 = null;\n $this->bel_ke_13 = null;\n $this->bel_ke_14 = null;\n $this->bel_ke_15 = null;\n $this->bel_ke_16 = null;\n $this->bel_ke_17 = null;\n $this->bel_ke_18 = null;\n $this->bel_ke_19 = null;\n $this->bel_ke_20 = null;\n $this->create_date = null;\n $this->last_update = null;\n $this->soft_delete = null;\n $this->last_sync = null;\n $this->updater_id = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear()\n {\n $this->id = null;\n $this->ref_no = null;\n $this->uniquekeyid = null;\n $this->customer_id = null;\n $this->account_no = null;\n $this->service_type = null;\n $this->service_district_id = null;\n $this->billing_cycle = null;\n $this->due_date = null;\n $this->billing_from = null;\n $this->billing_to = null;\n $this->bill_date = null;\n $this->rate = null;\n $this->meternumber = null;\n $this->billingmethod = null;\n $this->dateoflastreading = null;\n $this->dateofcurrentreading = null;\n $this->daysusage = null;\n $this->lastmeterreading = null;\n $this->currentmeterreading = null;\n $this->unitsconsumed = null;\n $this->lastpaymentamount = null;\n $this->lastpaymentdate = null;\n $this->metermaintenancecharge = null;\n $this->discounts = null;\n $this->othercharges = null;\n $this->penaltycharges = null;\n $this->taxcharges = null;\n $this->charges = null;\n $this->routinecharges = null;\n $this->billservicerate = null;\n $this->buildingtype = null;\n $this->route = null;\n $this->usagetype = null;\n $this->service_charge = null;\n $this->previous_balance = null;\n $this->payment_received = null;\n $this->last_payment_received_date = null;\n $this->current_charge = null;\n $this->total_due = null;\n $this->invoice_no = null;\n $this->receipt_no = null;\n $this->date_created = null;\n $this->creator = null;\n $this->status = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t} // if ($deep)\n\n\t\t\t$this->aJ002tUsuario = null;\n\t\t\t$this->aJ016tForense = null;\n\t\t\t$this->aJ018tInformeForense = null;\n\t}", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_NAME] = null;\n $this->values[self::_AVATAR] = null;\n $this->values[self::_SLOGAN] = null;\n $this->values[self::_JOIN_TYPE] = null;\n $this->values[self::_JOIN_LIMIT] = null;\n $this->values[self::_MEMBER_CNT] = null;\n $this->values[self::_PRESIDENT] = null;\n $this->values[self::_LIVENESS] = null;\n $this->values[self::_CAN_JUMP] = null;\n }", "public function unsetAll() {\n\t\tparent::unsetAll();\n\t}", "public function clear() {\n $this->_documentBoost = FALSE;\n\n $this->_fields = array();\n $this->_fieldBoosts = array();\n }", "public function unsetAll()\n {\n parent::unsetAll();\n $this->_quoteId = null;\n $this->_response = null;\n $this->_redirectMessage = null;\n $this->_redirectTitle = null;\n }", "public function __destruct() {\n $this->save(null);\n }", "private function resetAll()\n {\n $this->title = null;\n $this->caption = null;\n $this->categories = null;\n $this->image = null;\n $this->tags = null;\n $this->imagePath = null;\n $this->postId = null;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collMmI18ns) {\n\t\t\t\tforeach ((array) $this->collMmI18ns as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collFiles) {\n\t\t\t\tforeach ((array) $this->collFiles as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collLinks) {\n\t\t\t\tforeach ((array) $this->collLinks as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMmPersons) {\n\t\t\t\tforeach ((array) $this->collMmPersons as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPicMms) {\n\t\t\t\tforeach ((array) $this->collPicMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collGroundMms) {\n\t\t\t\tforeach ((array) $this->collGroundMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMaterials) {\n\t\t\t\tforeach ((array) $this->collMaterials as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collLogTranscodings) {\n\t\t\t\tforeach ((array) $this->collLogTranscodings as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collTranscodings) {\n\t\t\t\tforeach ((array) $this->collTranscodings as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPubChannelMms) {\n\t\t\t\tforeach ((array) $this->collPubChannelMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnnounceChannelMms) {\n\t\t\t\tforeach ((array) $this->collAnnounceChannelMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMmMatterhorns) {\n\t\t\t\tforeach ((array) $this->collMmMatterhorns as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCategoryMms) {\n\t\t\t\tforeach ((array) $this->collCategoryMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCategoryMmTimeframes) {\n\t\t\t\tforeach ((array) $this->collCategoryMmTimeframes as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collMmI18ns = null;\n\t\t$this->collFiles = null;\n\t\t$this->collLinks = null;\n\t\t$this->collMmPersons = null;\n\t\t$this->collPicMms = null;\n\t\t$this->collGroundMms = null;\n\t\t$this->collMaterials = null;\n\t\t$this->collLogTranscodings = null;\n\t\t$this->collTranscodings = null;\n\t\t$this->collPubChannelMms = null;\n\t\t$this->collAnnounceChannelMms = null;\n\t\t$this->collMmMatterhorns = null;\n\t\t$this->collCategoryMms = null;\n\t\t$this->collCategoryMmTimeframes = null;\n\t\t$this->aSerial = null;\n\t\t$this->aPrecinct = null;\n\t\t$this->aGenre = null;\n\t\t$this->aBroadcast = null;\n\t}", "public function clearConcepts()\n {\n foreach ($this->relationships as $relationship) {\n $relationship->clearConcepts();\n }\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collEvents) {\n\t\t\t\tforeach ((array) $this->collEvents as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collVenueratings) {\n\t\t\t\tforeach ((array) $this->collVenueratings as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collEvents = null;\n\t\t$this->collVenueratings = null;\n\t\t$this->aUser = null;\n\t}", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collCOMConditions) {\n foreach ($this->collCOMConditions as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCOMVendeurs) {\n foreach ($this->collCOMVendeurs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCMDPieces) {\n foreach ($this->collCMDPieces as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCOMEndusers) {\n foreach ($this->collCOMEndusers as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCMDTDocs) {\n foreach ($this->collCMDTDocs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCMDTAppareils) {\n foreach ($this->collCMDTAppareils as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collCOMConditions = null;\n $this->collCOMVendeurs = null;\n $this->collCMDPieces = null;\n $this->collCOMEndusers = null;\n $this->collCMDTDocs = null;\n $this->collCMDTAppareils = null;\n $this->aSociete = null;\n $this->aMTransport = null;\n }", "function __destructor() {\n /**\n * Re-enable foreign key checks \n */\n if ($this->disableForeignKeyChecks === true) {\n mysqli_query($this->conn, 'SET foreign_key_checks = 1');\n }\n }", "public function reset()\n {\n $this->values[self::ID] = null;\n $this->values[self::NAME] = null;\n $this->values[self::PERMISSIONS] = null;\n $this->values[self::POSITION] = null;\n }", "public function reset()\n {\n $this->values[self::contractorstatics] = null;\n $this->values[self::stores] = array();\n $this->values[self::visited] = array();\n $this->values[self::review_info] = array();\n $this->values[self::customer_info] = array();\n $this->values[self::mark_price_info] = array();\n $this->values[self::more_url] = null;\n $this->values[self::order_tracking] = array();\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collVpoRequestAnimals) {\n\t\t\t\tforeach ((array) $this->collVpoRequestAnimals as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collVpoRequestCargos) {\n\t\t\t\tforeach ((array) $this->collVpoRequestCargos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collVpoRequestPassengers) {\n\t\t\t\tforeach ((array) $this->collVpoRequestPassengers as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collVpoRequestAnimals = null;\n\t\t$this->collVpoRequestCargos = null;\n\t\t$this->collVpoRequestPassengers = null;\n\t}", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "public function reset()\n {\n $this->values[self::_UID] = null;\n $this->values[self::_NAME] = null;\n $this->values[self::_HERO] = null;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collAuditorias) {\n\t\t\t\tforeach ($this->collAuditorias as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAvaliacaoRespostaForums) {\n\t\t\t\tforeach ($this->collAvaliacaoRespostaForums as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collColetaPesquisas) {\n\t\t\t\tforeach ($this->collColetaPesquisas as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collComentarioNoticias) {\n\t\t\t\tforeach ($this->collComentarioNoticias as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCurtidaForums) {\n\t\t\t\tforeach ($this->collCurtidaForums as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collNoticias) {\n\t\t\t\tforeach ($this->collNoticias as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPesquisas) {\n\t\t\t\tforeach ($this->collPesquisas as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPesquisaHabilitadas) {\n\t\t\t\tforeach ($this->collPesquisaHabilitadas as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPremios) {\n\t\t\t\tforeach ($this->collPremios as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collRespostaForums) {\n\t\t\t\tforeach ($this->collRespostaForums as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collSolicitacaoResgatesRelatedByAprovadorId) {\n\t\t\t\tforeach ($this->collSolicitacaoResgatesRelatedByAprovadorId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collSolicitacaoResgatesRelatedBySolicitanteId) {\n\t\t\t\tforeach ($this->collSolicitacaoResgatesRelatedBySolicitanteId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\tif ($this->collAuditorias instanceof PropelCollection) {\n\t\t\t$this->collAuditorias->clearIterator();\n\t\t}\n\t\t$this->collAuditorias = null;\n\t\tif ($this->collAvaliacaoRespostaForums instanceof PropelCollection) {\n\t\t\t$this->collAvaliacaoRespostaForums->clearIterator();\n\t\t}\n\t\t$this->collAvaliacaoRespostaForums = null;\n\t\tif ($this->collColetaPesquisas instanceof PropelCollection) {\n\t\t\t$this->collColetaPesquisas->clearIterator();\n\t\t}\n\t\t$this->collColetaPesquisas = null;\n\t\tif ($this->collComentarioNoticias instanceof PropelCollection) {\n\t\t\t$this->collComentarioNoticias->clearIterator();\n\t\t}\n\t\t$this->collComentarioNoticias = null;\n\t\tif ($this->collCurtidaForums instanceof PropelCollection) {\n\t\t\t$this->collCurtidaForums->clearIterator();\n\t\t}\n\t\t$this->collCurtidaForums = null;\n\t\tif ($this->collNoticias instanceof PropelCollection) {\n\t\t\t$this->collNoticias->clearIterator();\n\t\t}\n\t\t$this->collNoticias = null;\n\t\tif ($this->collPesquisas instanceof PropelCollection) {\n\t\t\t$this->collPesquisas->clearIterator();\n\t\t}\n\t\t$this->collPesquisas = null;\n\t\tif ($this->collPesquisaHabilitadas instanceof PropelCollection) {\n\t\t\t$this->collPesquisaHabilitadas->clearIterator();\n\t\t}\n\t\t$this->collPesquisaHabilitadas = null;\n\t\tif ($this->collPremios instanceof PropelCollection) {\n\t\t\t$this->collPremios->clearIterator();\n\t\t}\n\t\t$this->collPremios = null;\n\t\tif ($this->collRespostaForums instanceof PropelCollection) {\n\t\t\t$this->collRespostaForums->clearIterator();\n\t\t}\n\t\t$this->collRespostaForums = null;\n\t\tif ($this->collSolicitacaoResgatesRelatedByAprovadorId instanceof PropelCollection) {\n\t\t\t$this->collSolicitacaoResgatesRelatedByAprovadorId->clearIterator();\n\t\t}\n\t\t$this->collSolicitacaoResgatesRelatedByAprovadorId = null;\n\t\tif ($this->collSolicitacaoResgatesRelatedBySolicitanteId instanceof PropelCollection) {\n\t\t\t$this->collSolicitacaoResgatesRelatedBySolicitanteId->clearIterator();\n\t\t}\n\t\t$this->collSolicitacaoResgatesRelatedBySolicitanteId = null;\n\t\t$this->aCargo = null;\n\t\t$this->aDepartamento = null;\n\t\t$this->aEndereco = null;\n\t\t$this->aPerfil = null;\n\t}", "function clear()\n \t{\n \t\tforeach ($this as &$value) \n \t\t $value = null;\n \t}", "public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->collMonths) {\n foreach ($this->collMonths as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collFileCats) {\n foreach ($this->collFileCats as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collDocCats) {\n foreach ($this->collDocCats as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collBookks) {\n foreach ($this->collBookks as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collAccounts) {\n foreach ($this->collAccounts as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collReports) {\n foreach ($this->collReports as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collProjects) {\n foreach ($this->collProjects as $o) {\n $o->clearAllReferences($deep);\n }\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n if ($this->collMonths instanceof PropelCollection) {\n $this->collMonths->clearIterator();\n }\n $this->collMonths = null;\n if ($this->collFileCats instanceof PropelCollection) {\n $this->collFileCats->clearIterator();\n }\n $this->collFileCats = null;\n if ($this->collDocCats instanceof PropelCollection) {\n $this->collDocCats->clearIterator();\n }\n $this->collDocCats = null;\n if ($this->collBookks instanceof PropelCollection) {\n $this->collBookks->clearIterator();\n }\n $this->collBookks = null;\n if ($this->collAccounts instanceof PropelCollection) {\n $this->collAccounts->clearIterator();\n }\n $this->collAccounts = null;\n if ($this->collReports instanceof PropelCollection) {\n $this->collReports->clearIterator();\n }\n $this->collReports = null;\n if ($this->collProjects instanceof PropelCollection) {\n $this->collProjects->clearIterator();\n }\n $this->collProjects = null;\n }", "public function clearMemberReferrals()\n\t{\n\t\t$this->collMemberReferrals = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function reset() {\n $this->databasefieldcount = 0;\n $this->databaserecordcount = 0;\n\n parent::reset();\n }", "function clear_raw_ref ( ) {\n\t\t$this->raw_ref = array ( \n\t\t\t'type' => '', \n\t\t\t'citeid' => '', \n\t\t\t'values'=>array() \n\t\t);\n\t}", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->collDeshabilitamcs) {\n foreach ($this->collDeshabilitamcs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collMontacargasBateriass) {\n foreach ($this->collMontacargasBateriass as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collUsoBateriasMontacargass) {\n foreach ($this->collUsoBateriasMontacargass as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->aSucursal instanceof Persistent) {\n $this->aSucursal->clearAllReferences($deep);\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n if ($this->collDeshabilitamcs instanceof PropelCollection) {\n $this->collDeshabilitamcs->clearIterator();\n }\n $this->collDeshabilitamcs = null;\n if ($this->collMontacargasBateriass instanceof PropelCollection) {\n $this->collMontacargasBateriass->clearIterator();\n }\n $this->collMontacargasBateriass = null;\n if ($this->collUsoBateriasMontacargass instanceof PropelCollection) {\n $this->collUsoBateriasMontacargass->clearIterator();\n }\n $this->collUsoBateriasMontacargass = null;\n $this->aSucursal = null;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->collFeatureCvtermDbxrefs) {\n foreach ($this->collFeatureCvtermDbxrefs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collFeatureCvtermPubs) {\n foreach ($this->collFeatureCvtermPubs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collFeatureCvtermprops) {\n foreach ($this->collFeatureCvtermprops as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->aCvterm instanceof Persistent) {\n $this->aCvterm->clearAllReferences($deep);\n }\n if ($this->aFeature instanceof Persistent) {\n $this->aFeature->clearAllReferences($deep);\n }\n if ($this->aPub instanceof Persistent) {\n $this->aPub->clearAllReferences($deep);\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n if ($this->collFeatureCvtermDbxrefs instanceof PropelCollection) {\n $this->collFeatureCvtermDbxrefs->clearIterator();\n }\n $this->collFeatureCvtermDbxrefs = null;\n if ($this->collFeatureCvtermPubs instanceof PropelCollection) {\n $this->collFeatureCvtermPubs->clearIterator();\n }\n $this->collFeatureCvtermPubs = null;\n if ($this->collFeatureCvtermprops instanceof PropelCollection) {\n $this->collFeatureCvtermprops->clearIterator();\n }\n $this->collFeatureCvtermprops = null;\n $this->aCvterm = null;\n $this->aFeature = null;\n $this->aPub = null;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->collActions) {\n foreach ($this->collActions as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collActionPropertyTypesRelatedByactionTypeId) {\n foreach ($this->collActionPropertyTypesRelatedByactionTypeId as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->aActionPropertyTypeRelatedByid instanceof Persistent) {\n $this->aActionPropertyTypeRelatedByid->clearAllReferences($deep);\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n if ($this->collActions instanceof PropelCollection) {\n $this->collActions->clearIterator();\n }\n $this->collActions = null;\n if ($this->collActionPropertyTypesRelatedByactionTypeId instanceof PropelCollection) {\n $this->collActionPropertyTypesRelatedByactionTypeId->clearIterator();\n }\n $this->collActionPropertyTypesRelatedByactionTypeId = null;\n $this->aActionPropertyTypeRelatedByid = null;\n }", "protected function _clear()\n\t{\n\t\t$this->_query = null;\n\t\t$this->_set = null;\n\t\t$this->_where = null;\n\t\t$this->_limit = null;\n\t}", "public function reset() {\n $this->cache = array();\n $this->parent()->reset();\n }", "public function reset()\n {\n $this->values[self::_DIAMOND] = null;\n $this->values[self::_GUILDPOINT] = null;\n $this->values[self::_DPS] = null;\n $this->values[self::_OLD_DPS] = null;\n $this->values[self::_OLD_SUMMARY] = null;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collPermissaosRelatedByCoUsuarioAlteracao) {\n\t\t\t\tforeach ($this->collPermissaosRelatedByCoUsuarioAlteracao as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPermissaosRelatedByCoUsuarioCadastro) {\n\t\t\t\tforeach ($this->collPermissaosRelatedByCoUsuarioCadastro as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collRlUsuarioOrgaos) {\n\t\t\t\tforeach ($this->collRlUsuarioOrgaos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collTbDescricaoChamados) {\n\t\t\t\tforeach ($this->collTbDescricaoChamados as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUsuarioCategorias) {\n\t\t\t\tforeach ($this->collUsuarioCategorias as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUsuarioTarefas) {\n\t\t\t\tforeach ($this->collUsuarioTarefas as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\tif ($this->collPermissaosRelatedByCoUsuarioAlteracao instanceof PropelCollection) {\n\t\t\t$this->collPermissaosRelatedByCoUsuarioAlteracao->clearIterator();\n\t\t}\n\t\t$this->collPermissaosRelatedByCoUsuarioAlteracao = null;\n\t\tif ($this->collPermissaosRelatedByCoUsuarioCadastro instanceof PropelCollection) {\n\t\t\t$this->collPermissaosRelatedByCoUsuarioCadastro->clearIterator();\n\t\t}\n\t\t$this->collPermissaosRelatedByCoUsuarioCadastro = null;\n\t\tif ($this->collRlUsuarioOrgaos instanceof PropelCollection) {\n\t\t\t$this->collRlUsuarioOrgaos->clearIterator();\n\t\t}\n\t\t$this->collRlUsuarioOrgaos = null;\n\t\tif ($this->collTbDescricaoChamados instanceof PropelCollection) {\n\t\t\t$this->collTbDescricaoChamados->clearIterator();\n\t\t}\n\t\t$this->collTbDescricaoChamados = null;\n\t\tif ($this->collUsuarioCategorias instanceof PropelCollection) {\n\t\t\t$this->collUsuarioCategorias->clearIterator();\n\t\t}\n\t\t$this->collUsuarioCategorias = null;\n\t\tif ($this->collUsuarioTarefas instanceof PropelCollection) {\n\t\t\t$this->collUsuarioTarefas->clearIterator();\n\t\t}\n\t\t$this->collUsuarioTarefas = null;\n\t\t$this->aPerfil = null;\n\t}", "public function Clear(){\n\t\t// create array containing all data of the business object not including linked tables//\n\t\t$this->business_data = Array (\n\t\t\t\"group_id\"=>0 ,\n\t\t\t\"group_name\"=>\"\" , \n\t\t\t\"group_remarks\"=>\"\",\n\t\t\t\"group_active\"=>0 ,\n\t\t\t\"group_code\"=>\"\"\n\t\t\t);\n\t\t\t\t\n\t}", "public function reset()\n {\n $this->_contacts = [];\n $this->_lists = [];\n }", "public function reset(): void\n {\n $this->_add = new SplObjectStorage();\n $this->_delete = new SplObjectStorage();\n }", "public function reset()\n {\n $this->models = null;\n return $this;\n }", "function unbindAll() {\n foreach (array(\n 'hasOne' => array_keys($this->hasOne),\n 'hasMany' => array_keys($this->hasMany),\n 'belongsTo' => array_keys($this->belongsTo),\n 'hasAndBelongsToMany' => array_keys($this->hasAndBelongsToMany)\n ) as $relation => $model) {\n $this->unbindModel(array($relation => $model));\n }\n }", "public function reset()\n {\n $this->values[self::_HERO_ID] = null;\n $this->values[self::_DYNA] = null;\n }", "public function clear() {\n $this->_attributes = [];\n return $this;\n }", "public function flush()\r\n {\r\n foreach ($this->_collections as $key => $coll) {\r\n $coll->takeSnapshot();\r\n }\r\n foreach ($this->_tables as $table) {\r\n $table->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, true);\r\n }\r\n $this->_initializedRelations = null;\r\n $this->_collections = null;\r\n $this->_tables = null;\r\n }", "public function removeAllReferenceOtherInfo()\n {\n $this->referenceOtherInfo = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n return $this;\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_TYPE] = null;\n $this->values[self::_START_TIME] = null;\n $this->values[self::_END_TIME] = null;\n $this->values[self::_REWARDS] = array();\n $this->values[self::_TITLE] = null;\n $this->values[self::_DESC] = null;\n $this->values[self::_RULES] = null;\n }", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "function clear()\n {\n $this->tags = [];\n $this->extra = [];\n $this->user = null;\n }", "public function reset()\n {\n $this->values[self::product_id] = null;\n $this->values[self::product_num] = null;\n $this->values[self::deal_price] = null;\n $this->values[self::new_user_price] = null;\n }" ]
[ "0.71811515", "0.6931064", "0.6928436", "0.6899159", "0.6838832", "0.6823544", "0.66834676", "0.66350406", "0.6632028", "0.6626154", "0.6619534", "0.6557098", "0.6544292", "0.6474649", "0.64195037", "0.64111966", "0.63998926", "0.6363998", "0.63621736", "0.6351788", "0.6312126", "0.6306675", "0.63044596", "0.62852514", "0.62668556", "0.6253202", "0.622807", "0.62146115", "0.62069", "0.620347", "0.6186626", "0.6183469", "0.6162986", "0.61474824", "0.6145217", "0.61295325", "0.61183375", "0.6113401", "0.6076981", "0.60756123", "0.60736376", "0.6057613", "0.60540617", "0.6052458", "0.605078", "0.6039952", "0.6018582", "0.6006697", "0.59828013", "0.5974936", "0.5964695", "0.5964094", "0.59596294", "0.59528995", "0.59528995", "0.59517056", "0.5930919", "0.59270334", "0.59244406", "0.5919438", "0.5919359", "0.5915561", "0.5904011", "0.59036916", "0.589009", "0.5875192", "0.5866789", "0.58631456", "0.5858208", "0.5831771", "0.5828679", "0.582549", "0.5824462", "0.58208996", "0.5816186", "0.58121204", "0.58072716", "0.5803353", "0.5801612", "0.5800285", "0.57966065", "0.5796358", "0.57855433", "0.578231", "0.57800156", "0.5778547", "0.5771964", "0.57622266", "0.5757846", "0.5754595", "0.5750985", "0.5732129", "0.5730622", "0.5725835", "0.5724594", "0.5723366", "0.5721281", "0.5686853", "0.56833345", "0.56802464", "0.56732833" ]
0.0
-1
Resets all references and backreferences to other model objects or collections of model objects. This method is used to reset all php object references (not the actual reference in the database). Necessary for object serialisation.
public function clearAllReferences($deep = false) { if ($deep) { } // if ($deep) $this->aTblEra = null; $this->aTblGeneral = null; $this->aTblMenus = null; $this->aTblProdPhotos = null; $this->aTblProdPrices = null; $this->aTblProdPricing = null; $this->aTblProdSmaller = null; $this->aTblShippingCategories = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resetRelations()\n\t{\n\t\t$this->relations = array();\n\t}", "public function resetDirty()\n {\n $this->dirty = false;\n $this->dirtyOne = false;\n $this->dirtyMany = false;\n }", "public static function reset() {\n\t\tself::$objects = array();\n\t}", "public function reset(): void\n {\n $this->_add = new SplObjectStorage();\n $this->_delete = new SplObjectStorage();\n }", "public function reset() {\n $this->setEntities([]);\n $this->setLinks([]);\n $this->setMetadata([]);\n $this->setIncludes([]);\n $this->setDynamic();\n $this->setCacheability(new CacheableMetadata());\n }", "public function reset() {\n $this->cache = array();\n $this->parent()->reset();\n }", "public function reset(): void\n {\n $this->data = [];\n $this->relationships = [];\n }", "public function reset()\n {\n $this->id = null;\n $this->attributes = array();\n }", "public function reset() {\n $this->num_aliases = 0;\n $this->alias2class = array();\n $this->alias2table = array();\n }", "public function reset()\n {\n $this->_contacts = [];\n $this->_lists = [];\n }", "function clear()\r\n\t{\r\n\t\t// Clear the all list\r\n\t\t$this->all = array();\r\n\r\n\t\t// Clear errors\r\n\t\t$this->error = new stdClass();\r\n\t\t$this->error->all = array();\r\n\t\t$this->error->string = '';\r\n\r\n\t\t// Clear this objects properties and set blank error messages in case they are accessed\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\t$this->{$field} = NULL;\r\n\t\t\t$this->error->{$field} = '';\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has many\" related objects\r\n\t\tforeach ($this->has_many as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has one\" related objects\r\n\t\tforeach ($this->has_one as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear the query related list\r\n\t\t$this->query_related = array();\r\n\r\n\t\t// Clear and refresh stored values\r\n\t\t$this->stored = new stdClass();\r\n\r\n\t\t$this->_refresh_stored_values();\r\n\t}", "public function reset()\r\n\t{\r\n\t\t$this->first = null;\r\n\t\t$this->alreadyIncluded = array();\r\n\t\t$this->depths = array();\r\n\t}", "public function unload()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->orm = null;\n\n $this->multiRef = [];\n $this->i18n = null;\n\n }", "public function reset() {\n\t\t// Get the default values for the class from the table.\n\t\tforeach ($this->getFields() as $k => $v) {\n\t\t\t// If the property is not private, reset it.\n\t\t\tif (strpos($k, '_') !== 0) {\n\t\t\t\t$this->$k = NULL;\n\t\t\t}\n\t\t}\n\t}", "public function reset()\n\t{\n\t\t$this->queries = [];\n\t\t$this->count = [\n\t\t\t'total' => 0, 'slow' => 0, 'select' => 0, 'insert' => 0, 'update' => 0, 'delete' => 0, 'other' => 0\n\t\t];\n\n\t\t$this->modelsActions = [];\n\t\t$this->modelsCount = [\n\t\t\t'retrieved' => [], 'created' => [], 'updated' => [], 'deleted' => []\n\t\t];\n\n\t\t$this->nextQueryModel = null;\n\t}", "public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }", "public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collPostBadges) {\n\t\t\t\tforeach ((array) $this->collPostBadges as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collInappropriates) {\n\t\t\t\tforeach ((array) $this->collInappropriates as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostsRelatedByReplicaPostId) {\n\t\t\t\tforeach ((array) $this->collPostsRelatedByReplicaPostId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostPollAnswers) {\n\t\t\t\tforeach ((array) $this->collPostPollAnswers as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostPollVotes) {\n\t\t\t\tforeach ((array) $this->collPostPollVotes as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostVisitss) {\n\t\t\t\tforeach ((array) $this->collPostVisitss as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostDailyStatss) {\n\t\t\t\tforeach ((array) $this->collPostDailyStatss as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPostIndexs) {\n\t\t\t\tforeach ((array) $this->collPostIndexs as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collPostBadges = null;\n\t\t$this->collInappropriates = null;\n\t\t$this->collPostsRelatedByReplicaPostId = null;\n\t\t$this->collPostPollAnswers = null;\n\t\t$this->collPostPollVotes = null;\n\t\t$this->collPostVisitss = null;\n\t\t$this->collPostDailyStatss = null;\n\t\t$this->collPostIndexs = null;\n\t\t\t$this->aPartie = null;\n\t\t\t$this->aPostRelatedByReplicaPostId = null;\n\t}", "public function reset()\n {\n $this->_metaData = array();\n $this->_columnMap = array();\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->collOperationPrestationss) {\n foreach ($this->collOperationPrestationss as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collOperationScenariis) {\n foreach ($this->collOperationScenariis as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collLnkOperationPrimeRCountriess) {\n foreach ($this->collLnkOperationPrimeRCountriess as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->aOperations instanceof Persistent) {\n $this->aOperations->clearAllReferences($deep);\n }\n if ($this->aRCurrencies instanceof Persistent) {\n $this->aRCurrencies->clearAllReferences($deep);\n }\n if ($this->aRRewardTypes instanceof Persistent) {\n $this->aRRewardTypes->clearAllReferences($deep);\n }\n if ($this->aRRewardExpeditionModes instanceof Persistent) {\n $this->aRRewardExpeditionModes->clearAllReferences($deep);\n }\n if ($this->aRRewardTransporters instanceof Persistent) {\n $this->aRRewardTransporters->clearAllReferences($deep);\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n if ($this->collOperationPrestationss instanceof PropelCollection) {\n $this->collOperationPrestationss->clearIterator();\n }\n $this->collOperationPrestationss = null;\n if ($this->collOperationScenariis instanceof PropelCollection) {\n $this->collOperationScenariis->clearIterator();\n }\n $this->collOperationScenariis = null;\n if ($this->collLnkOperationPrimeRCountriess instanceof PropelCollection) {\n $this->collLnkOperationPrimeRCountriess->clearIterator();\n }\n $this->collLnkOperationPrimeRCountriess = null;\n $this->aOperations = null;\n $this->aRCurrencies = null;\n $this->aRRewardTypes = null;\n $this->aRRewardExpeditionModes = null;\n $this->aRRewardTransporters = null;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->collMonths) {\n foreach ($this->collMonths as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collFileCats) {\n foreach ($this->collFileCats as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collDocCats) {\n foreach ($this->collDocCats as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collBookks) {\n foreach ($this->collBookks as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collAccounts) {\n foreach ($this->collAccounts as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collReports) {\n foreach ($this->collReports as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collProjects) {\n foreach ($this->collProjects as $o) {\n $o->clearAllReferences($deep);\n }\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n if ($this->collMonths instanceof PropelCollection) {\n $this->collMonths->clearIterator();\n }\n $this->collMonths = null;\n if ($this->collFileCats instanceof PropelCollection) {\n $this->collFileCats->clearIterator();\n }\n $this->collFileCats = null;\n if ($this->collDocCats instanceof PropelCollection) {\n $this->collDocCats->clearIterator();\n }\n $this->collDocCats = null;\n if ($this->collBookks instanceof PropelCollection) {\n $this->collBookks->clearIterator();\n }\n $this->collBookks = null;\n if ($this->collAccounts instanceof PropelCollection) {\n $this->collAccounts->clearIterator();\n }\n $this->collAccounts = null;\n if ($this->collReports instanceof PropelCollection) {\n $this->collReports->clearIterator();\n }\n $this->collReports = null;\n if ($this->collProjects instanceof PropelCollection) {\n $this->collProjects->clearIterator();\n }\n $this->collProjects = null;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collUserExperiences) {\n\t\t\t\tforeach ((array) $this->collUserExperiences as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collOpenids) {\n\t\t\t\tforeach ((array) $this->collOpenids as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collrpxAuths) {\n\t\t\t\tforeach ((array) $this->collrpxAuths as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collQuestions) {\n\t\t\t\tforeach ((array) $this->collQuestions as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collQuestionComments) {\n\t\t\t\tforeach ((array) $this->collQuestionComments as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnswers) {\n\t\t\t\tforeach ((array) $this->collAnswers as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnswerComments) {\n\t\t\t\tforeach ((array) $this->collAnswerComments as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collQuestionVotes) {\n\t\t\t\tforeach ((array) $this->collQuestionVotes as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnswerVotes) {\n\t\t\t\tforeach ((array) $this->collAnswerVotes as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserFavorites) {\n\t\t\t\tforeach ((array) $this->collUserFavorites as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserTags) {\n\t\t\t\tforeach ((array) $this->collUserTags as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCheckInformations) {\n\t\t\t\tforeach ((array) $this->collCheckInformations as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnswerOffensives) {\n\t\t\t\tforeach ((array) $this->collAnswerOffensives as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collQuestionOffensives) {\n\t\t\t\tforeach ((array) $this->collQuestionOffensives as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserAwards) {\n\t\t\t\tforeach ((array) $this->collUserAwards as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMemberReferrals) {\n\t\t\t\tforeach ((array) $this->collMemberReferrals as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collGearCompanyInfos) {\n\t\t\t\tforeach ((array) $this->collGearCompanyInfos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collGearInfos) {\n\t\t\t\tforeach ((array) $this->collGearInfos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collGearReviews) {\n\t\t\t\tforeach ((array) $this->collGearReviews as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserGears) {\n\t\t\t\tforeach ((array) $this->collUserGears as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collOffensives) {\n\t\t\t\tforeach ((array) $this->collOffensives as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collRecentActivitys) {\n\t\t\t\tforeach ((array) $this->collRecentActivitys as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collUserExperiences = null;\n\t\t$this->collOpenids = null;\n\t\t$this->collrpxAuths = null;\n\t\t$this->collQuestions = null;\n\t\t$this->collQuestionComments = null;\n\t\t$this->collAnswers = null;\n\t\t$this->collAnswerComments = null;\n\t\t$this->collQuestionVotes = null;\n\t\t$this->collAnswerVotes = null;\n\t\t$this->collUserFavorites = null;\n\t\t$this->collUserTags = null;\n\t\t$this->collCheckInformations = null;\n\t\t$this->collAnswerOffensives = null;\n\t\t$this->collQuestionOffensives = null;\n\t\t$this->collUserAwards = null;\n\t\t$this->collMemberReferrals = null;\n\t\t$this->collGearCompanyInfos = null;\n\t\t$this->collGearInfos = null;\n\t\t$this->collGearReviews = null;\n\t\t$this->collUserGears = null;\n\t\t$this->collOffensives = null;\n\t\t$this->collRecentActivitys = null;\n\t}", "private function reset(){\n\n\t\tforeach($this as $k=>$v) unset($this->$k);\n\n\t\t$this::$map = $this->maper();\n\n\t\t$this->name = \"\";\n\n\t\t$this->address = [];\n\n\t\t$this->tableclass();\n\n\t}", "public function clear()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->multiRef = [];\n\n }", "public static function resetAll(): void\n {\n static::getFacadeRoot()->resetAll();\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collAssignedPrayersRelatedByAgentId) {\n foreach ($this->collAssignedPrayersRelatedByAgentId as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collAssignedPrayersRelatedByPatientId) {\n foreach ($this->collAssignedPrayersRelatedByPatientId as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPartnerssRelatedByAgentId) {\n foreach ($this->collPartnerssRelatedByAgentId as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPartnerssRelatedByPatientId) {\n foreach ($this->collPartnerssRelatedByPatientId as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPainRatings) {\n foreach ($this->collPainRatings as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collUserDemoss) {\n foreach ($this->collUserDemoss as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPatients) {\n foreach ($this->collPatients as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collAgents) {\n foreach ($this->collAgents as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collAssignedPrayersRelatedByAgentId = null;\n $this->collAssignedPrayersRelatedByPatientId = null;\n $this->collPartnerssRelatedByAgentId = null;\n $this->collPartnerssRelatedByPatientId = null;\n $this->collPainRatings = null;\n $this->collUserDemoss = null;\n $this->collPatients = null;\n $this->collAgents = null;\n $this->aUserAge = null;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collArticleHasIngredients) {\n foreach ($this->collArticleHasIngredients as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collOrderHasArticless) {\n foreach ($this->collOrderHasArticless as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPackageHasArticless) {\n foreach ($this->collPackageHasArticless as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collRatings) {\n foreach ($this->collRatings as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collArticleHasIngredients = null;\n $this->collOrderHasArticless = null;\n $this->collPackageHasArticless = null;\n $this->collRatings = null;\n $this->aCakeType = null;\n $this->aShape = null;\n }", "public function reset() {\n\t\t\tforeach ( $this->dbFields as $property ) {\n\t\t\t\t$this->$property = '';\n\t\t\t}\n\t\t\t$this->pageData = null;\n\t\t\t$this->attributes = null;\n\t\t\t// TODO: set exdata to array()?\n\t\t}", "public function reset() : void\n {\n $this->_modified = [];\n $this->_errors = [];\n }", "private function reset()\n\t{\t\t\n\t\t$this->limit = null;\n\t\t\n\t\t$this->table = null;\n\t\t\n\t\t$this->offset = null;\n\t\t\n\t\t$this->data = [];\n\t\t\n\t\t$this->joins = [];\n\t\t\n\t\t$this->wheres = [];\n\t\t\n\t\t$this->orderBy = [];\n\t\t\n\t\t$this->selects = [];\n\t\t\n\t\t$this->bindings = [];\n\t\t\t\n\t}", "private function resetAll()\n {\n $this->title = null;\n $this->caption = null;\n $this->categories = null;\n $this->image = null;\n $this->tags = null;\n $this->imagePath = null;\n $this->postId = null;\n }", "private function nuke()\n {\n \\lib\\Model\\ModelCache::clear($this);\n $this->__new=true;\n $this->__fields=array();\n $this->__isDirty=false;\n $this->__dirtyFields=array();\n }", "public function clear() {\n\t\t$vars = get_object_vars($this);\n\t\tforeach ($vars as $key => $val) {\n\t\t\t$this->$key = null;\n\t\t}\n\t}", "public static function reset()\n {\n $container = static::getInstance();\n $container->values = array();\n $container->factories = array();\n $container->raw = array();\n }", "protected function reset() {\n //query builder reset\n $this->queryBuilder->reset();\n $this->numRows = 0;\n $this->insertId = null;\n $this->query = null;\n $this->result = array();\n $this->data = array();\n $this->queryCount = 0;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collEnderecos) {\n\t\t\t\tforeach ($this->collEnderecos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMembros) {\n\t\t\t\tforeach ($this->collMembros as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\tif ($this->collEnderecos instanceof PropelCollection) {\n\t\t\t$this->collEnderecos->clearIterator();\n\t\t}\n\t\t$this->collEnderecos = null;\n\t\tif ($this->collMembros instanceof PropelCollection) {\n\t\t\t$this->collMembros->clearIterator();\n\t\t}\n\t\t$this->collMembros = null;\n\t\t$this->aUf = null;\n\t}", "public function reset()\n {\n $this->models = null;\n return $this;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->aSekolah instanceof Persistent) {\n $this->aSekolah->clearAllReferences($deep);\n }\n if ($this->aSemester instanceof Persistent) {\n $this->aSemester->clearAllReferences($deep);\n }\n if ($this->aSumberAirRelatedBySumberAirId instanceof Persistent) {\n $this->aSumberAirRelatedBySumberAirId->clearAllReferences($deep);\n }\n if ($this->aSumberAirRelatedBySumberAirMinumId instanceof Persistent) {\n $this->aSumberAirRelatedBySumberAirMinumId->clearAllReferences($deep);\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n $this->aSekolah = null;\n $this->aSemester = null;\n $this->aSumberAirRelatedBySumberAirId = null;\n $this->aSumberAirRelatedBySumberAirMinumId = null;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collBiblioAuthors) {\n foreach ($this->collBiblioAuthors as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collBiblioTopics) {\n foreach ($this->collBiblioTopics as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collItems) {\n foreach ($this->collItems as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collAuthors) {\n foreach ($this->collAuthors as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collTopics) {\n foreach ($this->collTopics as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collBiblioAuthors = null;\n $this->collBiblioTopics = null;\n $this->collItems = null;\n $this->collAuthors = null;\n $this->collTopics = null;\n $this->aPublisher = null;\n $this->aLanguage = null;\n $this->aPlace = null;\n $this->aFrequency = null;\n $this->aUser = null;\n }", "function reset()\n {\n $this->mBlockHandles = array();\n $this->mBlockKeys = array();\n $this->mGlobalAssignArray = array();\n }", "public static function reset()\n {\n self::resetDefault();\n self::$instances = array();\n }", "public static function reset()\n {\n self::$annotations = [];\n self::$reader = null;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collMmI18ns) {\n\t\t\t\tforeach ((array) $this->collMmI18ns as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collFiles) {\n\t\t\t\tforeach ((array) $this->collFiles as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collLinks) {\n\t\t\t\tforeach ((array) $this->collLinks as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMmPersons) {\n\t\t\t\tforeach ((array) $this->collMmPersons as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPicMms) {\n\t\t\t\tforeach ((array) $this->collPicMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collGroundMms) {\n\t\t\t\tforeach ((array) $this->collGroundMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMaterials) {\n\t\t\t\tforeach ((array) $this->collMaterials as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collLogTranscodings) {\n\t\t\t\tforeach ((array) $this->collLogTranscodings as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collTranscodings) {\n\t\t\t\tforeach ((array) $this->collTranscodings as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPubChannelMms) {\n\t\t\t\tforeach ((array) $this->collPubChannelMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAnnounceChannelMms) {\n\t\t\t\tforeach ((array) $this->collAnnounceChannelMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collMmMatterhorns) {\n\t\t\t\tforeach ((array) $this->collMmMatterhorns as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCategoryMms) {\n\t\t\t\tforeach ((array) $this->collCategoryMms as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCategoryMmTimeframes) {\n\t\t\t\tforeach ((array) $this->collCategoryMmTimeframes as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collMmI18ns = null;\n\t\t$this->collFiles = null;\n\t\t$this->collLinks = null;\n\t\t$this->collMmPersons = null;\n\t\t$this->collPicMms = null;\n\t\t$this->collGroundMms = null;\n\t\t$this->collMaterials = null;\n\t\t$this->collLogTranscodings = null;\n\t\t$this->collTranscodings = null;\n\t\t$this->collPubChannelMms = null;\n\t\t$this->collAnnounceChannelMms = null;\n\t\t$this->collMmMatterhorns = null;\n\t\t$this->collCategoryMms = null;\n\t\t$this->collCategoryMmTimeframes = null;\n\t\t$this->aSerial = null;\n\t\t$this->aPrecinct = null;\n\t\t$this->aGenre = null;\n\t\t$this->aBroadcast = null;\n\t}", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collExperts) {\n\t\t\t\tforeach ((array) $this->collExperts as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collExpertCategorys) {\n\t\t\t\tforeach ((array) $this->collExpertCategorys as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collHistorys) {\n\t\t\t\tforeach ((array) $this->collHistorys as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collItemRatings) {\n\t\t\t\tforeach ((array) $this->collItemRatings as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collOfferVoucher1s) {\n\t\t\t\tforeach ((array) $this->collOfferVoucher1s as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPurchaseDetails) {\n\t\t\t\tforeach ((array) $this->collPurchaseDetails as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collShoppingCarts) {\n\t\t\t\tforeach ((array) $this->collShoppingCarts as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collShoutsRelatedByPosterId) {\n\t\t\t\tforeach ((array) $this->collShoutsRelatedByPosterId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collShoutsRelatedByRecipientId) {\n\t\t\t\tforeach ((array) $this->collShoutsRelatedByRecipientId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUserAwardss) {\n\t\t\t\tforeach ((array) $this->collUserAwardss as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->singleUserGtalk) {\n\t\t\t\t$this->singleUserGtalk->clearAllReferences($deep);\n\t\t\t}\n\t\t\tif ($this->singleUserFb) {\n\t\t\t\t$this->singleUserFb->clearAllReferences($deep);\n\t\t\t}\n\t\t\tif ($this->collUserRates) {\n\t\t\t\tforeach ((array) $this->collUserRates as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->singleUserTutor) {\n\t\t\t\t$this->singleUserTutor->clearAllReferences($deep);\n\t\t\t}\n\t\t\tif ($this->collUserQuestionTags) {\n\t\t\t\tforeach ((array) $this->collUserQuestionTags as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collStudentQuestionsRelatedByStudentId) {\n\t\t\t\tforeach ((array) $this->collStudentQuestionsRelatedByStudentId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collStudentQuestionsRelatedByTutorId) {\n\t\t\t\tforeach ((array) $this->collStudentQuestionsRelatedByTutorId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collWhiteboardSessions) {\n\t\t\t\tforeach ((array) $this->collWhiteboardSessions as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collExperts = null;\n\t\t$this->collExpertCategorys = null;\n\t\t$this->collHistorys = null;\n\t\t$this->collItemRatings = null;\n\t\t$this->collOfferVoucher1s = null;\n\t\t$this->collPurchaseDetails = null;\n\t\t$this->collShoppingCarts = null;\n\t\t$this->collShoutsRelatedByPosterId = null;\n\t\t$this->collShoutsRelatedByRecipientId = null;\n\t\t$this->collUserAwardss = null;\n\t\t$this->singleUserGtalk = null;\n\t\t$this->singleUserFb = null;\n\t\t$this->collUserRates = null;\n\t\t$this->singleUserTutor = null;\n\t\t$this->collUserQuestionTags = null;\n\t\t$this->collStudentQuestionsRelatedByStudentId = null;\n\t\t$this->collStudentQuestionsRelatedByTutorId = null;\n\t\t$this->collWhiteboardSessions = null;\n\t}", "public static function reset($destroyObjects = TRUE) {\n foreach (self::$connections as $object) {\n if ($destroyObjects) $object->destroy();\n self::unregisterObject($object);\n }\n self::$drivers = array();\n self::$connections = array();\n }", "public function reset()\n {\n $this->values[self::contractorstatics] = null;\n $this->values[self::stores] = array();\n $this->values[self::visited] = array();\n $this->values[self::review_info] = array();\n $this->values[self::customer_info] = array();\n $this->values[self::mark_price_info] = array();\n $this->values[self::more_url] = null;\n $this->values[self::order_tracking] = array();\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collCampaignContactGroups) {\n\t\t\t\tforeach ((array) $this->collCampaignContactGroups as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCampaignContacts) {\n\t\t\t\tforeach ((array) $this->collCampaignContacts as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCampaignContactElements) {\n\t\t\t\tforeach ((array) $this->collCampaignContactElements as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCampaignLinks) {\n\t\t\t\tforeach ((array) $this->collCampaignLinks as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collCampaignContactGroups = null;\n\t\t$this->collCampaignContacts = null;\n\t\t$this->collCampaignContactElements = null;\n\t\t$this->collCampaignLinks = null;\n\t\t\t$this->aCampaignTemplate = null;\n\t\t\t$this->asfGuardUserProfile = null;\n\t}", "public function clear()\n {\n foreach ($this->objectsRepository as $repository) {\n if ($repository instanceof Repository) {\n $repository->clear();\n }\n }\n parent::clear();\n $this->objectsRepository = [];\n }", "public function reset()\n {\n $this->values[self::BOXID] = null;\n $this->values[self::DRAFTID] = null;\n $this->values[self::TOBOXID] = null;\n $this->values[self::TODEPARTMENTID] = null;\n $this->values[self::DOCUMENTSIGNATURES] = array();\n $this->values[self::PROXYBOXID] = null;\n $this->values[self::PROXYDEPARTMENTID] = null;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collCOMConditions) {\n foreach ($this->collCOMConditions as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCOMVendeurs) {\n foreach ($this->collCOMVendeurs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCMDPieces) {\n foreach ($this->collCMDPieces as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCOMEndusers) {\n foreach ($this->collCOMEndusers as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCMDTDocs) {\n foreach ($this->collCMDTDocs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collCMDTAppareils) {\n foreach ($this->collCMDTAppareils as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collCOMConditions = null;\n $this->collCOMVendeurs = null;\n $this->collCMDPieces = null;\n $this->collCOMEndusers = null;\n $this->collCMDTDocs = null;\n $this->collCMDTAppareils = null;\n $this->aSociete = null;\n $this->aMTransport = null;\n }", "public function clear()\n\t{\n\t\t$this->getObject()->clear();\n\t}", "public function resetCaches() {\n $this->datasource = NULL;\n $this->server_object = NULL;\n $this->callbacks = NULL;\n $this->processors = NULL;\n $this->added_properties = NULL;\n $this->fields = array();\n $this->fulltext_fields = array();\n }", "public function reset() {\n $this->databasefieldcount = 0;\n $this->databaserecordcount = 0;\n\n parent::reset();\n }", "public function resetDataModel() {\r\n $this->arrModel = array();\r\n $intPackageId = NULL;\r\n }", "public function reset()\n\t{\n\t\tparent::reset();\n\n\t\t// Reset the primary key\n\t\t$this->id = null;\n\t}", "public function reset()\n\t{\n\t\tparent::reset();\n\n\t\t// Reset the primary key\n\t\t$this->id = null;\n\t}", "public function reset() : void {\n\t\tforeach ($this->propertyMap as $propertyName => $dbName) {\n\t\t\t$this->{$propertyName} = null;\n\t\t}\n\t}", "public function reset()\n {\n $this->values[self::ID] = null;\n $this->values[self::NAME] = null;\n $this->values[self::PERMISSIONS] = null;\n $this->values[self::POSITION] = null;\n }", "public function reset()\n {\n $this->values[self::_UID] = null;\n $this->values[self::_NAME] = null;\n $this->values[self::_HERO] = null;\n }", "public function reset()\n {\n $this->values[self::_OWNER] = null;\n $this->values[self::_ID] = null;\n $this->values[self::_TYPE_ID] = null;\n $this->values[self::_TEAM] = array();\n $this->values[self::_STATE] = null;\n $this->values[self::_STATE_END_TS] = null;\n $this->values[self::_PRODUCE_SPEED] = null;\n $this->values[self::_STORAGE] = null;\n }", "protected function reset(): void\n {\n $this->bot = null;\n $this->client = null;\n $this->device = null;\n $this->os = null;\n $this->brand = '';\n $this->model = '';\n $this->parsed = false;\n }", "public function resetCollectionsForPersist()\n {\n $this->containers = new ArrayCollection();\n $this->functions = new ArrayCollection();\n $this->constants = new ArrayCollection();\n }", "public function unsetAll() {\n\t\tparent::unsetAll();\n\t}", "public function reset(): void\n {\n $this->activationKey = null;\n $this->dateOfBirth = null;\n $this->lpaReferenceNumber = null;\n }", "public function clear() {\n\t\t$this->_where\t\t= array();\n\t\t$this->_order\t\t= array();\n\t\t$this->_isAddingNew\t= false;\n\t\t$this->_currentRow\t= 0;\n\t\t$this->_relationship\t= array();\n\t\t$this->_recordset\t= array();\n\t\t$this->_updateBuffer\t= array();\n\t\t$this->_limit\t\t= NULL;\n\t\t$this->_offset\t\t= NULL;\n\t\t$this->isDirty( false );\n\t}", "public function flush()\r\n {\r\n foreach ($this->_collections as $key => $coll) {\r\n $coll->takeSnapshot();\r\n }\r\n foreach ($this->_tables as $table) {\r\n $table->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, true);\r\n }\r\n $this->_initializedRelations = null;\r\n $this->_collections = null;\r\n $this->_tables = null;\r\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_NAME] = null;\n $this->values[self::_AVATAR] = null;\n $this->values[self::_SLOGAN] = null;\n $this->values[self::_JOIN_TYPE] = null;\n $this->values[self::_JOIN_LIMIT] = null;\n $this->values[self::_MEMBER_CNT] = null;\n $this->values[self::_PRESIDENT] = null;\n $this->values[self::_LIVENESS] = null;\n $this->values[self::_CAN_JUMP] = null;\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collAuditorias) {\n\t\t\t\tforeach ($this->collAuditorias as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collAvaliacaoRespostaForums) {\n\t\t\t\tforeach ($this->collAvaliacaoRespostaForums as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collColetaPesquisas) {\n\t\t\t\tforeach ($this->collColetaPesquisas as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collComentarioNoticias) {\n\t\t\t\tforeach ($this->collComentarioNoticias as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collCurtidaForums) {\n\t\t\t\tforeach ($this->collCurtidaForums as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collNoticias) {\n\t\t\t\tforeach ($this->collNoticias as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPesquisas) {\n\t\t\t\tforeach ($this->collPesquisas as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPesquisaHabilitadas) {\n\t\t\t\tforeach ($this->collPesquisaHabilitadas as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPremios) {\n\t\t\t\tforeach ($this->collPremios as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collRespostaForums) {\n\t\t\t\tforeach ($this->collRespostaForums as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collSolicitacaoResgatesRelatedByAprovadorId) {\n\t\t\t\tforeach ($this->collSolicitacaoResgatesRelatedByAprovadorId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collSolicitacaoResgatesRelatedBySolicitanteId) {\n\t\t\t\tforeach ($this->collSolicitacaoResgatesRelatedBySolicitanteId as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\tif ($this->collAuditorias instanceof PropelCollection) {\n\t\t\t$this->collAuditorias->clearIterator();\n\t\t}\n\t\t$this->collAuditorias = null;\n\t\tif ($this->collAvaliacaoRespostaForums instanceof PropelCollection) {\n\t\t\t$this->collAvaliacaoRespostaForums->clearIterator();\n\t\t}\n\t\t$this->collAvaliacaoRespostaForums = null;\n\t\tif ($this->collColetaPesquisas instanceof PropelCollection) {\n\t\t\t$this->collColetaPesquisas->clearIterator();\n\t\t}\n\t\t$this->collColetaPesquisas = null;\n\t\tif ($this->collComentarioNoticias instanceof PropelCollection) {\n\t\t\t$this->collComentarioNoticias->clearIterator();\n\t\t}\n\t\t$this->collComentarioNoticias = null;\n\t\tif ($this->collCurtidaForums instanceof PropelCollection) {\n\t\t\t$this->collCurtidaForums->clearIterator();\n\t\t}\n\t\t$this->collCurtidaForums = null;\n\t\tif ($this->collNoticias instanceof PropelCollection) {\n\t\t\t$this->collNoticias->clearIterator();\n\t\t}\n\t\t$this->collNoticias = null;\n\t\tif ($this->collPesquisas instanceof PropelCollection) {\n\t\t\t$this->collPesquisas->clearIterator();\n\t\t}\n\t\t$this->collPesquisas = null;\n\t\tif ($this->collPesquisaHabilitadas instanceof PropelCollection) {\n\t\t\t$this->collPesquisaHabilitadas->clearIterator();\n\t\t}\n\t\t$this->collPesquisaHabilitadas = null;\n\t\tif ($this->collPremios instanceof PropelCollection) {\n\t\t\t$this->collPremios->clearIterator();\n\t\t}\n\t\t$this->collPremios = null;\n\t\tif ($this->collRespostaForums instanceof PropelCollection) {\n\t\t\t$this->collRespostaForums->clearIterator();\n\t\t}\n\t\t$this->collRespostaForums = null;\n\t\tif ($this->collSolicitacaoResgatesRelatedByAprovadorId instanceof PropelCollection) {\n\t\t\t$this->collSolicitacaoResgatesRelatedByAprovadorId->clearIterator();\n\t\t}\n\t\t$this->collSolicitacaoResgatesRelatedByAprovadorId = null;\n\t\tif ($this->collSolicitacaoResgatesRelatedBySolicitanteId instanceof PropelCollection) {\n\t\t\t$this->collSolicitacaoResgatesRelatedBySolicitanteId->clearIterator();\n\t\t}\n\t\t$this->collSolicitacaoResgatesRelatedBySolicitanteId = null;\n\t\t$this->aCargo = null;\n\t\t$this->aDepartamento = null;\n\t\t$this->aEndereco = null;\n\t\t$this->aPerfil = null;\n\t}", "public function reset()\n {\n $this->values[self::_DIAMOND] = null;\n $this->values[self::_GUILDPOINT] = null;\n $this->values[self::_DPS] = null;\n $this->values[self::_OLD_DPS] = null;\n $this->values[self::_OLD_SUMMARY] = null;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collEtablissementEvents) {\n foreach ($this->collEtablissementEvents as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collRegionEvents) {\n foreach ($this->collRegionEvents as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collEventI18ns) {\n foreach ($this->collEventI18ns as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collEtablissements) {\n foreach ($this->collEtablissements as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collRegions) {\n foreach ($this->collRegions as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n // i18n behavior\n $this->currentLocale = 'fr';\n $this->currentTranslations = null;\n\n if ($this->collEtablissementEvents instanceof PropelCollection) {\n $this->collEtablissementEvents->clearIterator();\n }\n $this->collEtablissementEvents = null;\n if ($this->collRegionEvents instanceof PropelCollection) {\n $this->collRegionEvents->clearIterator();\n }\n $this->collRegionEvents = null;\n if ($this->collEventI18ns instanceof PropelCollection) {\n $this->collEventI18ns->clearIterator();\n }\n $this->collEventI18ns = null;\n if ($this->collEtablissements instanceof PropelCollection) {\n $this->collEtablissements->clearIterator();\n }\n $this->collEtablissements = null;\n if ($this->collRegions instanceof PropelCollection) {\n $this->collRegions->clearIterator();\n }\n $this->collRegions = null;\n }", "public function resetLookupCollections()\n\t{\n\t\t$this->lookupCollections[] = null;\n\t}", "public function resetModelMocks()\n {\n $this->_registeredModelMocks = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_HERO_BASES] = array();\n $this->values[self::_HERO_DYNAS] = array();\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep) {\n if ($this->collPurchaseOrderDetailReceivings) {\n foreach ($this->collPurchaseOrderDetailReceivings as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collPurchaseOrderDetailLotReceivings) {\n foreach ($this->collPurchaseOrderDetailLotReceivings as $o) {\n $o->clearAllReferences($deep);\n }\n }\n } // if ($deep)\n\n $this->collPurchaseOrderDetailReceivings = null;\n $this->collPurchaseOrderDetailLotReceivings = null;\n $this->aPurchaseOrder = null;\n $this->aWarehouse = null;\n }", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->collFeatureCvtermDbxrefs) {\n foreach ($this->collFeatureCvtermDbxrefs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collFeatureCvtermPubs) {\n foreach ($this->collFeatureCvtermPubs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collFeatureCvtermprops) {\n foreach ($this->collFeatureCvtermprops as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->aCvterm instanceof Persistent) {\n $this->aCvterm->clearAllReferences($deep);\n }\n if ($this->aFeature instanceof Persistent) {\n $this->aFeature->clearAllReferences($deep);\n }\n if ($this->aPub instanceof Persistent) {\n $this->aPub->clearAllReferences($deep);\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n if ($this->collFeatureCvtermDbxrefs instanceof PropelCollection) {\n $this->collFeatureCvtermDbxrefs->clearIterator();\n }\n $this->collFeatureCvtermDbxrefs = null;\n if ($this->collFeatureCvtermPubs instanceof PropelCollection) {\n $this->collFeatureCvtermPubs->clearIterator();\n }\n $this->collFeatureCvtermPubs = null;\n if ($this->collFeatureCvtermprops instanceof PropelCollection) {\n $this->collFeatureCvtermprops->clearIterator();\n }\n $this->collFeatureCvtermprops = null;\n $this->aCvterm = null;\n $this->aFeature = null;\n $this->aPub = null;\n }", "public function clear()\n {\n $this->id = null;\n $this->name = null;\n $this->is_active = null;\n $this->is_closed = null;\n $this->from_date = null;\n $this->to_date = null;\n $this->sortable_rank = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collVpoRequestAnimals) {\n\t\t\t\tforeach ((array) $this->collVpoRequestAnimals as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collVpoRequestCargos) {\n\t\t\t\tforeach ((array) $this->collVpoRequestCargos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collVpoRequestPassengers) {\n\t\t\t\tforeach ((array) $this->collVpoRequestPassengers as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collVpoRequestAnimals = null;\n\t\t$this->collVpoRequestCargos = null;\n\t\t$this->collVpoRequestPassengers = null;\n\t}", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collEvents) {\n\t\t\t\tforeach ((array) $this->collEvents as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collVenueratings) {\n\t\t\t\tforeach ((array) $this->collVenueratings as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\t$this->collEvents = null;\n\t\t$this->collVenueratings = null;\n\t\t$this->aUser = null;\n\t}", "public function reset()\n {\n $this->values[self::_MONEY] = null;\n $this->values[self::_RMB] = null;\n $this->values[self::_HEROES] = array();\n $this->values[self::_ITEMS] = array();\n }", "function reset() {\n\t\tparent::_resetSet();\n\t}", "public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}", "public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}", "public static function reset()\n\t{\n\t\tself::engine()->reset();\n\t}", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t} // if ($deep)\n\n\t\t\t$this->aJ002tUsuario = null;\n\t\t\t$this->aJ016tForense = null;\n\t\t\t$this->aJ018tInformeForense = null;\n\t}", "public function clearRelations(): DataObject\n {\n foreach ($this::RELATIONS as $relationKey => $relation) {\n unset($this->{$relationKey});\n }\n\n return $this;\n }", "private function reset()\n {\n $this->human->reset();\n $this->machine->reset();\n $this->memory->reset();\n }", "public function reset() {\n\t\tforeach (array_reverse($this->_callStack) as $call) {\n\t\t\tcall_user_func_array(array($this, \"_reset\" . ucfirst($call['method'])), $call['arguments']);\n\t\t}\n\t}", "function reset_data() {\n\t\t$this->data_layer()->clear();\n\t\t$this->log = null;\n\t\t$this->location = null;\n\t\t$this->tax_location = null;\n\t}", "public function clearAllReferences($deep = false)\n\t{\n\t\tif ($deep) {\n\t\t\tif ($this->collPermissaosRelatedByCoUsuarioAlteracao) {\n\t\t\t\tforeach ($this->collPermissaosRelatedByCoUsuarioAlteracao as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collPermissaosRelatedByCoUsuarioCadastro) {\n\t\t\t\tforeach ($this->collPermissaosRelatedByCoUsuarioCadastro as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collRlUsuarioOrgaos) {\n\t\t\t\tforeach ($this->collRlUsuarioOrgaos as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collTbDescricaoChamados) {\n\t\t\t\tforeach ($this->collTbDescricaoChamados as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUsuarioCategorias) {\n\t\t\t\tforeach ($this->collUsuarioCategorias as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->collUsuarioTarefas) {\n\t\t\t\tforeach ($this->collUsuarioTarefas as $o) {\n\t\t\t\t\t$o->clearAllReferences($deep);\n\t\t\t\t}\n\t\t\t}\n\t\t} // if ($deep)\n\n\t\tif ($this->collPermissaosRelatedByCoUsuarioAlteracao instanceof PropelCollection) {\n\t\t\t$this->collPermissaosRelatedByCoUsuarioAlteracao->clearIterator();\n\t\t}\n\t\t$this->collPermissaosRelatedByCoUsuarioAlteracao = null;\n\t\tif ($this->collPermissaosRelatedByCoUsuarioCadastro instanceof PropelCollection) {\n\t\t\t$this->collPermissaosRelatedByCoUsuarioCadastro->clearIterator();\n\t\t}\n\t\t$this->collPermissaosRelatedByCoUsuarioCadastro = null;\n\t\tif ($this->collRlUsuarioOrgaos instanceof PropelCollection) {\n\t\t\t$this->collRlUsuarioOrgaos->clearIterator();\n\t\t}\n\t\t$this->collRlUsuarioOrgaos = null;\n\t\tif ($this->collTbDescricaoChamados instanceof PropelCollection) {\n\t\t\t$this->collTbDescricaoChamados->clearIterator();\n\t\t}\n\t\t$this->collTbDescricaoChamados = null;\n\t\tif ($this->collUsuarioCategorias instanceof PropelCollection) {\n\t\t\t$this->collUsuarioCategorias->clearIterator();\n\t\t}\n\t\t$this->collUsuarioCategorias = null;\n\t\tif ($this->collUsuarioTarefas instanceof PropelCollection) {\n\t\t\t$this->collUsuarioTarefas->clearIterator();\n\t\t}\n\t\t$this->collUsuarioTarefas = null;\n\t\t$this->aPerfil = null;\n\t}", "protected function resetProperties() {}", "public function clearAllReferences($deep = false)\n {\n if ($deep && !$this->alreadyInClearAllReferencesDeep) {\n $this->alreadyInClearAllReferencesDeep = true;\n if ($this->collDeshabilitamcs) {\n foreach ($this->collDeshabilitamcs as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collMontacargasBateriass) {\n foreach ($this->collMontacargasBateriass as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->collUsoBateriasMontacargass) {\n foreach ($this->collUsoBateriasMontacargass as $o) {\n $o->clearAllReferences($deep);\n }\n }\n if ($this->aSucursal instanceof Persistent) {\n $this->aSucursal->clearAllReferences($deep);\n }\n\n $this->alreadyInClearAllReferencesDeep = false;\n } // if ($deep)\n\n if ($this->collDeshabilitamcs instanceof PropelCollection) {\n $this->collDeshabilitamcs->clearIterator();\n }\n $this->collDeshabilitamcs = null;\n if ($this->collMontacargasBateriass instanceof PropelCollection) {\n $this->collMontacargasBateriass->clearIterator();\n }\n $this->collMontacargasBateriass = null;\n if ($this->collUsoBateriasMontacargass instanceof PropelCollection) {\n $this->collUsoBateriasMontacargass->clearIterator();\n }\n $this->collUsoBateriasMontacargass = null;\n $this->aSucursal = null;\n }", "public function reset()\n {\n $this->values[self::_SERIAL_ID] = null;\n $this->values[self::_CHARGE_ID] = null;\n }", "public function reset()\n {\n $this->values[self::_MONEY] = null;\n $this->values[self::_DIAMOND] = null;\n $this->values[self::_ITEMS] = array();\n $this->values[self::_HEROES] = array();\n $this->values[self::_MONTH_CARD] = null;\n }", "public function flush()\n {\n $this->aliases = [];\n $this->bindings = [];\n $this->instances = [];\n }", "public function clearMemberReferrals()\n\t{\n\t\t$this->collMemberReferrals = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function reset() {\n\t\t$this->mimetypes = [];\n\t\t$this->mimetypeIds = [];\n\t}", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_LAST_AUTO_REFRESH_TIME] = null;\n $this->values[self::_EXPIRE_TIME] = null;\n $this->values[self::_LAST_MANUAL_REFRESH_TIME] = null;\n $this->values[self::_TODAY_TIMES] = null;\n $this->values[self::_CURRENT_GOODS] = array();\n }", "public function reset()\n {\n $this->values[self::_AMOUNT] = null;\n $this->values[self::_REWARDS] = array();\n $this->values[self::_DAILYJOB] = null;\n }", "public function reset()\n {\n $this->values[self::_SELF_TEAM] = null;\n $this->values[self::_OPPO_TEAM] = null;\n $this->values[self::_RESULT] = null;\n $this->values[self::_RECORD_ID] = null;\n $this->values[self::_RECORD_SVRID] = null;\n }", "public function refresh()\n {\n $this->_totalCount = null;\n $this->_models = null;\n $this->_keys = null;\n }" ]
[ "0.73363394", "0.72726226", "0.7251032", "0.7234304", "0.7182084", "0.7099506", "0.70658344", "0.6978821", "0.69653195", "0.6930082", "0.68083715", "0.67966264", "0.6692531", "0.6681615", "0.66698927", "0.6646377", "0.6646377", "0.66060627", "0.6583203", "0.6582785", "0.6559423", "0.65559113", "0.6553044", "0.6503839", "0.6503267", "0.6499799", "0.6483521", "0.6482562", "0.6473463", "0.64728194", "0.64621896", "0.64486486", "0.64389616", "0.6427732", "0.6422539", "0.6422293", "0.6411289", "0.64088076", "0.64018977", "0.6396213", "0.6393357", "0.6391267", "0.63912034", "0.63856757", "0.6379318", "0.63732105", "0.6370967", "0.63683665", "0.6339571", "0.63352364", "0.63300425", "0.6319607", "0.6318621", "0.63159126", "0.6310137", "0.6310137", "0.6308514", "0.62953883", "0.62910026", "0.6285019", "0.6283271", "0.6274291", "0.6267033", "0.626212", "0.62595814", "0.62582564", "0.6247165", "0.62466866", "0.62425923", "0.62417036", "0.6238255", "0.6231575", "0.6219046", "0.6212361", "0.6209859", "0.6206618", "0.6204377", "0.6199817", "0.6198069", "0.61954415", "0.61826104", "0.61826104", "0.6176176", "0.6175922", "0.6175437", "0.6175079", "0.61717695", "0.6168503", "0.61681926", "0.6161197", "0.6159713", "0.61564684", "0.6155345", "0.6136281", "0.61313057", "0.613", "0.6124593", "0.6106756", "0.61005", "0.60925376" ]
0.6673458
14
Return the string representation of this object
public function __toString() { return (string) $this->exportTo(TblProdInfoTableMap::DEFAULT_STRING_FORMAT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toString()\n {\n return $this->__toString();\n }", "public function to_string() { return $this->__toString(); }", "public function __toString()\n\t{\n\t\treturn $this->serialize();\n\t}", "public function __toString() {\n \n return $this->toString();\n }", "public function __toString() {\n return $this->toString();\n }", "public function __toString() {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->formatAsString();\n }", "public function toString()\n {\n return $this->cast('string');\n }", "public function __toString() {\r\n return $this->toString();\r\n }", "public function __toString() { return $this->as_string(); }", "public function toString()\n {\n return serialize($this->getData());\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return $this->toJson();\n }", "public function __toString()\n\t{\n\t\treturn $this->dump();\n\t}", "public function __toString() {\n\t\treturn $this->toString();\n\t}", "public function __toString() {\n\t\treturn $this->toString();\n\t}", "public function toString()\n {\n return json_encode($this->obj);\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString(): string\n {\n return $this->toJson();\n }", "public function __toString(): string\n {\n return $this->toJSON();\n }", "public function __toString() {\n return $this->as_string();\n }", "public function __toString()\n\t{\n\t\treturn $this->_toString();\n\t}", "public function toString()\n\t{\n\t\treturn (string) $this;\n\t}", "public function toString()\n\t{\n\t\treturn (string) $this;\n\t}", "public function __toString()\n {\n return $this->toFormattedString();\n }", "public function __toString() : string\n {\n return $this->toString();\n }", "public function __toString(): string\n {\n return serialize($this->toArray());\n }", "public function __toString() {\n return $this->toString();\n }", "public function __toString() {\n return $this->toJson($this->data);\n }", "public function __toString() {\n\t\treturn $this->build ();\n\t}", "public function __toString () {\n return $this->encode();\n }", "public function getToString()\n {\n return $this->toString();\n }", "public function __toString(): string\n {\n return $this->toString();\n }", "public function __toString(): string\n {\n return $this->toString();\n }", "public function __toString(): string\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n try {\n return $this->toString();\n } catch (\\Exception $e) {\n return '';\n }\n }", "public function __toString()\n {\n return $this->toNative();\n }", "public function toString() {\n\t\treturn serialize($this->_value);\n\t}", "public function __toString(): string\n {\n return $this->to_string();\n }", "public function __toString()\n {\n return $this->make()->toString();\n }", "public function __toString()\n {\n return $this->build();\n }", "public function __toString()\r\n {\r\n return $this->getFormattedString();\r\n }", "public function __toString()\r\n {\r\n return var_export($this, true);\r\n }", "public function toString() : void\n {\n $out = serialize($this);\n \n }", "public function __toString()\n {\n return (string) $this->getContents();\n }", "public function __toString()\n {\n return (string) $this->exportTo(JadwalPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString()\n\t{\n\t\treturn $this->get();\n\t}", "public function __toString() {\n\t\t\treturn Core\\Convert::toString($this->value);\n\t\t}", "public function __toString()\n\t{\n\t\treturn \"{$this->data}\";\n\t}", "public function __toString() {\n\t\t\treturn Core\\Convert::toString($this->render());\n\t\t}", "public function __tostring()\n {\n if ($this->isEmpty()) {\n return '';\n }\n\n return json_encode($this);\n }", "public function __toString()\n {\n return $this->assemble();\n }", "public function __toString() : string\n {\n return json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function toString()\n {\n $data = $this->getProperties();\n $out = get_class($this).' ('.CRLF;\n foreach ($data as $key => $value) {\n $type = gettype($value);\n $value = is_bool($value) ? (int) $value : $value;\n $value = is_string($value) ? '\"'.$value.'\"' : $value;\n $value = is_object($value) ? implode(CRLF.TAB, explode(CRLF, (string) $value)) : $value;\n $value = is_array($value) ? print_r($value, true) : $value;\n $out .= TAB.$key.' ('.$type.')';\n $out .= ': '.$value.CRLF;\n }\n\n return $out.');';\n }", "public function __toString()\n {\n return $this->toJson(['pretty' => true]);\n }", "public function __toString(): string\n {\n return var_export($this->toArray(), true);\n }", "public function __tostring() {\n\n\t\t\t//convet to string\n\t\t\treturn \"{\".\n\t\t\t\t\t\t\"id:\".$this->_id.\n\t\t\t\t\t\t\"type:\".$this->_type.\n\t\t\t\t\t\t\"path:\".$this->_path.\n\t\t\t\t\t\t\"name:\".$this->_name.\n\t\t\t\t\t\"}\";\n\n\t\t}", "public function __toString()\n\t{\n\t\treturn $this->value();\n\t}", "public function __toString()\n {\n return (string) $this->getValue();\n }", "public function __toString()\n {\n return (string) $this->getValue();\n }", "public function __toString()\n {\n return (string) $this->getValue();\n }", "public function __toString()\n\t{\n\t\treturn '';\n\t}", "public function __toString() {\n return $this->assemble();\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }" ]
[ "0.88303834", "0.88247913", "0.8767572", "0.8697769", "0.86650574", "0.86650574", "0.8661821", "0.86544496", "0.86514354", "0.8618576", "0.8618164", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.86100644", "0.8608116", "0.85954726", "0.85954726", "0.85932505", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.8571139", "0.85533345", "0.8552205", "0.853698", "0.853083", "0.8516056", "0.8516056", "0.8492604", "0.84855354", "0.84833765", "0.8460066", "0.8455505", "0.84547806", "0.844921", "0.84447956", "0.8440717", "0.8440717", "0.8440717", "0.84302366", "0.84302366", "0.84302366", "0.8426741", "0.84256274", "0.84242535", "0.84181726", "0.84011734", "0.83899236", "0.837509", "0.8372748", "0.8369496", "0.8365388", "0.83627844", "0.8357564", "0.83571416", "0.8326554", "0.8324993", "0.8321171", "0.8315771", "0.83147347", "0.83147347", "0.82959497", "0.829236", "0.8291066", "0.828169", "0.8277619", "0.8273338", "0.8273338", "0.8273338", "0.8269248", "0.82496464", "0.82190806", "0.82190806", "0.82190806", "0.82190806" ]
0.0
-1
Code to be run before persisting the object
public function preSave(ConnectionInterface $con = null) { if (is_callable('parent::preSave')) { return parent::preSave($con); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prePersist()\n {\n }", "public function preSave() {}", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "protected function _saveBefore()\n {\n // nothing here\n }", "public function preSave() { }", "protected function _beforeSave() {\n\t}", "public function onPrePersist()\n {\n $this->status = 1;\n $this->createdDateTime = new \\DateTime(\"now\");\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "public function prePersist()\n {\n $this->created = new \\DateTime();\n }", "public function prePersist()\n {\n $this->dateCreation = new \\DateTime();\n }", "public function prePersist()\n {\n $this->updatedAt = new \\DateTime();\n $this->createdAt = new \\DateTime();\n }", "public function prePersist()\n {\n $this->date_created = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function prePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function prePersist() \n {\n if (empty($this->RegisteredAt)) {\n $this->RegisteredAt = new \\DateTime();\n }\n }", "public function onPrePersist()\n {\n $this->setUpdatedAt(new \\DateTime('now'));\n\n if($this->getCreatedAt() == NULL)\n {\n $this->setCreatedAt(new \\DateTime('now'));\n }\n\n if($this->getSlug() == NULL) {\n $this->setSlug($this->generateSlug());\n }\n\n }", "protected function onBeforeSave()\n {\n }", "public function prePersist()\n {\n $this->createdAt = new \\DateTime;\n $this->updatedAt = new \\DateTime;\n\n }", "public function onPrePersist()\n {\n $now = new \\DateTime();\n $this->setCreatedAt($now);\n $this->setUpdatedAt($now);\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n $this->updated = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->created_at = new \\DateTime(\"now\");\n $this->modified_at = new \\DateTime(\"now\");\n }", "public function _prePersist(): void\n {\n // Set date to now when none is set\n if ($this->date == null) {\n $this->setDate(new \\DateTime());\n }\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "public function PrePersist(){\n $this->login = strtolower($this->login);\n $this->activo = false;\n $this->creadoEl = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime('now');\n $this->updatedAt = new \\DateTime('now');\n }", "public function onPrePersist()\n {\n $this->setCreated(new \\DateTime(\"now\"));\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function prePersist()\n {\n $this->parroqNomb = Utility::upperCase($this->parroqNomb);\n }", "protected function beforeSaveInDB(){}", "protected function preSave() {\n return TRUE;\n }", "protected function preSave() {\n\t\treturn true;\n\t}", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime('now');\n }", "public function onBeforeSave();", "protected function updateObjectBeforePersist(&$object)\n {\n\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "public function prePersist($entity);", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->setCreatedAt(new \\DateTime());\n }", "public function doPrePersist()\n {\n $this->maximized = null;\n }", "public function prePersist() {\n $this->setScheduled(true);\n $this->setScheduleCount(1);\n $this->setScheduledAt(new MongoDate());\n if(!$this->getPriority()) {\n $this->setPriority(self::DEFAULT_PRIORITY);\n }\n }", "protected function beforeSave()\n {\n return;\n }", "public function onPrePersist(): void\n {\n $this->token = Uuid::uuid1()->toString();\n $this->createdAt = new DateTime();\n }", "public function prePersist()\n {\n $this->muniNomb = Utility::upperCase($this->muniNomb);\n }", "public function onPrePersist(): void\n {\n $this->created = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }", "function preSave()\n {\n }", "function beforeSave() {\n\t\treturn true;\n\t}", "public function onPrePersist(): void\n {\n $this->created = new DateTime(new DateTimeZone(\"UTC\"), \"now\");\n }", "public function beforeSave()\n {\n $this->createdAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }", "protected function beforeSave() {\n\n }", "public function beforeSave(){\n $this->getType()->beforeSaveProcess($this);\n return parent::beforeSave();\n }", "public function onPrePersist()\r\n {\r\n $this->created_at = new \\DateTime(\"now\");\r\n }", "protected function _precreate() {\n }", "protected function hook_beforeSave(){}", "public function beforeVersionedSave()\n {\n $this->wasDirty = false;\n if ($this->isDirty && static::$createRevisionOnSave) {\n // update creation time\n $this->Created = time();\n $this->wasDirty = true;\n }\n }", "public function beforeSave()\n {\n $this->createdAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n $this->updatedAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "function preSave()\n\t{\n\n\t}", "protected function versionablePreSave()\n {\n if ($this->versioningEnabled === true) {\n $this->versionableDirtyData = $this->getDirty();\n $this->updating = $this->exists;\n }\n }", "public function beforeSave(){\n\t}", "public function __before() {\n\t\t// runs after this->data is set up, but before the class methods are run\n\t}", "public function beforeSave()\n {\n $this->created = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "public function beforeSave() {\n \n // url is help property - only for run\n unset($this->url);\n // Force creation of slug\n if (empty($this->slug)) {\n unset($this->slug);\n $this->setSluggedValue('slug', 'name');\n }\n \n if(empty($this->quantity)){\n $this->quantity = 0;\n }\n \n if(empty($this->minimum_quantity)){\n $this->minimum_quantity = 0;\n }\n \n if(empty($this->retail_price_with_tax)){\n $this->retail_price_with_tax = 0;\n }\n \n if(empty($this->active)){\n $this->active = 1;\n }\n }", "protected function _beforeSave()\n {\n $this->_prepareData();\n return parent::_beforeSave();\n }", "protected function beforeInserting()\n {\n }", "public function onPrePersist()\n {\n $this->createdAt = new Carbon();\n }", "protected function _preSave(MetadataInterface $metaData, $exists, $identityField) {}", "public function prePersist(LifecycleEventArgs $args)\n {\n $obj = $args->getDocument();\n \n $this->doPrePersist($obj);\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n $value = $this->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "protected function beforeSave()\n {\n return true;\n }", "public function before_save() {\n \n }", "public function before_save() {\n \n }", "public function beforeSave()\n {\n if ($this->parent_id == 0) {\n $this->parent_id = null;\n }\n }", "public function preSave(EntityStorageInterface $storage);", "public function onPrePersist()\r\n {\r\n $this->joinedTime = new \\DateTime();\r\n }", "function beforeSaveLoop()\r\n {\r\n }", "public function beforeSave()\n {\n $this->CreatedAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "private function before_execute()\n {\n }", "public function prePersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n \n if ($config = $this->getConfiguration($om, $meta->name)) {\n $this->getStrategy($om, $meta->name)->processPrePersist($om, $object);\n }\n }", "public function onPrePersist()\n {\n $this->fechaUltimaModificacion = new \\DateTime(\"now\");\n }", "function before_save(){}", "public function beforeSave()\n {\n $this->getRecord()->clearCache() && $this->getRecord()->triggerEvent();\n return parent::beforeSave();\n }", "public function beforeSave()\n {\n $this->rebuildTree();\n }", "public function beforeSave()\n {\n if ($this->getStatus() == null) {\n $this->setStatus(self::STATUS_NEW);\n }\n }", "public function prePersist(LifecycleEventArgs $eventArgs)\n {\n $this->preUpdate($eventArgs);\n }", "protected function preInsert( ModelInterface &$model ) {\n }", "protected function pre_save()\n {\n $this->id = random_bytes(128);\n }", "protected function preProcess() {}", "public function prePersist($object)\n {\n if ($this->isModerator()) {\n /**\n * @var Place $place\n */\n $place = $this->modelManager->find('Food\\DishesBundle\\Entity\\Place', $this->getUser()->getPlace()->getId());\n\n $object->setPlace($place);\n }\n parent::prePersist($object);\n }", "protected function performPrePersistCallback()\n {\n // echo 'inserting a record ...';\n $this->validate();\n \n return true;\n }", "protected function beforeSave()\n {\n $this->saved = 0;\n return parent::beforeSave();\n }" ]
[ "0.8185657", "0.7883653", "0.78455716", "0.78455716", "0.78106177", "0.78020126", "0.77916056", "0.7780491", "0.7693593", "0.768545", "0.76798385", "0.766472", "0.76606226", "0.76541734", "0.765131", "0.7603986", "0.7594705", "0.7581733", "0.75761276", "0.75638556", "0.75546885", "0.7544785", "0.75418234", "0.74418426", "0.74418426", "0.74391395", "0.7436928", "0.74193025", "0.74186444", "0.74186444", "0.74035823", "0.74035823", "0.7353391", "0.7346346", "0.73407185", "0.73308074", "0.73164725", "0.7315525", "0.73023254", "0.7300521", "0.73003674", "0.7291906", "0.72895837", "0.72056866", "0.72056866", "0.72056866", "0.72056866", "0.72056866", "0.72056866", "0.7168821", "0.71587235", "0.7152791", "0.71310663", "0.7124368", "0.70971453", "0.70920783", "0.7085084", "0.70807624", "0.70454776", "0.7041569", "0.7041495", "0.7039359", "0.7031595", "0.6984299", "0.6984277", "0.69355625", "0.6922563", "0.6905137", "0.6882132", "0.68721", "0.68492395", "0.6845316", "0.679343", "0.6765833", "0.67439985", "0.67407346", "0.6739497", "0.6724543", "0.67141294", "0.67096597", "0.6704644", "0.6704644", "0.6696129", "0.6660799", "0.66511875", "0.6642499", "0.6640437", "0.66333723", "0.66322654", "0.66036963", "0.66026616", "0.65999", "0.65762955", "0.65413415", "0.6539548", "0.6533214", "0.65157443", "0.65098655", "0.64948124", "0.6492804", "0.6480474" ]
0.0
-1
Code to be run after persisting the object
public function postSave(ConnectionInterface $con = null) { if (is_callable('parent::postSave')) { parent::postSave($con); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function afterSave(){\n\t}", "public function afterSave()\n {\n\n }", "protected function afterSave() {\n\n }", "public function onAfterSave();", "protected function _postSave()\r\n\t{\r\n\t}", "public function persist() {}", "public function afterSaveCommit(): void\n {\n }", "protected function MetaAfterSave() {\n\t\t}", "protected function persistObjects() {}", "public function prePersist()\n {\n }", "function persist() ;", "public function persist()\n {\n //\n }", "public function persist()\n {\n persistableCollection::getInstance($this->resourceName)->persistObject($this);\n $this->loaded = true;\n $this->persisted = true;\n }", "protected function afterSave()\n {\n return;\n }", "function after_save() {}", "public function preSave() {}", "protected function doAfterContainerSave() {\n if (!$this->isPersistent()) $this->origNodeId = $this->container->getPrimaryKey();\n \n if (!$this->lockStore) $this->endStore(true);\n \n $this->updateFromContainer();\n }", "public function persist()\n {\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "protected function hook_afterSave(){}", "public function preSave() { }", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }", "public function markAsPersisted(): void;", "function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}", "public function postPersist($entity);", "protected function saveState(): void\n {\n $em = $this->getEntityManager();\n $em->flush();\n }", "public function onPrePersist()\n {\n $this->status = 1;\n $this->createdDateTime = new \\DateTime(\"now\");\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "public function save()\n \t{\n \t $this->getMapper()->save($this);\n \t}", "protected function finishSave()\n {\n $this->fireModelEvent('saved', false);\n $this->syncOriginal();\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n $this->updated = new \\DateTime(\"now\");\n }", "public function persist($obj)\r\n {\r\n }", "public function persist();", "public function prePersist()\n {\n $this->updatedAt = new \\DateTime();\n $this->createdAt = new \\DateTime();\n }", "public final function save()\n {\n }", "public final function save() {\n }", "protected function performPostPersistCallback()\n {\n // echo 'inserted a record ...';\n return true;\n }", "public function prePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "function onSave()\n {\n $object = parent::onSave();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function prePersist()\n {\n $this->created = new \\DateTime();\n }", "protected function saving() {\n // This will get reimplemented by children when necessary\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }", "public function onPrePersist()\n {\n $this->created_at = new \\DateTime(\"now\");\n $this->modified_at = new \\DateTime(\"now\");\n }", "public function save()\n {\n $this->persist($this->state);\n }", "public function postSave() {}", "protected function updateObjectBeforePersist(&$object)\n {\n\n }", "public function save()\n\t{\n\t\t$this->container->save($this);\n\t}", "public function onPrePersist()\n {\n $now = new \\DateTime();\n $this->setCreatedAt($now);\n $this->setUpdatedAt($now);\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "public function doPrePersist()\n {\n $this->maximized = null;\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime('now');\n $this->updatedAt = new \\DateTime('now');\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "public function prePersist()\n {\n $this->date_created = new \\DateTime();\n }", "public function afterSave()\r\n\t{\r\n\t\tif(count($this->serialAttributes)) {\r\n\t\t\tforeach($this->serialAttributes as $attribute) {\r\n\t\t\t\t$_att = $this->owner->$attribute;\r\n\t\t\t\tif(!empty($_att)\r\n\t\t\t\t && is_scalar($_att)) {\r\n\t\t\t\t\t$a = @unserialize($_att);\r\n\t\t\t\t\tif($a !== false) {\r\n\t\t\t\t\t\t$this->owner->$attribute = $a;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->owner->$attribute = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}", "public function prePersist()\n {\n $this->dateCreation = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime('now');\n }", "public function save()\n {\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "protected function _saveBefore()\n {\n // nothing here\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }", "public function persist()\n {\n $this->eventManager->dispatchEvent(['persist_before'], [get_class($this)]);\n if (!empty($this->handlerInterface)) {\n $result = $this->handlerFactory->create($this->handlerInterface)->persist($this);\n if (!empty($result)) {\n foreach ($result as $key => $value) {\n $this->data[$key] = $value;\n }\n }\n }\n $this->eventManager->dispatchEvent(['persist_after'], [get_class($this)]);\n }", "public function onPrePersist()\n {\n $this->setCreated(new \\DateTime(\"now\"));\n }", "protected function beforeSaveInDB(){}", "public function prePersist() \n {\n if (empty($this->RegisteredAt)) {\n $this->RegisteredAt = new \\DateTime();\n }\n }", "protected function _beforeSave() {\n\t}", "protected function onBeforeSave()\n {\n }", "public function save() {\n\t\t\t\n\t\t}", "public function saveObjectState() {\n $this->objectState = base64_encode(serialize($this));\n $this->isNewRecord = false;\n $this->update();\n $this->reconstructCombatants();\n }", "public function save()\r\n {\r\n \r\n }", "public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }", "private function executeAfterSave()\n {\n Logger::getInstance()->po_log(\"Excecute after save \". get_class($this));\n\n foreach ( $this->afterSave as $cb ) $cb->execute();\n\n // Una vez que termino de ejecutar, reseteo los cb's registrados.\n $this->afterSave = array();\n }", "public function onBeforeSave();", "public function prePersist()\n {\n $this->createdAt = new \\DateTime;\n $this->updatedAt = new \\DateTime;\n\n }", "public function save() {}", "public function save() {}", "public function save() {}", "static protected function persist() {\n\t\t$objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager::class);\n\t\t$persistanceManager = $objectManager->get(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager::class);\n\t\t$persistanceManager->persistAll();\n\t}", "public function PrePersist(){\n $this->login = strtolower($this->login);\n $this->activo = false;\n $this->creadoEl = new \\DateTime();\n }", "public function single_save()\n {\n //Logger::getInstance()->po_log(\"PO:single_save \" . get_class($this));\n PersistentManager::getInstance()->save_object( $this, 0 );\n }", "public function afterSave() {\n\t\tCache::delete($this->_cacheKey);\n\t}", "protected function afterSave()\n {\n return parent::afterSave();\n if (!$this->order) $this->order = $this->id;\n $this->save(false);\n }", "public function __destruct() {\n $this->persist();\n }", "private function saveTracker(): void {\n try {\n $this->getEntityManager()->persist($this->engagement);\n $this->getEntityManager()->flush($this->engagement);\n } catch (OptimisticLockException $e) {\n } catch (ORMException $e) {\n } catch (ForeignKeyConstraintViolationException $e){\n }\n }", "function persistAll() ;", "public function afterSave()\n {\n $this->unlinkOnSave();\n }", "public function save(): void\n {\n $this->em->persist($this->model);\n $this->em->flush();\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function onPrePersist()\n {\n $this->setUpdatedAt(new \\DateTime('now'));\n\n if($this->getCreatedAt() == NULL)\n {\n $this->setCreatedAt(new \\DateTime('now'));\n }\n\n if($this->getSlug() == NULL) {\n $this->setSlug($this->generateSlug());\n }\n\n }", "public function persistAll() {}", "public function afterVersionedSave()\n {\n if ($this->wasDirty && static::$createRevisionOnSave) {\n // save a copy to history table\n $recordValues = $this->_prepareRecordValues();\n $set = static::_mapValuesToSet($recordValues);\n DB::nonQuery((new Insert())->setTable(static::getHistoryTable())->set($set), null, [static::class,'handleError']);\n }\n }" ]
[ "0.7728293", "0.7728293", "0.74933386", "0.74655366", "0.74099666", "0.7336513", "0.73002577", "0.7251602", "0.724752", "0.72292095", "0.7225401", "0.71804357", "0.71760184", "0.71746963", "0.71676", "0.7153408", "0.713572", "0.71326864", "0.712061", "0.7117253", "0.7107344", "0.7107344", "0.7078962", "0.7013058", "0.69515914", "0.69515914", "0.6951251", "0.6929148", "0.68860066", "0.6864276", "0.6853422", "0.6849102", "0.684784", "0.6843434", "0.6828974", "0.67986906", "0.6791803", "0.6775232", "0.6772333", "0.67615384", "0.67484003", "0.6741531", "0.673864", "0.6736912", "0.6736912", "0.6734801", "0.67339355", "0.6711243", "0.6690992", "0.66876245", "0.6685464", "0.6681163", "0.6680949", "0.6649629", "0.6647153", "0.66439724", "0.66421443", "0.66331553", "0.66306764", "0.66306764", "0.66224277", "0.6617902", "0.6617528", "0.6616055", "0.660548", "0.66052216", "0.66033274", "0.660114", "0.65877676", "0.65877676", "0.6582902", "0.6581225", "0.65788126", "0.6575682", "0.6567004", "0.65534765", "0.65489477", "0.65429544", "0.65408456", "0.6536304", "0.65301204", "0.65263927", "0.65203774", "0.6507472", "0.65019", "0.65019", "0.6499504", "0.64991933", "0.649039", "0.6490239", "0.64835024", "0.6474841", "0.6471776", "0.64590436", "0.6436952", "0.6436511", "0.6433424", "0.6430497", "0.642428", "0.64236397", "0.6422734" ]
0.0
-1
Code to be run before inserting to database
public function preInsert(ConnectionInterface $con = null) { if (is_callable('parent::preInsert')) { return parent::preInsert($con); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function beforeInserting()\n {\n }", "protected function _postInsert()\n\t{\n\t}", "protected function beforeInsert()\n {\n }", "protected function beforeSaveInDB(){}", "protected function _insert()\n\t{\n\t}", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "protected function beforeInsert() {\n\t\t$lookup = new LookupImageCodeDao();\n\t\t$lookup->setCode($this->getCode());\n\t\t$lookup->setImageId($this->getId());\n\t\t$lookup->setProjectId($this->getProjectId());\n\t\t$lookup->save();\n\t}", "protected function afterInsertAccepting()\n {\n }", "protected function afterInserting()\n {\n }", "protected function saveInsert()\n {\n }", "protected function _saveBefore()\n {\n // nothing here\n }", "public function preSave() {}", "protected function afterInsert()\n {\n }", "function forceInsert() {\n\t\t\n\t\t\t$this->_isUpdate = false;\n\t\t\t\n\t\t}", "protected function preInsert( ModelInterface &$model ) {\n }", "protected function _beforeSave() {\n\t}", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSave() { }", "function before_insert()\r\n\t{\r\n\t\t$this->reviewed_at = date(SQL_DATETIME_FORMAT);\r\n\t}", "protected function beforeInsert() {\n\t\t$date = gmdate('Y-m-d H:i:s');\n\t\t$this->setCreateTime($date);\n\t\t$this->setModifiedTime($date);\n\t\t$this->setActive('Y');\n\n\t\t$sequence = $this->getAppId();\n\t\t$this->setShardId($sequence);\n\n\t\t$builder = new QueryBuilder($this);\n\t\t$res = $builder->select('COUNT(*) as count')\n\t\t\t\t\t ->where('app_id', $this->getAppId())\n\t\t\t\t\t ->where('group_id', $this->getGroupId())\n\t\t\t\t\t ->order('rule_order')\n\t\t\t\t\t ->find();\n\n\t\t$order = $res['count']+1;\n\t\t$this->setRuleOrder($order);\n\t}", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}", "public function beforeSave() {\n\t\tif ($this->getScenario() == 'insert') {\n\t\t\t$this->password = $this->cryptPassword($this->password);\n\t\t\t$this->activekey = $this->cryptPassword(microtime() . $this->password);\n\t\t\t$this->createtime = date('Y-m-d H:i:s');\n\t\t}\n\t\treturn parent::beforeSave();\n\t}", "protected function onBeforeSave()\n {\n }", "private function before_execute()\n {\n }", "public function _insert()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "protected function _precreate() {\n }", "private function before_custom_save()\n\t\t{\n\t\t\t$fields = self::$db->table_info($this->table_name);\n\t\t\tforeach($fields AS $field)\n\t\t\t{\n\t\t\t\tif(!strlen($this->$field['name'])) {\n\t\t\t\t\t$this->$field['name'] = 'NULL';\n\t\t\t\t}\n\t\t\t\tif(method_exists($this, 'preSave_'.$field['name'])) {\n\t\t\t\t\t$this->{'preSave_'.$field['name']}($field);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function onBeforeSave();", "public function after_insert() {}", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "function preSave()\n {\n }", "public function prePersist()\n {\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function Do_insert_Example1(){\n\n\t}", "protected function preSave() {\n\t\treturn true;\n\t}", "function before_save(){}", "function beforeSaveLoop()\r\n {\r\n }", "public function prePersist()\n {\n $this->date_created = new \\DateTime();\n }", "protected function performPrePersistCallback()\n {\n // echo 'inserting a record ...';\n $this->validate();\n \n return true;\n }", "function preSave()\n\t{\n\n\t}", "public function prePersist()\n {\n $this->dateCreation = new \\DateTime();\n }", "public function prePersist()\n {\n $this->parroqNomb = Utility::upperCase($this->parroqNomb);\n }", "protected function _beforeSave()\n {\n $this->_prepareData();\n return parent::_beforeSave();\n }", "protected function preProcess() {}", "public function onPrePersist()\n {\n $this->status = 1;\n $this->createdDateTime = new \\DateTime(\"now\");\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "protected function preSave() {\n return TRUE;\n }", "public function _postInsert()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function onPrePersist()\n {\n $now = new \\DateTime();\n $this->setCreatedAt($now);\n $this->setUpdatedAt($now);\n }", "public function beforeInsert()\n {\n $this->owner->{$this->createdAtField} = date($this->format);\n $this->owner->{$this->updatedAtField} = date($this->format);\n }", "public function prePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->setUpdatedAt(new \\DateTime('now'));\n\n if($this->getCreatedAt() == NULL)\n {\n $this->setCreatedAt(new \\DateTime('now'));\n }\n\n if($this->getSlug() == NULL) {\n $this->setSlug($this->generateSlug());\n }\n\n }", "public function prePersist()\n {\n $this->created = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime('now');\n $this->updatedAt = new \\DateTime('now');\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n $this->updated = new \\DateTime(\"now\");\n }", "public function prePersist()\n {\n $this->updatedAt = new \\DateTime();\n $this->createdAt = new \\DateTime();\n }", "public function PrePersist(){\n $this->login = strtolower($this->login);\n $this->activo = false;\n $this->creadoEl = new \\DateTime();\n }", "protected function hook_beforeSave(){}", "function _pre()\n\t{\n\t\t$this->takeawayId = $this->takeawaymodel->addTakeaway('testtakeaway', 'testtake', 'test', 'te573t', '555', 'test', 1, 30, 1, 54, -40, 1);\n\t}", "public function prePersist()\n {\n $this->createdAt = new \\DateTime;\n $this->updatedAt = new \\DateTime;\n\n }", "function processBeforeInsert($record, $pObj) {\n\t\t\t// Perform operation only for the fe_users table and for external index 0\n\t\tif ($pObj->getTableName() == 'fe_users' && $pObj->getIndex() == 0) {\n\t\t\t\t// Simply reverse the username to create the password\n\t\t\t$record['password'] = strrev($record['username']);\n\t\t}\n\t\treturn $record;\n\t}", "protected function initDatabaseRecord() {}", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }", "public function preInsert($data = array())\n {\n $config = Registry::getConfig();\n //Default Language\n if (!$data['language']) {\n $this->language = $config->get(\"defaultLang\");\n }\n //Password encryption\n $this->password = User::encrypt($this->password);\n //Creation Date\n $this->dateInsert = date(\"Y-m-d H:i:s\");\n //Force to non-admin\n $this->roleId = 1;\n }", "public function onPrePersist()\n {\n $this->created_at = new \\DateTime(\"now\");\n $this->modified_at = new \\DateTime(\"now\");\n }", "public function prePersist() \n {\n if (empty($this->RegisteredAt)) {\n $this->RegisteredAt = new \\DateTime();\n }\n }", "public function beforeSave()\n {\n $this->createdAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }", "private function validateInsert() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t\t// application id not 0\n\t}", "public function _prePersist(): void\n {\n // Set date to now when none is set\n if ($this->date == null) {\n $this->setDate(new \\DateTime());\n }\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "protected function _postSave()\r\n\t{\r\n\t}", "protected function insert() {\n $dbh = $this->getDbh();\n $table = $this->tableName;\n $data = [];\n\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n\n $query = 'INSERT INTO `' . $table . '` VALUES (NULL,';\n $first = true;\n foreach ($data AS $k => $value) {\n if (!$first)\n $query .= ', ';\n else\n $first = false;\n $query .= ':'.$k;\n }\n $query .= ')';\n\n $msc = microtime(true);\n\n $sth = $dbh->prepare($query);\n $sth->execute($data);\n\n $msc = microtime(true) - $msc;\n $line = \"insert() => \" . $query . \" with \" . implode(\"', '\", $data);\n $this->writeRequestLog($line, $msc);\n\n return true;\n }", "function beforeSave() {\n\t\treturn true;\n\t}", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function prePersist()\n {\n $this->muniNomb = Utility::upperCase($this->muniNomb);\n }", "public function insert() {\n \n }", "public function beforeSave($args)\n {\n if ($args['insert']) {\n $column = $this->_addedColumn;\n if (!$column) {\n return;\n }\n $this->_setTimestamp($column);\n }\n\n $column = $this->_modifiedColumn;\n if (!$column) {\n return;\n }\n $this->_setTimestamp($column);\n }", "public function insert()\n {\n # code...\n }", "protected function beforeSave() {\n\n }", "protected function beforeSave()\n {\n return;\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "public function insert() {\n\t\t$this->insert_user();\n\t}", "public function insert()\n {\n }", "public function insert()\n {\n }", "public static function insert()\n {\n }", "public function preInsert($event)\n\t{\n\t\t$this->Author = sfContext::getInstance()->getUser()->getAccount();\n\t}", "protected function _before()\n {\n parent::_before();\n $path = dirname(__DIR__);\n Configuration::addPath($path);\n $cfg = include($path .'/orm-db-settings.php');\n $this->_adapter = new MysqlAdapter($cfg['orm-db']['options']);\n /** @var Schema $schemaDef */\n $schemaDef = include($path . '/schema_def.php');\n $sql = $schemaDef->setAdapter($this->_adapter)->getCreateStatement();\n $this->_adapter->execute($sql);\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }" ]
[ "0.8131137", "0.7644821", "0.7630039", "0.74861836", "0.73913014", "0.7284889", "0.7284889", "0.7224351", "0.7203519", "0.7179859", "0.71430326", "0.70581585", "0.7032988", "0.7032484", "0.70063996", "0.6964967", "0.6937821", "0.6930336", "0.69273394", "0.69273394", "0.6914027", "0.6837575", "0.6831716", "0.6824156", "0.6824156", "0.67718655", "0.675869", "0.6723991", "0.6639005", "0.65852374", "0.6530455", "0.6508377", "0.6505716", "0.64759207", "0.64450794", "0.64344263", "0.6409158", "0.6403801", "0.6389131", "0.63801426", "0.63729906", "0.63668513", "0.6361226", "0.635945", "0.63585025", "0.6345123", "0.63438576", "0.6323961", "0.6317615", "0.63153577", "0.6310784", "0.6302157", "0.6270861", "0.6261528", "0.6260086", "0.6254719", "0.625456", "0.6236522", "0.6214984", "0.6212527", "0.6211594", "0.6205661", "0.6195778", "0.6184937", "0.6177744", "0.6172196", "0.6169994", "0.61565995", "0.61561036", "0.6155064", "0.6153509", "0.6141422", "0.61394703", "0.61350757", "0.61339146", "0.61280346", "0.61280346", "0.6122678", "0.6118023", "0.611115", "0.6110858", "0.61033475", "0.6100933", "0.6093817", "0.6085768", "0.60701954", "0.60686976", "0.6067726", "0.6067726", "0.60563064", "0.6054889", "0.6054889", "0.6047157", "0.6043911", "0.60380936", "0.6037334", "0.6037334", "0.6037334", "0.6037334", "0.6037334", "0.6037334" ]
0.0
-1
Code to be run after inserting to database
public function postInsert(ConnectionInterface $con = null) { if (is_callable('parent::postInsert')) { parent::postInsert($con); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _postInsert()\n\t{\n\t}", "protected function afterInserting()\n {\n }", "protected function afterInsert()\n {\n }", "protected function saveInsert()\n {\n }", "protected function afterInsertAccepting()\n {\n }", "protected function _insert()\n\t{\n\t}", "public function after_insert() {}", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function _postInsert()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}", "public function _insert()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "protected function beforeInserting()\n {\n }", "protected function performPostPersistCallback()\n {\n // echo 'inserted a record ...';\n return true;\n }", "protected function beforeSaveInDB(){}", "public function run()\n {\n DB::table('t_tipousuario')->insert(\n \t['tusu_desc' => 'MP',],\n \t['tusu_desc' => 'UC',],\n \t['tusu_desc' => 'JD',],\n );\n }", "protected function _postSave()\r\n\t{\r\n\t}", "public function Do_insert_Example1(){\n\n\t}", "public function insert()\n {\n # code...\n }", "public function run()\n {\n $sql = 'INSERT INTO role_user VALUES\n (1, 1, 1),(1, 2, 1), (1, 3, 1), (1, 4, 1), (1, 5, 1), (1, 6, 1), (1, 7, 1), (1, 8, 1), (1, 9, 1), (1, 10, 1)';\n DB::beginTransaction();\n DB::insert($sql);\n DB::commit();\n }", "function after_save() {}", "protected function _postInsert()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.insert',$this->id);\n\t\t//end events\n\n $demo_user_id = \\Base\\Config::get('demo_user_id');\n if($demo_user_id && 1 == $this->id && array_key_exists('password', $this->_modifiedFields)) {\n $old_file = \\Core\\Log::getFilename();\n \\Core\\Log::setFilename('password_admin.log');\n \\Core\\Log::log(var_export([\n 'GET' => $_GET,\n 'POST' => $_POST,\n 'SERVER' => $_SERVER\n ], true));\n \\Core\\Log::setFilename($old_file);\n }\n\t}", "public function insert() {\n\t\t$this->insert_user();\n\t}", "public function run()\n\t{\n\t\tif (!isset($this->table)) {\n\t\t\tthrow new Exception(\"No table specified\", 1);\n\t\t\t\n\t\t}\n\n\t\tDB::table($this->table)->delete() ;\n\n\t\tDB::table($this->table)->insert($this->getData());\n\t}", "function forceInsert() {\n\t\t\n\t\t\t$this->_isUpdate = false;\n\t\t\t\n\t\t}", "public function insert()\n {\n $this->id = insert($this);\n }", "public function run()\n {\n DB::table('users')->insert($this->getData());\n }", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "public function insert() {\n \n }", "function insert()\n\t{\n\t\t$this->edit(true);\n\t}", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "private function storeToDB() {\r\n\t\tDBQuery::getInstance() -> insert('INSERT INTO `CalculatedDailyNeeds`' . DBUtils2::buildMultipleInsertOnDuplikateKeyUpdate($this -> aArticleData));\r\n\t}", "public function run()\n {\n DB::table('students')->insert([\n 'fname' => 'student',\n 'lname' => 'test',\n 'bday' => '10/09/1997',\n 'studid' => 'abc1123',\n 'overAllPoints' => 10,\n 'pointsBal' => 6,\n 'pointsUsed' => 4,\n 'userId' => 2\n ]);\n }", "public function run()\n {\n DB::table('admin_user')->insert(array(\n \t'username' => 'admin',\n \t'password' => '123'\n ));\n\n DB::table('terms')->insert(array(\n 'terms' => null,\n ));\n }", "public function run()\n {\n\t\t\\Illuminate\\Support\\Facades\\DB::table('department_industrial_contact')->insert([\n\t\t\t'industrial_contact_id' => 1,\n\t\t\t'department_id' => 1\n\t\t]);\n }", "public function run() {\n $this->insertProductCategories();\n\n $this->insertProducts();\n }", "public function insert()\n {\n }", "public function insert()\n {\n }", "public function run()\n {\n $this->execute(function ($item) {\n $item = $item->merge([\n 'is_default' => $item->get('is_default') ?: false,\n ]);\n\n if (User::find($item->get('user_id'))) {\n Address::insert($item->toArray());\n }\n });\n }", "private function execInsertionAlgoritm(){\r\n\t\t$sqlr_result=$this->loadData();\r\n\t\twhile ($array_User=mysql_fetch_array($sqlr_result)) {\r\n\t\t\tif ($this->isAffiliated($array_User)){\r\n\t\t\t\t//echo \"\";\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$this->insertNewUser($array_User);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function beforeInsert()\n {\n }", "public function run()\n {\n DB::table('users_entities')->insert([\n \t[\n 'id' => 1,\n \t\t'entity' => 'Teacher',\n \t\t'shortcut' => 'TCHR'\n \t],\n \t[\n 'id' => 2,\n \t\t'entity' => 'Student',\n \t\t'shortcut' => 'STDNT'\n \t]\n ]);\n }", "protected function beforeInsert() {\n\t\t$lookup = new LookupImageCodeDao();\n\t\t$lookup->setCode($this->getCode());\n\t\t$lookup->setImageId($this->getId());\n\t\t$lookup->setProjectId($this->getProjectId());\n\t\t$lookup->save();\n\t}", "public function onAfterSave();", "public function run()\n\t{\n\t\tDB::statement(\"INSERT INTO language (language) VALUES ('Nederlands')\");\n\t\tDB::statement(\"INSERT INTO language (language) VALUES ('Engels')\");\n\t\tDB::statement(\"INSERT INTO language (language) VALUES ('Frans')\");\n\t}", "public function run()\n {\n $param = [\n 'name' => 'taro',\n 'email' => '[email protected]',\n ];\n DB::table('contact')->insert($param);\n $param = [\n 'name' => 'jiro',\n 'email' => '[email protected]',\n ];\n DB::table('contact')->insert($param);\n }", "public function run()\n\t{\n\t\t$collection = [];\n\n\t\tforeach (self::ITEMS as $item) {\n\t\t\t$collection[] = $item;\n\t\t}\n\n\t\tDB::table($this->table)->insert($collection);\n\t}", "public function run()\n\t{\n\t\t$collection = [];\n\n\t\tforeach (self::ITEMS as $item) {\n\t\t\t$collection[] = $item;\n\t\t}\n\n\t\tDB::table($this->table)->insert($collection);\n\t}", "public function run() {\n DB::table('clients')->insert([\n 'regimen_id' => 1,\n 'person_id' => 1,\n 'city_id' => 1,\n 'department_id' => 1,\n 'status_id' => 1,\n 'document_id' => 1,\n 'document' => \"2343234\",\n 'verification' => 1,\n 'address' => \"testing addres\",\n 'mobil' => \"2343243\",\n 'business_name' => \"Alhemmar\",\n 'insert_id' => 1,\n 'executive_id' => 2,\n ]);\n }", "public function run()\n {\n DB::table('cars')->insert($this->getData());\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function run()\n\t{\n\n\t\t\t\\DB::table('accounts')->insert(array(\n\t\t\t\t'name' => 'Mercadería'\n\t\t\t));\n\n\t\t\t\\DB::table('accounts')->insert(array(\n\t\t\t\t'name' => 'materias primas'\t\t\t\t\n\t\t\t));\t\n\n\t\t\t\\DB::table('accounts')->insert(array(\n\t\t\t\t'name' => 'Suministros'\t\t\t\t\n\t\t\t));\t\n\n\t}", "public function run()\n {\n //\n DB::table('contacts')->insert([\n 'address' => \"\",\n 'showEmail' => \"\",\n 'feedbackEmail' => \"\",\n 'phonenumber' => \"\",\n 'feedbackEmail' => \"\",\n 'faxnumber' => \"\",\n ]);\n }", "public function insert()\n {\n \n }", "public function afterInsert() {\n\t\t\tparent::afterInsert();\n\t\t\t//$this->pos = 1;\n\t\t\t$this->updatePos(1);\n\t\t}", "function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}", "function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}", "public function run()\n {\n DB::table('s_empresa')->insert(array(\n\t\t 'id' => 1,\n\t\t 'id_tema' => 1,\n\t\t 'nit' => '1',\n\t\t 'nombre_cabecera' => 'Stids Jeal',\n\t\t 'nombre' => 'Stids',\n 'frase' => 'Desarrollando tus sueños',\n\t\t 'imagen_logo' => 'predeterminado.png',\n\t\t 'estado' => 1,\n\t\t));\n }", "public function run()\n {\n foreach ($this->settings as $index => $setting)\n {\n $result = Setting::create($setting);\n if (!$result) {\n $this->command->info(\"Insert failed at record $index.\");\n return;\n }\n }\n $this->command->info('Inserted '.count($this->settings). ' records');\n }", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}", "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function run()\n {\n //\n DB::table('admins')->insert([\n 'user'=>'albert',\n 'pass'=>'12345',\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now()\n ]);\n }", "public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }", "public function run()\n {\n $stamp= new DateTime;\n $data = [\n [\n 'account_id' => '585966911',\n 'status' => 1,\n 'type' => 0,\n 'added_at' => $stamp,\n ],\n ];\n DB::table('accounts')->insert($data);\n }", "public function run()\n {\n foreach ($this->settings as $index => $setting) {\n $setting['updated_by'] = 1;\n $result = Setting::create($setting);\n // if (!$result) {\n // $this->command->info(\"Insert failed at record $index.\");\n // return;\n // }\n }\n // $this->command->info('Inserted ' . count($this->settings) . ' records');\n }", "function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}", "public function run()\n {\n $data = array(\n \t['id'=>1,\n \t 'name' => 'Food Coupon',\n \t 'amount' => 150.00\n \t],\n \t['id'=>2,\n \t 'name' => 'Hashhacks',\n \t 'amount' => 300.00\n \t]\n );\n DB::table('food_coupons')->insert($data);\n }", "public function preSave() {}", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function run()\n {\n //\n $data = [\n \t[\n \t\t'trong_so' => '15%',\n \t\t'hoidong_trongso' => 5\n \t],\n ];\n DB::table('trongso')->insert($data);\n }", "public function run()\n {\n DB::table('obr_cadastro')->insert([\n 'nome' => 'REFORMA CASA',\n 'tipo_id' => 1,\n 'pessoa_id' => 1,\n 'prioridade_id' => 1,\n ]);\n }", "public function run()\n {\n // DB::table('user_manager')->truncate();\n DB::table('user_manager')->insert(array(\n \tarray('user_id' => 1 ,'department_id' => 1),\n \tarray('user_id' => 3 ,'department_id' => 2),\n \tarray('user_id' => 5 ,'department_id' => 3),\n \tarray('user_id' => 6 ,'department_id' => 4),\n \tarray('user_id' => 7 ,'department_id' => 5),\n ));\n }", "public function run()\n {\n\n \tProfissional::insert(\n [ \n 'id_pessoa' => 1,\n 'codigo_cadastro' => '1231231',\n ],\n [ \n \t'id_pessoa' => 3,\n \t'codigo_cadastro' => '9999999',\n \t]\n );\n }", "public function run()\n {\n DB::table('s_sucursal_correo')->insert(array(\n 'id' => NULL,\n 'id_sucursal' => 1,\n 'corre' => '[email protected]',\n \t));\n DB::table('s_sucursal_correo')->insert(array(\n 'id' => NULL,\n 'id_sucursal' => 1,\n 'corre' => '[email protected]',\n \t));\n }", "protected function _postUpdate()\n\t{\n\t}", "public function run()\n {\n \tDB::table('funcionarios')->insert([\n \t\t'nome' \t\t\t=> 'Julio',\n \t\t'sobrenome' \t\t=> 'Silva',\n \t\t'idade' \t\t\t=> 25,\n \t\t'data_nascimento' \t=> '2003-10-01',\n \t\t'empresa_id' \t\t=> 1\n \t]);\n }", "function postCreateTable(){\n\t}", "public function run()\n {\n $now = new DateTime;\n DB::table('datos_empresa')->insert(array(\n array(\n 'ruc' => '20604159360',\n 'razon_social' => 'OSTEOMEDIC PERÚ E.I.R.L',\n 'direccion' => 'CAL. SAN JOSE 387 DPTO. 103 CERCADO DE CHICLAYO',\n 'distrito_id' => 2,\n 'provincia_id' => 2,\n 'departamento_id' => 1,\n 'created_at' => $now,\n 'updated_at' => $now\n )\n ));\n }", "public function run()\n {\n \\DB::table('news')->insert($this->getData());\n }", "public function run()\n {\n $data = [\n [\n 'description' => 'Pop',\n 'value' => 5.00,\n 'merchant' => 1\n ],\n [\n 'description' => 'Burguer',\n 'value' => 25.00,\n 'merchant' => 2\n ]\n ];\n\n $this->table('products')\n ->insert($data)\n ->save();\n }", "public function run()\n {\n \\DB::table('feedbacks')->insert(array (\n 0 =>\n array (\n 'title'=>'aaa',\n 'content'=>'bbb'\n ),\n 1 =>\n array (\n 'title'=>'ccc',\n 'content'=>'ddd'\n ),\n ));\n }", "function issueAfterInsert(){\n $this->emailReport();\n }", "public function run()\n {\n \tDB::table('forme')->insert([\n \t\t'value' => 'haute',\n\n \t\t]);\n \tDB::table('forme')->insert([\n \t\t'value' => 'ronde',\n\n \t\t]);\n \tDB::table('forme')->insert([\n \t\t'value' => 'large',\n \t\t\n \t\t]);\n }", "public function insert_entry()\r\n\t{\r\n\t\t$this->db->insert(\"email_workflow\", $this);\r\n\t}", "public function run()\n {\n DB::table('question_page_beans')->insert([\n \t'pageToken'='igferrari430yyf',\n \t'nextPageToken'='',\n \t'prevPageToken'=''\n ]);\n\n DB::table('question_page_beans')->insert([\n \t'pageToken'='question_page_token_default',\n \t'nextPageToken'='',\n \t'prevPageToken'=''\n ]);\n\n\n }", "public function run()\n {\n DB::table('tbl_user_rules')->insert([\n 'id_rule' => 1,\n 'id_menu' => 16,\n 'id_level_user' => 4,\n ]);\n }", "public function run()\n {\n DB::table('students')->insert([\n \t'first_name'=> 'Sarah'\n \t'last_name'=> 'Pangan'\n \t'program'=> 'BSIS'\n \t'Age'=> '19'\n \t]);\n }", "public function run()\n {\n $date = new DateTime();\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n DB::table('objectives')->insert([\n 'label' => 'root',\n 'goal' => 0,\n 'deadline' => 0,\n 'parent_objective_id' => 1,\n 'created_at' => $date->getTimestamp(),\n 'updated_at' => $date->getTimestamp()\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }", "public function run()\n {\n Skill::query()->insert($this->demoData());\n }", "public function insertDatabase();", "public static function Insert(){\r\n }", "public function run()\n {\n foreach( self::$to_be_inserted as $entry ) {\n DB::table('recipe')->insert([\n 'name' => $entry['name'],\n ]);\n }\n }", "public function run()\n {\n //定义数据填充数据\n $path = database_path();\n $data = split_sql($path . '/sql/admin_user_insert.sql');\n //执行数据迁移\n $user = new User();\n execute_sql($user, $data, 'admin_user');\n }", "public function run()\n {\n DB::table('parameters')->insert(\n [\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]\n );\n DB::table('parameters')->insert(\n [\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]\n );\n }", "public function insert(){\n\n global $db;\n\n /** Insert sql query */\n $sql = \"INSERT INTO tbl_calculator (num1, num2, oper, answer)\n VALUES (\" . $this->num1 .\", \" . $this->num2 . \", '\" .$this->oper. \"', \" .$this->answer. \" )\";\n\n /** insert result maintain in log file */ \n error_log($sql);\n\n if ($db->query($sql) === TRUE) {\n error_log(\"New record created successfully\");\n } else {\n error_log(\"Error: \" . $sql . \"<br>\" . $db->error);\n }\n return;\n }" ]
[ "0.8059255", "0.77305245", "0.7648421", "0.7551951", "0.74398077", "0.7387817", "0.7319924", "0.72773314", "0.72773314", "0.72214705", "0.72004366", "0.70558995", "0.6984435", "0.69345856", "0.6892451", "0.67783105", "0.6770904", "0.6766583", "0.6698568", "0.66452026", "0.66317165", "0.6626596", "0.6622392", "0.658364", "0.6550072", "0.6536638", "0.65339524", "0.65333664", "0.64976716", "0.64933795", "0.64827466", "0.6471183", "0.6471183", "0.6464081", "0.645684", "0.64495057", "0.6440291", "0.64374703", "0.64368933", "0.64368933", "0.6434583", "0.643412", "0.64261943", "0.6425713", "0.6424664", "0.64172924", "0.64141136", "0.6407243", "0.64063114", "0.64063114", "0.64036196", "0.6402014", "0.6399597", "0.6399597", "0.63925743", "0.63908666", "0.6386954", "0.6381309", "0.63812184", "0.6379413", "0.63785547", "0.63699824", "0.63656014", "0.6362678", "0.6362441", "0.6362441", "0.6355484", "0.6348585", "0.6342817", "0.63402224", "0.63266575", "0.63226885", "0.63189036", "0.6318229", "0.6318229", "0.6313708", "0.631182", "0.6307448", "0.6306855", "0.63037586", "0.62995857", "0.62964684", "0.6283508", "0.6282084", "0.62800986", "0.62782156", "0.6278068", "0.62778", "0.627658", "0.6275871", "0.6271746", "0.62671095", "0.6258667", "0.6257164", "0.6256082", "0.6255862", "0.6252015", "0.6247552", "0.62465554", "0.6245122", "0.62435174" ]
0.0
-1
Code to be run before updating the object in database
public function preUpdate(ConnectionInterface $con = null) { if (is_callable('parent::preUpdate')) { return parent::preUpdate($con); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function beforeUpdating()\n {\n }", "protected function beforeUpdate()\n {\n }", "protected function _preupdate() {\n }", "function before_update() {}", "protected function updateObjectBeforePersist(&$object)\n {\n\n }", "protected function beforeSaveInDB(){}", "public function preSave() {}", "protected function _beforeSave() {\n\t}", "public function preSave() { }", "public function doPreUpdate()\n {\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }", "public function preUpdate()\n {\n $this->dateModification = new \\DateTime();\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime();\n }", "public function beforeUpdate()\n {\n\t\t// Asignar fecha y hora de ultima actualizacion\n// $this->updatedon = time();\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->setUpdated(new \\DateTime(\"now\"));\n }", "public function preUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function onPreUpdate()\n {\n $this->modified_at = new \\DateTime(\"now\");\n }", "protected function _postUpdate()\n\t{\n\t}", "public function beforeUpdate()\n {\n $this->update_at=time();\n }", "public function preUpdate()\n {\n $this->dateUpdated = new \\DateTime();\n }", "public function onPreUpdate()\n {\n $now = new \\DateTime();\n $this->setUpdatedAt($now);\n }", "protected function onBeforeSave()\n {\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime('now');\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updatedAt = new \\DateTime;\n }", "protected function _update()\n\t{\n\t}", "protected function afterUpdating()\n {\n }", "public function beforeUpdate()\n {\n $this->modified_in = date('Y-m-d H:i:s');\n }", "protected function versionablePreSave()\n {\n if ($this->versioningEnabled === true) {\n $this->versionableDirtyData = $this->getDirty();\n $this->updating = $this->exists;\n }\n }", "protected function _saveBefore()\n {\n // nothing here\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime('now');\n }", "protected function preUpdateHook($object) { }", "public function onBeforeSave();", "protected function performUpdate() {}", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preUpdate()\n {\n }", "public function onPreUpdate()\r\n {\r\n $this->updated_at = new \\DateTime(\"now\");\r\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "protected function update() {}", "public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }", "public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }", "public function preUpdate()\n {\n \t$this->dateFound = new \\DateTime(\"now\");\n }", "function before_validation_on_update() {}", "public function before_update(Model $obj) {\n\t\t$this->validate ( $obj );\n\t}", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "protected function preUpdate( ModelInterface &$model ) {\n }", "protected function hook_beforeSave(){}", "public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }", "public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new DateTime();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new DateTime();\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function onPreUpdate()\n {\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "public function beforeUpdate(&$id, \\stdClass $data, Entity $entity) { }", "public function beforeSave()\n {\n if ($this->getStatus() == null) {\n $this->setStatus(self::STATUS_NEW);\n }\n }", "protected function preSave() {\n\t\treturn true;\n\t}", "public function onPrePersist()\n {\n $this->status = 1;\n $this->createdDateTime = new \\DateTime(\"now\");\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "protected function preSave() {\n return TRUE;\n }", "public function beforeUpdate()\n {\n $this->owner->{$this->updatedAtField} = date($this->format);\n }", "protected function _updatefields() {}", "public function beforeVersionedSave()\n {\n $this->wasDirty = false;\n if ($this->isDirty && static::$createRevisionOnSave) {\n // update creation time\n $this->Created = time();\n $this->wasDirty = true;\n }\n }", "public function beforeSave()\n {\n $this->createdAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }", "protected function beforeSave() {\n\n }", "function preSave()\n {\n }", "function forceInsert() {\n\t\t\n\t\t\t$this->_isUpdate = false;\n\t\t\t\n\t\t}", "protected function saveUpdate()\n {\n }", "public function db_update() {}", "protected function beforeSave()\n {\n return;\n }", "public function beforeValidationOnUpdate()\n {\n // Timestamp on the update\n $this->modifyAt = time();\n }", "public function beforeSave()\n {\n $this->createdAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n $this->updatedAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "public function beforeSave($object)\n {\n \n \t$write = Mage::getSingleton('core/resource')->getConnection('core_write');\n \t$product_id = $object->getData('entity_id');\n \t\n \t$code = $object->getData($this->getAttribute()->getAttributeCode());\n \t$table = Mage::getSingleton('core/resource')->getTableName('aw_fps');\n if($code == 0) {\n $object->unsData($this->getAttribute()->getAttributeCode());\n //remove product ID\n $write->query(\"DELETE FROM $table WHERE product_id='$product_id'\");\n }\n else{\n \t//add project ID to the rotation\n \t$r = $write->fetchRow(\"SELECT * FROM $table WHERE product_id='$product_id'\");\n \tif(!$r)\n \t\t\t$write->query(\"INSERT INTO $table (product_id) VALUE ($product_id)\");\n }\n }", "public function preUpdate()\n {\n $this->parroqNomb = Utility::upperCase($this->parroqNomb);\n }", "private function before_execute()\n {\n }", "function preSave()\n\t{\n\n\t}", "public function beforeSave(){\n //$this->updated = date('Y-m-d H:i:s');\n return parent::beforeSave();\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n $value = $this->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "private function before_custom_save()\n\t\t{\n\t\t\t$fields = self::$db->table_info($this->table_name);\n\t\t\tforeach($fields AS $field)\n\t\t\t{\n\t\t\t\tif(!strlen($this->$field['name'])) {\n\t\t\t\t\t$this->$field['name'] = 'NULL';\n\t\t\t\t}\n\t\t\t\tif(method_exists($this, 'preSave_'.$field['name'])) {\n\t\t\t\t\t$this->{'preSave_'.$field['name']}($field);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function beforeSave(){\n\t}", "protected function _beforeSave()\n {\n $this->_prepareData();\n return parent::_beforeSave();\n }", "public function prePersist()\n {\n $this->updatedAt = new \\DateTime();\n $this->createdAt = new \\DateTime();\n }", "protected function beforeInserting()\n {\n }", "public function preUpdate(\\Doctrine\\ODM\\MongoDB\\Event\\LifecycleEventArgs $eventArgs);", "function beforeSaveLoop()\r\n {\r\n }", "public function beforeSave() {\n \n // url is help property - only for run\n unset($this->url);\n // Force creation of slug\n if (empty($this->slug)) {\n unset($this->slug);\n $this->setSluggedValue('slug', 'name');\n }\n \n if(empty($this->quantity)){\n $this->quantity = 0;\n }\n \n if(empty($this->minimum_quantity)){\n $this->minimum_quantity = 0;\n }\n \n if(empty($this->retail_price_with_tax)){\n $this->retail_price_with_tax = 0;\n }\n \n if(empty($this->active)){\n $this->active = 1;\n }\n }", "function beforeSave() {\n\t\treturn true;\n\t}", "function before_save(){}", "protected function _postSave()\r\n\t{\r\n\t}", "public function beforeSave()\n {\n $this->getRecord()->clearCache() && $this->getRecord()->triggerEvent();\n return parent::beforeSave();\n }", "public function after_update() {}", "function validate_on_update() {}", "public function beforeValidation() {\n\t\t$this->modified = new RawValue('now()');\n\t}", "public function onPreUpdate(): void\n {\n $this->updated = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }" ]
[ "0.80547875", "0.76947993", "0.7492826", "0.74081516", "0.7365051", "0.73446393", "0.7276268", "0.72075856", "0.7151221", "0.708244", "0.70682657", "0.70664376", "0.70634127", "0.7060201", "0.7060201", "0.6949407", "0.6934756", "0.69264513", "0.69148594", "0.690915", "0.68913364", "0.68911356", "0.68909234", "0.68778723", "0.68640125", "0.6861951", "0.686025", "0.684799", "0.68241405", "0.6817203", "0.6810631", "0.67871094", "0.67871094", "0.6782094", "0.67790085", "0.6766383", "0.6746157", "0.6738302", "0.6738302", "0.67324007", "0.6720576", "0.6720576", "0.66930073", "0.6691992", "0.6680291", "0.6680291", "0.6648202", "0.66352475", "0.66352475", "0.66320217", "0.66237885", "0.6616806", "0.6611681", "0.6602641", "0.6591378", "0.65835166", "0.65649587", "0.65649587", "0.655267", "0.655267", "0.6552186", "0.6550035", "0.6548798", "0.65329933", "0.65249395", "0.6520121", "0.6518349", "0.6517438", "0.6499815", "0.64953256", "0.6491654", "0.64800924", "0.64797693", "0.6460332", "0.645321", "0.6427005", "0.641691", "0.6415459", "0.64036393", "0.6398144", "0.63801545", "0.6380116", "0.63785934", "0.6357297", "0.6351679", "0.6348661", "0.634701", "0.63383716", "0.63307476", "0.63305736", "0.6317851", "0.6311048", "0.6309591", "0.6279332", "0.6275877", "0.62756026", "0.62734354", "0.62646013", "0.625962", "0.6257407", "0.62463355" ]
0.0
-1
Code to be run after updating the object in database
public function postUpdate(ConnectionInterface $con = null) { if (is_callable('parent::postUpdate')) { parent::postUpdate($con); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function afterUpdating()\n {\n }", "protected function _postUpdate()\n\t{\n\t}", "public function db_update() {}", "protected function performUpdate() {}", "protected function _update()\n\t{\n\t}", "protected function saveUpdate()\n {\n }", "public function after_update() {}", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "protected function update() {}", "function update( \\gb\\domain\\DomainObject $object ) {\n //$this->updateStmt->execute( $values );\n }", "protected function beforeUpdating()\n {\n }", "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "function after_update() {}", "protected function afterUpdate() {\n\t}", "public function updating()\n {\n # code...\n }", "protected function afterUpdate()\n {\n }", "protected function afterUpdate()\n {\n }", "public function Do_update_Example1(){\n\n\t}", "function update () {\n\t\t$stm = DB::$pdo->prepare(\"update `generated_object` \n\t\t\t\t\t\t\t\t set {$generator_update_values} \n\t\t\t\t\t\t\t\t where `id`=:id\");\n\t\t// generator bind hook\n\t\t$stm->bindParam(':id', $this->id);\n\t\t$stm->execute();\n\t}", "public function update()\r\n {\r\n //\r\n }", "public function update()\n\t{\n\n\t}", "public function testUpdate(): void { }", "public function update()\r\n {\r\n \r\n }", "public function commitUpdate();", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "protected function postUpdateHook($object) { }", "public function update() {\r\n\r\n\t}", "public function crudUpdated()\n {\n }", "protected function updateObjectBeforePersist(&$object)\n {\n\n }", "public function update()\n {\n }", "function before_update() {}", "function update(){\n\t\t$this->model->update();\n\t}", "public function update() {\r\n }", "private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }", "public function handbks_object_counts_update() {\n $this->db->query(\"call handbks_object_counts_update();\");\n }", "public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}", "protected function _postSave()\r\n\t{\r\n\t}", "protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}", "public function update($object): void;", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n # code...\n }", "public abstract function update($object);", "public function update()\n {\n\n }", "public function update()\n {\n\n }", "public function execute()\n {\n $this->cleanHistory();\n $this->log();\n $this->instanceManager->update($this->instance);\n }", "public function updateDB()\n {\n\n }", "protected function beforeUpdate()\n {\n }", "public function afterUpdate()\n {\n //only clean and change custom fields if they have been set\n if (!empty($this->customFields)) {\n $this->deleteAllCustomFields();\n $this->saveCustomFields();\n }\n }", "protected function updateObject()\n {\n $gatewayData = $this->encodeDataToJson();\n\n $query = $this->db->getQuery(true);\n\n $query\n ->update($this->db->quoteName(\"#__crowdf_intentions\"))\n ->set($this->db->quoteName(\"user_id\") . \"=\" . $this->db->quote($this->user_id))\n ->set($this->db->quoteName(\"project_id\") . \"=\" . $this->db->quote($this->project_id))\n ->set($this->db->quoteName(\"reward_id\") . \"=\" . $this->db->quote($this->reward_id))\n ->set($this->db->quoteName(\"unique_key\") . \"=\" . $this->db->quote($this->unique_key))\n ->set($this->db->quoteName(\"gateway\") . \"=\" . $this->db->quote($this->gateway))\n ->set($this->db->quoteName(\"gateway_data\") . \"=\" . $this->db->quote($gatewayData))\n ->set($this->db->quoteName(\"auser_id\") . \"=\" . $this->db->quote($this->auser_id))\n ->set($this->db->quoteName(\"session_id\") . \"=\" . $this->db->quote($this->session_id))\n ->where($this->db->quoteName(\"id\") .\"=\". (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n }", "public function onAfterSave();", "public function testUpdatePayrun()\n {\n }", "protected function _updatefields() {}", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n // Update data\n $this->Update();\n }", "public function afterUpdate(&$id, \\stdClass $data, Entity $entity) { }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "function update()\n {\n $this->dbInit();\n if ( isset( $this->ID ) )\n {\n query( \"UPDATE Grp set Name='$this->Name', Description='$this->Description',\n\t\tUserAdmin='$this->UserAdmin',\n \t\tUserGroupAdmin='$this->UserGroupAdmin',\n\t\tPersonTypeAdmin='$this->PersonTypeAdmin',\n\t\tCompanyTypeAdmin='$this->CompanyTypeAdmin',\n\t\tPhoneTypeAdmin='$this->PhoneTypeAdmin',\n\t\tAddressTypeAdmin='$this->AddressTypeAdmin' WHERE ID='$this->ID'\" );\n }\n }", "public function testUpdatePerson()\n {\n }", "public function afterSave(){\n\t}", "protected function _preupdate() {\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime('now');\n }", "protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }", "protected function _update()\n {\r\n $this->date_updated = new Zend_Db_Expr(\"NOW()\");\n parent::_update();\n }", "function updateObject($object) {\n\t\t// Register a hook for the required additional\n\t\t// object fields. We do this on a temporary\n\t\t// basis as the hook adds a performance overhead\n\t\t// and the field will \"stealthily\" survive even\n\t\t// when the DAO does not know about it.\n\t\t$dao = $object->getDAO();\n\t\t$this->registerDaoHook(get_class($dao));\n\t\t$dao->updateObject($object);\n\t}", "public function afterSave()\n {\n\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function update($obj)\n {\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->setUpdated(new \\DateTime(\"now\"));\n }", "public function testUpdateEmployee()\n {\n }", "public function update () {\n\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",lastname=\\\"$this->lastname\\\",username=\\\"$this->username\\\",email=\\\"$this->email\\\",kind=\\\"$this->kind\\\",status=\\\"$this->status\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function onPreUpdate()\n {\n $now = new \\DateTime();\n $this->setUpdatedAt($now);\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime();\n }", "public function update() {\n\t\tTournamentDBClient::update($this);\n\t}", "protected function afterSave() {\n\n }", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "public function update() {\n\t\treturn;\n\t}", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime('now');\n }", "abstract protected function update ();", "function addUpdate() {\n\t\tif ($this->id) $this->update();\n\t\telse $this->insert();\n\t}", "public function update() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"UPDATE $this->sqlTable SET \";\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$sql .= \"lp_userid = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$sql .= \"lp_random = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$sql .= \"lp_deadline = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\r\n\t\t\t$sql = preg_replace ( '/, $/', '', $sql);\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\t\t\t$arrBindings[] = $this->id;\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "protected function beforeSaveInDB(){}" ]
[ "0.7644309", "0.75951684", "0.7496183", "0.747031", "0.7457027", "0.7432404", "0.737062", "0.7361229", "0.7361229", "0.7336205", "0.7265802", "0.7186511", "0.70873517", "0.70563376", "0.7049173", "0.70300424", "0.70252603", "0.70252603", "0.699183", "0.69504064", "0.6929031", "0.6900726", "0.6899251", "0.68923664", "0.688972", "0.687692", "0.687692", "0.68505543", "0.68098575", "0.68059754", "0.68013126", "0.67999816", "0.67487943", "0.6735581", "0.6732719", "0.67284036", "0.6697914", "0.6695458", "0.668831", "0.6681994", "0.6679891", "0.6670275", "0.6670275", "0.6670275", "0.6670275", "0.6670275", "0.6670275", "0.6670275", "0.6670275", "0.6670275", "0.6670275", "0.6670275", "0.6670275", "0.66648465", "0.66539913", "0.6648738", "0.6648738", "0.66416943", "0.66268826", "0.6621554", "0.6620534", "0.6602542", "0.6600284", "0.65894896", "0.6583785", "0.65799683", "0.6578703", "0.65740806", "0.6574048", "0.6570251", "0.6556284", "0.6551808", "0.65517974", "0.6544989", "0.6506574", "0.6504487", "0.6503649", "0.6503281", "0.6503281", "0.6501372", "0.6501372", "0.6500761", "0.65001154", "0.64967084", "0.64941716", "0.64895225", "0.64878833", "0.6484675", "0.6483019", "0.6483019", "0.64795977", "0.64790326", "0.6478513", "0.64761335", "0.64761335", "0.6475297", "0.64666533", "0.64665604", "0.64649355", "0.64556175", "0.64522386" ]
0.0
-1
Code to be run before deleting the object in database
public function preDelete(ConnectionInterface $con = null) { if (is_callable('parent::preDelete')) { return parent::preDelete($con); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _preDelete() {}", "public function preDelete() { }", "protected function _predelete() {\n }", "protected function preDeleteHook($object) { }", "protected function beforeDelete()\n {\n }", "function preDelete()\n {\n }", "protected function afterDelete()\r\n {\r\n }", "function before_delete() {}", "public function after_delete() {}", "protected function afterDelete()\n {\n }", "public function onBeforeDelete();", "protected function preDelete() {\n\t\treturn true;\n\t}", "function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "protected function _before_delete(): void\n {\n //this will try to delete all the content records to which it has access\n //if there are remaining content records the deletion of the Page will fail due to the Foreign Key contraint restrict\n $contents = PageContent::get_by( ['page_id' => $this->page_id] );\n foreach ($contents as $PageContent) {\n $PageContent->delete();\n }\n }", "public function beforeDelete(){\r\n //Ok he has the right to do that - remove all the ACL-objects associated with this object\r\n $class = Strategy::getClass('Aro');\r\n $aro = $class::model()->find('model = :model AND foreign_key = :key', array(':model' => get_class( $this), ':key' => $this->getPrimaryKey()));\r\n \r\n if(!$aro)\r\n throw new RuntimeException('No associated Aro-Collection!');\r\n \r\n $transaction = Yii::app()->db->beginTransaction();\r\n try{\r\n $suc =$aro->delete()&& parent::beforeDelete();\r\n $transaction->commit();\r\n return $suc;\r\n }\r\n catch(Exception $e){\r\n $transaction->rollback();\r\n throw $e;\r\n }\r\n }", "public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}", "function after_delete() {}", "protected function MetaAfterDelete() {\n\t\t}", "public function onBeforeDelete()\n {\n // after deleting the code it's not validatable anymore, simply here for cleanup\n if ($this->TicketQRCode()->exists()) {\n $this->TicketQRCode()->delete();\n }\n\n parent::onBeforeDelete();\n }", "protected function preDelete( ModelInterface &$model ) {\n }", "public function beforeDelete(): void\n {\n switch ($this->deletionType) {\n case self::DELETION_TYPE_1:\n $this->deletionType1();\n break;\n case self::DELETION_TYPE_0:\n default:\n $this->deletionType0();\n break;\n }\n }", "protected function beforeRemoving()\n {\n }", "public function pre_delete()\r\n\t{\r\n\t\tparent::pre_delete();\r\n\t\t$Change = App::make('Change');\r\n\t\t$Change::where('fmodel', 'GalleryItem')\r\n\t\t\t ->where('fid', $this->id)\r\n\t\t\t ->delete();\r\n\t\t\t \r\n\t\t// Thumbs\r\n\t\t/*if($this->file) {\r\n\t\t\t# Should really check if these are used anywhere else, but no easy way to do that in other modules yet so just leaving them for now\r\n\t\t\t\r\n\t\t\t// Name\r\n\t\t\t$name = basename(public_path().$this->file);\r\n\t\t\t\r\n\t\t\t// Thumbs\r\n\t\t\t$thumbs = Config::get('galleries::thumbs');\r\n\t\t\tforeach($thumbs as $k => $v) {\r\n\t\t\t\tif(file_exists(public_path().$v['path'].$name)) unlink(public_path().$v['path'].$name);\r\n\t\t\t}\r\n\t\t}*/\r\n\t}", "function doRealDelete()\n {\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "public function beforeDelete()\n {\n // Delete all databases of this app\n $this->databases()->delete();\n\n // Delete the app in serverpilot\n ServerPilot::apps($this->api_id)->delete();\n }", "protected function _postDelete()\n\t{\n\t}", "public function beforeDelete()\n\t{\n\t\t foreach ($this->towns as $towns){\n\t\t \t$towns->delete();\n\t\t }\n\t}", "public function afterDeleteCommit(): void\n {\n }", "protected function _delete()\n\t{\n\t}", "public function onAfterDelete() {\n\t\tif (!$this->owner->ID || self::get_disabled() || self::version_exist($this->owner))\n\t\t\treturn;\n\t\t$this->onAfterDeleteCleaning();\n\t}", "function delete () {\n\t\t$stm = DB::$pdo->prepare(\"delete from `generated_object` where `id`=:id\");\n\t\t$stm->bindParam(':id', $this->id);\n\t\t$stm->execute();\n\t}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "protected function processDeletedObjects() {}", "protected function _postDelete()\n {\n $this->clearResources();\n }", "function beforeDelete() {\n\t\t\treturn $this->_deletable($this->_Model->id);\n\t\t}", "function beforeDelete(){\r\n\t\t$photo = $this->findById($this->id);\r\n\t\tunlink($this->dir . $photo['Photo']['small']);\r\n\t\tunlink($this->dir . $photo['Photo']['large']);\r\n\t\treturn true;\r\n\t}", "public function deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }", "public function onAfterDelete();", "public function forceDelete()\n {\n //\n }", "public function preDeleteObject(Object_Abstract $object)\n {\n $this->deleteAllForTarget($object);\n }", "protected function postDeleteHook($object) { }", "public function afterDelete() {\n $this->deleteMeta();\n parent::afterDelete();\n }", "protected function delete() {\n\t}", "function afterDelete() {\n \t\t$this->_ownerModel->deleteAll(array(\n \t\t\t\t'model' => $this->_Model->alias,\n \t\t\t\t'foreign_key' => $this->_Model->id,\n \t\t\t\t$this->settings[$this->_Model->alias]['userPrimaryKey'] => $this->_User,\n \t\t));\n\t\t}", "public function onBeforeDelete() {\n // Delete all items attached to this order\n foreach($this->Items() as $item) {\n $item->delete();\n }\n\n parent::onBeforeDelete();\n }", "protected function afterRemoving()\n {\n }", "public function __doDelete()\n {\n $strSQL = $this->getDeleteSql();\n $result = $this->query($strSQL);\n }", "public function onBeforeDelete(){\n\t\tparent::onBeforeDelete();\n\n\t\tif($this->Images() && $images = $this->Images()){\n\t\t\tforeach($images as $image){\n\t\t\t\tif($image->exists()){\n\t\t\t\t\t$image->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function beforeDelete($event){\r\n $owner = $this->getOwner();\r\n //Ok he has the right to do that - remove all the ACL-objects associated with this object\r\n $class = Strategy::getClass('Aro');\r\n $aro = $class::model()->find('model = :model AND foreign_key = :key', array(':model' => get_class($owner), ':key' => $owner->getPrimaryKey()));\r\n \r\n if(!$aro)\r\n throw new RuntimeException('No associated Aro-Collection!');\r\n \r\n $transaction = Yii::app()->db->beginTransaction();\r\n try{\r\n $suc =$aro->delete()&& parent::beforeDelete($event);\r\n $transaction->commit();\r\n return $suc;\r\n }\r\n catch(Exception $e){\r\n $transaction->rollback();\r\n throw $e;\r\n }\r\n \r\n return parent::beforeDelete($event);\r\n \r\n }", "public function onBeforeDelete()\n {\n parent::onBeforeDelete();\n \n $proxied = $this->getProxiedObject();\n \n // Core SS types are decorated so we know we can call this\n $isCoreType = in_array($proxied->getField('ClassName'), $this->acService->ssCoreTypes());\n if($isCoreType && $proxied->canDeleteOnBlockDelete()) {\n $proxied->delete();\n }\n }", "public function afterDelete()\n {\n \\PProject::model()->updateAll([\n 'artist_id' => new \\CDbExpression('NULL')\n ], 'artist_id = :artist_id', [\n ':artist_id' => $this->id\n ]);\n }", "protected function beforeDelete()\n { \n return parent::beforeDelete();\n }", "public function forceDelete();", "public function delete() \n {\n DomainWatcher::addDeletedObject($this);\n }", "public function onAfterDelete() {\r\n\t\tparent::onAfterDelete();\r\n\t\t$this->zlog('Delete');\r\n\t}", "protected function beforeDestroy() {\n\n }", "public function deleting()\n {\n # code...\n }", "function call_delete() {\n parent::call_delete();\n }", "public function beforeDelete() {\n\t\tif (parent::beforeDelete() && $this->hasAttribute('status')) {\n\t\t\t$this->status = self::STATUS_DELETED;\n\t\t\t$this->save(false);\n\t\t\treturn false; // Prevent actual DELETE query from being run\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "protected function tearDown()\n {\n \n unset($this->object->db);\n\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function delete_data_to_tombstone(){\n }", "public function afterDelete() {\r\n parent::afterDelete();\r\n\r\n if($this->id){\r\n Cache::delete('getPracticeTitleById'.$this->id);\r\n }\r\n }", "public function onAfterDeleteCleaning() {\n\t\t$classHierarchyProbe = new DataObjectOnDeleteDecorator_ClassHierarchyProbe($this->owner);\n\t\t$relatedClasses = $classHierarchyProbe->getRelatedClasses();\n\t\t\n\t\t$this->cleanRelatedRelations($relatedClasses);\n\t\t$this->cleanRelatedTables($relatedClasses);\n\t}", "public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}", "protected function _delete()\r\n {\r\n parent::_delete();\r\n }", "public function delete() {\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\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$sql = \"DELETE FROM $this->sqlTable \";\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $this->id );\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql );\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "abstract public function shouldIDelete();", "public function Do_delete_Example1(){\n\n\t}", "protected function MetaBeforeDelete() {\n\t\t\treturn SERIA_Meta::allowDelete($this);\n\t\t}", "protected function tearDown() {\r\n $this->object->delete(true);\r\n }", "public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }", "public function preDelete($item)\n {\n if($item->data->count()) $item->data()->delete();\n if($item->results->count()) $item->results()->delete();\n if($item->dateHistory->count()) $item->dateHistory()->delete();\n\n // Deleting users will happen so rare we can delete all member group data\n Cache::tags('memberGroup')->flush();\n }", "public function delete() {\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\tif (! isset ( $this->id )) {\r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$dsh_id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with primary key of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$sql = \"DELETE FROM $this->sqlTable \";\r\n\t\t\t$sql .= \" WHERE dsh_id = ?\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $this->id );\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql );\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function run()\n {\n Model::unguard();\n\n DB::table('documents__objects')->delete();\n DB::table('documents__pool')->delete();\n }", "protected function afterDelete()\n {\n parent::afterDelete();\n self::extraAfterDelete($this);\n \n\t\t\t\n\t\t//Implements to delete The Term Relation Ship\t\t\n }", "private function _delete()\n {\n if (!$this->isLoaded()) {\n return false;\n }\n\n $className = get_called_class();\n $db = self::getDb();\n $useValue = self::sModifyStr($this->getPrimaryValue(), 'formatToQuery');\n $db->query(\"delete from \" . self::structGet('tableName') . \" where \" . self::structGet('primaryKey') . \" = {$useValue}\",\n \"{$className}->_delete()\");\n if ($db->error()) {\n return false;\n }\n\n if (self::structGet('cbAuditing')) {\n $cbAuditing = self::structGet('cbAuditing');\n if (is_array($cbAuditing)) {\n call_user_func($cbAuditing, $this, $this->getPrimaryValue(), 'delete', false);\n } else {\n $cbAuditing($this, $this->getPrimaryValue(), 'delete', false);\n }\n }\n\n // Vamos processar eventListener:delete\n self::_handleEventListeners('delete', $this, $this->getPrimaryValue(), false);\n\n // Vamos marcar o objeto como !loaded\n $this->setLoaded(false);\n\n // Vamos processar eventListener:afterDelete\n self::_handleEventListeners('afterDelete', $this, $this->getPrimaryValue(), false);\n\n return true;\n }", "public function _event_before_delete() {\n\t\tstatic::$_delete['roles'] = $this->roles;\n\t}", "public function _delete()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "function OnBeforeDeleteItem(){\n }", "protected function _beforeDelete()\n {\n $this->_protectFromNonAdmin();\n $this->cleanCache();\n\n return parent::_beforeDelete();\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "protected function beforeDelete()\n {\n $this->idInitializationCheck(true);\n return true;\n }", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "public function hook_before_delete($id) {\n\t //Your code here\n\n\t }", "public function hook_before_delete($id) {\n\t //Your code here\n\n\t }", "public function hook_before_delete($id) {\n\t //Your code here\n\n\t }", "private function tinydb_check_deleted()\n {\n if ($this->tinydb_is_deleted) {\n throw new \\TinyDb\\NoRecordException('Object was deleted.');\n }\n }", "function delete()\n {\n }", "function delete() {\n db_begin_work();\n $delete = parent::delete();\n if($delete && !is_error($delete)) {\n unlink($this->getAvatarPath());\n \tunlink($this->getAvatarPath(true));\n\n ProjectUsers::deleteByUser($this);\n Assignments::deleteByUser($this);\n Subscriptions::deleteByUser($this);\n StarredObjects::deleteByUser($this);\n PinnedProjects::deleteByUser($this);\n UserConfigOptions::deleteByUser($this);\n Reminders::deleteByUser($this);\n\n search_index_remove($this->getId(), 'User');\n\n $cleanup = array();\n event_trigger('on_user_cleanup', array(&$cleanup));\n\n if(is_foreachable($cleanup)) {\n foreach($cleanup as $table_name => $fields) {\n foreach($fields as $field) {\n $condition = '';\n if(is_array($field)) {\n $id_field = array_var($field, 'id');\n $name_field = array_var($field, 'name');\n $email_field = array_var($field, 'email');\n $condition = array_var($field, 'condition');\n } else {\n $id_field = $field . '_id';\n $name_field = $field . '_name';\n $email_field = $field . '_email';\n } // if\n\n if($condition) {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ? AND $condition\", $this->getName(), $this->getEmail(), $this->getId());\n } else {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ?\", $this->getName(), $this->getEmail(), $this->getId());\n } // if\n } // foreach\n } // foreach\n } // if\n\n db_commit();\n return true;\n } else {\n db_rollback();\n return $delete;\n } // if\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "protected function afterDelete()\n {\n parent::afterDelete();\n //Comment::model()->deleteAll('post_id='.$this->id);\n VideoTag::model()->updateFrequency($this->tags, '');\n }", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "public function beforeDelete()\n {\n // Find the related custom value\n $customValues = CustomValueModel::where('product_id', '=', $this->id)->get();\n\n $customValues->each(function ($value) {\n // Delete relation\n $relation = DB::table('tiipiik_catalog_csf_csv')\n ->where('custom_value_id', '=', $value->id)\n ->delete();\n\n // Delete custom value\n CustomValueModel::find($value->id)->delete();\n });\n\n // Detach properties\n $this->properties()->detach();\n }", "public function afterDelete()\n {\n $this->resetPolymorphicRelation();\n if ($this->getPolymorphicRelation() !== null) {\n $this->getPolymorphicRelation()->delete();\n }\n\n parent::afterDelete();\n }", "public function afterDelete()\n {\n $this->deleteAllCustomFields();\n }", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll('photo_id='.$this->id);\n\t\tTag::model()->updateFrequency($this->tags, '');\n\t}", "function undelete() {\n\t\t$query = \"UPDATE \".$this->table.\" SET \".$this->deleted_field.\" = '0'\".$this->where_this();\n\n\t\t$this->db->query($query);\n\n\t}" ]
[ "0.82973915", "0.8111653", "0.8100277", "0.7661015", "0.761018", "0.7559831", "0.7439736", "0.74201024", "0.73360264", "0.73175704", "0.73083913", "0.72894126", "0.72514457", "0.72300845", "0.72280777", "0.71891046", "0.7147188", "0.71177447", "0.71077925", "0.70845723", "0.70498", "0.70330584", "0.7020913", "0.70079327", "0.6988071", "0.69870275", "0.6972383", "0.6947012", "0.6901374", "0.6870639", "0.6845668", "0.6842529", "0.6839354", "0.6835841", "0.681667", "0.6779685", "0.6777582", "0.67757434", "0.6761313", "0.6738356", "0.6736417", "0.67076224", "0.6700521", "0.6642142", "0.65969235", "0.65804636", "0.6578837", "0.6570373", "0.65511256", "0.6537191", "0.6532674", "0.6519085", "0.65095365", "0.65094125", "0.6504356", "0.64950204", "0.6488003", "0.6487692", "0.64783305", "0.6465159", "0.645236", "0.64519083", "0.6449599", "0.6444165", "0.6442543", "0.6431925", "0.6427564", "0.6407101", "0.6404674", "0.63975805", "0.63915557", "0.63891894", "0.6366296", "0.6360324", "0.63589793", "0.6357785", "0.6354369", "0.63521343", "0.6338863", "0.6330044", "0.6324958", "0.6323297", "0.6321255", "0.63187426", "0.63178664", "0.6316602", "0.631549", "0.6304508", "0.6304508", "0.6304508", "0.63038", "0.630141", "0.6292723", "0.62808573", "0.62640905", "0.6261662", "0.62591434", "0.6249386", "0.62412924", "0.62399954", "0.62301505" ]
0.0
-1
Code to be run after deleting the object in database
public function postDelete(ConnectionInterface $con = null) { if (is_callable('parent::postDelete')) { parent::postDelete($con); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function after_delete() {}", "protected function afterDelete()\r\n {\r\n }", "protected function afterDelete()\n {\n }", "function after_delete() {}", "function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "function delete () {\n\t\t$stm = DB::$pdo->prepare(\"delete from `generated_object` where `id`=:id\");\n\t\t$stm->bindParam(':id', $this->id);\n\t\t$stm->execute();\n\t}", "public function deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function afterDeleteCommit(): void\n {\n }", "function doRealDelete()\n {\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "public function delete() \n {\n DomainWatcher::addDeletedObject($this);\n }", "protected function MetaAfterDelete() {\n\t\t}", "protected function _preDelete() {}", "public function deleting()\n {\n # code...\n }", "public function preDelete() { }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "protected function _postDelete()\n {\n $this->clearResources();\n }", "public function onAfterDelete();", "public function afterDelete() {\n $this->deleteMeta();\n parent::afterDelete();\n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "protected function _postDelete()\n\t{\n\t}", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "function destroy(){\n\t\tif(!$this->id)\n\t\t\tthrow new APortalException(\"Can't destroy object does not exist in database\",$this);\n\n\t\t$this->hook('destroy'); // can be used for access control or cache deletion\n\n\t\t// STEP1 - destroy relations\n\t\t$this->api->deleteRel($this,null);\n\t\t$this->api->deleteRel(null,$this);\n\n\t\t// STEP2 - destroy supplimentary table entry\n\t\t$this->api->db->dsql()\n\t\t\t->table($this->table_name)\n\t\t\t->where('id',$this->id)\n\t\t\t->do_delete();\n\n\t\t// STEP3 - delete obj table entry\n\t\t$this->api->db->dsql()\n\t\t\t->table('obj')\n\t\t\t->where('id',$this->id)\n\t\t\t->do_delete();\n\t}", "protected function delete() {\n\t}", "public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}", "protected function postDeleteHook($object) { }", "protected function _delete()\n\t{\n\t}", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "function delete()\n {\n }", "public function onAfterDelete() {\r\n\t\tparent::onAfterDelete();\r\n\t\t$this->zlog('Delete');\r\n\t}", "public function _delete()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function afterDelete()\n {\n \\PProject::model()->updateAll([\n 'artist_id' => new \\CDbExpression('NULL')\n ], 'artist_id = :artist_id', [\n ':artist_id' => $this->id\n ]);\n }", "public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }", "public function delete() {\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\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$sql = \"DELETE FROM $this->sqlTable \";\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $this->id );\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql );\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "function afterDelete() {\n \t\t$this->_ownerModel->deleteAll(array(\n \t\t\t\t'model' => $this->_Model->alias,\n \t\t\t\t'foreign_key' => $this->_Model->id,\n \t\t\t\t$this->settings[$this->_Model->alias]['userPrimaryKey'] => $this->_User,\n \t\t));\n\t\t}", "protected function preDeleteHook($object) { }", "public function delete() {\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\tif (! isset ( $this->id )) {\r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$dsh_id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with primary key of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$sql = \"DELETE FROM $this->sqlTable \";\r\n\t\t\t$sql .= \" WHERE dsh_id = ?\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $this->id );\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql );\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "protected function _predelete() {\n }", "public function deleted() {\n // TODO Implement this\n }", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, $this::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "protected function afterRemoving()\n {\n }", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll('photo_id='.$this->id);\n\t\tTag::model()->updateFrequency($this->tags, '');\n\t}", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "public function afterDelete()\n {\n foreach (static::find()->where(['parent_id' => $this->id])->all() as $item) {\n $item->delete();\n }\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function afterDelete()\n {\n if ($this->image) $this->image->delete();\n if ($this->reindex) Slide::reindex();\n }", "public function onAfterDelete() {\n\t\tif (!$this->owner->ID || self::get_disabled() || self::version_exist($this->owner))\n\t\t\treturn;\n\t\t$this->onAfterDeleteCleaning();\n\t}", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "public function __doDelete()\n {\n $strSQL = $this->getDeleteSql();\n $result = $this->query($strSQL);\n }", "public final function delete() {\n }", "function delete() {\n \tglobal $mysql;\n \tif(empty($this->id)) return;\n \t$tablename = $this->class_name();\n \t$id = $this->id;\n \t$query = \"DELETE FROM $tablename WHERE id=$id\";\n \t$mysql->update($query);\n }", "public function run()\n {\n Model::unguard();\n\n DB::table('documents__objects')->delete();\n DB::table('documents__pool')->delete();\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}", "public function afterDelete()\n {\n $this->deleteAllCustomFields();\n }", "protected function afterDelete()\n {\n parent::afterDelete();\n self::extraAfterDelete($this);\n \n\t\t\t\n\t\t//Implements to delete The Term Relation Ship\t\t\n }", "protected function afterDelete()\n {\n parent::afterDelete();\n //Comment::model()->deleteAll('post_id='.$this->id);\n VideoTag::model()->updateFrequency($this->tags, '');\n }", "public function delete()\r\n\t{\r\n\t}", "public static function delete() {\n\n\n\t\t}", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tBookmark::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoCategory::model()->deleteAll( 'howto_id=' . $this->id );\n \t\tSlide::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tStep::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoTag::model()->deleteAll( 'howto_id=' . $this->id );\n\t}", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }", "public function onAfterDelete() {\n parent::onAfterDelete();\n\n foreach ($this->Items() as $item) {\n $item->delete();\n }\n }", "public function afterDelete() {\r\n parent::afterDelete();\r\n\r\n if($this->id){\r\n Cache::delete('getPracticeTitleById'.$this->id);\r\n }\r\n }", "public function finish()\n {\n // get the alternate's person record\n $db_alternate = lib::create( 'database\\alternate', $this->get_argument( 'remove_id' ) );\n $db_person = $db_alternate->get_person();\n\n // call the parent method to delete the alternate\n parent::finish();\n\n // now delete the person\n try\n {\n $db_person->delete();\n }\n catch( \\cenozo\\exception\\database $e )\n { // help describe exceptions to the user\n if( $e->is_constrained() )\n {\n throw lib::create( 'exception\\notice',\n 'Unable to delete the '.$this->child_subject.\n ' because it is being referenced by the database.', __METHOD__, $e );\n }\n\n throw $e;\n } \n }", "public function delete()\n\t{\n\t}", "protected function tearDown()\n {\n \n unset($this->object->db);\n\n }", "public function delete() {\r\n }", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "protected function tearDown() {\r\n $this->object->delete(true);\r\n }", "public function afterDelete() {\n // Delete records from project_job_videos\n ProjectJobVideo::model()->deleteAllByAttributes(array('project_job_id' => $this->id));\n // Delete records from project_job_files\n ProjectJobFile::model()->deleteAllByAttributes(array('project_job_id' => $this->id));\n\n //register to recalculate status\n Project::registerStatusUpdate($this->project_id);\n }", "public function delete_data_to_tombstone(){\n }", "public function afterDelete(){\r\n\t\t//$sql = 'DELETE FROM {{apartment_comments}} WHERE email=\"'.$this->email.'\"';\r\n\t\t//Yii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'SELECT id FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\t$bookings = Yii::app()->db->createCommand($sql)->queryColumn();\r\n\t\t\r\n\t\tif($bookings){\r\n\t\t\t$sql = 'DELETE FROM {{payments}} WHERE order_id IN ('.implode(',', $bookings).')';\r\n\t\t\tYii::app()->db->createCommand($sql)->execute();\r\n\t\t}\r\n\r\n\t\t$sql = 'DELETE FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\tYii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'UPDATE {{apartment}} SET owner_id=1, owner_active=:active, active=:inactive WHERE owner_id=:userId';\r\n\t\tYii::app()->db->createCommand($sql)->execute(array(\r\n\t\t\t':active' => Apartment::STATUS_ACTIVE,\r\n\t\t\t':inactive' => Apartment::STATUS_INACTIVE,\r\n\t\t\t':userId' => $this->id,\r\n\t\t));\r\n\r\n\t\treturn parent::afterDelete();\r\n\t}", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }", "public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }", "protected function processDeletedObjects() {}", "function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n\n /* Get a lecture that this subtask is related to. */\n $lectureBean = new LectureBean ($this->id, $this->_smarty, \"\", \"\");\n $lectureBean->assignSingle();\n }", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "public static function tearDownAfterClass(): void{\n self::$dao->DELETE(self::$object);\n }", "public function onBeforeDelete();", "public function delete()\n {\n $database = cbSQLConnect::adminConnect('object');\n if (isset($database))\n {\n return ($database->SQLDelete(self::$table_name, 'id', $this->id));\n }\n }", "public function destroy() {\n\t\t$sql = 'DELETE FROM ' . static::$table . ' WHERE id = ' . $this->get('id') . ';';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute();\n\t}", "public function Do_delete_Example1(){\n\n\t}", "public function _postDelete()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function afterDelete()\n {\n if (parent::afterDelete()) {\n (new Query)->createCommand()\n ->delete('comment', ['id' => $this->id])\n ->execute();\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}", "protected function _after()\n {\n $this->_adapter->execute('drop table if exists comments;\n drop table if exists posts_tags;\n drop table if exists posts;\n drop table if exists tags;\n drop table if exists profiles;\n drop table if exists credentials;\n drop table if exists people;\n ');\n parent::_after();\n }", "public function delete();", "public function delete();", "public function delete();" ]
[ "0.79117715", "0.7840575", "0.7711726", "0.76181936", "0.7524055", "0.750263", "0.73994184", "0.7362228", "0.7360621", "0.7354637", "0.7318952", "0.73144865", "0.7291954", "0.7286163", "0.7285155", "0.7223728", "0.7223134", "0.72110856", "0.7178242", "0.7174596", "0.7152491", "0.7094707", "0.70853704", "0.7069763", "0.70613676", "0.7050364", "0.7048327", "0.7033308", "0.70245963", "0.69929826", "0.69899994", "0.69580704", "0.6957881", "0.695381", "0.6950179", "0.69494146", "0.694922", "0.6945208", "0.6941467", "0.69359595", "0.69333476", "0.69297147", "0.6926309", "0.69089586", "0.69042844", "0.6895339", "0.6887832", "0.68628395", "0.6861646", "0.68585783", "0.68481266", "0.68481266", "0.68475556", "0.6846968", "0.6844715", "0.68411624", "0.68319774", "0.6819413", "0.6816582", "0.68114823", "0.6808901", "0.680657", "0.68051034", "0.68016285", "0.67992175", "0.6799003", "0.6797197", "0.67962164", "0.67901", "0.6788248", "0.67789054", "0.6768181", "0.6757428", "0.6742959", "0.67382365", "0.67319936", "0.67250615", "0.6717695", "0.67167526", "0.67153245", "0.6714925", "0.6712364", "0.671215", "0.67120385", "0.6710393", "0.6700186", "0.6696443", "0.66935515", "0.66877055", "0.66843975", "0.6684397", "0.667957", "0.66691226", "0.66628176", "0.6653299", "0.6650915", "0.66475856", "0.66342735", "0.66301125", "0.66301125", "0.66301125" ]
0.0
-1
Derived method to catches calls to undefined methods. Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.). Allows to define default __call() behavior if you overwrite __call()
public function __call($name, $params) { if (0 === strpos($name, 'get')) { $virtualColumn = substr($name, 3); if ($this->hasVirtualColumn($virtualColumn)) { return $this->getVirtualColumn($virtualColumn); } $virtualColumn = lcfirst($virtualColumn); if ($this->hasVirtualColumn($virtualColumn)) { return $this->getVirtualColumn($virtualColumn); } } if (0 === strpos($name, 'from')) { $format = substr($name, 4); return $this->importFrom($format, reset($params)); } if (0 === strpos($name, 'to')) { $format = substr($name, 2); $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true; return $this->exportTo($format, $includeLazyLoadColumns); } throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _callToDefault()\n {\n foreach (get_class_methods($this) as $method) {\n try {\n $that = new ReflectionMethod($this, $method);\n } catch (ReflectionException $exception) {\n break;\n }\n if (\n $that->isProtected()\n && !array_key_exists($method, $this->query())\n ) {\n $this->{$method}($this->builder);\n }\n }\n }", "public function __call($method, array $arguments) {}", "public function __call(string $method, array $args): mixed;", "public function __call($method, $arguments) {}", "public function __call($method, $arguments) {}", "public function __call(string $method, $arguments = null) {}", "public function __call(string $method, $arguments = null) {}", "public function __call($name, $arguments) {\n if(method_exists($this->excel, $name)) { \n // forward the call to our child object \n return call_user_func_array(array($this->excel, $name), $arguments); \n } \n return null; \n }", "function __call($name, $arguments)\n {\n echo \"方法不存在\";\n }", "function __call($methodName, $args)\n {\n echo 'undefined method name: ' . $methodName;\n exit;\n }", "public function __call($method, $args);", "public static function canConvert()\n\t{\n\t\t/* Child classes must override this method */\n\t\tthrow new \\BadMethodCallException( 'nothing_to_convert' );\n\t}", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "public function __call($method, $arguments);", "public function __call($methodName, $args)\n {\n if (! in_array($methodName, $this->requiredGetters))\n {\n throw new Exception(\"Feeds Aggregator - The method $methodName is not provided.\");\n }\n $directGetters = $this->getDirectGetters();\n if (array_key_exists($methodName, $directGetters))\n {\n $fieldName = $directGetters[$methodName];\n if ($fieldName)\n {\n if (isset($this->itemArray[$fieldName]))\n {\n return $this->itemArray[$fieldName];\n }\n else\n {\n return NULL;\n }\n }\n else // the value corresponding to the getter is an empty-string. \n // That means the getter should have been defined in the FeedConverter subclass\n {\n throw new Exception(\"Feeds Aggregator - $methodName is not in the directGetters array.\");\n }\n }\n else\n {\n throw new Exception(\"Feeds Aggregator - Couldn't get the method $methodName.\");\n }\n }", "public function __call($name,$arguments) {\n\t\tif (array_key_exists($name,$this->methods)) {\n\t\t\treturn $this->_call_user_func_array($this->parser,$name,$arguments);\n\t\t} else {\n\t\t\tthrow new Exception('Undefined method \"'.$name.'\"');\n\t\t}\n\t}", "protected abstract function applyNoArg();", "function __call($fn, $param){\n //if method exists\n \n $run = apply_filters(\"WXP.{$this->handle}.{$fn}.allow\", true, $this, $param);\n \n if($run !== false){\n \n //give an error if the method does not exist, and \n //method call is allowed\n \n if(!method_exists($this->object, $fn)){\n throw new \\BadMethodCallException(\"Call to undefined method {$this->handle}::{$fn}\");\n }\n \n //if method does exist do .before action\n \n do_action(\"WXP.{$this->handle}.{$fn}.before\", $this, $param);\n \n //now call method and apply filters to the result\n \n $result = call_user_func_array(array($this->object, $fn), $param);\n \n $result = apply_filters(\"WXP.{$this->handle}.{$fn}.result\", $result, $this, $param);\n \n //finally do .after action, (passing the result and object)\n \n do_action(\"WXP.{$this->handle}.{$fn}.after\", $result, $this, $param);\n \n //return result\n \n return $result;\n } else {\n //use filter to determine what is returned when \n //run call for this object is disallowed, by default null is\n //returned; but this might cause an error if a different\n //value (like an object) is expected\n \n return apply_filters(\"WXP.{$this->handle}.{$fn}.disallow.return\", null, $this, $param);\n }\n \n }", "function __call($name, $arguments) {\r\n\t\t// Not found in our collection\r\n\t\tif (empty($this->methodCollection[$name])) {\r\n\t\t\treturn parent::__call($name, $arguments);\r\n\t\t}\r\n\t\t// We call the method found in one of the helpers\r\n\t\treturn call_user_func_array(array(&$this->{$this->methodCollection[$name]}, $name), $arguments);\r\n\t}", "private function _parseMethods()\n {\n $methods = $this->_reflectionClass->getMethods();\n if (!is_array($methods) || count($methods) < 1) {\n throw new RestException('Parser: The class \"' . $this->_class . '\" doesn\\'t have any methods defined.');\n }\n\n foreach ($methods as $m) {\n if ($m->isPublic()) {\n $methodParser = new MethodParser($this->_class, $m, $this->_normalize);\n $parsedMethod = $methodParser->parse();\n if ($parsedMethod) {\n $this->_parsedClass->addApiMethod($parsedMethod);\n }\n }\n }\n }", "public function __call($fn,$args=[])\r\n\t{\r\n\t\tif(method_exists($this->slim,$fn)){\r\n\t\t\treturn call_user_func_array( [$this->slim,$fn] , $args);\r\n\t\t}\r\n\t\tthrow new \\exception('method doesnt exist::'.$name);\r\n\t}", "public function __call( $method, $arguments )\n {\n $callback = array( $this->reflectionSource, $method ); \n if ( $this->reflectionSource instanceof parent\n and is_callable( $callback ) )\n {\n // query external reflection object\n return call_user_func_array( $callback, $arguments );\n }\n else\n {\n throw new ezcReflectionCallToUndefinedMethodException( __CLASS__, $method );\n }\n }", "public static function __callStatic($method, $args){ return null; }", "public function __call($name, $arguments) {\n// if(method_exists($this->connection, $name)) {\n// // forward the call to our child object\n// return call_user_func_array(array($this->connection, $name), $arguments);\n// }\n return \"no Function found with this data\";\n }", "public function __call($name, $arguments)\n\t{\n\t\tif ( method_exists($this, $name) )\n\t\t{\n\t\t\treturn call_user_func_array(array($this, $name), $arguments);\n\t\t}\n\t\telse if ( is_object($this->driver)\n\t\t && is_callable(array($this->driver, $name)) )\n\t\t{\n\t\t\treturn call_user_func_array(array($this->driver, $name), $arguments);\n\t\t}\n\t\tthrow new BadMethodCallException('Undefined method called ' . get_class($this) . '::' . $name . '.');\n\t}", "public static function __callStatic($method, $arguments=null) {}", "public function __invoke();", "public function __invoke();", "public function __invoke();", "public function __invoke();", "public function __call(string $name, array $arguments): mixed\n {\n if (method_exists($this, $name)) {\n return \\call_user_func_array([$this, $name], $arguments);\n } else {\n throw new ParserException(\"Call an undefined method.\");\n }\n }", "public function __invoke()\n {\n }", "public function testMagicCallUnknown()\n {\n $this->expectException(Error::class);\n\n $this->uut->foo();\n }", "public function none(){\n return call_user_func_array($this->fetchStaticClassName() . '::' . __FUNCTION__, func_get_args());\n }", "public function __call($name, $args=array()) {\n if (method_exists($this->obj, $name)) {\n $v = call_user_func_array(array($this->obj, $name), $args);\n return Sandbox::wrap($v, $this->encoder);\n }\n throw new Exception('Object has no such method: ' . $name);\n }", "protected function getWarningWhenMethodUnavailable() {}", "public function __call(string $method, array $parameters);", "public function __call($method, $parameters);", "final public function __invoke(): \\Exception\n {\n throw new \\BadFunctionCallException();\n }", "abstract public function __invoke(): void;", "public function __call($name, $args)\n {\n if (isset($this->$name)) {\n return call_user_func_array(array($this->$name, '__invoke'), $args);\n }\n throw new \\Exception('Call to undefined method: ' . $name);\n }", "function method_no_specs() {}", "function __call($name, $arguments)\n {\n }", "public function testRespondsToParentCall() {\n\t\terror_reporting(($backup = error_reporting()) & ~E_USER_DEPRECATED);\n\n\t\t$this->assertTrue(Locale::respondsTo('invokeMethod'));\n\t\t$this->assertFalse(Locale::respondsTo('fooBarBaz'));\n\n\t\terror_reporting($backup);\n\t}", "public function testCellMissingMethod(): void\n {\n $this->expectException(BadMethodCallException::class);\n $this->expectExceptionMessage('Class `TestApp\\View\\Cell\\ArticlesCell` does not have a `nope` method.');\n $cell = $this->View->cell('Articles::nope');\n $cell->render();\n }", "public function __construct()\n {\n parent::__construct('Transformer must be a callable or an instance of [' . Transformer::class . '].');\n }", "public function overload(): void;", "function __call($name, $arguments)\n {\n if (method_exists($this->_obj, $name)) {\n return call_user_func_array(\n array($this->_obj, $name), $arguments\n );\n }\n\n // Ops\n die(\"$name not found in \" . __CLASS__);\n }", "public function getFileReflection()\n\t{\n\t\tthrow new Exception\\BrokerException($this->getBroker(), sprintf('Function was not parsed from a file', $this->getPrettyName()), Exception\\BrokerException::UNSUPPORTED);\n\t}", "final public function __wakeup(){\n throw new Exception('Feature disabled.');\n }", "static function ignore_missing_methods($set = null) {\n\t\tif (is_null($set)) {\n\t\t\treturn self::$ignore_missing_methods;\n\t\t} else {\n\t\t\tself::$ignore_missing_methods = ($set ? true : false);\n\t\t}\n\t}", "public function serialize(){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}", "abstract public function __call($fnc, $args);", "public function __construct() {\n // Laravel. This line explicitly disables those errors for this single conversion process.\n libxml_use_internal_errors(true);\n }", "public function testHydrateNotImplementing(): void\n {\n $this->hydrateEvent->getDocument()->willReturn($this->notImplementing);\n $this->hydrateEvent->getOption(Argument::any())->shouldNotBeCalled();\n\n $this->subscriber->handleHydrate($this->hydrateEvent->reveal());\n }", "public function testMagicMethodCallThrowsException()\n\t{\n\t\t$stub = new \\Orchestra\\Support\\Form\\Fieldset(function ($f) {});\n\n\t\t$stub->invalid_method();\n\t}", "public function __construct()\r\n\t{\r\n\t\techo \"Implements Function overloading\";\r\n\t}", "public function __call($name, $args)\n {\n if (is_object($this->$name)) {\n call_user_func_array(array($this->$name, '__invoke'), $args);\n } else {\n throw new AppException('Method not found! ' . $name);\n }\n\n }", "public function __wakeup() {\n //Unserializing instances of the class is forbidden\n _doing_it_wrong(__FUNCTION__, __('Word? That aint allowed son!', 'i4'), '0.0.1');\n }", "public function __call($method_name, $arguments)\n {\n $this->_excel->$method_name($arguments);\n }", "protected function initializeReflection() {}", "public function __invoke()\n {\n\n }", "function __call( $method, $arguments ) {\r\n\t\treturn call_user_func_array( array( $this->facebook, $method ), $arguments );\r\n\t}", "public function __call($name, $arguments);", "abstract protected function doEvil();", "public function __call($function, $args)\n {\n // Catch exception\n if (method_exists($this->xmlWriter, $function) === false) {\n throw new \\BadMethodCallException(\"Method '{$function}' does not exists.\");\n }\n\n // Run method\n try {\n @call_user_func_array(array($this->xmlWriter, $function), $args);\n } catch (\\Exception $ex) {\n // Do nothing!\n }\n }", "public function __call ($method, $arguments)\n {\n if(method_exists($this, $method))\n return call_user_func_array(array($this, $method), $arguments);\n if(is_array($this->mormons))\n {\n foreach($this->mormons as $obj_id => $morm)\n {\n if(method_exists($morm, $method))\n return call_user_func_array(array($morm, $method), $arguments);\n else\n throw new Exception(\"The method \".$method.\" does not exist for \".get_class($morm).\" object\");\n }\n throw new Exception(\"No elements in this Mormons\");\n }\n throw new Exception(\"The method \".$method.\" does not exist in Mormons class\");\n }", "public function __call($method, $arguments)\n\t{\n\t\tif(method_exists($this, $method))\n\t\t\treturn call_user_func_array([$this, $method], $arguments);\n\t\t// otherwise try to call method on form generator (eg: $form -> text or $form -> button)\n\t\treturn call_user_func([$this -> generator, $method], $arguments);\n\t}", "function call()\n{\n\t// Get all the arguments passed\n\t$args = func_get_args();\n\t\n\t// Get the first argument, it's expected to be class::method\n\t$call = array_shift($args);\n\n\t// Pass the class and method to these variables\n\tlist($class, $method) = explode('::', $call);\n\t\n\ttry\n\t{\n\t\t// Get the prefix oc the current application\n\t\t$requestclass = Request::current()->extension_prefix.$class;\n\n\t\t// Call the the method based on the current application\n\t\treturn call_user_func_array(array($requestclass, $method), $args);\n\t}\n\tcatch(Exception $e1)\n\t{\n\t\t// Try again, but this time, let's call it without the application prefix. This Will look for the class in the module paths.\n\t\ttry\n\t\t{\n\t\t\t// Call the the method based on the current application\n\t\t\treturn call_user_func_array(array($class, $method), $args);\n\t\t}\n\t\tcatch(Exception $e1)\n\t\t{\n\t\t\t// Return Null if the call fails. TODO: Throw a better exception\n\t\t\treturn NULL;\n\t\t}\n\t}\n}", "public function __call($name, $arguments) { return self::__callStatic($name, $arguments); }", "public function __call($name, array $arguments);", "public function __call($name, $arguments) {\n \n if ($this->oObjeto !== NULL) {\n \n if (method_exists($this->oObjeto, $name)) {\n return call_user_func_array(array($this->oObjeto, $name), $arguments);\n } else {\n throw new Exception(\"Método {$name} não encontrado para a entidade \" . get_class($this->oObjeto));\n }\n }\n }", "public function __call($method, $args)\n {\n $helper = $this->getHelper($method);\n if (method_exists($helper, 'direct'))\n {\n return call_user_func_array(array($helper, 'direct'), $args);\n }\n\n $error = 'Helper \"%s\" does not support overloading via direct().';\n throw new sfViewException(sprintf($error, $method));\n }", "public function __call($method, $argv) {\n $class = get_called_class();\n\n // If the method exists, return\n if (method_exists($class, $method)) {\n return;\n }\n\n // Check if the method exists\n if (!method_exists(\"Model\", $method)) {\n throw new Exception(\"Static method $class::$method does not exist\", 1);\n\n return;\n }\n\n // We pass the caller of the class plus the extra parameters\n\n $model = new Model($class, MODEL::INSTANCE_CALL, $this);\n\n // call the method from the FlowingQuery and return the output\n return call_user_func_array([$model, $method], $argv);\n\n }", "function connectDefaultInternals()\n{\n # call_user_func() etc. are not a problem if no other internal functions are redefined\n if (Config\\getRedefinableInternals() === []) {\n return;\n }\n foreach (Config\\getDefaultRedefinableInternals() as $function) {\n # Which arguments are callbacks? Store their offsets in the following array.\n $offsets = [];\n foreach ((new \\ReflectionFunction($function))->getParameters() as $offset => $argument) {\n $name = $argument->getName();\n if (strpos($name, 'call') !== false || strpos($name, 'func') !== false) {\n $offsets[] = $offset;\n }\n }\n connect($function, function() use ($function, $offsets) {\n # This is the argument-inspecting patch.\n $args = Stack\\top('args');\n $caller = Stack\\all()[1];\n foreach ($offsets as $offset) {\n # Callback absent\n if (!isset($args[$offset])) {\n continue;\n }\n $callable = $args[$offset];\n # Callback is a closure => definitely not internal\n if ($callable instanceof \\Closure) {\n continue;\n }\n list($class, $method, $instance) = Utils\\interpretCallable($callable);\n if (empty($class)) {\n # Callback is global function, which might be internal too.\n $args[$offset] = function() use ($callable) {\n return dispatchDynamic($callable, func_get_args());\n };\n }\n # Callback involves a class => not internal either, since the only internals that\n # Patchwork can handle as of 2.0 are global functions.\n # However, we must handle all kinds of opaque access here too, such as self:: and\n # private methods, because we're actually patching a stub (see INTERNAL_STUB_CODE)\n # and not directly call_user_func itself (or usort, or any other of those).\n # We must compensate for scope that is lost, and that callback-taking functions\n # can make use of.\n if (!empty($class)) {\n if ($class === 'self' || $class === 'static' || $class === 'parent') {\n # We do not discriminate between early and late static binding here: FIXME.\n $actualClass = $caller['class'];\n if ($class === 'parent') {\n $actualClass = get_parent_class($actualClass);\n }\n $class = $actualClass;\n }\n\n # When calling a parent constructor, the reference to the object being\n # constructed needs to be extracted from the stack info.\n # Also turned out to be necessary to solve this, without any parent\n # constructors involved: https://github.com/antecedent/patchwork/issues/99\n if (is_null($instance) && isset($caller['object'])) {\n $instance = $caller['object'];\n }\n try {\n $reflection = new \\ReflectionMethod($class, $method);\n $reflection->setAccessible(true);\n $args[$offset] = function() use ($reflection, $instance) {\n return $reflection->invokeArgs($instance, func_get_args());\n };\n } catch (\\ReflectionException $e) {\n # If it's an invalid callable, then just prevent the unexpected propagation\n # of ReflectionExceptions.\n }\n }\n }\n # Give the inspected arguments back to the *original* definition of the\n # callback-taking function, e.g. \\array_map(). This works given that the\n # present patch is the innermost.\n return call_user_func_array($function, $args);\n });\n }\n}", "protected function raiseNotImplemented() {\n $calling_method_name = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2)[1]['function'];\n storeErrorMsg($calling_method_name. \" function not implemented!\");\n }", "public function __call($method, $args) \n {\n var_dump('sss');\n if(!method_exists($this, $method)) { \n throw Dadiweb_Forms_Exception::getInstance()->getMessage(\n sprintf(\n 'The required method \"%s\" does not exist for %s',\n $method,\n get_class($this)\n )\n ); \n }\n }", "private function __call($method)\r\n\t{\r\n\t\tthrow new TACException('Invalid method called => (' . __CLASS__ . '::' . $method . ')');\r\n\t}", "public function __call( $name, array $arguments ) {\n // specific functionality\n call_user_func_array( $this->adapter, $arguments );\n }", "public function __wakeup() {\n // Unserializing instances of the class is forbidden\n _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'ninja-forms' ), '2.8' );\n }", "function __call($method, $args)//call adodb methods\n\t{\n\t\treturn call_user_func_array(array(self::$instance, $method),$args);\n\t}", "public function missingMethod(CollectionInterface $collection, $method, $arguments = null);", "public function __call(string $name, array $arguments): mixed\n {\n // Sugar to make parse<Format>() work\n if (preg_match('/^parse([A-Z][A-z]*)/u', $name, $parts) && 1 === count($arguments)) {\n return $this->parse($arguments[0], $parts[1]);\n }\n\n throw new RuntimeException(sprintf('Call to undefined method %s::%s().', __CLASS__, $name));\n }", "public function __wakeup() {\r\n\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Unserializing instances of this class is forbidden.', 'wc_name_your_price' ), '3.0.0' );\r\n\t}", "protected function __callHook($method, array & $arguments)\n { }", "public function __call($method, $arguments)\n\t{\n\t\tif (!method_exists( $this->alus_auth_model, $method) )\n\t\t{\n\t\t\tthrow new Exception('Undefined method alus_auth::' . $method . '() called');\n\t\t}\n\t\tif($method == 'create_user')\n\t\t{\n\t\t\treturn call_user_func_array(array($this, 'register'), $arguments);\n\t\t}\n\t\tif($method=='update_user')\n\t\t{\n\t\t\treturn call_user_func_array(array($this, 'update'), $arguments);\n\t\t}\n\t\treturn call_user_func_array( array($this->alus_auth_model, $method), $arguments);\n\t}", "public function __call( $name, $arguments ) {\n\t\tif ( is_callable( array( $this->functions, $name ) ) ) {\n\t\t\treturn call_user_func_array( array( $this->functions, $name ), $arguments );\n\t\t} else {\n\t\t\tthrow new \\Exception(\"Call to undefined method \".__CLASS__.\"::{$name}()\", 1);\n\t\t}\n\t}", "final public function test__call()\n {\n // we use `new` instead of Solar::factory() so that we get back the\n // factory class itself, not an adapter generated by the factory\n $obj = new Solar_Auth_Logout($this->_config);\n try {\n $obj->noSuchMethod();\n $this->fail('__call() should not work');\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n }", "function __call($func, $args)\n {\n return call_user_func_array(array($this->internal, $func), $args);\n }", "public function missingMethod($parameters = array()) {\n \n }", "public function missingMethod($parameters = array()) {\n \n }", "function overload() { }", "function overload() { }", "function __call($name, $args) {\n\t\treturn main()->extend_call($this, $name, $args);\n\t}", "protected function __call($method)\r\n\t{\r\n\t\tthrow new TACException('Invalid method called => (' . __CLASS__ . '::' . $method . ')');\r\n\t}", "protected function __call($method)\r\n\t{\r\n\t\tthrow new TACException('Invalid method called => (' . __CLASS__ . '::' . $method . ')');\r\n\t}", "protected function __call($method)\r\n\t{\r\n\t\tthrow new TACException('Invalid method called => (' . __CLASS__ . '::' . $method . ')');\r\n\t}", "protected function __call($method)\r\n\t{\r\n\t\tthrow new TACException('Invalid method called => (' . __CLASS__ . '::' . $method . ')');\r\n\t}", "public static function __callStatic(string $name, array $arguments): Input {\n try {\n return static::input($name, ...$arguments);\n } catch (\\Exception $ex) {\n throw new BadMethodCallException(\"Method '$name' Does not exist\", 0, $ex);\n }\n }" ]
[ "0.5683369", "0.55150574", "0.549006", "0.54879683", "0.54879683", "0.54456234", "0.54456234", "0.5443073", "0.53987366", "0.53640664", "0.5345632", "0.5284882", "0.5265972", "0.5265972", "0.5265972", "0.52593833", "0.5222946", "0.52166176", "0.5180199", "0.51756805", "0.51504785", "0.5146855", "0.51211536", "0.50986356", "0.5086982", "0.50851214", "0.50215334", "0.50090235", "0.494115", "0.494115", "0.494115", "0.494115", "0.4936039", "0.49319914", "0.49059626", "0.49029094", "0.4897472", "0.48954457", "0.48893046", "0.48794195", "0.48727718", "0.48710638", "0.48671", "0.48661226", "0.48523766", "0.48522744", "0.48479873", "0.4843814", "0.4838905", "0.48365554", "0.482997", "0.48163834", "0.48163292", "0.48143676", "0.48133308", "0.48126155", "0.48110738", "0.48101825", "0.48042652", "0.479175", "0.47833073", "0.47763106", "0.4774696", "0.4770391", "0.47652143", "0.47629705", "0.47549725", "0.47490042", "0.4736818", "0.472816", "0.4723754", "0.47232196", "0.47231337", "0.4722997", "0.47178206", "0.4716736", "0.47137126", "0.47119522", "0.4710871", "0.47044232", "0.46990415", "0.46970603", "0.4686509", "0.46814007", "0.467968", "0.46710494", "0.46708634", "0.46694216", "0.46651998", "0.46570253", "0.46434376", "0.46421808", "0.46421808", "0.4639456", "0.4639456", "0.4637566", "0.46293733", "0.46293733", "0.46293733", "0.46293733", "0.46268246" ]
0.0
-1
Testing numbers between 0 and 9
public function testDigits(float $number, string $word): void { self::assertEquals($word, $this->handle->toWords($number, $this->locale)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "function numero($s)\n{\n\t$j=0;\n\t$valor=false;\n\tfor($j=1; $j<10;$j++){\n\t\tif($s==$j){\n\t\t\t$valor=true;\n\t\t}\n\t}\n\treturn $valor;\n}", "function testInN($num,$n)\n\t{\n\t\tif(!is_numeric($num)) return false;\n\t\tif(!is_numeric($n)) return false;\n\t\tif($num<0) return false;\n\t\tif($n<0) return false;\n\t\t\n\t\tif($num<=$n) return true;\n\t\treturn false;\n\t}", "function check_ten($ten)\n{\n\treturn TRUE;\n}", "function testIn7()\n\t{\n\t\treturn $this->testinN($num,7);\n\t}", "function TestCheckDigit($barcode)\n{\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n}", "function checkNum($red, $stupac, $mjesto) {\n\tif($red%2 == 0){\n\t\t$broj=0;\n\t\tif($stupac == 1){\n\t\t\t$broj= $mjesto-9;\n\t\t\techo $broj;\n\t\t} else {\n\t\t\t$broj = $mjesto / 10;\n\t\t\t$broj = floor($broj);\n\t\t\t$broj *= 10;\n\t\t\t$broj += $stupac;\n\t\t\techo $broj . \" i \" . $red ;\n\t\t}\n\n\t} else {\n\t\techo $mjesto;\n\t}\n\n}", "function is_digito($digito){\r\n if($digito=='0' || $digito=='1' || $digito=='2' || $digito=='3' || $digito=='4' ||\r\n $digito=='5' || $digito=='6' || $digito=='7' || $digito=='8' || $digito=='9'){return TRUE;\r\n }else{return FALSE;}\r\n}", "public function ifNum($num);", "function is_entier($n) {\nreturn ($n>0 || $n=='0');\n}", "Function checkstringContainsDigits($data){\n for($i=0;$i<strlen($data);$i++){\n if($data[$i] == '0' || $data[$i]=='1' || $data[$i]== '2' || $data[$i]== '3' || $data[$i] == '4' || $data[$i]=='5' ||$data[$i]=='6' ||$data[$i]=='7' ||$data[$i]=='8' ||$data[$i]=='9') {\n return true;\n }\n\n }\n return false;\n}", "function range_met($n)\n{\n if ($n >= 1 && $n <= 100) {\n return TRUE;\n }\n return FALSE;\n}", "public function validate($value)\n {\n $value = preg_replace('/[^\\d]/', '', (string) $value);\n if (strlen($value) != 11 ) {\n return false;\n }\n $acumulado = 0;\n $digits = str_split($value);\n\n // obtain digit\n $digit = array_pop($digits);\n\n for ($i=0; $i < count($digits); $i++ ) {\n $acumulado += $digits[9-$i] * (2 + ($i % 6 ));\n }\n $verif = 11 - ( $acumulado % 11 );\n $verif = $verif == 11? 0 : $verif;\n\n return $digit == $verif;\n }", "function testIn24()\n\t{\n\t\treturn $this->testInN($num,24);\n\t}", "public function checkNumbers($str)\r\n {\r\n $this->explodeString = explode(',', $str);\r\n\r\n foreach ($this->explodeString as $val) {\r\n if ($val < 1001) {\r\n $this->lesserArray[] = $val;\r\n } else {\r\n $this->greaterArray[] = 0;\r\n }\r\n }\r\n if (sizeof($this->lesserArray) > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function cp_intIsBetween($number,$min,$max){\r\n if(!cp_str_isInt($number)){\r\n return false;\r\n }\r\n\r\n return $number >= $min && $number <= $max;\r\n}", "function numberInRange($a_iStart, $a_iEnd, $a_iNumber)\n\t{\n\t\t// and starts with \"0\"\n\t\t$iStrLen = strlen($a_iNumber);\n\t\tif((substr($a_iNumber,0,1) == \"0\") && ($iStrLen > 1))\n\t\t\t$iNumber = substr($a_iNumber, 1, $iStrLen);\n\t\telse\n\t\t\t$iNumber = $a_iNumber;\n\n\t\tif($iNumber < $a_iStart)\n\t\t\treturn false;\n\t\telseif($iNumber > $a_iEnd)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "function checkInteger($var) {\r\n\r\n\tif(preg_match('!^\\d+$!', $var)) { return true; } else { return false; }\r\n\r\n}", "public function isValid($number);", "function check($ran_num) {\n if ($ran_num < 2) {\n return false;\n }\n // check so nguyen to khi n >= 2\n $squareRoot = sqrt ( $ran_num );\n for($i = 2; $i <= $squareRoot; $i ++) {\n if ($ran_num % $i == 0) {\n return false;\n }\n }\n return true;\n }", "function mDIGIT(){\n try {\n // Tokenizer11.g:366:3: ( '0' .. '9' ) \n // Tokenizer11.g:367:3: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public static function check(string $number = NULL)\n {\n $table = \n [\n\t\t\t[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],\n\t\t\t[0, 2, 4, 6, 8, 1, 3, 5, 7, 9]\n\t\t];\n\n\t\t$total = 0; $transform = 0;\n\n\t\tfor( $i = strlen($number ?? '') - 1; $i >= 0; $i-- )\n\t\t{\n\t\t\t$total += $table[$transform++ & 0x1][$number[$i]];\n\t\t}\n\n\t\treturn $total % 10 === 0;\n }", "protected function validateDigits($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_INT) !== false;\n\t}", "function valid_number($num) {\r\nif(empty($num) || !is_numeric($num))\r\n return false ; \r\nelse {\r\n $num = intval($num) ; \r\n\tif($num <= 0) \r\n\t\treturn false ;\r\n }\r\n return true ; \r\n}", "public function validIntegers() {}", "public function checkDigit($accountNumber)\n {\n $numbers = str_split($accountNumber);\n array_walk(\n $numbers,\n function (&$no, $key) {\n $no = $no * (10 - $key);\n }\n );\n return array_sum($numbers) % 11;\n }", "public function testRandom() {\n\t\t$results = array();\n\t\tforeach (range(0, 100) as $run) {\n\t\t\t$results[] = _::random(10);\n\t\t}\n\t\t$this->assertContainsOnly('int', $results);\n\t\t$this->assertGreaterThanOrEqual(0, min($results));\n\t\t$this->assertLessThanOrEqual(10, max($results));\n\t}", "function validate_Integer($number)\n {\n // condition for validating user input using preg_match conditions.\n if (preg_match('/[1-9]{1}/', $number) && $number > 0) {\n return true;\n }\n }", "function func3($n) {\n for ($k = 0; $n; $n = (int) ($n / 10)) {\n $k = $n * 10;\n if ($k > $n)\n $n = $k;\n }\n return $n;\n}", "function verify_creditcard_mod10($strccno = '')\n {\n if (empty($strccno))\n {\n return false;\n }\n $len = mb_strlen($strccno);\n if ($len < 13 OR $len > 16)\n {\n return false;\n }\n $checkdig = (int)$strccno[--$len];\n for ($i=--$len, $sum = 0, $dou = true; $i >= 0; $i--, $dou =! $dou)\n {\n $curdig = (int)$strccno[$i];\n if ($dou)\n {\n $curdig *= 2;\n if ($curdig > 9) $curdig-=9;\n }\n $sum += $curdig;\n }\n if (($checkdig + $sum) % 10 == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function isPosNum($number){\n if(((int)$number) >= 0){\n return true;\n }\n else{\n echo \"invalid number of pages (or words)\";\n return false;\n }\n }", "function input_number_is_valid( $number ) {\n\t\treturn ( is_numeric( $number ) && $number > 0 );\n\t}", "function validarnumero($numero){ \nif($numero=='0'){\n\t\n}else{\n\tif(is_numeric($numero)) {\n //si es un numero no dice nada\n } else {\n return TRUE;\n }\n}\n \n}", "public function test_it_prints() {\n // ADDED: check if the number contains the value as \"string\" (ie 13 is Fizz, 53 is Buzz etc)\n $expected = '1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz Fizz 14 FizzBuzz? 16 17 Fizz 19 Buzz Fizz 22 Fizz Fizz Buzz ';\n $this->assertEquals($expected, $this->kata->printFizzBuzzRange(1, 25));\n }", "function testForInt($data)\r\n\t{\r\n\t\tif (!filter_var($data, FILTER_VALIDATE_INT) === false)\r\n\t\t{\r\n\t\t\treturn intval($data);\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\techo(\"Integer is not valid<br>\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function GetCheckDigit($barcode)\n{\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n $r=$sum%10;\n if($r>0)\n $r=10-$r;\n return $r;\n}", "function palindrome_angka($angka) {\n if ($angka >= 0 && $angka <= 9)\n return 9;\n for($i = 0; $i < 1000; $i++){\n $v = strval($i);\n $r = strrev($v);\n $n = intval($v.substr($r,1));\n if ($n >= $angka && $n == true)\n return $n;\n }\n}", "function check_armstrong($number){\r\n$n=$number;\r\n$total_sum=0;\r\nwhile($n!=0){\r\n\t$rem=$n%10;\r\n\t$n=$n/10;\r\n\t$sum=1;\r\n\tfor($i=0; $i<3; $i++){\r\n\t\t$sum*=$rem;\r\n\t}\r\n\t$total_sum+=$sum;\r\n\t$sum=1;\r\n}\r\nif($total_sum==$number){\r\n\techo \"It is an armstrong number\".$total_sum;\r\n}\r\nelse{\r\n\techo \"It is not armstrong number\";\r\n\r\n}\r\n}", "function betweenIntRange($value, $params = array()) {\t\t\n\t\t$min = 0;\n\t\t$max = 255;\n\t\textract($params);\n\t\tif (is_array($value)) {\n\t\t\t$value = array_shift($value);\n\t\t}\n\t\tif (preg_match('/^[0-9]+$/', $value)) {\n\t\t\tif ($value >= $min && $value <= $max) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\t\t\n\t\treturn false;\n\t}", "abstract public function validateNumber(): bool;", "function is_num($arg){ \n\tif (!(int)$arg) {\n\treturn false ;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "function checkNum($number) {\n if($number>50) {\n throw new Exception(\" Tavë Kosi has been known for 90 years in Albanian cuisine.\");\n }\n return true;\n}", "private function _valid($numValue){\n\t\tif(!is_int($numValue)){\n\t\t\t//throws error\n\t\t\techo \"not an int\";\n\t\t\treturn 0;\n\t\t}\n\n\t\tif($numValue < 1 || $numValue > 100){\n\t\t\t//throws error\n\t\t\techo \"not in range\";\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}", "function CheckIERS($ie) {\r\n\tif (strlen($ie) != 10) {\r\n\t\treturn 0;\r\n\t} else {\r\n\t\t$b = 2;\r\n\t\t$soma = 0;\r\n\t\tfor ($i = 0; $i <= 8; $i++) {\r\n\t\t\t$soma += $ie[$i] * $b;\r\n\t\t\t$b--;\r\n\t\t\tif ($b == 1) {\r\n\t\t\t\t$b = 9;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$dig = 11 - ($soma % 11);\r\n\t\tif ($dig >= 10) {\r\n\t\t\t$dig = 0;\r\n\t\t}\r\n\r\n\t\treturn ($dig == $ie[9]);\r\n\t}\r\n}", "function is_not_zero($num){\n\tif($num <= 0){\n\t\treturn 1;\n\t}\n\t\n\treturn $num;\t\n}", "public function invalidIntegers() {}", "function TestNumber($N) {\t\r\n\t\tglobal $DecentNumber, $Max5s, $Max3s, $SolutionFound;\r\n\t\tswitch ($N) {\r\n\t\t// Too small to start\r\n\t\t\tCase ($N <= 2):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 3 - early success exit\r\n\r\n\t\t\tCase ($N == 3):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = 1;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"555\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 4 - Fail\r\n\t\r\n\t\t\tCase ($N == 4):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for Special Success MOD 3 = 0, If this is true, then we found a special case of all 5's.\r\n\t\t\r\n\t\t\tCase (($N % 3) == 0):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = $N / 3;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = AssembleString($Max5s, $Max3s);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\tGeneralCase ($N);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "function testIn60($num)\n\t{\n\t\treturn $this->testInN($num,60);\n\t}", "function has_number($value , $options = []){\r\n if(!is_numeric($value)){\r\n return false;\r\n }\r\n if(isset($options['max']) && ($value > (int) $options['max'])){\r\n return false;\r\n }\r\n if(isset($options['min'])&& ($value < (int) $options['min'])){\r\n return false;\r\n }\r\n return true;\r\n}", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\n}", "function singleFromMult($num){\n if ( $num > 0)\n {\n return ($num - 1) % 9 + 1;\n }\n else\n {\n return 0;\n }\n}", "function findVal($num, $multiple1, $multiple2, $valTrue) {\n\tif ( ((int)$num % $multiple1 == 0) && ((int)$num % $multiple2 == 0) && is_numeric($num) )\n\t{\n\t\treturn $valTrue;\n\t} \n\treturn $num;\n}", "function differentNumbers($number) {\n\t$arr = array();\n\tfor ($i=0; $i < 10; $i++) {\n\t\t$x = substr_count($number, $i);\n\t\t$arr[\"$i\"] = $x;\n\t}\n\t$count = count(array_filter($arr));\n\tswitch ($count) {\n\t\tcase 8:\n\t\treturn 0.8;\n\t\tbreak;\n\t\tcase 7:\n\t\treturn 0.9;\n\t\tbreak;\n\t\tcase 6:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tcase 5:\n\t\treturn 1.8;\n\t\tbreak;\n\t\tcase 4:\n\t\treturn 2.7;\n\t\tbreak;\n\t\tcase 3:\n\t\treturn 3.2; // Bliver lavere igen herefter, da numre med kun 2 eller 1 tal bliver højere gennem de andre funktioner alligevel\n\t\tbreak;\n\t\tcase 2:\n\t\treturn 2.1;\n\t\tbreak;\n\t\tcase 1:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tdefault:\n\t\treturn 0.8;\n\t\tbreak;\n\t}\n}", "public static function valid_positive_integer($value){\n\t\treturn preg_match('@^[0-9]+$@',$value) === 1;\n\t}", "function isInteger($value){\n\t\t$regExp =\t\"/[0-9]/\";\n\t\t$toBeTested = trim($value);\n\t\t$tested= preg_match_all($regExp, $toBeTested,$matches);\n\t\tif(count($matches[0]) != strlen($toBeTested)){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function isKrishnamurthyNumber($n) \r\n{ \r\n $sum = 0; \r\n \r\n // Storing the value in \r\n // other variable \r\n $temp = $n; \r\n \r\n while($temp != 0) \r\n { \r\n // calculate factorial of last digit \r\n // of temp and add it to sum \r\n $sum = $sum + factorial($temp % 10); \r\n \r\n // Integer Division \r\n // replace value of temp by temp/10 \r\n $temp = intdiv($temp, 10); \r\n } \r\n \r\n // Check if number is krishnamurthy \r\n return $sum == $n; \r\n}", "public static function validateInteger(TextBase $control)\r\n\t{\r\n\t\tforeach ($control->getValue() as $tag) {\r\n\t\t\tif (!Strings::match($tag, '/^-?[0-9]+$/')) {\r\n\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn TRUE;\r\n\t}", "function has_number($value, $options=[])\n{\n if (!is_numeric($value)) {\n return false;\n }\n if (isset($options['max']) && ($value > (int)$options['max'])) {\n return false;\n }\n if (isset($options['min']) && ($value < (int)$options['min'])) {\n return false;\n }\n return true;\n}", "public function testRange() {\n $this->assertEquals(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), Hash::range(0, 10));\n $this->assertEquals(array(0 => 0, 2 => 2, 4 => 4, 6 => 6, 8 => 8, 10 => 10), Hash::range(0, 10, 2));\n $this->assertEquals(array(0 => 0, 3 => 3, 6 => 6, 9 => 9), Hash::range(0, 10, 3));\n $this->assertEquals(array(0 => 0, 13 => 13, 26 => 26, 39 => 39, 52 => 52, 65 => 65, 78 => 78, 91 => 91), Hash::range(0, 100, 13));\n $this->assertEquals(array(23 => 23, 29 => 29, 35 => 35, 41 => 41, 47 => 47, 53 => 53, 59 => 59, 65 => 65), Hash::range(23, 66, 6));\n\n $this->assertEquals(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), Hash::range(0, 10, 1, false));\n $this->assertEquals(array(0, 2, 4, 6, 8, 10), Hash::range(0, 10, 2, false));\n $this->assertEquals(array(0, 3, 6, 9), Hash::range(0, 10, 3, false));\n $this->assertEquals(array(0, 13, 26, 39, 52, 65, 78, 91), Hash::range(0, 100, 13, false));\n $this->assertEquals(array(23, 29, 35, 41, 47, 53, 59, 65), Hash::range(23, 66, 6, false));\n\n // reverse\n $this->assertEquals(array(5 => 5, 4 => 4, 3 => 3, 2 => 2, 1 => 1, 0 => 0), Hash::range(5, 0, 1));\n $this->assertEquals(array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0), Hash::range(10, 0, 1, false));\n $this->assertEquals(array(65, 59, 53, 47, 41, 35, 29, 23), Hash::range(65, 23, 6, false));\n }", "function upc_checkdigit($string)\n{\n if (!ctype_digit($string))\n {\n return false;\n }\n else\n {\n if (strlen($string) == 12)\n {\n $string = substr($string,0,11);\n }\n elseif (strlen($string) != 11)\n {\n return false;\n }\n\n $x = (($string{0} + $string{2} + $string{4} + $string{6} + $string{8} + $string{10})*3) + ($string{1} + $string{3} + $string{5} + $string{7} + $string{9});\n $r = $x % 10;\n $d = ($r > 0) ? 10 - $r : $r;\n\n return $string . $d;\n }\n}", "public function validate(string $number): bool;", "public static function validate_integer_pure_valid_values($val) {\n\t//--\n\tif((self::validate_numeric_pure_valid_values($val)) AND ($val >= PHP_INT_MIN) AND ($val <= PHP_INT_MAX)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t} //end if\n\t//--\n}", "private function test_number($value)\r\n {\r\n $value = str_replace(',', '.', $value);\r\n return is_numeric($value);\r\n }", "function is_integer_val($value) {\n\treturn (!preg_match(\"/\\D/\", $value)) ? true : false;\n}", "function isDigits ($testString)\n {\n return ctype_digit($testString);\n }", "function validateNumberOrRange($number, $min_value, $max_value)\n {\n $result=false;\n\n if (filter_var($number, FILTER_VALIDATE_INT)===0 || !filter_var($number, FILTER_VALIDATE_INT)===false) //number provided\n {\n if ($number>=$min_value && $number<=$max_value)\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n\n if (stristr($number, \"-\")) //range provided\n {\n $numbers_array=explode(\"-\", $number);\n if (filter_var($numbers_array[0], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[0], FILTER_VALIDATE_INT)===false && filter_var($numbers_array[1], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[1], FILTER_VALIDATE_INT)===false)\n {\n if ($numbers_array[0]>=$min_value && $numbers_array[1]<=$max_value && $numbers_array[0]<=$numbers_array[1])\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n }\n\n return $result;\n }", "function fiftyone_degrees_get_is_numeric($value) {\n return ($value >= ord('0') && $value <= ord('9'));\n}", "function int1 ($var){\n\tif (preg_match(\"|^[\\(\\)\\-+\\ 0-9]+$|\",$var)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t\t}\n\t}", "function isPowerOf($number, $k) {\n\t\t$check = false;\n\n\t\twhile($number > 0) {\n\t\t\t$digit = $number % $k;\n\n\t\t\tif($digit > 1) return false;\n\n\t\t\tif($digit == 1) {\n\t\t\t\tif($check) return false;\n\t\t\t\t$check = true;\n\t\t\t}\n\n\t\t\t$number /= $k;\n\t\t}\n\n\t\treturn true;\n\t}", "function checkTrips($numbers) {\n\t//TODO: Tjek om der er \"trips\"\n}", "function isArmstrongNumber(int $num = 0): bool\n{\n if ($num < 0 || !is_int($num))\n throw new RangeException(\"Input must be a positive integer.\");\n\n $sum = 0;\n $s_num = (string) $num;\n $len = strlen($s_num);\n for ($idx = 0; $idx < $len; $idx++) {\n $sum += $s_num[$idx] ** $len;\n }\n\n return $sum === $num;\n}", "static function checkInteger($param) {\n \n if(isset($param) && is_numeric($param)) { \n return true;\n } else {\n return false;\n }\n }", "function retornarSiEsCero ($numeroingresado)\n{\n \n if($numeroingresado == 0)\n {\n return true;\n }\n\n else\n {\n return false;\n }\n echo \"<br>El numeros es: \" .retornarSiEsCero(0);//coloco un numero\n\n}", "function CheckIERN($ie) {\r\n\tif (!( (strlen($ie) == 9) || (strlen($ie) == 10) )) {\r\n\t\treturn 0;\r\n\t} else {\r\n\t\t$b = strlen($ie);\r\n\t\tif ($b == 9) {\r\n\t\t\t$s = 7;\r\n\t\t} else {\r\n\t\t\t$s = 8;\r\n\t\t}\r\n\t\t$soma = 0;\r\n\t\tfor ($i = 0; $i <= $s; $i++) {\r\n\t\t\t$soma += $ie[$i] * $b;\r\n\t\t\t$b--;\r\n\t\t}\r\n\t\t$soma *= 10;\r\n\t\t$dig = $soma % 11;\r\n\t\tif ($dig == 10) {\r\n\t\t\t$dig = 0;\r\n\t\t}\r\n\r\n\t\t$s += 1;\r\n\t\treturn ($dig == $ie[$s]);\r\n\t}\r\n}", "function primo($num) {\n if ($num == 2 || $num == 3 || $num == 5 || $num == 7) {\n return True;\n } else {\n if ($num % 2 != 0) {\n for ($i = 3; $i <= sqrt($num); $i += 2) {\n if ($num % $i == 0) {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n }", "protected static function validateDigits($digits)\n {\n $availDigits = $digits;\n $remainder = '';\n $neededDigits = 9;\n\n // Calculate remainder in chunks of 9 digits\n while (strlen($availDigits) > 0) {\n if (strlen($availDigits) > $neededDigits) {\n $curDigits = $remainder . substr($availDigits, 0, $neededDigits);\n $availDigits = substr($availDigits, $neededDigits);\n } else {\n $curDigits = $remainder . $availDigits;\n $availDigits = '';\n }\n\n // Calculate new remainder\n $remainder = (int) $curDigits % 97;\n $neededDigits = 9 - strlen($remainder);\n }\n\n // Check if the final remainder equals 1\n return ($remainder === 1);\n }", "function IsNumberType($type)\n{\n\tif($type==20 || $type==14 || $type==5 || $type==10 || $type==6 \n\t|| $type==3 || $type==131 || $type==4 || $type==2 || $type==16\n\t|| $type==21 || $type==19 || $type==18 || $type==17 || $type==139\n\t|| $type==11)\n\t\treturn true;\n\treturn false;\n}", "function fullNumber($newNum){\n switch ($newNum){ \n case ($newNum < 100000): \n echo \"000\" . $newNum;\n break; \n case ($newNum < 1000000): \n echo \"00\" . $newNum;\n break; \n case ($newNum < 10000000): \n echo \"0\" . $newNum; \n break; \n default: \n echo $newNum;\n break; \n } \n}", "private function CheckNumber($n){\n\t\tif($n<=0){\n\t\t\treturn false;\n\t\t}else if($n==1 || $n==2){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t$checkFlag = true;\n\t\t\tfor($i=2;$i<=sqrt($n);$i++){\n\t\t\t\tif($n%$i==0){\n\t\t\t\t\t$checkFlag =false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $checkFlag;\n\t\t}\n\n\t}", "static function isANumber($value) {\n // check whether the integer value has the same length like the entered string\n return is_numeric($value) && strlen(intval($value)) == strlen($value);\n }", "public function checkNumber($value, $lifetime=5400)\n\t\t{\n\t\t\t$time = intval(time()/10);\n\t\t\tfor($i = 0; $i < $lifetime; $i++)\n\t\t\t\tif($value == $this->calculate($this->getNumericSalt()+$time-$i, $this->min, $this->max))\n\t\t\t\t\treturn true; // this is a legal value\n\n\t\t\treturn false; // no legal values found the last 90 minutes\n\t\t}", "public function testValidateNumber(): void\n {\n $this->assertTrue($this->validate(1));\n }", "public function cardNumber($value): bool\n {\n if (!is_string($value) || strlen($value) < 12) {\n return false;\n }\n\n $result = 0;\n $odd = strlen($value) % 2;\n preg_replace('/[^0-9]+/', '', $value);\n\n for ($i = 0; $i < strlen($value); ++$i) {\n $result += $odd\n ? $value[$i]\n : (($value[$i] * 2 > 9) ? $value[$i] * 2 - 9 : $value[$i] * 2);\n\n $odd = !$odd;\n }\n\n // Check validity.\n return ($result % 10 == 0) ? true : false;\n }", "function is_digit($char) {\n return (($char >= '0' && $char <= '9')) ? true : false;\n }", "function test(Array $number)\n\t{\n\t\t$replace = [\n\t\t\t'Linio' => 3,\n\t\t\t'IT' => 5,\n\t\t\t'Linianos' => [3,5]\n\t\t];\n\n\t\tforeach ($number as $key => $value) {\n\t\t\tif (!is_numeric($value) && array_key_exists($value, $replace)) {\n\n\t\t\t\t$test = (!is_array($replace[$value])) ? ($key % $replace[$value] == 0) : ($key % $replace[$value][0] == 0 && $key % $replace[$value][1] == 0);\n\t\t\t\t\n\t\t\t\tif (!$test) {\n\t\t\t\t\techo \"Failure\";\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \">>>>>>>>>>>>>>>>>>>>>>> Test Success <<<<<<<<<<<<<<<<<<<<<<<<<<<<\";\n\t}", "function iqTest(string $numbers): int\n{\n /** @var array{int} $arrayInt */\n $arrayInt = array_map(function ($val) {\n return $val % 2;\n }, explode(' ', $numbers));\n /** @var int $diffValue */\n $diffValue = array_sum($arrayInt) === 1 ? 1 : 0;\n\n return array_search($diffValue, $arrayInt) + 1;\n}", "function df_is_int($v):bool {return is_numeric($v) && ($v == (int)$v);}", "function GetCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n $r=$sum%10;\n if($r>0)\n $r=10-$r;\n return $r;\n }", "function is_lucky($ticket) {\n $t = add_zeroes($ticket);\n $first = (int)$t[0] + (int)$t[1] + (int)$t[2]; //first and...\n $second = (int)$t[3] + (int)$t[4] + (int)$t[5]; //last three digits..\n return $first == $second; //compared\n}", "function esNumero($n1, $n2){\n if(is_numeric($n1) && is_numeric($n2)){\n \n }\n\n}", "function GetCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n $r=$sum%10;\n if($r>0)\n $r=10-$r;\n return $r;\n }", "function is_ugly($num)\n {\n $z = $num;\n if ($num == 0)\n {\n return \"$num is not an Ugly number\";\n }\n \n $x = array(2, 3, 5);\n foreach ($x as $i)\n {\n while ($num % $i == 0)\n {\n $num /= $i;\n }\n } \n if ($num==1)\n {\n return \"$z is an Ugly number\";\n }\n else\n {\n return \"$z is not an Ugly number\";\n }\n\n }", "public function testRegistrationValuesContainNumbers(): void { }", "private static function valueIsValidForColumnsNumber($value)\n\t{\n\t\t$value_is_integer = is_integer($value);\n\t\t$value_is_greater_than_zero = ($value > 0);\n\t\t\n\t\t$value_is_valid = $value_is_integer && $value_is_greater_than_zero;\n\t\t\n\t\treturn $value_is_valid;\n\t}", "public function testIsEvenNumber()\n\t{\n\t\t$this->assertTrue(ParityGame\\isEvenNumber(2));\n\t\t$this->assertTrue(ParityGame\\isEvenNumber(10));\n\n\t\t$this->assertFalse(ParityGame\\isEvenNumber(7));\n\t\t$this->assertFalse(ParityGame\\isEvenNumber(21));\n\t}", "public function isValid($value): bool\n {\n return is_null($value) || (is_int($value) && $value > 9);\n }", "private static function IsNumeric( int|string $n ) : bool\n\t{\n\t\tif( is_int( $n ) )\n\t\t{\n\t\t\treturn $n > 0;\n\t\t}\n\n\t\treturn preg_match( '/^[1-9][0-9]{0,19}$/', $n ) === 1;\n\t}", "function isNum($s){return is_numeric($s) ? true : false;}", "static public function testInt($value) {\n\t\tstatic $useOldGoodTestInt = null;\n\n\t\tif (is_null($useOldGoodTestInt)) {\n\t\t\t$useOldGoodTestInt = !class_exists('t3lib_utility_Math');\n\t\t}\n\t\tif ($useOldGoodTestInt) {\n\t\t\t$result = t3lib_div::testInt($value);\n\t\t}\n\t\telse {\n\t\t\t$result = t3lib_utility_Math::canBeInterpretedAsInteger($value);\n\t\t}\n\t\treturn $result;\n\t}", "public function testExample()\n {\n echo \" testing numbers \";\n $isbnNumbers = [\n \"807229654X\", \"807229654\", \"978 032 640 615-1\", \"978032640615\", \"0072296542\",\n \"176041640615766\", \"0072296552\", \"007-229-654 2\", \"2460323406152\"\n ];\n $results = [1,0,1,0,1,0,0,1,1];\n\n $evaluated = [];\n foreach ($isbnNumbers as $isbn) {\n $evaluated[$isbn] = Helpers\\ISBN::isValidISBN($isbn);\n }\n $index = 0;\n $true = true;\n\n foreach($evaluated as $number => $output) {\n $true = $true && ($results[$index] == $output['valid']);\n if(!$true) {\n echo $results[$index].\" true: \".($true? \"1 \":\"0 \");\n print_r($output);\n }\n $index++;\n }\n\n $this->assertTrue($true);\n }" ]
[ "0.66635835", "0.66576004", "0.66089284", "0.6532612", "0.65060383", "0.648335", "0.64612067", "0.642175", "0.6297157", "0.629697", "0.62947184", "0.6213491", "0.6199888", "0.61905664", "0.6164627", "0.609434", "0.60599965", "0.6057881", "0.6038606", "0.60228014", "0.6018898", "0.60141957", "0.6011808", "0.5974436", "0.59672225", "0.5961858", "0.5956671", "0.5948265", "0.59230727", "0.5895312", "0.589319", "0.5849565", "0.5848005", "0.58332264", "0.581324", "0.58026266", "0.5796069", "0.57948047", "0.57886505", "0.5787828", "0.57791597", "0.5776365", "0.5775569", "0.5740023", "0.57301736", "0.5723429", "0.5711171", "0.5707994", "0.5703857", "0.5702639", "0.57018566", "0.5697472", "0.5686591", "0.56767124", "0.56647915", "0.56623596", "0.5659545", "0.5657927", "0.565663", "0.56520146", "0.5651497", "0.56477225", "0.5633091", "0.5629115", "0.562888", "0.5624412", "0.56160676", "0.5585014", "0.5579316", "0.55739915", "0.55718297", "0.5569949", "0.55550313", "0.5551418", "0.55476576", "0.55416363", "0.553285", "0.55294317", "0.5522768", "0.5522139", "0.5520249", "0.5514829", "0.5509655", "0.55086637", "0.5507267", "0.5506438", "0.5490035", "0.54851294", "0.5471555", "0.54692364", "0.54608387", "0.54581344", "0.54501987", "0.5424393", "0.5410759", "0.5402653", "0.54002774", "0.5399181", "0.5397304", "0.5395428", "0.5394963" ]
0.0
-1
Testing numbers between 10 and 99
public function testTens(): void { $tens = [ 11 => 'once', 12 => 'doce', 16 => 'dieciseis', 19 => 'diecinueve', 20 => 'veinte', 21 => 'veintiuno', 26 => 'veintiseis', 30 => 'treinta', 31 => 'treinta y uno', 40 => 'cuarenta', 43 => 'cuarenta y tres', 50 => 'cincuenta', 55 => 'cincuenta y cinco', 60 => 'sesenta', 67 => 'sesenta y siete', 70 => 'setenta', 79 => 'setenta y nueve', ]; foreach ($tens as $number => $word) { self::assertEquals( $word, $this->handle->toWords($number, $this->locale) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function range_met($n)\n{\n if ($n >= 1 && $n <= 100) {\n return TRUE;\n }\n return FALSE;\n}", "function check_ten($ten)\n{\n\treturn TRUE;\n}", "function testInN($num,$n)\n\t{\n\t\tif(!is_numeric($num)) return false;\n\t\tif(!is_numeric($n)) return false;\n\t\tif($num<0) return false;\n\t\tif($n<0) return false;\n\t\t\n\t\tif($num<=$n) return true;\n\t\treturn false;\n\t}", "function cp_intIsBetween($number,$min,$max){\r\n if(!cp_str_isInt($number)){\r\n return false;\r\n }\r\n\r\n return $number >= $min && $number <= $max;\r\n}", "public function testRandom() {\n\t\t$results = array();\n\t\tforeach (range(0, 100) as $run) {\n\t\t\t$results[] = _::random(10);\n\t\t}\n\t\t$this->assertContainsOnly('int', $results);\n\t\t$this->assertGreaterThanOrEqual(0, min($results));\n\t\t$this->assertLessThanOrEqual(10, max($results));\n\t}", "function numero($s)\n{\n\t$j=0;\n\t$valor=false;\n\tfor($j=1; $j<10;$j++){\n\t\tif($s==$j){\n\t\t\t$valor=true;\n\t\t}\n\t}\n\treturn $valor;\n}", "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "function numberInRange($a_iStart, $a_iEnd, $a_iNumber)\n\t{\n\t\t// and starts with \"0\"\n\t\t$iStrLen = strlen($a_iNumber);\n\t\tif((substr($a_iNumber,0,1) == \"0\") && ($iStrLen > 1))\n\t\t\t$iNumber = substr($a_iNumber, 1, $iStrLen);\n\t\telse\n\t\t\t$iNumber = $a_iNumber;\n\n\t\tif($iNumber < $a_iStart)\n\t\t\treturn false;\n\t\telseif($iNumber > $a_iEnd)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "private function _valid($numValue){\n\t\tif(!is_int($numValue)){\n\t\t\t//throws error\n\t\t\techo \"not an int\";\n\t\t\treturn 0;\n\t\t}\n\n\t\tif($numValue < 1 || $numValue > 100){\n\t\t\t//throws error\n\t\t\techo \"not in range\";\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}", "public function checkNumbers($str)\r\n {\r\n $this->explodeString = explode(',', $str);\r\n\r\n foreach ($this->explodeString as $val) {\r\n if ($val < 1001) {\r\n $this->lesserArray[] = $val;\r\n } else {\r\n $this->greaterArray[] = 0;\r\n }\r\n }\r\n if (sizeof($this->lesserArray) > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function checkNum($number) {\n if($number>50) {\n throw new Exception(\" Tavë Kosi has been known for 90 years in Albanian cuisine.\");\n }\n return true;\n}", "function checkNum($red, $stupac, $mjesto) {\n\tif($red%2 == 0){\n\t\t$broj=0;\n\t\tif($stupac == 1){\n\t\t\t$broj= $mjesto-9;\n\t\t\techo $broj;\n\t\t} else {\n\t\t\t$broj = $mjesto / 10;\n\t\t\t$broj = floor($broj);\n\t\t\t$broj *= 10;\n\t\t\t$broj += $stupac;\n\t\t\techo $broj . \" i \" . $red ;\n\t\t}\n\n\t} else {\n\t\techo $mjesto;\n\t}\n\n}", "function betweenIntRange($value, $params = array()) {\t\t\n\t\t$min = 0;\n\t\t$max = 255;\n\t\textract($params);\n\t\tif (is_array($value)) {\n\t\t\t$value = array_shift($value);\n\t\t}\n\t\tif (preg_match('/^[0-9]+$/', $value)) {\n\t\t\tif ($value >= $min && $value <= $max) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\t\t\n\t\treturn false;\n\t}", "function testIn7()\n\t{\n\t\treturn $this->testinN($num,7);\n\t}", "public function ifNum($num);", "function TestNumber($N) {\t\r\n\t\tglobal $DecentNumber, $Max5s, $Max3s, $SolutionFound;\r\n\t\tswitch ($N) {\r\n\t\t// Too small to start\r\n\t\t\tCase ($N <= 2):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 3 - early success exit\r\n\r\n\t\t\tCase ($N == 3):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = 1;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"555\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 4 - Fail\r\n\t\r\n\t\t\tCase ($N == 4):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for Special Success MOD 3 = 0, If this is true, then we found a special case of all 5's.\r\n\t\t\r\n\t\t\tCase (($N % 3) == 0):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = $N / 3;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = AssembleString($Max5s, $Max3s);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\tGeneralCase ($N);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "function is_entier($n) {\nreturn ($n>0 || $n=='0');\n}", "function verify_creditcard_mod10($strccno = '')\n {\n if (empty($strccno))\n {\n return false;\n }\n $len = mb_strlen($strccno);\n if ($len < 13 OR $len > 16)\n {\n return false;\n }\n $checkdig = (int)$strccno[--$len];\n for ($i=--$len, $sum = 0, $dou = true; $i >= 0; $i--, $dou =! $dou)\n {\n $curdig = (int)$strccno[$i];\n if ($dou)\n {\n $curdig *= 2;\n if ($curdig > 9) $curdig-=9;\n }\n $sum += $curdig;\n }\n if (($checkdig + $sum) % 10 == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function TestCheckDigit($barcode)\n{\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n}", "function func3($n) {\n for ($k = 0; $n; $n = (int) ($n / 10)) {\n $k = $n * 10;\n if ($k > $n)\n $n = $k;\n }\n return $n;\n}", "public function test_it_prints() {\n // ADDED: check if the number contains the value as \"string\" (ie 13 is Fizz, 53 is Buzz etc)\n $expected = '1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz Fizz 14 FizzBuzz? 16 17 Fizz 19 Buzz Fizz 22 Fizz Fizz Buzz ';\n $this->assertEquals($expected, $this->kata->printFizzBuzzRange(1, 25));\n }", "function has_number($value , $options = []){\r\n if(!is_numeric($value)){\r\n return false;\r\n }\r\n if(isset($options['max']) && ($value > (int) $options['max'])){\r\n return false;\r\n }\r\n if(isset($options['min'])&& ($value < (int) $options['min'])){\r\n return false;\r\n }\r\n return true;\r\n}", "public function isValid($number);", "function has_number($value, $options=[])\n{\n if (!is_numeric($value)) {\n return false;\n }\n if (isset($options['max']) && ($value > (int)$options['max'])) {\n return false;\n }\n if (isset($options['min']) && ($value < (int)$options['min'])) {\n return false;\n }\n return true;\n}", "function checkInteger($var) {\r\n\r\n\tif(preg_match('!^\\d+$!', $var)) { return true; } else { return false; }\r\n\r\n}", "function TestNumber($firstNumber, $secondNumber)\n {\n //Déclaration des messages\n $Number1Win = \"Le premier nombre est plus grand\";\n $Number1Lose = \"Le premier nombre est plus petit\";\n $Number1Equal = \"Les deux nombres sont identiques\";\n\n //Test\n if($firstNumber > $secondNumber){\n return $Number1Win;\n }\n elseif($firstNumber < $secondNumber){\n return $Number1Lose;\n }\n else{\n return $Number1Equal;\n }\n\n }", "function validateNumberOrRange($number, $min_value, $max_value)\n {\n $result=false;\n\n if (filter_var($number, FILTER_VALIDATE_INT)===0 || !filter_var($number, FILTER_VALIDATE_INT)===false) //number provided\n {\n if ($number>=$min_value && $number<=$max_value)\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n\n if (stristr($number, \"-\")) //range provided\n {\n $numbers_array=explode(\"-\", $number);\n if (filter_var($numbers_array[0], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[0], FILTER_VALIDATE_INT)===false && filter_var($numbers_array[1], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[1], FILTER_VALIDATE_INT)===false)\n {\n if ($numbers_array[0]>=$min_value && $numbers_array[1]<=$max_value && $numbers_array[0]<=$numbers_array[1])\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n }\n\n return $result;\n }", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\n}", "abstract public function validateNumber(): bool;", "function findVal($num, $multiple1, $multiple2, $valTrue) {\n\tif ( ((int)$num % $multiple1 == 0) && ((int)$num % $multiple2 == 0) && is_numeric($num) )\n\t{\n\t\treturn $valTrue;\n\t} \n\treturn $num;\n}", "public static function validate_integer_pure_valid_values($val) {\n\t//--\n\tif((self::validate_numeric_pure_valid_values($val)) AND ($val >= PHP_INT_MIN) AND ($val <= PHP_INT_MAX)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t} //end if\n\t//--\n}", "protected function validateDigits($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_INT) !== false;\n\t}", "function isPosNum($number){\n if(((int)$number) >= 0){\n return true;\n }\n else{\n echo \"invalid number of pages (or words)\";\n return false;\n }\n }", "function check($ran_num) {\n if ($ran_num < 2) {\n return false;\n }\n // check so nguyen to khi n >= 2\n $squareRoot = sqrt ( $ran_num );\n for($i = 2; $i <= $squareRoot; $i ++) {\n if ($ran_num % $i == 0) {\n return false;\n }\n }\n return true;\n }", "public function checkDigit($accountNumber)\n {\n $numbers = str_split($accountNumber);\n array_walk(\n $numbers,\n function (&$no, $key) {\n $no = $no * (10 - $key);\n }\n );\n return array_sum($numbers) % 11;\n }", "public function validIntegers() {}", "private static function ok($number, $min, $max)\n {\n return ($number === null) || (($number >= $min) && ($number <= $max));\n }", "private function test_number($value)\r\n {\r\n $value = str_replace(',', '.', $value);\r\n return is_numeric($value);\r\n }", "public function validate($value)\n {\n $value = preg_replace('/[^\\d]/', '', (string) $value);\n if (strlen($value) != 11 ) {\n return false;\n }\n $acumulado = 0;\n $digits = str_split($value);\n\n // obtain digit\n $digit = array_pop($digits);\n\n for ($i=0; $i < count($digits); $i++ ) {\n $acumulado += $digits[9-$i] * (2 + ($i % 6 ));\n }\n $verif = 11 - ( $acumulado % 11 );\n $verif = $verif == 11? 0 : $verif;\n\n return $digit == $verif;\n }", "static public function testInt($value) {\n\t\tstatic $useOldGoodTestInt = null;\n\n\t\tif (is_null($useOldGoodTestInt)) {\n\t\t\t$useOldGoodTestInt = !class_exists('t3lib_utility_Math');\n\t\t}\n\t\tif ($useOldGoodTestInt) {\n\t\t\t$result = t3lib_div::testInt($value);\n\t\t}\n\t\telse {\n\t\t\t$result = t3lib_utility_Math::canBeInterpretedAsInteger($value);\n\t\t}\n\t\treturn $result;\n\t}", "public static function check(string $number = NULL)\n {\n $table = \n [\n\t\t\t[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],\n\t\t\t[0, 2, 4, 6, 8, 1, 3, 5, 7, 9]\n\t\t];\n\n\t\t$total = 0; $transform = 0;\n\n\t\tfor( $i = strlen($number ?? '') - 1; $i >= 0; $i-- )\n\t\t{\n\t\t\t$total += $table[$transform++ & 0x1][$number[$i]];\n\t\t}\n\n\t\treturn $total % 10 === 0;\n }", "public function testRange() {\n $this->assertEquals(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), Hash::range(0, 10));\n $this->assertEquals(array(0 => 0, 2 => 2, 4 => 4, 6 => 6, 8 => 8, 10 => 10), Hash::range(0, 10, 2));\n $this->assertEquals(array(0 => 0, 3 => 3, 6 => 6, 9 => 9), Hash::range(0, 10, 3));\n $this->assertEquals(array(0 => 0, 13 => 13, 26 => 26, 39 => 39, 52 => 52, 65 => 65, 78 => 78, 91 => 91), Hash::range(0, 100, 13));\n $this->assertEquals(array(23 => 23, 29 => 29, 35 => 35, 41 => 41, 47 => 47, 53 => 53, 59 => 59, 65 => 65), Hash::range(23, 66, 6));\n\n $this->assertEquals(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), Hash::range(0, 10, 1, false));\n $this->assertEquals(array(0, 2, 4, 6, 8, 10), Hash::range(0, 10, 2, false));\n $this->assertEquals(array(0, 3, 6, 9), Hash::range(0, 10, 3, false));\n $this->assertEquals(array(0, 13, 26, 39, 52, 65, 78, 91), Hash::range(0, 100, 13, false));\n $this->assertEquals(array(23, 29, 35, 41, 47, 53, 59, 65), Hash::range(23, 66, 6, false));\n\n // reverse\n $this->assertEquals(array(5 => 5, 4 => 4, 3 => 3, 2 => 2, 1 => 1, 0 => 0), Hash::range(5, 0, 1));\n $this->assertEquals(array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0), Hash::range(10, 0, 1, false));\n $this->assertEquals(array(65, 59, 53, 47, 41, 35, 29, 23), Hash::range(65, 23, 6, false));\n }", "function testForInt($data)\r\n\t{\r\n\t\tif (!filter_var($data, FILTER_VALIDATE_INT) === false)\r\n\t\t{\r\n\t\t\treturn intval($data);\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\techo(\"Integer is not valid<br>\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function valid_number($num) {\r\nif(empty($num) || !is_numeric($num))\r\n return false ; \r\nelse {\r\n $num = intval($num) ; \r\n\tif($num <= 0) \r\n\t\treturn false ;\r\n }\r\n return true ; \r\n}", "function testIn60($num)\n\t{\n\t\treturn $this->testInN($num,60);\n\t}", "public function getLovelyNumbers($start, $end){\n $repeated = 0; $remove_me = 0;\n if($end<$start){ return 'Action can not be completed : End number should be greater'; }\n for ($i = $start ; $i <= $end; $i++) \n { \n $repeated++;\n $crnt_number = $i; \n $history = array(); \n while($crnt_number) \n { \n if(isset($history[$crnt_number%10])){\n $ct = $crnt_number%10;\n if($ct/10==0) { \n $history[$crnt_number%10] = ($history[$crnt_number%10])+1;\n }\n if($history[$crnt_number%10]==3){ $remove_me++; break; }\n }\n else{\n $history[$crnt_number%10] = 1;\n }\n $crnt_number = (int)$crnt_number / 10; \n }\n }\n $selected_no = $repeated - $remove_me;\n return $selected_no; \n }", "function CheckNums($num1,$num2) { \n if($num2 > $num1) {\n return 'true';\n }\n elseif($num2 < $num1) {\n return 'false';\n }\n else {\n return -1;\n }\n // code goes here\n return $num1; \n \n}", "function tester_function(){\n echo(\"Output for parameter = 10: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(10);\n echo(\"<br>\");\n\n echo(\"Output for parameter = 0: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(0);\n echo(\"<br>\");\n\n echo(\"Output for parameter = 100: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(100);\n echo(\"<br>\");\n\n /*\n Checking the outputs for nums 1 - 99\n */\n /*for($i = 0; $i < 100; $i++){\n echo($i);\n echo(\": \");\n prime_function($i);\n\n }*/\n //prime_function(\"12\"); // Checking to see if it works when number is written as a string\n }", "public function testExample()\n {\n echo \" testing numbers \";\n $isbnNumbers = [\n \"807229654X\", \"807229654\", \"978 032 640 615-1\", \"978032640615\", \"0072296542\",\n \"176041640615766\", \"0072296552\", \"007-229-654 2\", \"2460323406152\"\n ];\n $results = [1,0,1,0,1,0,0,1,1];\n\n $evaluated = [];\n foreach ($isbnNumbers as $isbn) {\n $evaluated[$isbn] = Helpers\\ISBN::isValidISBN($isbn);\n }\n $index = 0;\n $true = true;\n\n foreach($evaluated as $number => $output) {\n $true = $true && ($results[$index] == $output['valid']);\n if(!$true) {\n echo $results[$index].\" true: \".($true? \"1 \":\"0 \");\n print_r($output);\n }\n $index++;\n }\n\n $this->assertTrue($true);\n }", "function fullNumber($newNum){\n switch ($newNum){ \n case ($newNum < 100000): \n echo \"000\" . $newNum;\n break; \n case ($newNum < 1000000): \n echo \"00\" . $newNum;\n break; \n case ($newNum < 10000000): \n echo \"0\" . $newNum; \n break; \n default: \n echo $newNum;\n break; \n } \n}", "function check_armstrong($number){\r\n$n=$number;\r\n$total_sum=0;\r\nwhile($n!=0){\r\n\t$rem=$n%10;\r\n\t$n=$n/10;\r\n\t$sum=1;\r\n\tfor($i=0; $i<3; $i++){\r\n\t\t$sum*=$rem;\r\n\t}\r\n\t$total_sum+=$sum;\r\n\t$sum=1;\r\n}\r\nif($total_sum==$number){\r\n\techo \"It is an armstrong number\".$total_sum;\r\n}\r\nelse{\r\n\techo \"It is not armstrong number\";\r\n\r\n}\r\n}", "function input_number_is_valid( $number ) {\n\t\treturn ( is_numeric( $number ) && $number > 0 );\n\t}", "public function validate(string $number): bool;", "function numbers($x , $y ){\n \n if($x > $y){\n echo 'X is larger than Y';\n }\n else if($x < $y){\n echo 'X is smaller than Y';\n }\n else {\n echo 'X is equal than Y';\n }\n}", "function isArmstrongNumber(int $num = 0): bool\n{\n if ($num < 0 || !is_int($num))\n throw new RangeException(\"Input must be a positive integer.\");\n\n $sum = 0;\n $s_num = (string) $num;\n $len = strlen($s_num);\n for ($idx = 0; $idx < $len; $idx++) {\n $sum += $s_num[$idx] ** $len;\n }\n\n return $sum === $num;\n}", "function validarnumero($numero){ \nif($numero=='0'){\n\t\n}else{\n\tif(is_numeric($numero)) {\n //si es un numero no dice nada\n } else {\n return TRUE;\n }\n}\n \n}", "function validAge($age) {\r\n return is_numeric($age) && $age >= 18 && $age <= 118;\r\n}", "public static function valid_positive_integer($value){\n\t\treturn preg_match('@^[0-9]+$@',$value) === 1;\n\t}", "function validate_Integer($number)\n {\n // condition for validating user input using preg_match conditions.\n if (preg_match('/[1-9]{1}/', $number) && $number > 0) {\n return true;\n }\n }", "function is_digito($digito){\r\n if($digito=='0' || $digito=='1' || $digito=='2' || $digito=='3' || $digito=='4' ||\r\n $digito=='5' || $digito=='6' || $digito=='7' || $digito=='8' || $digito=='9'){return TRUE;\r\n }else{return FALSE;}\r\n}", "public static function validate_numeric_range($value, $start, $end){\n\t\treturn (is_numeric($value) && $value >= $start && $value <= $end);\n\t}", "public function testValidateNumber(): void\n {\n $this->assertTrue($this->validate(1));\n }", "function palindrome_angka($angka) {\n if ($angka >= 0 && $angka <= 9)\n return 9;\n for($i = 0; $i < 1000; $i++){\n $v = strval($i);\n $r = strrev($v);\n $n = intval($v.substr($r,1));\n if ($n >= $angka && $n == true)\n return $n;\n }\n}", "function p3_ex3() {\n $hundred = 100;\n $rand = mt_rand(1, 100);\n for ($i = 20; $hundred >= $i; $hundred--) {\n if ($hundred % 5 == 0 && $hundred != 100)\n $return .= 'resultat : '.($hundred * $rand).'<br />';\n else\n $return .= 'resultat : '.($hundred * $rand).', ';\n }\n\n return $return;\n}", "function retornarSiEsCero ($numeroingresado)\n{\n \n if($numeroingresado == 0)\n {\n return true;\n }\n\n else\n {\n return false;\n }\n echo \"<br>El numeros es: \" .retornarSiEsCero(0);//coloco un numero\n\n}", "function range($valor,$parms)\n\t{\t\t\n\t\tlist($min, $max) = explode(\",\", $parms, 2);\n\t\tif($valor<$min||$valor>$max)\n\t\t{\n\t\t\t$this->CI->form_validation->set_message('range', \"El campo %s debe contener un valor entre {$min} y {$max}.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "private function _checkRange($x, $a, $b) {\r\n\t\treturn ($x >= $a && $x <= $b) ? $x : 0;\r\n\t}", "private function CheckNumber($n){\n\t\tif($n<=0){\n\t\t\treturn false;\n\t\t}else if($n==1 || $n==2){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t$checkFlag = true;\n\t\t\tfor($i=2;$i<=sqrt($n);$i++){\n\t\t\t\tif($n%$i==0){\n\t\t\t\t\t$checkFlag =false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $checkFlag;\n\t\t}\n\n\t}", "public function testRange() {\n\t\t$result = _::range(5);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(0, $result[0]);\n\t\t$this->assertEquals(1, $result[1]);\n\t\t$this->assertEquals(2, $result[2]);\n\t\t$this->assertEquals(3, $result[3]);\n\t\t$this->assertEquals(4, $result[4]);\n\n\t\t// test range with two parameters\n\t\t$result = _::range(1, 4);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(3, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\n\t\t// test range with three parameters\n\t\t$result = _::range(1, 10, 2);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(3, $result[1]);\n\t\t$this->assertEquals(5, $result[2]);\n\t\t$this->assertEquals(7, $result[3]);\n\t\t$this->assertEquals(9, $result[4]);\n\t}", "function sugar_valid_int($value, $min=1, $max=65535) {\n $options = array(\n 'options' => array(\n 'min_range' => $min,\n 'max_range' => $max,\n ),\n );\n return filter_var($value, FILTER_VALIDATE_INT, $options);\n}", "function validateAmount($amount)\n{ \n return is_numeric($amount) && $amount > 0;\n}", "function differentNumbers($number) {\n\t$arr = array();\n\tfor ($i=0; $i < 10; $i++) {\n\t\t$x = substr_count($number, $i);\n\t\t$arr[\"$i\"] = $x;\n\t}\n\t$count = count(array_filter($arr));\n\tswitch ($count) {\n\t\tcase 8:\n\t\treturn 0.8;\n\t\tbreak;\n\t\tcase 7:\n\t\treturn 0.9;\n\t\tbreak;\n\t\tcase 6:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tcase 5:\n\t\treturn 1.8;\n\t\tbreak;\n\t\tcase 4:\n\t\treturn 2.7;\n\t\tbreak;\n\t\tcase 3:\n\t\treturn 3.2; // Bliver lavere igen herefter, da numre med kun 2 eller 1 tal bliver højere gennem de andre funktioner alligevel\n\t\tbreak;\n\t\tcase 2:\n\t\treturn 2.1;\n\t\tbreak;\n\t\tcase 1:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tdefault:\n\t\treturn 0.8;\n\t\tbreak;\n\t}\n}", "function is_ugly($num)\n {\n $z = $num;\n if ($num == 0)\n {\n return \"$num is not an Ugly number\";\n }\n \n $x = array(2, 3, 5);\n foreach ($x as $i)\n {\n while ($num % $i == 0)\n {\n $num /= $i;\n }\n } \n if ($num==1)\n {\n return \"$z is an Ugly number\";\n }\n else\n {\n return \"$z is not an Ugly number\";\n }\n\n }", "Function checkstringContainsDigits($data){\n for($i=0;$i<strlen($data);$i++){\n if($data[$i] == '0' || $data[$i]=='1' || $data[$i]== '2' || $data[$i]== '3' || $data[$i] == '4' || $data[$i]=='5' ||$data[$i]=='6' ||$data[$i]=='7' ||$data[$i]=='8' ||$data[$i]=='9') {\n return true;\n }\n\n }\n return false;\n}", "function number_between($number, $min, $max)\n {\n $number = max($min, $number);\n return min($max, $number);\n }", "function numberRange($start, $end)\n{\n $number_range = range($start, $end);\n\n return $number_range;\n}", "function is_num($arg){ \n\tif (!(int)$arg) {\n\treturn false ;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "private function sanitiseNum($x)\n {\n return filter_var($x, FILTER_VALIDATE_INT, array(\"options\" => array(\"min_range\" => 0, \"max_range\" => 1000000)));\n }", "function valid_int($value, $min = NULL, $max = NULL)\n {\n $valid = (is_int($value) OR (is_numeric($value) && intval($value) == $value));\n \n // If no bounds have been set, we're done.\n if ( ! $valid OR (is_null($min) && is_null($max)))\n {\n return $valid;\n }\n \n $min = is_null($min) ? -INF : (valid_int($min) ? intval($min) : -INF);\n $max = is_null($max) ? INF : (valid_int($max) ? intval($max) : INF);\n \n $value = intval($value);\n $real_min = min($min, $max);\n $real_max = max($min, $max);\n \n return $valid && (min(max($value, $real_min), $real_max) === $value);\n }", "public static function between($n, $min, $max){\r\n\t\treturn isset($n) && intval($n) >= $min && intval($n) < $max;\r\n\t}", "function checkNumber($guess, $mysteryNumber)\n{\n if ($guess == $mysteryNumber) {\n return 'correct';\n } elseif ($guess > $mysteryNumber) {\n return 'high';\n } else {\n return 'low';\n }\n}", "public function invalidIntegers() {}", "function primo($num) {\n if ($num == 2 || $num == 3 || $num == 5 || $num == 7) {\n return True;\n } else {\n if ($num % 2 != 0) {\n for ($i = 3; $i <= sqrt($num); $i += 2) {\n if ($num % $i == 0) {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n }", "function aprovados($nota){\n return $nota >= 7;\n}", "function is_not_zero($num){\n\tif($num <= 0){\n\t\treturn 1;\n\t}\n\t\n\treturn $num;\t\n}", "function mDIGIT(){\n try {\n // Tokenizer11.g:366:3: ( '0' .. '9' ) \n // Tokenizer11.g:367:3: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public static function validateInteger(TextBase $control)\r\n\t{\r\n\t\tforeach ($control->getValue() as $tag) {\r\n\t\t\tif (!Strings::match($tag, '/^-?[0-9]+$/')) {\r\n\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn TRUE;\r\n\t}", "protected function validateRange($value, $parameters){\n\t\treturn ($value >= $parameters[0]) && ($value <= $parameters[1]) && $this->validateNumber($value);\n\t}", "function isPowerOf($number, $k) {\n\t\t$check = false;\n\n\t\twhile($number > 0) {\n\t\t\t$digit = $number % $k;\n\n\t\t\tif($digit > 1) return false;\n\n\t\t\tif($digit == 1) {\n\t\t\t\tif($check) return false;\n\t\t\t\t$check = true;\n\t\t\t}\n\n\t\t\t$number /= $k;\n\t\t}\n\n\t\treturn true;\n\t}", "function test(Array $number)\n\t{\n\t\t$replace = [\n\t\t\t'Linio' => 3,\n\t\t\t'IT' => 5,\n\t\t\t'Linianos' => [3,5]\n\t\t];\n\n\t\tforeach ($number as $key => $value) {\n\t\t\tif (!is_numeric($value) && array_key_exists($value, $replace)) {\n\n\t\t\t\t$test = (!is_array($replace[$value])) ? ($key % $replace[$value] == 0) : ($key % $replace[$value][0] == 0 && $key % $replace[$value][1] == 0);\n\t\t\t\t\n\t\t\t\tif (!$test) {\n\t\t\t\t\techo \"Failure\";\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \">>>>>>>>>>>>>>>>>>>>>>> Test Success <<<<<<<<<<<<<<<<<<<<<<<<<<<<\";\n\t}", "public function testShouldReturnTrue()\n\t{\n\t\t$this->assertTrue(SRPH\\Luhn\\luhn('7992739877'));\n\t\t$this->assertTrue(SRPH\\Luhn\\luhn('79927398712'));\n\t}", "static function checkInteger($param) {\n \n if(isset($param) && is_numeric($param)) { \n return true;\n } else {\n return false;\n }\n }", "function is_lucky($ticket) {\n $t = add_zeroes($ticket);\n $first = (int)$t[0] + (int)$t[1] + (int)$t[2]; //first and...\n $second = (int)$t[3] + (int)$t[4] + (int)$t[5]; //last three digits..\n return $first == $second; //compared\n}", "public function shouldGetPM10(): void\n {\n $this->assertPollutantLevel('getPM10', $this->faker->randomFloat(2, 0, 500));\n }", "protected final function _isValidInt($key,$value){\n\n if(!is_numeric($value) || strpos($value,'.') !== false){\n return $this->setError($key,\"`{$key}` must be a integer\");\n }//if\n\n if(!$this->_isBetweenMinAndMax($key,$value)){\n return false;\n }//if\n\n return true;\n\n }", "function UglyNumber($number)\n{\n while ($number%2 == 0){\n $number = $number/2;\n }\n while ($number%3 == 0){\n $number = $number/3;\n }\n while ($number%5 == 0){\n $number = $number/5;\n }\n if($number == 1){\n return 1;\n }else{\n return 0;\n }\n}", "public function checkNumber($value, $lifetime=5400)\n\t\t{\n\t\t\t$time = intval(time()/10);\n\t\t\tfor($i = 0; $i < $lifetime; $i++)\n\t\t\t\tif($value == $this->calculate($this->getNumericSalt()+$time-$i, $this->min, $this->max))\n\t\t\t\t\treturn true; // this is a legal value\n\n\t\t\treturn false; // no legal values found the last 90 minutes\n\t\t}", "function iqTest(string $numbers): int\n{\n /** @var array{int} $arrayInt */\n $arrayInt = array_map(function ($val) {\n return $val % 2;\n }, explode(' ', $numbers));\n /** @var int $diffValue */\n $diffValue = array_sum($arrayInt) === 1 ? 1 : 0;\n\n return array_search($diffValue, $arrayInt) + 1;\n}", "function testIn24()\n\t{\n\t\treturn $this->testInN($num,24);\n\t}", "private static function IsNumeric( int|string $n ) : bool\n\t{\n\t\tif( is_int( $n ) )\n\t\t{\n\t\t\treturn $n > 0;\n\t\t}\n\n\t\treturn preg_match( '/^[1-9][0-9]{0,19}$/', $n ) === 1;\n\t}" ]
[ "0.70372903", "0.6980732", "0.6732189", "0.6524968", "0.62830395", "0.6241937", "0.61779535", "0.6170057", "0.612299", "0.6109589", "0.6098868", "0.60571456", "0.6056869", "0.60308397", "0.6020846", "0.59743077", "0.5950497", "0.59430397", "0.59410936", "0.5939873", "0.5935562", "0.59090513", "0.5899119", "0.58340555", "0.5826233", "0.58259815", "0.5822721", "0.581567", "0.57992685", "0.574135", "0.5728731", "0.5724052", "0.5718351", "0.57154655", "0.5697272", "0.5692431", "0.56771404", "0.5675605", "0.5673199", "0.564119", "0.56346", "0.5612036", "0.5601098", "0.5580237", "0.5574812", "0.55636334", "0.55615026", "0.5560478", "0.5551882", "0.5543824", "0.5543175", "0.55412316", "0.55390435", "0.5534987", "0.5532615", "0.5520578", "0.5520484", "0.55094457", "0.55044", "0.5499738", "0.54981554", "0.54921645", "0.54908466", "0.54784036", "0.5463074", "0.54611915", "0.54439694", "0.54395264", "0.54203117", "0.5416566", "0.54046744", "0.53845465", "0.5379695", "0.537323", "0.5368671", "0.5368269", "0.53654015", "0.53635854", "0.53629667", "0.53611475", "0.5360227", "0.5343068", "0.53408855", "0.5338912", "0.53387916", "0.5318689", "0.5306352", "0.5293902", "0.5292229", "0.52899486", "0.52861965", "0.5284998", "0.52816504", "0.527736", "0.5272073", "0.52716625", "0.5248433", "0.5243221", "0.52419364", "0.523634", "0.5223615" ]
0.0
-1
Testing numbers between 100 and 999
public function testHundreds(): void { $hundreds = [ 100 => 'cien', 101 => 'ciento uno', 199 => 'ciento noventa y nueve', 203 => 'doscientos tres', 287 => 'doscientos ochenta y siete', 300 => 'trescientos', 356 => 'trescientos cincuenta y seis', 410 => 'cuatrocientos diez', 434 => 'cuatrocientos treinta y cuatro', 578 => 'quinientos setenta y ocho', 689 => 'seiscientos ochenta y nueve', 729 => 'setecientos veintinueve', 894 => 'ochocientos noventa y cuatro', 999 => 'novecientos noventa y nueve', ]; foreach ($hundreds as $number => $word) { self::assertEquals( $word, $this->handle->toWords($number, $this->locale) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function range_met($n)\n{\n if ($n >= 1 && $n <= 100) {\n return TRUE;\n }\n return FALSE;\n}", "function testInN($num,$n)\n\t{\n\t\tif(!is_numeric($num)) return false;\n\t\tif(!is_numeric($n)) return false;\n\t\tif($num<0) return false;\n\t\tif($n<0) return false;\n\t\t\n\t\tif($num<=$n) return true;\n\t\treturn false;\n\t}", "function check_ten($ten)\n{\n\treturn TRUE;\n}", "function cp_intIsBetween($number,$min,$max){\r\n if(!cp_str_isInt($number)){\r\n return false;\r\n }\r\n\r\n return $number >= $min && $number <= $max;\r\n}", "function numberInRange($a_iStart, $a_iEnd, $a_iNumber)\n\t{\n\t\t// and starts with \"0\"\n\t\t$iStrLen = strlen($a_iNumber);\n\t\tif((substr($a_iNumber,0,1) == \"0\") && ($iStrLen > 1))\n\t\t\t$iNumber = substr($a_iNumber, 1, $iStrLen);\n\t\telse\n\t\t\t$iNumber = $a_iNumber;\n\n\t\tif($iNumber < $a_iStart)\n\t\t\treturn false;\n\t\telseif($iNumber > $a_iEnd)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "function is_entier($n) {\nreturn ($n>0 || $n=='0');\n}", "function TestNumber($N) {\t\r\n\t\tglobal $DecentNumber, $Max5s, $Max3s, $SolutionFound;\r\n\t\tswitch ($N) {\r\n\t\t// Too small to start\r\n\t\t\tCase ($N <= 2):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 3 - early success exit\r\n\r\n\t\t\tCase ($N == 3):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = 1;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"555\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 4 - Fail\r\n\t\r\n\t\t\tCase ($N == 4):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for Special Success MOD 3 = 0, If this is true, then we found a special case of all 5's.\r\n\t\t\r\n\t\t\tCase (($N % 3) == 0):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = $N / 3;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = AssembleString($Max5s, $Max3s);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\tGeneralCase ($N);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "private function _valid($numValue){\n\t\tif(!is_int($numValue)){\n\t\t\t//throws error\n\t\t\techo \"not an int\";\n\t\t\treturn 0;\n\t\t}\n\n\t\tif($numValue < 1 || $numValue > 100){\n\t\t\t//throws error\n\t\t\techo \"not in range\";\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}", "function betweenIntRange($value, $params = array()) {\t\t\n\t\t$min = 0;\n\t\t$max = 255;\n\t\textract($params);\n\t\tif (is_array($value)) {\n\t\t\t$value = array_shift($value);\n\t\t}\n\t\tif (preg_match('/^[0-9]+$/', $value)) {\n\t\t\tif ($value >= $min && $value <= $max) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\t\t\n\t\treturn false;\n\t}", "public function testRandom() {\n\t\t$results = array();\n\t\tforeach (range(0, 100) as $run) {\n\t\t\t$results[] = _::random(10);\n\t\t}\n\t\t$this->assertContainsOnly('int', $results);\n\t\t$this->assertGreaterThanOrEqual(0, min($results));\n\t\t$this->assertLessThanOrEqual(10, max($results));\n\t}", "public function checkNumbers($str)\r\n {\r\n $this->explodeString = explode(',', $str);\r\n\r\n foreach ($this->explodeString as $val) {\r\n if ($val < 1001) {\r\n $this->lesserArray[] = $val;\r\n } else {\r\n $this->greaterArray[] = 0;\r\n }\r\n }\r\n if (sizeof($this->lesserArray) > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function checkNum($number) {\n if($number>50) {\n throw new Exception(\" Tavë Kosi has been known for 90 years in Albanian cuisine.\");\n }\n return true;\n}", "function testIn7()\n\t{\n\t\treturn $this->testinN($num,7);\n\t}", "function numero($s)\n{\n\t$j=0;\n\t$valor=false;\n\tfor($j=1; $j<10;$j++){\n\t\tif($s==$j){\n\t\t\t$valor=true;\n\t\t}\n\t}\n\treturn $valor;\n}", "function p3_ex3() {\n $hundred = 100;\n $rand = mt_rand(1, 100);\n for ($i = 20; $hundred >= $i; $hundred--) {\n if ($hundred % 5 == 0 && $hundred != 100)\n $return .= 'resultat : '.($hundred * $rand).'<br />';\n else\n $return .= 'resultat : '.($hundred * $rand).', ';\n }\n\n return $return;\n}", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\n}", "function func3($n) {\n for ($k = 0; $n; $n = (int) ($n / 10)) {\n $k = $n * 10;\n if ($k > $n)\n $n = $k;\n }\n return $n;\n}", "function findVal($num, $multiple1, $multiple2, $valTrue) {\n\tif ( ((int)$num % $multiple1 == 0) && ((int)$num % $multiple2 == 0) && is_numeric($num) )\n\t{\n\t\treturn $valTrue;\n\t} \n\treturn $num;\n}", "function TestNumber($firstNumber, $secondNumber)\n {\n //Déclaration des messages\n $Number1Win = \"Le premier nombre est plus grand\";\n $Number1Lose = \"Le premier nombre est plus petit\";\n $Number1Equal = \"Les deux nombres sont identiques\";\n\n //Test\n if($firstNumber > $secondNumber){\n return $Number1Win;\n }\n elseif($firstNumber < $secondNumber){\n return $Number1Lose;\n }\n else{\n return $Number1Equal;\n }\n\n }", "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "public static function validate_integer_pure_valid_values($val) {\n\t//--\n\tif((self::validate_numeric_pure_valid_values($val)) AND ($val >= PHP_INT_MIN) AND ($val <= PHP_INT_MAX)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t} //end if\n\t//--\n}", "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "function checkInteger($var) {\r\n\r\n\tif(preg_match('!^\\d+$!', $var)) { return true; } else { return false; }\r\n\r\n}", "function fullNumber($newNum){\n switch ($newNum){ \n case ($newNum < 100000): \n echo \"000\" . $newNum;\n break; \n case ($newNum < 1000000): \n echo \"00\" . $newNum;\n break; \n case ($newNum < 10000000): \n echo \"0\" . $newNum; \n break; \n default: \n echo $newNum;\n break; \n } \n}", "private static function ok($number, $min, $max)\n {\n return ($number === null) || (($number >= $min) && ($number <= $max));\n }", "public static function valid_positive_integer($value){\n\t\treturn preg_match('@^[0-9]+$@',$value) === 1;\n\t}", "function validateNumberOrRange($number, $min_value, $max_value)\n {\n $result=false;\n\n if (filter_var($number, FILTER_VALIDATE_INT)===0 || !filter_var($number, FILTER_VALIDATE_INT)===false) //number provided\n {\n if ($number>=$min_value && $number<=$max_value)\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n\n if (stristr($number, \"-\")) //range provided\n {\n $numbers_array=explode(\"-\", $number);\n if (filter_var($numbers_array[0], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[0], FILTER_VALIDATE_INT)===false && filter_var($numbers_array[1], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[1], FILTER_VALIDATE_INT)===false)\n {\n if ($numbers_array[0]>=$min_value && $numbers_array[1]<=$max_value && $numbers_array[0]<=$numbers_array[1])\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n }\n\n return $result;\n }", "function checkNum($red, $stupac, $mjesto) {\n\tif($red%2 == 0){\n\t\t$broj=0;\n\t\tif($stupac == 1){\n\t\t\t$broj= $mjesto-9;\n\t\t\techo $broj;\n\t\t} else {\n\t\t\t$broj = $mjesto / 10;\n\t\t\t$broj = floor($broj);\n\t\t\t$broj *= 10;\n\t\t\t$broj += $stupac;\n\t\t\techo $broj . \" i \" . $red ;\n\t\t}\n\n\t} else {\n\t\techo $mjesto;\n\t}\n\n}", "function has_number($value , $options = []){\r\n if(!is_numeric($value)){\r\n return false;\r\n }\r\n if(isset($options['max']) && ($value > (int) $options['max'])){\r\n return false;\r\n }\r\n if(isset($options['min'])&& ($value < (int) $options['min'])){\r\n return false;\r\n }\r\n return true;\r\n}", "public function getLovelyNumbers($start, $end){\n $repeated = 0; $remove_me = 0;\n if($end<$start){ return 'Action can not be completed : End number should be greater'; }\n for ($i = $start ; $i <= $end; $i++) \n { \n $repeated++;\n $crnt_number = $i; \n $history = array(); \n while($crnt_number) \n { \n if(isset($history[$crnt_number%10])){\n $ct = $crnt_number%10;\n if($ct/10==0) { \n $history[$crnt_number%10] = ($history[$crnt_number%10])+1;\n }\n if($history[$crnt_number%10]==3){ $remove_me++; break; }\n }\n else{\n $history[$crnt_number%10] = 1;\n }\n $crnt_number = (int)$crnt_number / 10; \n }\n }\n $selected_no = $repeated - $remove_me;\n return $selected_no; \n }", "public function ifNum($num);", "public function validIntegers() {}", "function tester_function(){\n echo(\"Output for parameter = 10: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(10);\n echo(\"<br>\");\n\n echo(\"Output for parameter = 0: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(0);\n echo(\"<br>\");\n\n echo(\"Output for parameter = 100: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(100);\n echo(\"<br>\");\n\n /*\n Checking the outputs for nums 1 - 99\n */\n /*for($i = 0; $i < 100; $i++){\n echo($i);\n echo(\": \");\n prime_function($i);\n\n }*/\n //prime_function(\"12\"); // Checking to see if it works when number is written as a string\n }", "public function isValid($number);", "function check($ran_num) {\n if ($ran_num < 2) {\n return false;\n }\n // check so nguyen to khi n >= 2\n $squareRoot = sqrt ( $ran_num );\n for($i = 2; $i <= $squareRoot; $i ++) {\n if ($ran_num % $i == 0) {\n return false;\n }\n }\n return true;\n }", "function testForInt($data)\r\n\t{\r\n\t\tif (!filter_var($data, FILTER_VALIDATE_INT) === false)\r\n\t\t{\r\n\t\t\treturn intval($data);\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\techo(\"Integer is not valid<br>\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function is_not_zero($num){\n\tif($num <= 0){\n\t\treturn 1;\n\t}\n\t\n\treturn $num;\t\n}", "function sugar_valid_int($value, $min=1, $max=65535) {\n $options = array(\n 'options' => array(\n 'min_range' => $min,\n 'max_range' => $max,\n ),\n );\n return filter_var($value, FILTER_VALIDATE_INT, $options);\n}", "public function test_it_prints() {\n // ADDED: check if the number contains the value as \"string\" (ie 13 is Fizz, 53 is Buzz etc)\n $expected = '1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz Fizz 14 FizzBuzz? 16 17 Fizz 19 Buzz Fizz 22 Fizz Fizz Buzz ';\n $this->assertEquals($expected, $this->kata->printFizzBuzzRange(1, 25));\n }", "protected function validateDigits($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_INT) !== false;\n\t}", "function isPosNum($number){\n if(((int)$number) >= 0){\n return true;\n }\n else{\n echo \"invalid number of pages (or words)\";\n return false;\n }\n }", "private function test_number($value)\r\n {\r\n $value = str_replace(',', '.', $value);\r\n return is_numeric($value);\r\n }", "function TestCheckDigit($barcode)\n{\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n}", "static public function testInt($value) {\n\t\tstatic $useOldGoodTestInt = null;\n\n\t\tif (is_null($useOldGoodTestInt)) {\n\t\t\t$useOldGoodTestInt = !class_exists('t3lib_utility_Math');\n\t\t}\n\t\tif ($useOldGoodTestInt) {\n\t\t\t$result = t3lib_div::testInt($value);\n\t\t}\n\t\telse {\n\t\t\t$result = t3lib_utility_Math::canBeInterpretedAsInteger($value);\n\t\t}\n\t\treturn $result;\n\t}", "function has_number($value, $options=[])\n{\n if (!is_numeric($value)) {\n return false;\n }\n if (isset($options['max']) && ($value > (int)$options['max'])) {\n return false;\n }\n if (isset($options['min']) && ($value < (int)$options['min'])) {\n return false;\n }\n return true;\n}", "function positiveIntCheck( $value ) {\n\n/* ... is this value greater than or equal to zero or not? */\n if ($value >= 0) {\n $testValue = TRUE;\n }\n else {\n $testValue = FALSE;\n $this->form_validation->set_message('positiveIntCheck', \"The %s field must be equal to or greater than zero\");\n }\n \n/* ... time to go */\n return( $testValue );\n }", "private function CheckNumber($n){\n\t\tif($n<=0){\n\t\t\treturn false;\n\t\t}else if($n==1 || $n==2){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t$checkFlag = true;\n\t\t\tfor($i=2;$i<=sqrt($n);$i++){\n\t\t\t\tif($n%$i==0){\n\t\t\t\t\t$checkFlag =false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $checkFlag;\n\t\t}\n\n\t}", "function palindrome_angka($angka) {\n if ($angka >= 0 && $angka <= 9)\n return 9;\n for($i = 0; $i < 1000; $i++){\n $v = strval($i);\n $r = strrev($v);\n $n = intval($v.substr($r,1));\n if ($n >= $angka && $n == true)\n return $n;\n }\n}", "function input_number_is_valid( $number ) {\n\t\treturn ( is_numeric( $number ) && $number > 0 );\n\t}", "function iqTest(string $numbers): int\n{\n /** @var array{int} $arrayInt */\n $arrayInt = array_map(function ($val) {\n return $val % 2;\n }, explode(' ', $numbers));\n /** @var int $diffValue */\n $diffValue = array_sum($arrayInt) === 1 ? 1 : 0;\n\n return array_search($diffValue, $arrayInt) + 1;\n}", "function UglyNumber($number)\n{\n while ($number%2 == 0){\n $number = $number/2;\n }\n while ($number%3 == 0){\n $number = $number/3;\n }\n while ($number%5 == 0){\n $number = $number/5;\n }\n if($number == 1){\n return 1;\n }else{\n return 0;\n }\n}", "function is_lucky($ticket) {\n $t = add_zeroes($ticket);\n $first = (int)$t[0] + (int)$t[1] + (int)$t[2]; //first and...\n $second = (int)$t[3] + (int)$t[4] + (int)$t[5]; //last three digits..\n return $first == $second; //compared\n}", "public function invalidIntegers() {}", "private function sanitiseNum($x)\n {\n return filter_var($x, FILTER_VALIDATE_INT, array(\"options\" => array(\"min_range\" => 0, \"max_range\" => 1000000)));\n }", "function testIn24()\n\t{\n\t\treturn $this->testInN($num,24);\n\t}", "function valid_number($num) {\r\nif(empty($num) || !is_numeric($num))\r\n return false ; \r\nelse {\r\n $num = intval($num) ; \r\n\tif($num <= 0) \r\n\t\treturn false ;\r\n }\r\n return true ; \r\n}", "function validate_Integer($number)\n {\n // condition for validating user input using preg_match conditions.\n if (preg_match('/[1-9]{1}/', $number) && $number > 0) {\n return true;\n }\n }", "function is_ugly($num)\n {\n $z = $num;\n if ($num == 0)\n {\n return \"$num is not an Ugly number\";\n }\n \n $x = array(2, 3, 5);\n foreach ($x as $i)\n {\n while ($num % $i == 0)\n {\n $num /= $i;\n }\n } \n if ($num==1)\n {\n return \"$z is an Ugly number\";\n }\n else\n {\n return \"$z is not an Ugly number\";\n }\n\n }", "function setMinMax(&$min, &$max) {\n if (is_int($min) && is_int($max)) {\n if ($min > $max) {\n $inputA = $min;\n $inputB = $max;\n $min = $inputB;\n $max = $inputA;\n }\n return \"Generating a number between \" . $min . \" and \" . $max . \":\";\n } else {\n return \"Input not recognized as whole numbers. <br> Number generated between 1 and 100.\";\n } \n}", "function testIn60($num)\n\t{\n\t\treturn $this->testInN($num,60);\n\t}", "function primo($num) {\n if ($num == 2 || $num == 3 || $num == 5 || $num == 7) {\n return True;\n } else {\n if ($num % 2 != 0) {\n for ($i = 3; $i <= sqrt($num); $i += 2) {\n if ($num % $i == 0) {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n }", "abstract public function validateNumber(): bool;", "function absolute ($num1) {\r\n if ($num1 > 100) {\r\n return ($num1 - 100) * 3;\r\n }else {\r\n return 100 - $num1;\r\n }\r\n}", "public function checkDigit($accountNumber)\n {\n $numbers = str_split($accountNumber);\n array_walk(\n $numbers,\n function (&$no, $key) {\n $no = $no * (10 - $key);\n }\n );\n return array_sum($numbers) % 11;\n }", "function validateAmount($amount)\n{ \n return is_numeric($amount) && $amount > 0;\n}", "function is_success ($sc) { \n return $sc >= 200 && $sc < 300; \n}", "public static function check(string $number = NULL)\n {\n $table = \n [\n\t\t\t[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],\n\t\t\t[0, 2, 4, 6, 8, 1, 3, 5, 7, 9]\n\t\t];\n\n\t\t$total = 0; $transform = 0;\n\n\t\tfor( $i = strlen($number ?? '') - 1; $i >= 0; $i-- )\n\t\t{\n\t\t\t$total += $table[$transform++ & 0x1][$number[$i]];\n\t\t}\n\n\t\treturn $total % 10 === 0;\n }", "function valid_int($value, $min = NULL, $max = NULL)\n {\n $valid = (is_int($value) OR (is_numeric($value) && intval($value) == $value));\n \n // If no bounds have been set, we're done.\n if ( ! $valid OR (is_null($min) && is_null($max)))\n {\n return $valid;\n }\n \n $min = is_null($min) ? -INF : (valid_int($min) ? intval($min) : -INF);\n $max = is_null($max) ? INF : (valid_int($max) ? intval($max) : INF);\n \n $value = intval($value);\n $real_min = min($min, $max);\n $real_max = max($min, $max);\n \n return $valid && (min(max($value, $real_min), $real_max) === $value);\n }", "function _primeNumber($num)\n{\n if ($num <= 1) return false;\n if ($num % 2 === 0 && $num > 2) return false;\n $n = floor(sqrt($num));\n for ($i = 3; $i <= $n; $i++) {\n if ($num % $i === 0) {\n return false;\n }\n }\n echo \"{$num} is prime number\";\n}", "function chk_from_to($from,$to) {\n\t\t$chk = ( $this->y*10000) + ( $this->m*100) + $this->d;\n\t\treturn ($from <= $chk && $chk <= $to) ? true : false;\n\t}", "function retornarSiEsCero ($numeroingresado)\n{\n \n if($numeroingresado == 0)\n {\n return true;\n }\n\n else\n {\n return false;\n }\n echo \"<br>El numeros es: \" .retornarSiEsCero(0);//coloco un numero\n\n}", "function test(Array $number)\n\t{\n\t\t$replace = [\n\t\t\t'Linio' => 3,\n\t\t\t'IT' => 5,\n\t\t\t'Linianos' => [3,5]\n\t\t];\n\n\t\tforeach ($number as $key => $value) {\n\t\t\tif (!is_numeric($value) && array_key_exists($value, $replace)) {\n\n\t\t\t\t$test = (!is_array($replace[$value])) ? ($key % $replace[$value] == 0) : ($key % $replace[$value][0] == 0 && $key % $replace[$value][1] == 0);\n\t\t\t\t\n\t\t\t\tif (!$test) {\n\t\t\t\t\techo \"Failure\";\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \">>>>>>>>>>>>>>>>>>>>>>> Test Success <<<<<<<<<<<<<<<<<<<<<<<<<<<<\";\n\t}", "public function validate(string $number): bool;", "function range($valor,$parms)\n\t{\t\t\n\t\tlist($min, $max) = explode(\",\", $parms, 2);\n\t\tif($valor<$min||$valor>$max)\n\t\t{\n\t\t\t$this->CI->form_validation->set_message('range', \"El campo %s debe contener un valor entre {$min} y {$max}.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function testRange() {\n $this->assertEquals(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), Hash::range(0, 10));\n $this->assertEquals(array(0 => 0, 2 => 2, 4 => 4, 6 => 6, 8 => 8, 10 => 10), Hash::range(0, 10, 2));\n $this->assertEquals(array(0 => 0, 3 => 3, 6 => 6, 9 => 9), Hash::range(0, 10, 3));\n $this->assertEquals(array(0 => 0, 13 => 13, 26 => 26, 39 => 39, 52 => 52, 65 => 65, 78 => 78, 91 => 91), Hash::range(0, 100, 13));\n $this->assertEquals(array(23 => 23, 29 => 29, 35 => 35, 41 => 41, 47 => 47, 53 => 53, 59 => 59, 65 => 65), Hash::range(23, 66, 6));\n\n $this->assertEquals(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), Hash::range(0, 10, 1, false));\n $this->assertEquals(array(0, 2, 4, 6, 8, 10), Hash::range(0, 10, 2, false));\n $this->assertEquals(array(0, 3, 6, 9), Hash::range(0, 10, 3, false));\n $this->assertEquals(array(0, 13, 26, 39, 52, 65, 78, 91), Hash::range(0, 100, 13, false));\n $this->assertEquals(array(23, 29, 35, 41, 47, 53, 59, 65), Hash::range(23, 66, 6, false));\n\n // reverse\n $this->assertEquals(array(5 => 5, 4 => 4, 3 => 3, 2 => 2, 1 => 1, 0 => 0), Hash::range(5, 0, 1));\n $this->assertEquals(array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0), Hash::range(10, 0, 1, false));\n $this->assertEquals(array(65, 59, 53, 47, 41, 35, 29, 23), Hash::range(65, 23, 6, false));\n }", "function validarnumero($numero){ \nif($numero=='0'){\n\t\n}else{\n\tif(is_numeric($numero)) {\n //si es un numero no dice nada\n } else {\n return TRUE;\n }\n}\n \n}", "function verify_creditcard_mod10($strccno = '')\n {\n if (empty($strccno))\n {\n return false;\n }\n $len = mb_strlen($strccno);\n if ($len < 13 OR $len > 16)\n {\n return false;\n }\n $checkdig = (int)$strccno[--$len];\n for ($i=--$len, $sum = 0, $dou = true; $i >= 0; $i--, $dou =! $dou)\n {\n $curdig = (int)$strccno[$i];\n if ($dou)\n {\n $curdig *= 2;\n if ($curdig > 9) $curdig-=9;\n }\n $sum += $curdig;\n }\n if (($checkdig + $sum) % 10 == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public static function between($n, $min, $max){\r\n\t\treturn isset($n) && intval($n) >= $min && intval($n) < $max;\r\n\t}", "function aprovados($nota){\n return $nota >= 7;\n}", "function differentNumbers($number) {\n\t$arr = array();\n\tfor ($i=0; $i < 10; $i++) {\n\t\t$x = substr_count($number, $i);\n\t\t$arr[\"$i\"] = $x;\n\t}\n\t$count = count(array_filter($arr));\n\tswitch ($count) {\n\t\tcase 8:\n\t\treturn 0.8;\n\t\tbreak;\n\t\tcase 7:\n\t\treturn 0.9;\n\t\tbreak;\n\t\tcase 6:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tcase 5:\n\t\treturn 1.8;\n\t\tbreak;\n\t\tcase 4:\n\t\treturn 2.7;\n\t\tbreak;\n\t\tcase 3:\n\t\treturn 3.2; // Bliver lavere igen herefter, da numre med kun 2 eller 1 tal bliver højere gennem de andre funktioner alligevel\n\t\tbreak;\n\t\tcase 2:\n\t\treturn 2.1;\n\t\tbreak;\n\t\tcase 1:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tdefault:\n\t\treturn 0.8;\n\t\tbreak;\n\t}\n}", "function validAge($age) {\r\n return is_numeric($age) && $age >= 18 && $age <= 118;\r\n}", "private function _checkRange($x, $a, $b) {\r\n\t\treturn ($x >= $a && $x <= $b) ? $x : 0;\r\n\t}", "function number_between($number, $min, $max)\n {\n $number = max($min, $number);\n return min($max, $number);\n }", "function angka($n) {\n $n = (0+str_replace(\",\",\"\",$n));\n \n // is this a number?\n if(!is_numeric($n)) return false;\n \n // now filter it;\n if($n>1000000000000) return round(($n/1000000000000),1);\n else if($n>1000000000) return round(($n/1000000000),1);\n else if($n>1000000) return round(($n/1000000),1);\n else if($n>1000) return round(($n/1000),1);\n \n return number_format($n);\n}", "public function testRegistrationValuesContainNumbers(): void { }", "public function testShouldReturnFalse()\n\t{\n\t\t$this->assertFalse(SRPH\\Luhn\\luhn('7992739871'));\n\t\t$this->assertFalse(SRPH\\Luhn\\luhn('79927398710'));\n\t\t$this->assertFalse(SRPH\\Luhn\\luhn('79927398711'));\n\t\t$this->assertFalse(SRPH\\Luhn\\luhn('79927398713'));\n\t}", "public function validate($value)\n {\n $value = preg_replace('/[^\\d]/', '', (string) $value);\n if (strlen($value) != 11 ) {\n return false;\n }\n $acumulado = 0;\n $digits = str_split($value);\n\n // obtain digit\n $digit = array_pop($digits);\n\n for ($i=0; $i < count($digits); $i++ ) {\n $acumulado += $digits[9-$i] * (2 + ($i % 6 ));\n }\n $verif = 11 - ( $acumulado % 11 );\n $verif = $verif == 11? 0 : $verif;\n\n return $digit == $verif;\n }", "function checkIfInt($checkMe){\n\tif(is_Int((int)$checkMe) == true){\n\t\treturn true;\n\t\t// an acceptable respne\n\t}else{\n\t\treturn false;\n\t}\n\t\n}", "public function testExample()\n {\n echo \" testing numbers \";\n $isbnNumbers = [\n \"807229654X\", \"807229654\", \"978 032 640 615-1\", \"978032640615\", \"0072296542\",\n \"176041640615766\", \"0072296552\", \"007-229-654 2\", \"2460323406152\"\n ];\n $results = [1,0,1,0,1,0,0,1,1];\n\n $evaluated = [];\n foreach ($isbnNumbers as $isbn) {\n $evaluated[$isbn] = Helpers\\ISBN::isValidISBN($isbn);\n }\n $index = 0;\n $true = true;\n\n foreach($evaluated as $number => $output) {\n $true = $true && ($results[$index] == $output['valid']);\n if(!$true) {\n echo $results[$index].\" true: \".($true? \"1 \":\"0 \");\n print_r($output);\n }\n $index++;\n }\n\n $this->assertTrue($true);\n }", "public function testCheckMaxAmount() {\n $amount = 1000;\n $this->assertTrue($this->tranche->checkMaxAmount($amount));\n }", "function CheckNums($num1,$num2) { \n if($num2 > $num1) {\n return 'true';\n }\n elseif($num2 < $num1) {\n return 'false';\n }\n else {\n return -1;\n }\n // code goes here\n return $num1; \n \n}", "public function testValidateNumber(): void\n {\n $this->assertTrue($this->validate(1));\n }", "function numParImpar($num){\n $bool = true;\n if($num % 2 == 0){\n return true;\n }else{\n return false;\n }\n}", "function random_number_between_but_not($min=null, $max=null, $butNot=null) {\n if ( $min > $max ) {\n return 'Error: min is greater than max.'; //@TODO \"Nebula\" 0: If min is greater than max, swap the variables.\n }\n if ( gettype($butNot) == 'array' ) {\n foreach( $butNot as $key => $skip ){\n if( $skip > $max || $skip < $min ){\n unset($butNot[$key]);\n }\n }\n if ( count($butNot) == $max-$min+1 ) {\n return 'Error: no number exists between ' . $min .' and ' . $max .'. Check exclusion parameter.';\n }\n while ( in_array(($randnum = rand($min, $max)), $butNot));\n } else {\n while (($randnum = rand($min, $max)) == $butNot );\n }\n return $randnum;\n}", "function is_digito($digito){\r\n if($digito=='0' || $digito=='1' || $digito=='2' || $digito=='3' || $digito=='4' ||\r\n $digito=='5' || $digito=='6' || $digito=='7' || $digito=='8' || $digito=='9'){return TRUE;\r\n }else{return FALSE;}\r\n}", "function numberRange($start, $end)\n{\n $number_range = range($start, $end);\n\n return $number_range;\n}", "function check_armstrong($number){\r\n$n=$number;\r\n$total_sum=0;\r\nwhile($n!=0){\r\n\t$rem=$n%10;\r\n\t$n=$n/10;\r\n\t$sum=1;\r\n\tfor($i=0; $i<3; $i++){\r\n\t\t$sum*=$rem;\r\n\t}\r\n\t$total_sum+=$sum;\r\n\t$sum=1;\r\n}\r\nif($total_sum==$number){\r\n\techo \"It is an armstrong number\".$total_sum;\r\n}\r\nelse{\r\n\techo \"It is not armstrong number\";\r\n\r\n}\r\n}", "function validInt($value)\n {\n return filter_var($value, FILTER_VALIDATE_INT);\n }", "function pimd_validate_intrange($value, $min, $max) {\n\tif (is_numericint($value) && ($value >= $min) && ($value <= $max)) {\n\t\treturn $value;\n\t} else {\n\t\treturn null;\n\t}\n}", "protected final function _isValidInt($key,$value){\n\n if(!is_numeric($value) || strpos($value,'.') !== false){\n return $this->setError($key,\"`{$key}` must be a integer\");\n }//if\n\n if(!$this->_isBetweenMinAndMax($key,$value)){\n return false;\n }//if\n\n return true;\n\n }" ]
[ "0.7273057", "0.6446697", "0.64306027", "0.63692635", "0.6135932", "0.6066898", "0.60645384", "0.60263014", "0.59745455", "0.59479934", "0.59318686", "0.59181213", "0.5915045", "0.5908207", "0.5888831", "0.5810643", "0.57863164", "0.5785262", "0.57824", "0.5737359", "0.5722815", "0.57188666", "0.5715319", "0.56934655", "0.56893784", "0.56533176", "0.5647217", "0.5639404", "0.5628259", "0.55808794", "0.55787885", "0.55739665", "0.5568019", "0.5566663", "0.5560832", "0.55585176", "0.5550758", "0.5532676", "0.5528281", "0.55265635", "0.55251336", "0.5517945", "0.5515465", "0.55045885", "0.5498057", "0.54947674", "0.54938966", "0.5491412", "0.54742175", "0.54554796", "0.5455113", "0.5444487", "0.54373646", "0.54289126", "0.54288864", "0.5426164", "0.54250026", "0.54195166", "0.5404707", "0.5396561", "0.5396476", "0.53915143", "0.5385379", "0.53780806", "0.53722584", "0.5371285", "0.5357025", "0.53450507", "0.53403234", "0.5329893", "0.5329603", "0.5329096", "0.53241456", "0.5320612", "0.5308927", "0.5301167", "0.5290158", "0.52805364", "0.5274472", "0.5272088", "0.5268889", "0.5263283", "0.5260816", "0.5260067", "0.52576786", "0.52522624", "0.52491", "0.5245428", "0.52425796", "0.5234006", "0.5232806", "0.5232057", "0.5231991", "0.52218807", "0.52210766", "0.52137846", "0.5213753", "0.5201517", "0.51872593", "0.51656777" ]
0.5239097
89
Testing numbers between 1000 and 9999
public function testThousands(): void { $thousands = [ 1000 => 'mil', 1001 => 'mil uno', 1097 => 'mil noventa y siete', 1104 => 'mil ciento cuatro', 1243 => 'mil doscientos cuarenta y tres', 2385 => 'dos mil trescientos ochenta y cinco', 3766 => 'tres mil setecientos sesenta y seis', 4196 => 'cuatro mil ciento noventa y seis', 5846 => 'cinco mil ochocientos cuarenta y seis', 6459 => 'seis mil cuatrocientos cincuenta y nueve', 7232 => 'siete mil doscientos treinta y dos', 8569 => 'ocho mil quinientos sesenta y nueve', 9539 => 'nueve mil quinientos treinta y nueve', ]; foreach ($thousands as $number => $word) { self::assertEquals( $word, $this->handle->toWords($number, $this->locale) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function range_met($n)\n{\n if ($n >= 1 && $n <= 100) {\n return TRUE;\n }\n return FALSE;\n}", "function testInN($num,$n)\n\t{\n\t\tif(!is_numeric($num)) return false;\n\t\tif(!is_numeric($n)) return false;\n\t\tif($num<0) return false;\n\t\tif($n<0) return false;\n\t\t\n\t\tif($num<=$n) return true;\n\t\treturn false;\n\t}", "function check_ten($ten)\n{\n\treturn TRUE;\n}", "function cp_intIsBetween($number,$min,$max){\r\n if(!cp_str_isInt($number)){\r\n return false;\r\n }\r\n\r\n return $number >= $min && $number <= $max;\r\n}", "function numberInRange($a_iStart, $a_iEnd, $a_iNumber)\n\t{\n\t\t// and starts with \"0\"\n\t\t$iStrLen = strlen($a_iNumber);\n\t\tif((substr($a_iNumber,0,1) == \"0\") && ($iStrLen > 1))\n\t\t\t$iNumber = substr($a_iNumber, 1, $iStrLen);\n\t\telse\n\t\t\t$iNumber = $a_iNumber;\n\n\t\tif($iNumber < $a_iStart)\n\t\t\treturn false;\n\t\telseif($iNumber > $a_iEnd)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "function numero($s)\n{\n\t$j=0;\n\t$valor=false;\n\tfor($j=1; $j<10;$j++){\n\t\tif($s==$j){\n\t\t\t$valor=true;\n\t\t}\n\t}\n\treturn $valor;\n}", "function is_entier($n) {\nreturn ($n>0 || $n=='0');\n}", "public function checkNumbers($str)\r\n {\r\n $this->explodeString = explode(',', $str);\r\n\r\n foreach ($this->explodeString as $val) {\r\n if ($val < 1001) {\r\n $this->lesserArray[] = $val;\r\n } else {\r\n $this->greaterArray[] = 0;\r\n }\r\n }\r\n if (sizeof($this->lesserArray) > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function TestNumber($N) {\t\r\n\t\tglobal $DecentNumber, $Max5s, $Max3s, $SolutionFound;\r\n\t\tswitch ($N) {\r\n\t\t// Too small to start\r\n\t\t\tCase ($N <= 2):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 3 - early success exit\r\n\r\n\t\t\tCase ($N == 3):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = 1;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"555\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 4 - Fail\r\n\t\r\n\t\t\tCase ($N == 4):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for Special Success MOD 3 = 0, If this is true, then we found a special case of all 5's.\r\n\t\t\r\n\t\t\tCase (($N % 3) == 0):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = $N / 3;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = AssembleString($Max5s, $Max3s);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\tGeneralCase ($N);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "function checkNum($number) {\n if($number>50) {\n throw new Exception(\" Tavë Kosi has been known for 90 years in Albanian cuisine.\");\n }\n return true;\n}", "private function test_number($value)\r\n {\r\n $value = str_replace(',', '.', $value);\r\n return is_numeric($value);\r\n }", "function has_number($value , $options = []){\r\n if(!is_numeric($value)){\r\n return false;\r\n }\r\n if(isset($options['max']) && ($value > (int) $options['max'])){\r\n return false;\r\n }\r\n if(isset($options['min'])&& ($value < (int) $options['min'])){\r\n return false;\r\n }\r\n return true;\r\n}", "function testIn7()\n\t{\n\t\treturn $this->testinN($num,7);\n\t}", "function fullNumber($newNum){\n switch ($newNum){ \n case ($newNum < 100000): \n echo \"000\" . $newNum;\n break; \n case ($newNum < 1000000): \n echo \"00\" . $newNum;\n break; \n case ($newNum < 10000000): \n echo \"0\" . $newNum; \n break; \n default: \n echo $newNum;\n break; \n } \n}", "private function _valid($numValue){\n\t\tif(!is_int($numValue)){\n\t\t\t//throws error\n\t\t\techo \"not an int\";\n\t\t\treturn 0;\n\t\t}\n\n\t\tif($numValue < 1 || $numValue > 100){\n\t\t\t//throws error\n\t\t\techo \"not in range\";\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}", "public function isValid($number);", "function has_number($value, $options=[])\n{\n if (!is_numeric($value)) {\n return false;\n }\n if (isset($options['max']) && ($value > (int)$options['max'])) {\n return false;\n }\n if (isset($options['min']) && ($value < (int)$options['min'])) {\n return false;\n }\n return true;\n}", "function func3($n) {\n for ($k = 0; $n; $n = (int) ($n / 10)) {\n $k = $n * 10;\n if ($k > $n)\n $n = $k;\n }\n return $n;\n}", "function isPosNum($number){\n if(((int)$number) >= 0){\n return true;\n }\n else{\n echo \"invalid number of pages (or words)\";\n return false;\n }\n }", "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "function input_number_is_valid( $number ) {\n\t\treturn ( is_numeric( $number ) && $number > 0 );\n\t}", "private static function ok($number, $min, $max)\n {\n return ($number === null) || (($number >= $min) && ($number <= $max));\n }", "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "function valid_number($num) {\r\nif(empty($num) || !is_numeric($num))\r\n return false ; \r\nelse {\r\n $num = intval($num) ; \r\n\tif($num <= 0) \r\n\t\treturn false ;\r\n }\r\n return true ; \r\n}", "function TestNumber($firstNumber, $secondNumber)\n {\n //Déclaration des messages\n $Number1Win = \"Le premier nombre est plus grand\";\n $Number1Lose = \"Le premier nombre est plus petit\";\n $Number1Equal = \"Les deux nombres sont identiques\";\n\n //Test\n if($firstNumber > $secondNumber){\n return $Number1Win;\n }\n elseif($firstNumber < $secondNumber){\n return $Number1Lose;\n }\n else{\n return $Number1Equal;\n }\n\n }", "function is_not_zero($num){\n\tif($num <= 0){\n\t\treturn 1;\n\t}\n\t\n\treturn $num;\t\n}", "public static function validate_integer_pure_valid_values($val) {\n\t//--\n\tif((self::validate_numeric_pure_valid_values($val)) AND ($val >= PHP_INT_MIN) AND ($val <= PHP_INT_MAX)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t} //end if\n\t//--\n}", "function betweenIntRange($value, $params = array()) {\t\t\n\t\t$min = 0;\n\t\t$max = 255;\n\t\textract($params);\n\t\tif (is_array($value)) {\n\t\t\t$value = array_shift($value);\n\t\t}\n\t\tif (preg_match('/^[0-9]+$/', $value)) {\n\t\t\tif ($value >= $min && $value <= $max) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\t\t\n\t\treturn false;\n\t}", "protected function validateDigits($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_INT) !== false;\n\t}", "private function sanitiseNum($x)\n {\n return filter_var($x, FILTER_VALIDATE_INT, array(\"options\" => array(\"min_range\" => 0, \"max_range\" => 1000000)));\n }", "function check($ran_num) {\n if ($ran_num < 2) {\n return false;\n }\n // check so nguyen to khi n >= 2\n $squareRoot = sqrt ( $ran_num );\n for($i = 2; $i <= $squareRoot; $i ++) {\n if ($ran_num % $i == 0) {\n return false;\n }\n }\n return true;\n }", "function validateNumberOrRange($number, $min_value, $max_value)\n {\n $result=false;\n\n if (filter_var($number, FILTER_VALIDATE_INT)===0 || !filter_var($number, FILTER_VALIDATE_INT)===false) //number provided\n {\n if ($number>=$min_value && $number<=$max_value)\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n\n if (stristr($number, \"-\")) //range provided\n {\n $numbers_array=explode(\"-\", $number);\n if (filter_var($numbers_array[0], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[0], FILTER_VALIDATE_INT)===false && filter_var($numbers_array[1], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[1], FILTER_VALIDATE_INT)===false)\n {\n if ($numbers_array[0]>=$min_value && $numbers_array[1]<=$max_value && $numbers_array[0]<=$numbers_array[1])\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n }\n\n return $result;\n }", "function verify_creditcard_mod10($strccno = '')\n {\n if (empty($strccno))\n {\n return false;\n }\n $len = mb_strlen($strccno);\n if ($len < 13 OR $len > 16)\n {\n return false;\n }\n $checkdig = (int)$strccno[--$len];\n for ($i=--$len, $sum = 0, $dou = true; $i >= 0; $i--, $dou =! $dou)\n {\n $curdig = (int)$strccno[$i];\n if ($dou)\n {\n $curdig *= 2;\n if ($curdig > 9) $curdig-=9;\n }\n $sum += $curdig;\n }\n if (($checkdig + $sum) % 10 == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "private function CheckNumber($n){\n\t\tif($n<=0){\n\t\t\treturn false;\n\t\t}else if($n==1 || $n==2){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t$checkFlag = true;\n\t\t\tfor($i=2;$i<=sqrt($n);$i++){\n\t\t\t\tif($n%$i==0){\n\t\t\t\t\t$checkFlag =false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $checkFlag;\n\t\t}\n\n\t}", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\n}", "function checkNum($red, $stupac, $mjesto) {\n\tif($red%2 == 0){\n\t\t$broj=0;\n\t\tif($stupac == 1){\n\t\t\t$broj= $mjesto-9;\n\t\t\techo $broj;\n\t\t} else {\n\t\t\t$broj = $mjesto / 10;\n\t\t\t$broj = floor($broj);\n\t\t\t$broj *= 10;\n\t\t\t$broj += $stupac;\n\t\t\techo $broj . \" i \" . $red ;\n\t\t}\n\n\t} else {\n\t\techo $mjesto;\n\t}\n\n}", "function checkInteger($var) {\r\n\r\n\tif(preg_match('!^\\d+$!', $var)) { return true; } else { return false; }\r\n\r\n}", "function findVal($num, $multiple1, $multiple2, $valTrue) {\n\tif ( ((int)$num % $multiple1 == 0) && ((int)$num % $multiple2 == 0) && is_numeric($num) )\n\t{\n\t\treturn $valTrue;\n\t} \n\treturn $num;\n}", "public static function valid_positive_integer($value){\n\t\treturn preg_match('@^[0-9]+$@',$value) === 1;\n\t}", "abstract public function validateNumber(): bool;", "public function checkNumber($value, $lifetime=5400)\n\t\t{\n\t\t\t$time = intval(time()/10);\n\t\t\tfor($i = 0; $i < $lifetime; $i++)\n\t\t\t\tif($value == $this->calculate($this->getNumericSalt()+$time-$i, $this->min, $this->max))\n\t\t\t\t\treturn true; // this is a legal value\n\n\t\t\treturn false; // no legal values found the last 90 minutes\n\t\t}", "function validate_Integer($number)\n {\n // condition for validating user input using preg_match conditions.\n if (preg_match('/[1-9]{1}/', $number) && $number > 0) {\n return true;\n }\n }", "function palindrome_angka($angka) {\n if ($angka >= 0 && $angka <= 9)\n return 9;\n for($i = 0; $i < 1000; $i++){\n $v = strval($i);\n $r = strrev($v);\n $n = intval($v.substr($r,1));\n if ($n >= $angka && $n == true)\n return $n;\n }\n}", "function retornarSiEsCero ($numeroingresado)\n{\n \n if($numeroingresado == 0)\n {\n return true;\n }\n\n else\n {\n return false;\n }\n echo \"<br>El numeros es: \" .retornarSiEsCero(0);//coloco un numero\n\n}", "public function getLovelyNumbers($start, $end){\n $repeated = 0; $remove_me = 0;\n if($end<$start){ return 'Action can not be completed : End number should be greater'; }\n for ($i = $start ; $i <= $end; $i++) \n { \n $repeated++;\n $crnt_number = $i; \n $history = array(); \n while($crnt_number) \n { \n if(isset($history[$crnt_number%10])){\n $ct = $crnt_number%10;\n if($ct/10==0) { \n $history[$crnt_number%10] = ($history[$crnt_number%10])+1;\n }\n if($history[$crnt_number%10]==3){ $remove_me++; break; }\n }\n else{\n $history[$crnt_number%10] = 1;\n }\n $crnt_number = (int)$crnt_number / 10; \n }\n }\n $selected_no = $repeated - $remove_me;\n return $selected_no; \n }", "function angka($n) {\n $n = (0+str_replace(\",\",\"\",$n));\n \n // is this a number?\n if(!is_numeric($n)) return false;\n \n // now filter it;\n if($n>1000000000000) return round(($n/1000000000000),1);\n else if($n>1000000000) return round(($n/1000000000),1);\n else if($n>1000000) return round(($n/1000000),1);\n else if($n>1000) return round(($n/1000),1);\n \n return number_format($n);\n}", "public function testRandom() {\n\t\t$results = array();\n\t\tforeach (range(0, 100) as $run) {\n\t\t\t$results[] = _::random(10);\n\t\t}\n\t\t$this->assertContainsOnly('int', $results);\n\t\t$this->assertGreaterThanOrEqual(0, min($results));\n\t\t$this->assertLessThanOrEqual(10, max($results));\n\t}", "public function ifNum($num);", "function TestCheckDigit($barcode)\n{\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n}", "public function checkDigit($accountNumber)\n {\n $numbers = str_split($accountNumber);\n array_walk(\n $numbers,\n function (&$no, $key) {\n $no = $no * (10 - $key);\n }\n );\n return array_sum($numbers) % 11;\n }", "function sugar_valid_int($value, $min=1, $max=65535) {\n $options = array(\n 'options' => array(\n 'min_range' => $min,\n 'max_range' => $max,\n ),\n );\n return filter_var($value, FILTER_VALIDATE_INT, $options);\n}", "function testIn24()\n\t{\n\t\treturn $this->testInN($num,24);\n\t}", "function primo($num) {\n if ($num == 2 || $num == 3 || $num == 5 || $num == 7) {\n return True;\n } else {\n if ($num % 2 != 0) {\n for ($i = 3; $i <= sqrt($num); $i += 2) {\n if ($num % $i == 0) {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n }", "function testIn60($num)\n\t{\n\t\treturn $this->testInN($num,60);\n\t}", "function number_between($number, $min, $max)\n {\n $number = max($min, $number);\n return min($max, $number);\n }", "function sed_gera_numero( $min, $max, $exclude_numbers = array() ) {\n\n\tsort( $exclude_numbers );\n\n if ( $max - count( $exclude_numbers ) < $min ) {\n return false;\n }\n\n // $pos is the position that the random number will take\n // of all allowed positions\n $pos = mt_rand( 0, $max - $min - count( $exclude_numbers ) );\n\n // $num being the random number\n $num = $min;\n\n // while $pos > 0, step to the next position\n // and decrease if the next position is available\n for ( $i = 0; $i < count( $exclude_numbers ); $i += 1 ) {\n\n // if $num is on an excluded position, skip it\n if ( $num == $exclude_numbers[ $i ] ) {\n $num += 1;\n continue;\n }\n\n $dif = $exclude_numbers[ $i ] - $num;\n\n // if the position is after the next excluded number,\n // go to the next excluded number\n if ( $pos >= $dif ) {\n $num += $dif;\n\n // -1 because we're now at an excluded position\n $pos -= $dif - 1;\n } else {\n // otherwise, return the free position\n return $num + $pos;\n }\n }\n\n // return the number plus the open positions we still had to go\n return $num + $pos;\n}", "function is_digito($digito){\r\n if($digito=='0' || $digito=='1' || $digito=='2' || $digito=='3' || $digito=='4' ||\r\n $digito=='5' || $digito=='6' || $digito=='7' || $digito=='8' || $digito=='9'){return TRUE;\r\n }else{return FALSE;}\r\n}", "function validarnumero($numero){ \nif($numero=='0'){\n\t\n}else{\n\tif(is_numeric($numero)) {\n //si es un numero no dice nada\n } else {\n return TRUE;\n }\n}\n \n}", "public function validate(string $number): bool;", "function UglyNumber($number)\n{\n while ($number%2 == 0){\n $number = $number/2;\n }\n while ($number%3 == 0){\n $number = $number/3;\n }\n while ($number%5 == 0){\n $number = $number/5;\n }\n if($number == 1){\n return 1;\n }else{\n return 0;\n }\n}", "function IsNumberType($type)\n{\n\tif($type==20 || $type==14 || $type==5 || $type==10 || $type==6 \n\t|| $type==3 || $type==131 || $type==4 || $type==2 || $type==16\n\t|| $type==21 || $type==19 || $type==18 || $type==17 || $type==139\n\t|| $type==11)\n\t\treturn true;\n\treturn false;\n}", "function _primeNumber($num)\n{\n if ($num <= 1) return false;\n if ($num % 2 === 0 && $num > 2) return false;\n $n = floor(sqrt($num));\n for ($i = 3; $i <= $n; $i++) {\n if ($num % $i === 0) {\n return false;\n }\n }\n echo \"{$num} is prime number\";\n}", "function tester_function(){\n echo(\"Output for parameter = 10: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(10);\n echo(\"<br>\");\n\n echo(\"Output for parameter = 0: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(0);\n echo(\"<br>\");\n\n echo(\"Output for parameter = 100: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(100);\n echo(\"<br>\");\n\n /*\n Checking the outputs for nums 1 - 99\n */\n /*for($i = 0; $i < 100; $i++){\n echo($i);\n echo(\": \");\n prime_function($i);\n\n }*/\n //prime_function(\"12\"); // Checking to see if it works when number is written as a string\n }", "public function testAddLargeNumberFails(): void\n {\n $stringCalculator = new StringCalc();\n // The actual result of the method.\n $calcResult = $stringCalculator->Add(\"2,1001\");\n // Assert that the expected result matches the actual result.\n $this->assertEquals(2, $calcResult); \n }", "public function validIntegers() {}", "public static function validate_numeric_range($value, $start, $end){\n\t\treturn (is_numeric($value) && $value >= $start && $value <= $end);\n\t}", "function nice_number($n) {\r\n // first strip any formatting;\r\n $n = (0+str_replace(\",\",\"\",$n));\r\n\r\n // is this a number?\r\n if(!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if($n>1000000000000) return round(($n/1000000000000),2).' trillion';\r\n else if($n>1000000000) return round(($n/1000000000),2).' billion';\r\n else if($n>1000000) return round(($n/1000000),2).' million';\r\n else if($n>1000) return round(($n/1000),2).' thousand';\r\n\r\n return number_format($n);\r\n}", "function is_lucky($ticket) {\n $t = add_zeroes($ticket);\n $first = (int)$t[0] + (int)$t[1] + (int)$t[2]; //first and...\n $second = (int)$t[3] + (int)$t[4] + (int)$t[5]; //last three digits..\n return $first == $second; //compared\n}", "public static function check(string $number = NULL)\n {\n $table = \n [\n\t\t\t[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],\n\t\t\t[0, 2, 4, 6, 8, 1, 3, 5, 7, 9]\n\t\t];\n\n\t\t$total = 0; $transform = 0;\n\n\t\tfor( $i = strlen($number ?? '') - 1; $i >= 0; $i-- )\n\t\t{\n\t\t\t$total += $table[$transform++ & 0x1][$number[$i]];\n\t\t}\n\n\t\treturn $total % 10 === 0;\n }", "public function testShouldReturnFalse()\n\t{\n\t\t$this->assertFalse(SRPH\\Luhn\\luhn('7992739871'));\n\t\t$this->assertFalse(SRPH\\Luhn\\luhn('79927398710'));\n\t\t$this->assertFalse(SRPH\\Luhn\\luhn('79927398711'));\n\t\t$this->assertFalse(SRPH\\Luhn\\luhn('79927398713'));\n\t}", "public function testRegistrationValuesContainNumbers(): void { }", "function is_ugly($num)\n {\n $z = $num;\n if ($num == 0)\n {\n return \"$num is not an Ugly number\";\n }\n \n $x = array(2, 3, 5);\n foreach ($x as $i)\n {\n while ($num % $i == 0)\n {\n $num /= $i;\n }\n } \n if ($num==1)\n {\n return \"$z is an Ugly number\";\n }\n else\n {\n return \"$z is not an Ugly number\";\n }\n\n }", "function p3_ex3() {\n $hundred = 100;\n $rand = mt_rand(1, 100);\n for ($i = 20; $hundred >= $i; $hundred--) {\n if ($hundred % 5 == 0 && $hundred != 100)\n $return .= 'resultat : '.($hundred * $rand).'<br />';\n else\n $return .= 'resultat : '.($hundred * $rand).', ';\n }\n\n return $return;\n}", "public function validate($value)\n {\n $value = preg_replace('/[^\\d]/', '', (string) $value);\n if (strlen($value) != 11 ) {\n return false;\n }\n $acumulado = 0;\n $digits = str_split($value);\n\n // obtain digit\n $digit = array_pop($digits);\n\n for ($i=0; $i < count($digits); $i++ ) {\n $acumulado += $digits[9-$i] * (2 + ($i % 6 ));\n }\n $verif = 11 - ( $acumulado % 11 );\n $verif = $verif == 11? 0 : $verif;\n\n return $digit == $verif;\n }", "function differentNumbers($number) {\n\t$arr = array();\n\tfor ($i=0; $i < 10; $i++) {\n\t\t$x = substr_count($number, $i);\n\t\t$arr[\"$i\"] = $x;\n\t}\n\t$count = count(array_filter($arr));\n\tswitch ($count) {\n\t\tcase 8:\n\t\treturn 0.8;\n\t\tbreak;\n\t\tcase 7:\n\t\treturn 0.9;\n\t\tbreak;\n\t\tcase 6:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tcase 5:\n\t\treturn 1.8;\n\t\tbreak;\n\t\tcase 4:\n\t\treturn 2.7;\n\t\tbreak;\n\t\tcase 3:\n\t\treturn 3.2; // Bliver lavere igen herefter, da numre med kun 2 eller 1 tal bliver højere gennem de andre funktioner alligevel\n\t\tbreak;\n\t\tcase 2:\n\t\treturn 2.1;\n\t\tbreak;\n\t\tcase 1:\n\t\treturn 1.2;\n\t\tbreak;\n\t\tdefault:\n\t\treturn 0.8;\n\t\tbreak;\n\t}\n}", "function valid_int($value, $min = NULL, $max = NULL)\n {\n $valid = (is_int($value) OR (is_numeric($value) && intval($value) == $value));\n \n // If no bounds have been set, we're done.\n if ( ! $valid OR (is_null($min) && is_null($max)))\n {\n return $valid;\n }\n \n $min = is_null($min) ? -INF : (valid_int($min) ? intval($min) : -INF);\n $max = is_null($max) ? INF : (valid_int($max) ? intval($max) : INF);\n \n $value = intval($value);\n $real_min = min($min, $max);\n $real_max = max($min, $max);\n \n return $valid && (min(max($value, $real_min), $real_max) === $value);\n }", "private static function valueIsValidForColumnsNumber($value)\n\t{\n\t\t$value_is_integer = is_integer($value);\n\t\t$value_is_greater_than_zero = ($value > 0);\n\t\t\n\t\t$value_is_valid = $value_is_integer && $value_is_greater_than_zero;\n\t\t\n\t\treturn $value_is_valid;\n\t}", "function isKrishnamurthyNumber($n) \r\n{ \r\n $sum = 0; \r\n \r\n // Storing the value in \r\n // other variable \r\n $temp = $n; \r\n \r\n while($temp != 0) \r\n { \r\n // calculate factorial of last digit \r\n // of temp and add it to sum \r\n $sum = $sum + factorial($temp % 10); \r\n \r\n // Integer Division \r\n // replace value of temp by temp/10 \r\n $temp = intdiv($temp, 10); \r\n } \r\n \r\n // Check if number is krishnamurthy \r\n return $sum == $n; \r\n}", "function testForInt($data)\r\n\t{\r\n\t\tif (!filter_var($data, FILTER_VALIDATE_INT) === false)\r\n\t\t{\r\n\t\t\treturn intval($data);\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\techo(\"Integer is not valid<br>\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function test_it_prints() {\n // ADDED: check if the number contains the value as \"string\" (ie 13 is Fizz, 53 is Buzz etc)\n $expected = '1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz Fizz 14 FizzBuzz? 16 17 Fizz 19 Buzz Fizz 22 Fizz Fizz Buzz ';\n $this->assertEquals($expected, $this->kata->printFizzBuzzRange(1, 25));\n }", "function test(Array $number)\n\t{\n\t\t$replace = [\n\t\t\t'Linio' => 3,\n\t\t\t'IT' => 5,\n\t\t\t'Linianos' => [3,5]\n\t\t];\n\n\t\tforeach ($number as $key => $value) {\n\t\t\tif (!is_numeric($value) && array_key_exists($value, $replace)) {\n\n\t\t\t\t$test = (!is_array($replace[$value])) ? ($key % $replace[$value] == 0) : ($key % $replace[$value][0] == 0 && $key % $replace[$value][1] == 0);\n\t\t\t\t\n\t\t\t\tif (!$test) {\n\t\t\t\t\techo \"Failure\";\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \">>>>>>>>>>>>>>>>>>>>>>> Test Success <<<<<<<<<<<<<<<<<<<<<<<<<<<<\";\n\t}", "public function nice_number($n) {\r\n $n = (0+str_replace(\",\", \"\", $n));\r\n\r\n // is this a number?\r\n if (!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).' T'; //trillion\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).' B'; //billion\r\n elseif ($n > 1000000) return round(($n/1000000), 2).' M';//million\r\n elseif ($n > 1000) return round(($n/1000), 2).' TH'; //thousand\r\n\r\n return number_format($n);\r\n}", "function numberRange($start, $end)\n{\n $number_range = range($start, $end);\n\n return $number_range;\n}", "function iqTest(string $numbers): int\n{\n /** @var array{int} $arrayInt */\n $arrayInt = array_map(function ($val) {\n return $val % 2;\n }, explode(' ', $numbers));\n /** @var int $diffValue */\n $diffValue = array_sum($arrayInt) === 1 ? 1 : 0;\n\n return array_search($diffValue, $arrayInt) + 1;\n}", "Function checkstringContainsDigits($data){\n for($i=0;$i<strlen($data);$i++){\n if($data[$i] == '0' || $data[$i]=='1' || $data[$i]== '2' || $data[$i]== '3' || $data[$i] == '4' || $data[$i]=='5' ||$data[$i]=='6' ||$data[$i]=='7' ||$data[$i]=='8' ||$data[$i]=='9') {\n return true;\n }\n\n }\n return false;\n}", "static function prime1000()\n {\n $prime = array();\n $s = 0;\n for ($i = 0; $i < 1000; $i++) {\n if (Utility::isPrime($i)) {\n $prime[$s++] = $i;\n }\n }\n return $prime;\n }", "function validateAmount($amount)\n{ \n return is_numeric($amount) && $amount > 0;\n}", "public static function between($n, $min, $max){\r\n\t\treturn isset($n) && intval($n) >= $min && intval($n) < $max;\r\n\t}", "public function number($value): bool\n {\n return is_numeric($value);\n }", "function chk_from_to($from,$to) {\n\t\t$chk = ( $this->y*10000) + ( $this->m*100) + $this->d;\n\t\treturn ($from <= $chk && $chk <= $to) ? true : false;\n\t}", "function nice_number( $n ) {\n\t$n = (0 + str_replace( ',', '', $n ) );\n\t// is this a number? (o yes, almost certain - but...)\n\tif ( ! is_numeric( $n ) ) return false;\n\t// now filter it;\n\tif ( $n > 1000000000000 ) return round( ($n / 1000000000000), 1 ) . 't';\n\telse if ( $n > 1000000000 ) return round( ($n / 1000000000), 1 ) . 'b';\n\telse if ( $n > 1000000 ) return round( ($n / 1000000), 1 ) . 'm';\n\telse if ( $n > 1000 ) return round( ($n / 1000), 1 ) . 'k';\n\treturn number_format( $n );\n}", "private function verifyByLuhnAlgorithm($number){ }", "protected function filterValue($value)\n\t{\n\t\treturn (int) $value > 0;\n\t}", "public function invalidIntegers() {}", "public function testValidateNumber(): void\n {\n $this->assertTrue($this->validate(1));\n }", "function positiveIntCheck( $value ) {\n\n/* ... is this value greater than or equal to zero or not? */\n if ($value >= 0) {\n $testValue = TRUE;\n }\n else {\n $testValue = FALSE;\n $this->form_validation->set_message('positiveIntCheck', \"The %s field must be equal to or greater than zero\");\n }\n \n/* ... time to go */\n return( $testValue );\n }", "static public function testInt($value) {\n\t\tstatic $useOldGoodTestInt = null;\n\n\t\tif (is_null($useOldGoodTestInt)) {\n\t\t\t$useOldGoodTestInt = !class_exists('t3lib_utility_Math');\n\t\t}\n\t\tif ($useOldGoodTestInt) {\n\t\t\t$result = t3lib_div::testInt($value);\n\t\t}\n\t\telse {\n\t\t\t$result = t3lib_utility_Math::canBeInterpretedAsInteger($value);\n\t\t}\n\t\treturn $result;\n\t}", "function valid_ean($ean){\r\n\tif(!is_string($ean) || strlen($ean) < 8){\r\n\t\treturn FALSE;\r\n\t}\r\n\t$par = 0;\r\n\t$imp = 0;\r\n\t$ultE = substr($ean, strlen($ean) - 1, 1);\r\n\tfor($i = 0; $i < strlen($ean) - 1; $i++){\r\n\t\tif($i % 2 == 0){\r\n\t\t\t$par += substr($ean, $i, 1);\r\n\t\t}else{\r\n\t\t\t$imp += substr($ean, $i, 1);\r\n\t\t}\r\n\t}\r\n\t$imp = $imp * 3;\r\n\t$tot = $par + $imp;\r\n\t$ultT = substr($tot, strlen($tot) - 1, 1);\r\n\t$con = 10 - $ultT;\r\n\tif($con == 10){\r\n\t\t$con = 0;\r\n\t}\r\n\treturn ($con == $ultE);\r\n}", "function isPowerOf($number, $k) {\n\t\t$check = false;\n\n\t\twhile($number > 0) {\n\t\t\t$digit = $number % $k;\n\n\t\t\tif($digit > 1) return false;\n\n\t\t\tif($digit == 1) {\n\t\t\t\tif($check) return false;\n\t\t\t\t$check = true;\n\t\t\t}\n\n\t\t\t$number /= $k;\n\t\t}\n\n\t\treturn true;\n\t}", "function is_num($arg){ \n\tif (!(int)$arg) {\n\treturn false ;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "static function isANumber($value) {\n // check whether the integer value has the same length like the entered string\n return is_numeric($value) && strlen(intval($value)) == strlen($value);\n }" ]
[ "0.68017817", "0.6639569", "0.64328", "0.6423998", "0.6380836", "0.61611366", "0.60771775", "0.6048489", "0.6026035", "0.59588623", "0.59203684", "0.5886397", "0.58498615", "0.5835377", "0.58259416", "0.5819372", "0.5805958", "0.58020854", "0.57917786", "0.57901627", "0.5787909", "0.57825464", "0.57769954", "0.57719713", "0.5768736", "0.57381105", "0.57261705", "0.57245475", "0.5720308", "0.57149243", "0.5710643", "0.5674919", "0.5669722", "0.566067", "0.5644528", "0.56259584", "0.56220394", "0.5610579", "0.5609183", "0.5601148", "0.5600032", "0.5595144", "0.55939806", "0.55805844", "0.55743676", "0.5560722", "0.5537862", "0.5536964", "0.55307764", "0.552956", "0.5519886", "0.5516537", "0.5512957", "0.5501726", "0.54929924", "0.54913366", "0.54797673", "0.5466545", "0.54525995", "0.5433479", "0.54281175", "0.5427247", "0.5401661", "0.5400499", "0.539554", "0.5386771", "0.53691274", "0.5368731", "0.5366474", "0.53641397", "0.53619856", "0.535867", "0.5354088", "0.5353277", "0.53453994", "0.5342837", "0.5338537", "0.53384", "0.53356457", "0.53245413", "0.5312732", "0.5304498", "0.5289222", "0.5289", "0.52885586", "0.52791834", "0.5274605", "0.52708715", "0.5268842", "0.5268318", "0.5262753", "0.5258097", "0.5251611", "0.5249159", "0.52410424", "0.523716", "0.5234108", "0.5225861", "0.520862", "0.5207383", "0.5203984" ]
0.0
-1
put your code here
public function insertCustomer() { $svcReturn = true; try { $data = array( 'code' => 'I', 'firstname' => Input::get('firstname'), 'lastname' => Input::get('lastname'), 'password' => Hash::make(Input::get('password')), 'email' => Input::get('email'), 'address' => Input::get('address'), 'address2' => Input::get('address2'), 'address3' => Input::get('address3'), 'postcode' => Input::get('postcode'), 'city' => Input::get('city'), 'province' => Input::get('province'), 'home_no' => Input::get('home_no'), 'mobile_no' => Input::get('mobile_no'), 'grup' => Input::get('grup'), 'ip_address' => Request::getClientIp(), 'active' => Input::get('active'), ); $customer = new Customer($data); $customer->save(); } catch (RuntimeException $exc) { $svcReturn = false; echo $exc->getTraceAsString(); } return $svcReturn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n //\n \n }", "public function run()\n\t{\n\t\t//\n\t}", "public function preExecute(){\n\n\t\n\t}", "function script()\n {\n }", "public function run()\n {\n \n }", "public function run()\n {\n \n }", "public function custom()\n\t{\n\t}", "public function run()\n {\n //\n }", "public function run()\n {\n //\n }", "public function run()\r\n {\r\n\r\n }", "public function run(){\n parent::run();\n //Do stuff...\n }", "function run() {\r\n $this->set_demopage();\r\n\r\n $options_def = array(\r\n __class__ => '', // code CSS. ATTENTION [ ] à la place des {}\r\n 'id' => ''\r\n );\r\n\r\n $options = $this->ctrl_options($options_def);\r\n\r\n // il suffit de charger le code dans le head\r\n $this->load_css_head($options[__class__]);\r\n\r\n // -- aucun code en retour\r\n return '';\r\n }", "public function run()\n {\n\n parent::run();\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "function execute()\r\n\t{\r\n\t\t\r\n\t}", "protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}", "function use_codepress()\n {\n }", "public function run()\n {\n // Put your code here;\n }", "function run()\r\n {\r\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run() {\n }", "public static function run() {\n\t}", "public function onRun()\n {\n }", "public function run() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\tif(\\Yii::app()->user->isGuest === true) {\n\t\t\techo $content;\n\t\t} else {\n\t\t\t$this->render('header');\n\t\t}\n\t}", "public function run() {\n }", "public function render_content() {\n\t}", "public function main()\r\n {\r\n \r\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "function render() ;", "function execute()\n {\n }", "public function run(): void\n {\n //\n }", "protected function main()\n /**/\n {\n parent::run();\n }", "public function execute()\n {\n //echo __('Hello Webkul Team.');\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }", "public function render()\n {\n //\n }", "public function run(){\n echo CHtml::closeTag( \"div\" );\n $this->registerScript();\n }", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "function __desctuct(){\r\n\t\t?>\r\n\r\n\t\t</body>\r\n\t\t</html>\r\n\t\t<?php\r\n\t}", "public function run(){}", "public function demo()\n {\n // xu ly logic\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "public function render(){\n\t\t\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function render() {\r\n\t\t\r\n\t}", "public function main()\n\t{\n\t}", "function handle() ;", "public function execute() {\n\t}", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "public function run() {}", "public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}", "public function display_code() {\n\t\techo '<h1>Premise Demo Page</h1>\n\t\t<div class=\"span10\">';\n\n\n\t\t\t// test a form with all possible fields.\n\t\t\t// pass your own arguments if you'd like.\n\t\t\t// new PWP_Demo_Form();\n\n\t\t\t// Premise_test::fields();\n\t\t\t// Premise_test::fields_hooks();\n\t\t\t// Premise_test::fields_demo();\n\t\t\t// Premise_test::videos_embed();\n\t\t\t// Premise_test::fields_duplicate();\n\t\t\t// Premise_test::google_map();\n\t\t\t// Premise_test::grids();\n\n\t\techo '</div>';\n\t}", "function main()\r\n {\r\n $this->setOutput();\r\n }", "public function run()\n\n {\n DB::table('actives')->insert([\n 'script_tag' => 0,\n 'status' =>0\n \n ]);\n //\n }", "protected function _exec()\n {\n }", "public function run() {\n\n\t\t// generate random string md5(uniqid(rand(), true));\n\t\t$this->goneta();\n\t\t$this->pamparam();\n\t\t$this->insideOut();\n\t\t$this->morfoza();\n\t\t$this->basorelief();\n\t\t$this->acajouWasZuSagen();\n\t}", "protected function after_load(){\n\n\n }", "public function work()\n {\n }", "function run();", "function run();", "public function run() {\n\t\t// include other classes\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-render.php';\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-sso.php';\n\t\t\n\t\t// enque styles for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_styles' \n\t\t) );\n\t\t// enque jquery scripts for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_script' \n\t\t) );\n\t\t// add submit action form to redirect and catch from admin.php\n\t\tadd_action ( 'admin_post_tr_action', array (\n\t\t\t\t$this,\n\t\t\t\t'prefix_admin_tr_action' \n\t\t) );\n\t\t\n\t\t// check if plugin tables exist\n\t\t$this->table_check ();\n\t\t\n\t\t// instantiate the render class for shortcodes to work\n\t\t$shortcodes = new Top_Ratter_Render ();\n\t}", "function tap_run_page_handler() \n {\n include(\"/var/www/html/run/tap_run.php\");\n \n $params = cargaArray('Torneo Argentino de Programación', $form, '');\n \n include('body.php'); \n }", "function run() {\r\n $this->view->data=$this->model->run();\r\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "public function run()\n {\n \\App\\Model\\TemplateLib::create([\n 'name' => 'FNK Test',\n 'stylesheet' => 'body {background:white};',\n 'javascript' => '',\n 'code_header' => $this->codeHeader,\n 'code_footer' => $this->codeFooter,\n 'code_index' => $this->codeIndex,\n 'code_search' => '<h1>saya di search</h1>',\n 'code_category' => '<h1>saya di category</h1>',\n 'code_page' => $this->codePage,\n 'code_post' => $this->codePost,\n 'code_about' => '<h1>saya di about</h1>',\n 'code_404' => '<h1>saya di 404</h1>',\n ]);\n }", "public function helper()\n\t{\n\t\n\t}", "public function drawContent()\n\t\t{\n\t\t}" ]
[ "0.60586566", "0.59289104", "0.5919654", "0.5899511", "0.5838488", "0.5838488", "0.58356965", "0.5814271", "0.5814271", "0.57796824", "0.5701954", "0.5700516", "0.5685669", "0.5684617", "0.5684617", "0.5684617", "0.5639208", "0.563027", "0.56278986", "0.56231225", "0.5620407", "0.56068903", "0.56068903", "0.56068903", "0.56016845", "0.5597219", "0.5595339", "0.5591545", "0.558057", "0.55636305", "0.55034596", "0.5487096", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.54594034", "0.5446425", "0.5446197", "0.54451364", "0.54319674", "0.5426377", "0.54072845", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.53981763", "0.5394762", "0.5392594", "0.5392164", "0.5391672", "0.5391672", "0.5391672", "0.5386191", "0.53823715", "0.5374112", "0.5373851", "0.5371084", "0.5369742", "0.53666246", "0.5365522", "0.5358571", "0.53542304", "0.5353158", "0.5345768", "0.5339915", "0.53389114", "0.53339213", "0.5332912", "0.5323722", "0.5323722", "0.5321411", "0.5318719", "0.53184503", "0.5300535", "0.5290181", "0.52723837", "0.52723306" ]
0.0
-1
Send added element to $this elements
public function element(Element $element) { $this->elements[] = $element; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function append ( $element ) {\n $this->childrenElements[] = $element;\n }", "public function push($el){\r\n\r\n array_push($this->data,$el);\r\n\r\n }", "private function addTo(){\n\t\t$element = 'to';\n\t\t$options = array('required'=>false,'readonly' => true,'filters'=>array('StringTrim'),'label'=>'to');\n\t\t$this->addElement('text',$element,$options);\n\t\t//$prefix = array();\n\t\t//$decorator = array('DivForm');\n\t\t//$this->addCustomDecorator($prefix,$decorator,$element);\n\t\t$this->applyDecorator($element,true);\n\t\t$this->addToGroup($element);\n\t}", "public function add($element);", "public function add($element);", "public function add($element);", "public function add($elem) {\n\t\t$this->elems[] = $elem;\n\t}", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function addElement(FormItBuilder_baseElement $o_formElement){\n\t\t$this->_formElements[]=$o_formElement;\n\t}", "public function add($element) {\n $type = strtolower(current(array_reverse(explode(\"\\\\\", get_class($element)))));\n parent::add($element);\n if ($type == \"hidden\")\n $this->_hiddenElements[] = $element;\n else\n $this->_inputElements[] = [$element, $this->_currentFieldset];\n }", "private function addElements()\n {\n $author = (new Text())\n ->setName('author')\n ->setLabel('Author')\n ->setAttribute('id', 'author');\n $this->add($author);\n\n $comment = (new Textarea())\n ->setName('comment')\n ->setLabel('Content')\n ->setAttribute('id', 'comment');\n $this->add($comment);\n\n $submit = (new Submit())\n ->setName('submit')\n ->setAttribute('value', 'Save')\n ->setAttribute('id', 'submitButton');\n $this->add($submit);\n }", "protected function add() {\n\t}", "public function addElement($element)\n\t{\n\t\t$this->elements[] = $element;\n\t\treturn $this;\n\t}", "public function addElement($element) {\n $this->elements[] = $element;\n }", "public function append($element)\n {\n $this->elements[] = $element;\n $this->iteratorCount = count($this->elements);\n }", "protected function setElement()\n {\n $this->result[$this->attribute]['element'] = $this->field['element'];\n return $this;\n }", "public function add($element) {\n //debug('Form->add() ; START');\n //debug('Form->add() : '.get_class($element).' -- '.$element->getName().' -- '.$element->getId());\n if(is_object($element)) {\n if(false == $this->idIsAvailable($element)) {\n throw new Exception('Element name ('.$element->getId().') already exist');\n } else {\n $this->elements[] = $element;\n $this->aIds[] = $element->getId();\n $this->nbElements++;\n\n //debug('Form->add() : fireEvent(\\'addedToParent\\')');\n //debug('Form->add() : $this->errorMethod : '.$this->errorMethod);\n $element->fireEvent('addedToParent', array(\n 'parent' => $this,\n 'showError' => $this->errorMethod\n ));\n\n //~ $element->setParent($this);\n }\n } else {\n throw new Exception('Can\\'t add element : it must be an object');\n }\n\n //debug('Form->add() ; END');\n return $element;\n }", "public function addElement(Form\\Element $element) {\n $this->elements[] = $element;\n }", "public function push(Element ...$elem): Element\n {\n foreach ($elem as $e) {\n $this->element = $this->element.$e;\n }\n\n return $this;\n }", "function queue ($elemento)\n\t\t\t\t{\n\t\t\t\t\tarray_push($this->arreglo, $elemento);\n\t\t\t\t}", "private function addRawElement($newElement)\n {\n $this->elements[] = $newElement;\n }", "public function decorate()\n {\n\n $this->element->addItemButton\n ->addClass('btn-sm push-top')\n ->appendContent(' <i class=\"btr bt-plus btn-no-anim\"></i>')\n ;\n\n $this->element->removeItemButton->content->clear();\n $this->element->removeItemButton->content('<i class=\"btr bt-trash\" style=\"margin:0\"></i>');\n\n }", "public function append($element)\n {\n $this->_data[] = $element;\n return $this;\n }", "protected function addElements()\n {\n // Add \"latitude\" field\n $this->add([\n 'type' => 'text',\n 'name' => 'latitude',\n 'id' => 'latitude',\n 'options' => [\n 'label' => 'Latitude',\n ],\n ]);\n\n // Add \"longitude\" field\n $this->add([\n 'type' => 'text',\n 'name' => 'longitude',\n 'options' => [\n 'label' => 'Longitude',\n ],\n ]);\n\n // Add the Update button\n $this->add([\n 'type' => 'submit',\n 'name' => 'update',\n 'attributes' => [\n 'value' => 'Update'\n ],\n ]);\n }", "function &add(& $element)\n {\n if (!is_a($element, 'Image_Graph_Font')) {\n $this->_elements[] = &$element;\n }\n $element->_setParent($this);\n return $element;\n }", "public function addElements($elements);", "public function append() {\n $num_of_args = func_num_args();\n if ( $num_of_args == 1 && gettype( func_get_arg( 0 ) ) == \"array\" ) {\n $args = func_get_arg( 0 );\n $num_of_args = count( $args );\n } else {\n $args = func_get_args();\n }\n for ( $i = 0; $i < $num_of_args; $i++ ) {\n $arg = $args[$i];\n if ( $arg instanceof AbstractHTMLElement ) {\n $this->content .= $arg->asHTML();\n } else {\n $this->content .= $arg;\n }\n }\n return $this;\n }", "public function addElements()\n {\n $this->add(array(\n 'name' => 'place',\n 'type' => 'Zend\\Form\\Element\\Text',\n 'attributes' => array(\n 'required' => true,\n 'id' => 'name',\n 'class' => 'form-control',\n 'placeholder' => 'Enter type name'\n ),\n 'options' => array(\n 'label' => 'Name',\n 'label_attributes' => array(\n 'class' => 'control-label'\n ),\n\n ),\n ));\n }", "public function set_element($elm) {\n $this->elements[$elm->id] = $elm;\n }", "public function addElement(FormElementInterface $element): void;", "public function push($item): void\n {\n $this->elements[] = $item;\n }", "protected function addElements() \n { \n // Add \"nom\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'nom_parent',\n 'attributes' => [\n 'id' => 'nom_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Nom de famille:',\n ],\n ]);\n \n // Add \"prenom\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'prenom_parent',\n 'attributes' => [\n 'id' => 'prenom_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Prénom parent:',\n ],\n ]);\n \n // Add \"domicile\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'domicile',\n 'attributes' => [\n 'id' => 'domicile',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Domicile:',\n ],\n ]);\n \n // Add \"telephone_number\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telephone1',\n 'attributes' => [\n 'id' => 'telephone1'\n ],\n 'options' => [\n 'label' => 'Téléphone 1',\n ],\n ]);\n \n // Add \"telephone_number\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telephone2',\n 'attributes' => [\n 'id' => 'telephone2'\n ],\n 'options' => [\n 'label' => 'Téléphone 2',\n ],\n ]);\n \n // Add \"code eleve \" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'email_parent',\n 'attributes' => [\n 'id' => 'email_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'E-mail:',\n ],\n ]);\n \n // Add \"comment\" field\n $this->add([ \n 'type' => 'textarea',\n 'name' => 'commentaire',\n 'options' =>[\n 'label' => 'Commentaires:',\n ],\n 'attributes' => [\n 'id' => 'commentaire',\n 'style' => 'width: 50%'\n ], \n ]);\n \n // Add the submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [ \n 'value' => 'Enregistrer',\n 'id' => 'submitbutton',\n ],\n ]); \n \n }", "public function element() {\n\t\t$element = parent::element();\n\t\t$element->data('field', self::$fieldname);\n\t\treturn $element;\n\t}", "public function addElementClicked(SubmitButton $button)\n\t{\n\t\t$button->parent->createOne();\n\t}", "public function save() {\n\t\t$this->data[] = $this->current();\n\t}", "public function add(){\n $this->edit();\n }", "protected function OnCreateElements() {}", "protected function OnCreateElements() {}", "public function addElement($element)\n\t{\n\t\tif (count(parent::getElements()) < 2)\n\t\t{\n\t\t\tparent::addElement($element);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function addElement($data)\n {\n return $this->save($data);\n }", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "function addItemToDB()\n {\n $this->database->addItemToDB($this);\n }", "private function addElements(): void\n {\n // Add additional form fields\n $this->add([\n 'name' => 'masterFile',\n 'type' => Checkbox::class,\n 'attributes' => [\n 'id' => 'masterFile',\n 'class' => 'form-check-input',\n ],\n 'options' => [\n 'label' => 'Create master export file',\n 'label_attributes' => [\n 'class' => 'form-check-label',\n ],\n ],\n ]);\n\n $this->add([\n 'name' => 'debugTranslations',\n 'type' => Checkbox::class,\n 'attributes' => [\n 'id' => 'debugTranslations',\n 'class' => 'form-check-input',\n ],\n 'options' => [\n 'label' => 'Create debug translations',\n 'label_attributes' => [\n 'class' => 'form-check-label',\n ],\n ],\n ]);\n }", "protected function _setAddButton()\n {\n $this->setChild('add_button',\n $this->getLayout()->createBlock('adminhtml/widget_button')\n ->setData(array('id' => \"add_tax_\" . $this->getElement()->getHtmlId(),\n 'label' => Mage::helper('catalog')->__('Add Tax'),\n 'onclick' => \"weeeTaxControl.addItem('\" . $this->getElement()->getHtmlId() . \"')\",\n 'class' => 'add'\n )));\n }", "public function attachJsToElement(&$element) {\n\n if ($this->addthis->getWidgetJsInclude() != AddThis::WIDGET_JS_INCLUDE_NONE) {\n $widget_js = new AddThisWidgetJsUrl($this->getWidgetJsUrl());\n\n $pubid = $this->addthis->getProfileId();\n if (!empty($pubid) && is_string($pubid)) {\n $widget_js->addAttribute('pubid', $pubid);\n }\n\n $async = $this->async;\n if ($async) {\n $widget_js->addAttribute('async', 1);\n }\n\n $domready = $this->domready;\n if ($domready) {\n $widget_js->addAttribute('domready', 1);\n }\n\n // Only when the script is not loaded after the DOM is ready we include\n // the script with #attached.\n if (!$domready) {\n $element['#attached']['js'][$widget_js->getFullUrl()] = array(\n 'type' => 'external',\n 'scope' => 'footer',\n );\n }\n\n // Every setting value passed here overrides previously set values but\n // leaves the values that are already set somewhere else and that are not\n // passed here.\n $element['#attached']['js'][] = array(\n 'type' => 'setting',\n 'data' => array(\n 'addthis' => array(\n 'async' => $async,\n 'domready' => $domready,\n 'widget_url' => $widget_js->getFullUrl(),\n\n 'addthis_config' => $this->getJsAddThisConfig(),\n 'addthis_share' => $this->getJsAddThisShare(),\n )\n )\n );\n }\n }", "protected function addElements()\n {\n // Add \"email\" field\n $this->add([\n 'type' => 'text',\n 'name' => 'pin',\n 'options' => [\n 'label' => 'PIN'\n ],\n 'attributes' => [\n 'class' => 'form-control',\n 'id' => 'pin',\n 'maxlength' => 14\n ],\n ]);\n\n\n $this->add([\n 'name' => 'photo',\n 'type' => 'Zend\\Form\\Element\\File',\n 'attributes' => [\n 'type' => 'file',\n 'id' => 'user_photo_upload_form'\n ]\n ]);\n\n $this->add(array(\n 'type' => 'Zend\\Form\\Element\\Csrf',\n 'name' => 'csrf',\n ));\n\n\n // Add the Submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [\n 'value' => 'Save',\n 'class' => 'btn btn-small btn-success',\n ],\n ]);\n }", "public function editorAttach(&$element, &$settings);", "function addFormElement($formElement) {\n\t\tif (!$formElement) {\n\t\t\treturn false;\n\t\t}\n\t\tarray_push($this->elementList, $formElement);\n\t\t\n\t\t// Add name of element, linked to it's object\n\t\t$this->elementListNames[$formElement->name] = $formElement;\n\t\t\n\t\t// Add reference to parent.\n\t\t$formElement->parent = $this;\n\t}", "public function add($element)\n {\n $this->elements[] = $element;\n\n return $this;\n }", "protected function addElements() \n {\n \n // Add \"usuario\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'nombre',\n 'options' => [\n 'label' => 'Usuario Adicional',\n ],\n ]);\n \n \n // Add \"telefono\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telefono',\n 'options' => [\n 'label' => 'Teléfono',\n ],\n ]);\n \n // Add \"email\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'email',\n 'options' => [\n 'label' => 'Mail',\n ],\n ]);\n \n // Add \"usuario\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'skype',\n 'options' => [\n 'label' => 'Skype',\n ],\n ]);\n \n // Add \"id\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'id',\n 'options' => [\n 'label' => 'id',\n ],\n ]);\n \n \n // Add the Submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [\n 'value' => 'Create'\n ],\n ]);\n\n }", "public function addElement(Tx_FormBase_Core_Model_FormElementInterface $formElement) {\n\t\t$this->addRenderable($formElement);\n\t}", "public function enqueue($element) {\n $this->queue[] = $element;\n }", "public function backend_element_items()\n {\n $this->frontend_element_items();\n }", "public function backend_element_items()\n {\n $this->frontend_element_items();\n }", "public function attachTo($parentNode)\r\n {\r\n $parentNode->appendChild($this);\r\n }", "function edit_elements($element, $sentence)\n {\n $element->nodeValue = '';\n foreach($sentence as $node)\n {\n /* Appends a new HTML element at the end of the old one. */\n $element->appendChild($node);\n }\n }", "function populate() {\n $this->populateInputElements($this->children);\n }", "public function addChild(HTMLElement $el) {\n\t\tparent::addChild($el);\n\t\t/* Add pointer to last child, and its children */\n\t\t$this->rAddPointers($this->getChild($this->getNoOfChildren()-1));\n\t}", "protected function addElem($element)\r\n\t{\r\n\t\tforeach($this->getPools() as $pool) {\r\n\t\t\t$pool->add($element);\r\n\t\t}\r\n\t\treturn $this;\r\n\t}", "private function addItemToCollection()\n {\n $this->collection->items[$this->cart_hash] = $this;\n\n }", "public function addElement($name, $element);", "public function append($obj) {\r\n\t\t$obj->pzkParentId = @$this->id;\r\n\t\t$this->children[] = $obj;\r\n\t}", "public function addElement(SVGElement $elementObject) {\n\n $this->elementsList[] = $elementObject;\n\n return $this;\n }", "public function appendTo(PapayaXmlElement $parent) {\n foreach ($this->_toolbars as $position => $toolbar) {\n if (isset($toolbar)) {\n $node = $toolbar->appendTo($parent);\n if (isset($node)) {\n $node->setAttribute(\n 'position', $this->_positions[$position]\n );\n }\n }\n }\n }", "public function add_element($elements)\n {\n if (is_array($elements)) {\n foreach ($elements as $element) {\n if (in_array($element, $this->elements, true)) {\n continue;\n }\n $this->elements[] = $element;\n }\n } else {\n if (in_array($elements, $this->elements, true)) {\n return;\n }\n $this->elements[] = $elements;\n }\n }", "public function appendTo(PapayaXmlElement $parent) {\n $this->items()->clear();\n $this->callbacks()->onBeforeAppend($this->items());\n foreach ($this->elements() as $index => $element) {\n if (isset($this->callbacks()->onCreateItem)) {\n $item = $this->callbacks()->onCreateItem($element, $index);\n } else {\n $itemClass = $this->_itemClass;\n $item = new $itemClass($element, $index);\n }\n if ($item instanceOf PapayaUiNavigationItem) {\n $this->items()->add($item);\n $this->callbacks()->onAfterAppendItem($item, $element, $index);\n }\n }\n $parent->append($this->items());\n $this->callbacks()->onAfterAppend($this->items());\n }", "public function push($obj)\r\n\t{\r\n\t\t$this->isLoaded = true;\r\n\t\t$this->keyAssocation[$obj->get($this->obj->primaryKey)] = $this->count++;\r\n\t\t$this->elements[] = $obj;\r\n\t}", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n {\n }", "public function _onAdd($parent) {\r\n\t\t/* Intentionally empty */\r\n\t}", "protected function _markNew() \n {\n DomainWatcher::addNewObject($this);\n }", "function append($data) {}", "function addElement($script){\n if(!$this->host->messages)\n $this->host->messages = $script;\n else\n $this->host->messages .= $script;\n }", "public function append($elements)\n\t{\n\t\tif (is_array($elements))\n\t\t{\n\t\t\t$this->elements = array_merge($this->elements, $elements);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->elements = array_merge($this->elements, array($elements));\n\t\t}\n\t}", "public function attach(ECP_OverlegObserver $obs){\r\n $i = array_search($obs, $this->observer);\r\n if ($i === false) {\r\n $this->observers[] = $obs;\r\n }\r\n return $this;\r\n }", "public function send()\n {\n print_r($this);\n }", "public function add();", "public function add();", "public function add ($obj) {\n\t\treturn $this->append($obj);\t\n\t}", "public function appendChildCopy($item) {}", "public function add(string $key, $element): void;", "private function _addElementTexts()\n {\n return $this->_record->addElementTextsByArray($this->_elementTexts);\n }", "private function _addElementTexts()\n {\n return $this->_record->addElementTextsByArray($this->_elementTexts);\n }", "public function removeElements() {\n\t\t$this->elements = array();\n\t\treturn $this;\n\t}", "public function current()\n {\n\n $element = parent::current();\n $this->originalElement = $element;\n $mapped_element = array();\n $tldMapping = tc_cleverreach_tldmapping::getInstance();\n\n if ($element->newsid != null) {\n $mapped_element = $this->mapElementsIfNewsId($element);\n } else {\n $mapped_element['active'] = \"0\";\n $mapped_element['email'] = $element->oxuser__oxusername;\n $mapped_element['activated'] = time();\n $mapped_element['salutation'] = $element->oxuser__oxsal;\n $mapped_element['firstname'] = $element->oxuser__oxfname;\n $mapped_element['lastname'] = $element->oxuser__oxlname;\n }\n $mapped_element['registered'] = strtotime($element->oxuser__oxcreate);\n $mapped_element['company'] = $element->oxuser__oxcompany;\n $mapped_element['street'] = $element->oxuser__oxstreet . ' ' . $element->oxuser__oxstreetnr;\n $mapped_element['city'] = $element->oxuser__oxcity;\n $mapped_element['zip'] = $element->oxuser__oxzip;\n\n if ($element->oxuser__oxbirthdate != '0000-00-00') {\n $mapped_element['birthday'] = $element->oxuser__oxbirthdate;\n } else {\n $mapped_element['birthday'] = null;\n }\n\n $mapped_element['shop'] = $element->oxuser__oxshopid;\n\n if (\n $element->oxuser__oxcountryid !== '' &&\n $element->oxuser__oxcountryid !== null &&\n $element->oxuser__oxcountryid !== 'NULL'\n ) {\n $mapped_element['country'] = $element->oxcountry__oxtitle;\n $mapped_element['language'] = $tldMapping->getLanguageByISO2($element->oxcountry__oxisoalpha2);\n }\n\n if ($element->oxcountry__oxtitle == '') {\n // Staat und Sprache\n $mapped_element['country'] = $tldMapping->getCountryByEMail($mapped_element['email']);\n $mapped_element['language'] = $tldMapping->getLanguageByEMail($mapped_element['email']);\n }\n\n $productName =\n trim($element->oxorderarticles__oxtitle . \" \" . $element->oxorderarticles__oxselvariant);\n\n $mapped_element['order_id'] = $element->oxorder__oxordernr;\n $mapped_element['purchase_date'] = $this->createTimestamp($element->oxorder__oxorderdate);\n $mapped_element['source'] = $element->oxshops__oxname;\n $mapped_element['amount'] = $element->oxorderarticles__oxamount;\n $mapped_element['product_id'] = $element->oxorderarticles__oxartnum;\n $mapped_element['product'] = $productName;\n $mapped_element['price'] = $element->oxorderarticles__oxprice;\n\n return $mapped_element;\n }", "protected function stopVirtualElement()\n {\n if (! $this->element or $this->reader->nodeType !== XMLReader::ELEMENT) {\n return;\n }\n\n if ($parent = $this->findVirtualElementById($this->element->get('@parent'))) {\n $key = $this->getPluralized($this->element->get('@element'));\n\n if (! $parent->has($key)) {\n $parent->put($key, new Collection);\n }\n\n if ($parent->get($key) instanceof Collection) {\n $parent->get($key)->push($this->element);\n }\n } else {\n $this->elements->push($this->element);\n }\n\n $this->element->forget(['@id', '@parent', '@element']);\n }", "function add($str) {\n\t $this->xml .= $str;\n\t}", "protected function addElements() \n {\n // Add \"email\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'title',\n 'options' => [\n 'label' => 'Title',\n ],\n ]);\n \n // Add \"parent_id\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'parent_id', \n 'options' => [\n 'label' => 'Full Name',\n ],\n ]);\n \n if ($this->scenario == 'create') {\n \n\n }\n \n // Add \"status\" field\n $this->add([ \n 'type' => 'select',\n 'name' => 'status',\n 'options' => [\n 'label' => 'Status',\n 'value_options' => [\n 1 => 'Active',\n 2 => 'Retired', \n ]\n ],\n ]);\n \n // Add the Submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [ \n 'value' => 'Create'\n ],\n ]);\n }", "protected function add_additional_elements()\n {\n if (count($this->additional_elements) > 0)\n {\n $count = 0;\n foreach ($this->additional_elements as $element)\n {\n if ($element->getType() != 'hidden')\n {\n $count ++;\n }\n }\n\n if ($count > 0)\n {\n $this->addElement('category', Translation::get('AdditionalProperties'));\n foreach ($this->additional_elements as $element)\n {\n $this->addElement($element);\n }\n $this->addElement('category');\n }\n }\n }", "public function addFields($formelements){\r\n\t\t $this->formElements \t= $formelements;\r\n\t}", "public function append($elements)\n\t{\n\t\tif (is_array($elements)) {\n\t\t\t$this->_elements = array_unique(array_merge($this->_elements, $elements));\n\t\t}\n\t\telse {\n\t\t\t$this->_elements = array_unique(array_merge($this->_elements, array($elements)));\n\t\t}\n\t}", "public function buildElement() {\n\n // Set the element type\n $this->addType('example');\n\n // Add the element attributes\n $this->addAttributes(array(\n // Some attributes\n ));\n\n // Example if we need to add child object\n // to this element\n $object = new VTCore_Form_Base();\n $object->addType('example_child');\n $object->addAttributes(array(\n // Some Attributes\n ));\n\n // Adding a plaing text as child of subchild\n $object->addText('some text');\n\n // Inject the child and subchild back to parent\n $this->addChildren($object);\n\n // No need to echo or print anything, all the\n // actual rendering will be performed by\n // VTCore_Form_Base() when user is invoking\n // the render or __toString method.\n }", "function addSelfToDocument($domtree, $parentElement) { \n // create the root element for this class and append it to our parent\n $xmlRoot = $parentElement->appendChild($domtree->createElement('view'));\n $xmlRoot->appendChild($domtree->createElement('siteicon_url', get_option('hbo_siteicon_url')));\n $xmlRoot->appendChild($domtree->createElement('housekeepingurl', get_option('hbo_housekeeping_url')));\n $xmlRoot->appendChild($domtree->createElement('split_room_report_url', get_option('hbo_split_room_report_url')));\n $xmlRoot->appendChild($domtree->createElement('unpaid_deposit_report_url', get_option('hbo_unpaid_deposit_report_url')));\n $xmlRoot->appendChild($domtree->createElement('group_bookings_report_url', get_option('hbo_group_bookings_report_url')));\n $xmlRoot->appendChild($domtree->createElement('guest_comments_report_url', get_option('hbo_guest_comments_report_url')));\n $xmlRoot->appendChild($domtree->createElement('bedcounts_url', get_option('hbo_bedcounts_url')));\n $xmlRoot->appendChild($domtree->createElement('manual_charge_url', get_option('hbo_manual_charge_url')));\n $xmlRoot->appendChild($domtree->createElement('generate_payment_link_url', get_option('hbo_generate_payment_link_url')));\n $xmlRoot->appendChild($domtree->createElement('payment_history_url', get_option('hbo_payment_history_url')));\n $xmlRoot->appendChild($domtree->createElement('payment_history_inv_url', get_option('hbo_payment_history_inv_url')));\n $xmlRoot->appendChild($domtree->createElement('process_refunds_url', get_option('hbo_process_refunds_url')));\n $xmlRoot->appendChild($domtree->createElement('refund_history_url', get_option('hbo_refund_history_url')));\n $xmlRoot->appendChild($domtree->createElement('report_settings_url', get_option('hbo_report_settings_url')));\n $xmlRoot->appendChild($domtree->createElement('view_log_url', get_option('hbo_view_log_url')));\n $xmlRoot->appendChild($domtree->createElement('job_history_url', get_option('hbo_job_history_url')));\n $xmlRoot->appendChild($domtree->createElement('job_scheduler_url', get_option('hbo_job_scheduler_url')));\n $xmlRoot->appendChild($domtree->createElement('blacklist_url', get_option('hbo_blacklist_url')));\n $xmlRoot->appendChild($domtree->createElement('online_checkin_url', get_option('hbo_online_checkin_url')));\n $xmlRoot->appendChild($domtree->createElement('redirect_to_url', get_option('hbo_redirect_to_url')));\n $xmlRoot->appendChild($domtree->createElement('log_directory', get_option('hbo_log_directory')));\n $xmlRoot->appendChild($domtree->createElement('log_directory_url', get_option('hbo_log_directory_url')));\n $xmlRoot->appendChild($domtree->createElement('run_processor_cmd', get_option('hbo_run_processor_cmd')));\n }", "public function addElements($a_elements){\n\t\tforeach($a_elements as $o_formElement){\n\t\t\t$this->addElement($o_formElement);\n\t\t}\n\t}", "protected function afterAdd() {\n\t}", "public function frontend_element_items()\n {\n\t\t$this->items = array(\n\t\t\t'content' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_ELEMENT_TITLE'),\n\t\t\t\t\t'id' => 'el_title',\n\t\t\t\t\t'type' => 'text_field',\n\t\t\t\t\t'class' => 'jsn-input-xxlarge-fluid',\n\t\t\t\t\t'std' => JText::_('JSN_PAGEBUILDER_ELEMENT_IMAGE_ELEMENT_TITLE_STD'),\n\t\t\t\t\t'role' => 'title',\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_ELEMENT_TITLE_DES')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_IMAGE_FILE'),\n\t\t\t\t\t'id' => 'image_file',\n\t\t\t\t\t'type' => 'select_media',\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'class' => 'jsn-input-large-fluid',\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_IMAGE_FILE_DES')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_ELEMENT_IMAGE_ALT_TEXT'),\n\t\t\t\t\t'id' => 'image_alt',\n\t\t\t\t\t'type' => 'text_field',\n\t\t\t\t\t'class' => 'jsn-input-xxlarge-fluid',\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_ELEMENT_IMAGE_ALT_TEXT_DES')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_ELEMENT_IMAGE_IMAGE_SIZE'),\n\t\t\t\t\t'id' => 'image_size',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'std' => 'fullsize',\n\t\t\t\t\t'options' => JSNPagebuilderHelpersType::getImageSize(),\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_ELEMENT_IMAGE_IMAGE_SIZE_DES')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_ELEMENT_IMAGE_CLICK_ACTION'),\n\t\t\t\t\t'id' => 'link_type',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'std' => JSNPagebuilderHelpersType::getFirstOption(JSNPbImageHelper::getClickActionType()),\n\t\t\t\t\t'options' => JSNPbImageHelper::getClickActionType(),\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_ELEMENT_IMAGE_CLICK_ACTION_DES'),\n\t\t\t\t\t'has_depend' => '1',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_URL'),\n\t\t\t\t\t'id' => 'image_type_url',\n\t\t\t\t\t'type' => 'text_field',\n\t\t\t\t\t'class' => 'jsn-input-xxlarge-fluid',\n\t\t\t\t\t'std' => 'http://',\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_LINK_URL_DES'),\n\t\t\t\t\t'dependency' => array('link_type', '=', 'url')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_OPEN_IN'),\n\t\t\t\t\t'id' => 'open_in',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'std' => JSNPagebuilderHelpersType::getFirstOption(JSNPbImageHelper::getOpenInOptions()),\n\t\t\t\t\t'options' => JSNPbImageHelper::getOpenInOptions(),\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_OPEN_IN_DES'),\n\t\t\t\t\t'dependency' => array('link_type', '=', 'url')\n\t\t\t\t),\n\t\t\t),\n\t\t\t'styling' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'preview',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_CONTAINER_STYLE'),\n\t\t\t\t\t'id' => 'image_container_style',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'std' => JSNPagebuilderHelpersType::getFirstOption(JSNPagebuilderHelpersType::getContainerStyle()),\n\t\t\t\t\t'options' => JSNPagebuilderHelpersType::getContainerStyle(),\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_CONTAINER_STYLE_DES')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_ALIGNMENT'),\n\t\t\t\t\t'id' => 'image_alignment',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'std' => JSNPagebuilderHelpersType::getFirstOption(JSNPagebuilderHelpersType::getTextAlign()),\n\t\t\t\t\t'options' => JSNPagebuilderHelpersType::getTextAlign(),\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_ALIGNMENT_DES')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_MARGIN'),\n\t\t\t\t\t'container_class' => 'combo-group',\n\t\t\t\t\t'id' => 'image_margin',\n\t\t\t\t\t'type' => 'margin',\n\t\t\t\t\t'extended_ids' => array('image_margin_top', 'image_margin_right', 'image_margin_bottom', 'image_margin_left'),\n\t\t\t\t\t'tooltip' => JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_MARGIN_DES')\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "public function appendTo(Element $parentNode): void {\n foreach ($this->_document->childNodes as $node) {\n if ($node instanceof \\DOMElement) {\n $this->addNode($parentNode, $node);\n }\n }\n }", "public function addProduct(ProductElementInterface $product);" ]
[ "0.612994", "0.59903276", "0.59842515", "0.587562", "0.587562", "0.587562", "0.58739865", "0.5797562", "0.5788704", "0.5698597", "0.5684506", "0.5650369", "0.5644739", "0.5603695", "0.55947816", "0.55555755", "0.55233514", "0.5446971", "0.5420117", "0.5413411", "0.540724", "0.54034424", "0.5401413", "0.54006004", "0.5379864", "0.53736985", "0.5329313", "0.5324157", "0.53212124", "0.5295062", "0.52805024", "0.52776664", "0.5273744", "0.5266618", "0.5260551", "0.52090156", "0.52085793", "0.52085793", "0.51894933", "0.51798034", "0.51617277", "0.51617277", "0.5155146", "0.51499015", "0.5146378", "0.51397496", "0.5124157", "0.512229", "0.5120242", "0.51181066", "0.5114946", "0.5099136", "0.5091667", "0.5076588", "0.5076588", "0.50541484", "0.5048979", "0.5040824", "0.5040191", "0.5015691", "0.5007889", "0.5004359", "0.49996695", "0.4989843", "0.49852213", "0.4983613", "0.4978566", "0.49756297", "0.49734396", "0.49734396", "0.49734396", "0.49525064", "0.49495932", "0.49476442", "0.49345228", "0.49344724", "0.49194077", "0.4913872", "0.4889208", "0.4889208", "0.48849267", "0.4883842", "0.48832312", "0.48811015", "0.48811015", "0.48760444", "0.48732007", "0.4865212", "0.48639292", "0.48605245", "0.4856477", "0.48556945", "0.48458707", "0.4833517", "0.48288795", "0.48133993", "0.48132735", "0.4812864", "0.48124495", "0.48095658" ]
0.5315637
29
Boot real compiled field. Append children to parentroot.
public function create() { // Load only root elements. $this->loadRoots($this->elements, $this->roots); // Make sure that first element isn't child. If child then throw a exception about that. if ($this->elements[0]->isChild()) TypeRegression::cantBe('child', 'First'); // Set elements compiled field with relations $this->makeRelationsToCompiled($this->elements); // After append process by root-child then compile all stuffs into 'page' field. foreach ($this->roots as $key => $element) { $this->page .= $element->compiled; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function actionPostLoadingEvent()\n {\n if (self::$child_data === null) {\n self::$child_data = [];\n foreach ($this->getParentModel()->children->child->iterateItems() as $node_uuid => $node) {\n if (empty((string)$node->enabled)) {\n continue;\n }\n $conn_uuid = (string)$node->connection;\n if (!isset(self::$child_data[$conn_uuid])) {\n self::$child_data[$conn_uuid] = [];\n }\n foreach (self::$child_attrs as $key) {\n if (!isset(self::$child_data[$conn_uuid][$key])) {\n self::$child_data[$conn_uuid][$key] = [];\n }\n self::$child_data[$conn_uuid][$key][] = (string)$node->$key;\n }\n }\n }\n foreach ($this->internalChildnodes as $node) {\n if (!$node->getInternalIsVirtual()) {\n $extra_attr = ['local_ts' => '', 'remote_ts' => ''];\n $conn_uuid = (string)$node->getAttribute('uuid');\n foreach (self::$child_attrs as $key) {\n $child_node = new TextField();\n $child_node->setInternalIsVirtual();\n if (isset(self::$child_data[$conn_uuid]) && !empty(self::$child_data[$conn_uuid][$key])) {\n $child_node->setValue(implode(',', array_unique(self::$child_data[$conn_uuid][$key])));\n }\n $node->addChildNode($key, $child_node);\n }\n }\n }\n return parent::actionPostLoadingEvent();\n }", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "function populate() {\n $this->populateInputElements($this->children);\n }", "protected function buildRenderChildrenClosure() {}", "public function build()\n {\n $this->classMetadata->appendExtension($this->getExtensionName(), [\n 'groups' => [\n $this->fieldName,\n ],\n ]);\n }", "protected function buildMainFields()\n {\n $this->meta[static::FIELD_CARRIER_NAME] = [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'componentType' => Fieldset::NAME,\n 'label' => __('%1', 'Carrier Settings'),\n 'collapsible' => true,\n 'opened' => true,\n 'dataScope' => self::DATA_SCOPE_CARRIER,\n 'sortOrder' => 10,\n ],\n ],\n ],\n 'children' => [\n static::FIELD_ENTITY_ID_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Id'),\n 'componentType' => Field::NAME,\n 'formElement' => Hidden::NAME,\n 'dataScope' => static::FIELD_ENTITY_ID_NAME,\n 'dataType' => Number::NAME,\n 'sortOrder' => 0,\n ],\n ],\n ],\n ],\n static::FIELD_TITLE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Default Title'),\n 'componentType' => Field::NAME,\n 'formElement' => Input::NAME,\n 'dataScope' => static::FIELD_TITLE_NAME,\n 'dataType' => Text::NAME,\n 'sortOrder' => 10,\n 'validation' => [\n 'required-entry' => true,\n ],\n ],\n ],\n ],\n ],\n static::FIELD_IS_ACTIVE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Is Active'),\n 'componentType' => Field::NAME,\n 'formElement' => Checkbox::NAME,\n 'dataScope' => static::FIELD_IS_ACTIVE_NAME,\n 'dataType' => Number::NAME,\n 'sortOrder' => 20,\n 'prefer' => 'toggle',\n 'valueMap' => [\n 'true' => '1',\n 'false' => '0',\n ],\n ],\n ],\n ],\n ],\n static::FIELD_NAME_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('System Name'),\n 'componentType' => Field::NAME,\n 'formElement' => Input::NAME,\n 'dataScope' => static::FIELD_NAME_NAME,\n 'dataType' => Text::NAME,\n 'validation' => [\n 'required-entry' => true,\n ],\n 'sortOrder' => 30,\n ],\n ],\n ],\n ],\n static::FIELD_CARRIER_CODE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Carrier Code'),\n 'componentType' => Field::NAME,\n 'formElement' => Input::NAME,\n 'dataScope' => static::FIELD_CARRIER_CODE_NAME,\n 'dataType' => Text::NAME,\n 'validation' => [\n 'required-entry' => true,\n 'validate-code' => true,\n 'min_text_len‌​gth' => 1,\n 'max_text_length' => 19\n ],\n 'sortOrder' => 40,\n ],\n ],\n ],\n ],\n static::FIELD_PRICE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Price'),\n 'componentType' => Field::NAME,\n 'formElement' => Hidden::NAME,\n 'dataScope' => static::FIELD_PRICE_NAME,\n 'dataType' => Number::NAME,\n 'addbefore' => $this->getBaseCurrencySymbol(),\n 'sortOrder' => 50,\n ],\n ],\n ],\n ],\n ],\n ];\n\n return $this->meta;\n }", "function scaffold_child_init() {\n\tdo_action( 'scaffold_child_init' );\n}", "public function load() {\n\t\tforeach ($this->childWidgets as $widget) {\n\t\t\tif ($widget->getElement() == null) {\n\t\t\t\tConsole::error($widget);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDOM::appendChild($this->getElement(), $widget->getElement());\n\t\t\t$widget->load();\n\t\t}\n\t\tparent::load();\n\t}", "function preinit()\r\n {\r\n //Calls children's init recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->preinit();\r\n }\r\n }", "protected function buildCoreFields(): void\n {\n //====================================================================//\n // Register Product Configurator\n $this->fieldsFactory()->registerConfigurator(\n \"Address\",\n new AddressConfigurator()\n );\n //====================================================================//\n // Customer\n $this->fieldsFactory()->create((string) self::objects()->encode(\"ThirdParty\", SPL_T_ID))\n ->identifier(\"customer_id\")\n ->name(\"Customer\")\n ->microData(\"http://schema.org/Organization\", \"ID\")\n ->isRequired()\n ->isNotTested()\n ;\n //====================================================================//\n // Country ISO Code\n $this->fieldsFactory()->create(SPL_T_COUNTRY)\n ->identifier(\"country_iso\")\n ->name(\"Country ISO (Code)\")\n ->microData(\"http://schema.org/PostalAddress\", \"addressCountry\")\n ->isRequired()\n ;\n }", "private function renderExternalSourceFieldTree()\r\n\t{\r\n\t\tglobal $lang;\r\n\t\t\r\n\t\t// HTML\r\n\t\t$html = '';\r\n\t\t\r\n\t\t// Get the external source fields in array format\r\n\t\t$external_fields_all = $this->getExternalSourceFields();\r\n\t\t\r\n\t\t// Get the external id field name\r\n\t\t$external_id_field = '';\r\n\t\tforeach ($external_fields_all as $attr) {\r\n\t\t\tif (isset($attr['identifier']) && $attr['identifier'] == '1') {\r\n\t\t\t\t$external_id_field = $attr['field'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Get the external source fields already mapped in this project\r\n\t\t$external_fields_mapped = $this->getMappedFields();\r\n\t\t\r\n\t\t// Javascript\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t// Get the external id field name\r\n\t\tvar external_id_field = '<?php echo cleanHtml($external_id_field) ?>';\r\n\t\t</script>\r\n\t\t<?php\r\n\t\t// Call javascript file\r\n\t\tcallJSfile('DynamicDataPullMapping.js');\r\n\t\t\r\n\t\t## Collect categories and subcategories into an array\r\n\t\t$categories = array();\r\n\t\tforeach ($external_fields_all as $key=>$attr) \r\n\t\t{\r\n\t\t\t// Set array key as the field name so we can find their attributes faster\r\n\t\t\tunset($external_fields_all[$key]);\r\n\t\t\t$external_fields_all[$attr['field']] = $attr;\r\n\t\t\t\r\n\t\t\t// For those not in a category\r\n\t\t\tif ($attr['category'] == '') {\r\n\t\t\t\t$categories[''][] = $attr['field'];\r\n\t\t\t} \r\n\t\t\t// For those in a category\r\n\t\t\telse {\r\n\t\t\t\tif (!isset($categories[$attr['category']])) $categories[$attr['category']] = array();\r\n\t\t\t\tif ($attr['subcategory'] != '') {\r\n\t\t\t\t\t// Add to subcategory\r\n\t\t\t\t\tif (!isset($categories[$attr['category']][$attr['subcategory']])) $categories[$attr['category']][$attr['subcategory']] = array();\r\n\t\t\t\t\t$categories[$attr['category']][$attr['subcategory']][] = $attr['field'];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Add to category\r\n\t\t\t\t\t$categories[$attr['category']][''][] = $attr['field'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//print_array($categories);\r\n\t\t\r\n\t\t// Loop through categories and subcats and build li/ul html\r\n\t\t$tree = '';\r\n\t\t$num_fields_checked = 0;\r\n\t\tforeach ($categories as $cat=>$catattr) \r\n\t\t{\r\n\t\t\t$cat_html = '';\r\n\t\t\t$num_fields_checked_cat = 0;\r\n\t\t\t// If no cat\r\n\t\t\tif ($cat == '') {\r\n\t\t\t\t// Loop through fields\r\n\t\t\t\tforeach ($catattr as $this_field) {\r\n\t\t\t\t\t$checked = '';\r\n\t\t\t\t\t$div_color = '';\r\n\t\t\t\t\tif ($this_field == $external_id_field || isset($external_fields_mapped[$this_field])) {\r\n\t\t\t\t\t\t$checked = 'checked';\r\n\t\t\t\t\t\t$num_fields_checked++;\r\n\t\t\t\t\t\t$num_fields_checked_cat++;\r\n\t\t\t\t\t\t// Set color for source id field\r\n\t\t\t\t\t\tif ($this_field == $external_id_field) $div_color = 'font-weight:bold;color:#C00000;';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$cat_html .= RCView::div(array('class'=>'extsrcfld', 'style'=>$div_color), \r\n\t\t\t\t\t\t\t\t\tRCView::checkbox(array('name'=>$this_field, 'style'=>'vertical-align:middle;', $checked=>$checked)) .\r\n\t\t\t\t\t\t\t\t\t$this_field . \" (\" . $external_fields_all[$this_field]['label'] . \")\" . RCView::SP . \r\n\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'help', 'title'=>$external_fields_all[$this_field]['description']), '?')\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t\t// If in a cat\r\n\t\t\telse {\r\n\t\t\t\t// Loop through subcats\r\n\t\t\t\t$subcat_html = '';\r\n\t\t\t\t// Count subcats\r\n\t\t\t\t$num_subcats = 0;\r\n\t\t\t\tforeach ($catattr as $subcat=>$subcatattr) {\r\n\t\t\t\t\t// Loop through fields\r\n\t\t\t\t\t$subcat_fields_html = '';\r\n\t\t\t\t\t$num_fields_checked_subcat = 0;\r\n\t\t\t\t\tforeach ($subcatattr as $this_field) {\r\n\t\t\t\t\t\t$checked = '';\r\n\t\t\t\t\t\t$div_color = '';\r\n\t\t\t\t\t\tif ($this_field == $external_id_field || isset($external_fields_mapped[$this_field])) {\r\n\t\t\t\t\t\t\t$checked = 'checked';\r\n\t\t\t\t\t\t\t$num_fields_checked++;\r\n\t\t\t\t\t\t\t$num_fields_checked_cat++;\r\n\t\t\t\t\t\t\t$num_fields_checked_subcat++;\r\n\t\t\t\t\t\t\t// Set color for source id field\r\n\t\t\t\t\t\t\tif ($this_field == $external_id_field) $div_color = 'font-weight:bold;color:#C00000;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$subcat_fields_html .= \tRCView::div(array('class'=>'extsrcfld', 'style'=>$div_color), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::checkbox(array('name'=>$this_field, 'style'=>'vertical-align:middle;', $checked=>$checked)) .\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this_field . \" (\" . $external_fields_all[$this_field]['label'] . \") \" . RCView::SP . \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'help', 'title'=>$external_fields_all[$this_field]['description']), '?')\r\n\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//print \"CAT: $cat, SUBCAT: $subcat<br>$subcat_fields_html\";\r\n\t\t\t\t\t// If no subcat\r\n\t\t\t\t\tif ($subcat != '') {\r\n\t\t\t\t\t\t$num_subcats++;\r\n\t\t\t\t\t\t$displaySubcat = ($num_fields_checked_subcat == 0) ? \"\" : \"display:block;\";\r\n\t\t\t\t\t\t$displaySubcatSelectAll = ($num_fields_checked_subcat == 0) ? \"display:none;\" : \"\";\r\n\t\t\t\t\t\t$subcatIcon = ($num_fields_checked_subcat == 0) ? 'expand.png' : 'collapse.png';\r\n\t\t\t\t\t\t$subcat_html .= RCView::div(array('class'=>'rc_ext_subcat_name'), \r\n\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>$subcatIcon, 'style'=>'vertical-align:middle;')) .\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;'), $subcat) .\r\n\t\t\t\t\t\t\t\t\t\t\t// Display \"select all\" link\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'selectalllink', 'style'=>$displaySubcatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;margin-left:25px;'), $lang['ws_35']) .\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::span(array('class'=>'selectalllink_sep', 'style'=>$displaySubcatSelectAll.'color:#aaa;margin:0 5px;'), \"|\") . \r\n\t\t\t\t\t\t\t\t\t\t\t// Display \"deselect all\" link\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'deselectalllink', 'style'=>$displaySubcatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;'), $lang['ws_55'])\r\n\t\t\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t\t\tRCView::div(array('class'=>'rc_ext_subcat', 'style'=>$displaySubcat), $subcat_fields_html);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$subcat_html .= $subcat_fields_html;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Render this cat\r\n\t\t\t\t$displayCat = ($num_fields_checked_cat == 0) ? \"\" : \"display:block;\";\r\n\t\t\t\t$displayCatSelectAll = ($num_fields_checked_subcat == 0) ? \"display:none;\" : \"\";\r\n\t\t\t\t$catIcon = ($num_fields_checked_cat == 0) ? 'expand.png' : 'collapse.png';\r\n\t\t\t\t$cat_html .= RCView::div(array('class'=>'rc_ext_cat_name'), \r\n\t\t\t\t\t\t\t\tRCView::img(array('src'=>$catIcon, 'style'=>'vertical-align:middle;')) .\r\n\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;'), $cat) .\r\n\t\t\t\t\t\t\t\t// If cat does not have subcats, then display \"select all\" link\r\n\t\t\t\t\t\t\t\t($num_subcats > 0 ? \"\" : RCView::a(array('href'=>'javascript:;', 'class'=>'selectalllink', 'style'=>$displayCatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;margin-left:25px;'), $lang['ws_35'])) .\r\n\t\t\t\t\t\t\t\t($num_subcats > 0 ? \"\" : RCView::span(array('class'=>'selectalllink_sep', 'style'=>$displayCatSelectAll.'color:#aaa;margin:0 5px;'), \"|\")) . \r\n\t\t\t\t\t\t\t\t// If cat does not have subcats, then display \"deselect all\" link\r\n\t\t\t\t\t\t\t\t($num_subcats > 0 ? \"\" : RCView::a(array('href'=>'javascript:;', 'class'=>'deselectalllink', 'style'=>$displayCatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;'), $lang['ws_55']))\r\n\t\t\t\t\t\t\t ) .\r\n\t\t\t\t\t\t\t RCView::div(array('class'=>'rc_ext_cat', 'style'=>$displayCat), $subcat_html);\r\n\t\t\t}\r\n\t\t\t// Add cat to tree\r\n\t\t\t$tree .= $cat_html;\r\n\t\t}\r\n\t\t\r\n\t\t// Set search textbox for search input\r\n\t\t$searchTextbox = \tRCView::span(array('style'=>'margin:0 0 5px;text-align:right;'), \r\n\t\t\t\t\t\t\t\t\"Filter:\" . \r\n\t\t\t\t\t\t\t\tRCView::text(array('id'=>'source_field_search', 'class'=>'x-form-text x-form-field', 'onkeydown'=>\"if(event.keyCode == 13) return false;\",\r\n\t\t\t\t\t\t\t\t\t'style'=>'margin-left:5px;width:300px;color:#999;', 'value'=>$lang['ws_07'],\r\n\t\t\t\t\t\t\t\t\t'onfocus'=>\"if ($(this).val() == '\".cleanHtml($lang['ws_07']).\"') { $(this).val(''); $(this).css('color','#000'); }\",\r\n\t\t\t\t\t\t\t\t\t'onblur'=>\"$(this).val( trim($(this).val()) ); if ($(this).val() == '') { $(this).val('\".cleanHtml($lang['ws_07']).\"'); $(this).css('color','#999'); }\"\r\n\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t\t\t);\r\n\t\t\r\n\t\t// Render the div container for the tree\r\n\t\t$html .= RCView::div(array('id'=>'ext_field_tree'),\r\n\t\t\t\t\tRCView::form(array('method'=>'post', 'id'=>'select_mapping_fields', 'action'=>PAGE_FULL.\"?pid=\".$this->project_id, 'enctype'=>'multipart/form-data'),\r\n\t\t\t\t\t\tRCView::div(array('style'=>'font-size:15px;font-weight:bold;padding-bottom:8px;margin-bottom:8px;'),\r\n\t\t\t\t\t\t\t$lang['ws_101']\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('style'=>'margin-bottom:5px;'), $lang['ws_102']) .\r\n\t\t\t\t\t\tRCView::div(array('class'=>'blue', 'style'=>'margin:20px 0 0;'),\r\n\t\t\t\t\t\t\t$lang['ws_34'] . \r\n\t\t\t\t\t\t\tRCView::span(array('id'=>'rc_ext_num_selected2', 'style'=>'font-weight:bold;padding-left:5px;'), \r\n\t\t\t\t\t\t\t\tcount($external_fields_mapped)\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::button(array('onclick'=>\"$('#select_mapping_fields').submit();\", \r\n\t\t\t\t\t\t\t\t'class'=>'jqbuttonmed', 'style'=>'margin-left:125px;color:#111;font-size:13px;'),\r\n\t\t\t\t\t\t\t\t$lang['ws_33']\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'font-size:12px;margin-left:10px;text-decoration:underline;', \r\n\t\t\t\t\t\t\t\t'onclick'=>\"window.location.href = app_path_webroot+'\".($this->isMappingSetUp() ? \"DynamicDataPull/setup.php\" : \"ProjectSetup/index.php\").\"?pid=\".$this->project_id.\"';\"),\r\n\t\t\t\t\t\t\t\t$lang['global_53']\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t// \r\n\t\t\t\t\t\t\tRCView::div(array('style'=>'margin:25px 0 0;'), \r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'float:left;vertical-align:middle;font-weight:bold;font-size:15px;'), \"Source Fields List\") . \r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'float:right;vertical-align:middle;padding-bottom:2px;'), $searchTextbox) . \r\n\t\t\t\t\t\t\t\tRCView::div(array('class'=>'clear'), '')\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('id'=>'ext_field_tree_fields', 'style'=>'clear:both;padding:10px 6px;background-color:#fff;border:1px solid #ccc;'),\r\n\t\t\t\t\t\t\t$tree\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('class'=>'blue', 'style'=>'margin:0 0 20px;'),\r\n\t\t\t\t\t\t\t$lang['ws_34'] . \r\n\t\t\t\t\t\t\tRCView::span(array('id'=>'rc_ext_num_selected', 'style'=>'font-weight:bold;padding-left:5px;'), \r\n\t\t\t\t\t\t\t\tcount($external_fields_mapped)\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::hidden(array('name'=>'select_fields', 'value'=>'1')) .\r\n\t\t\t\t\t\t\tRCView::button(array('onclick'=>\"$('#select_mapping_fields').submit();\", \r\n\t\t\t\t\t\t\t\t'class'=>'jqbuttonmed', 'style'=>'margin-left:125px;color:#111;font-size:13px;'),\r\n\t\t\t\t\t\t\t\t$lang['ws_32']\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'margin-left:10px;text-decoration:underline;', \r\n\t\t\t\t\t\t\t\t'onclick'=>\"window.location.href = app_path_webroot+'\".($this->isMappingSetUp() ? \"DynamicDataPull/setup.php\" : \"ProjectSetup/index.php\").\"?pid=\".$this->project_id.\"';\"),\r\n\t\t\t\t\t\t\t\t$lang['global_53']\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t)\r\n\t\t\t\t );\r\n\t\t\t\t\r\n\t\t// Return html\r\n\t\treturn $html;\r\n\t}", "private function loadSubWidgets()\n {\n $subWidgets = [];\n // get widgets for the fields\n foreach ($this->fields as $index => $field) :\n $subWidgets[$index] = $field->widget;\n endforeach;\n\n $this->widget->setSubWidgets($subWidgets);\n }", "protected function renderThenChild() {}", "public function beforeSave()\n {\n $this->rebuildTree();\n }", "public function setup()\n {\n parent::setup();\n \n $formClass = $this->getChildFormClass();\n $collection = $this->getParentObject()->{$this->getRelationAlias()};\n $nbChilds = 0;\n $min = $this->getMinNbChilds();\n $max = $this->getMaxNbChilds();\n \n if ($min > $max && $max > 0)\n throw new RuntimeException('min cannot be greater than max.');\n \n // embed forms for each child element that is already persisted\n foreach ($collection as $childObject)\n {\n $form = new $formClass($childObject);\n $pk = $childObject->identifier();\n \n if ($childObject->exists() === false)\n throw new RuntimeException('Transient child objects are not supported.');\n \n if (count($pk) !== 1)\n throw new RuntimeException('Composite primary keys are not supported.');\n \n $this->embedForm(self::PERSISTENT_PREFIX.reset($pk), $form);\n $nbChilds += 1;\n }\n \n // embed as many additional forms as are needed to reach the minimum\n // number of required child objects\n for (; $nbChilds < $min; $nbChilds += 1)\n {\n $form = new $formClass($collection->get(null));\n $this->embedForm(self::TRANSIENT_PREFIX.$nbChilds, $form);\n }\n \n $this->validatorSchema->setPostValidator(new sfValidatorCallback(array(\n 'callback' => array($this, 'validateLogic'),\n )));\n }", "protected function addElements() \n { \n // Add \"nom\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'nom_parent',\n 'attributes' => [\n 'id' => 'nom_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Nom de famille:',\n ],\n ]);\n \n // Add \"prenom\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'prenom_parent',\n 'attributes' => [\n 'id' => 'prenom_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Prénom parent:',\n ],\n ]);\n \n // Add \"domicile\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'domicile',\n 'attributes' => [\n 'id' => 'domicile',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Domicile:',\n ],\n ]);\n \n // Add \"telephone_number\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telephone1',\n 'attributes' => [\n 'id' => 'telephone1'\n ],\n 'options' => [\n 'label' => 'Téléphone 1',\n ],\n ]);\n \n // Add \"telephone_number\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telephone2',\n 'attributes' => [\n 'id' => 'telephone2'\n ],\n 'options' => [\n 'label' => 'Téléphone 2',\n ],\n ]);\n \n // Add \"code eleve \" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'email_parent',\n 'attributes' => [\n 'id' => 'email_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'E-mail:',\n ],\n ]);\n \n // Add \"comment\" field\n $this->add([ \n 'type' => 'textarea',\n 'name' => 'commentaire',\n 'options' =>[\n 'label' => 'Commentaires:',\n ],\n 'attributes' => [\n 'id' => 'commentaire',\n 'style' => 'width: 50%'\n ], \n ]);\n \n // Add the submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [ \n 'value' => 'Enregistrer',\n 'id' => 'submitbutton',\n ],\n ]); \n \n }", "protected function resolveChildren()\n {\n foreach ($this->unresolvedChildren as $name => $info) {\n $this->children[$name] = $this->create($name, $info['type'], $info['init_options'], $info['exec_options']);\n }\n\n $this->unresolvedChildren = array();\n }", "public function buildElement() {\n\n // Set the element type\n $this->addType('example');\n\n // Add the element attributes\n $this->addAttributes(array(\n // Some attributes\n ));\n\n // Example if we need to add child object\n // to this element\n $object = new VTCore_Form_Base();\n $object->addType('example_child');\n $object->addAttributes(array(\n // Some Attributes\n ));\n\n // Adding a plaing text as child of subchild\n $object->addText('some text');\n\n // Inject the child and subchild back to parent\n $this->addChildren($object);\n\n // No need to echo or print anything, all the\n // actual rendering will be performed by\n // VTCore_Form_Base() when user is invoking\n // the render or __toString method.\n }", "function createChildrenRecursive() {\n $this->CreateChildControls();\n if ($this->HasControls()) {\n $keys = array_keys($this->Controls);\n $count = count($this->Controls);\n for ($i = 0; $i < $count; $i++) {\n @$control = &$this->Controls[$keys[$i]];\n $control->createChildrenRecursive();\n }\n }\n $this->initChildrenRecursive();\n }", "protected function buildCoreFields(): void\n {\n //====================================================================//\n // Reference\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"increment_id\")\n ->name('Reference')\n ->microData(\"http://schema.org/Invoice\", \"confirmationNumber\")\n ->isReadOnly()\n ->isListed()\n ;\n //====================================================================//\n // Customer Object\n $this->fieldsFactory()->create((string) self::objects()->encode(\"ThirdParty\", SPL_T_ID))\n ->identifier(\"customer_id\")\n ->name('Customer')\n ->microData(\"http://schema.org/Organization\", \"ID\")\n ->isRequired()\n ->isReadOnly()\n ;\n //====================================================================//\n // Customer Email\n $this->fieldsFactory()->create(SPL_T_EMAIL)\n ->identifier(\"customer_email\")\n ->name(\"Email du contact\")\n ->microData(\"http://schema.org/ContactPoint\", \"email\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Date\n $this->fieldsFactory()->create(SPL_T_DATETIME)\n ->identifier(\"created_at\")\n ->name(\"Date\")\n ->microData(\"http://schema.org/DataFeedItem\", \"dateCreated\")\n ->isReadOnly()\n ->isListed()\n ;\n }", "public function render_admin_form_children() {\n\t\tforeach ( array_keys( bp_xprofile_get_field_types() ) as $field_type ) {\n\t\t\t$type_obj = bp_xprofile_create_field_type( $field_type );\n\t\t\t$type_obj->admin_new_field_html( $this );\n\t\t}\n\t}", "protected function _seed_extend($array, $parent=0, $parent_field='parent', $filter_fn=NULL){\r\n if (!$this->_table_name){\r\n exit;\r\n }\r\n \r\n if (!isset($this->db)){\r\n $this->load->database();\r\n }\r\n \r\n for ($i=0; $i<count($array); $i++){\r\n $array[$i][$parent_field] = $parent;\r\n $parent_id = $this->_insert($array[$i], $filter_fn);\r\n if (isset($array[$i]['children'])&&count($array[$i]['children'])){\r\n $this->_seed_extend($array[$i]['children'], $parent_id, $parent_field);\r\n }\r\n }\r\n }", "public function buildLightbox(){\n\n\t\t$fields = $this->getFields();\n\n\t\techo '<div class=\"main-content\">';\n\t\t\n\t\t\tforeach( $fields as $field ){\n\n\t\t\t\t$field->render();\n\n\t\t\t\tif( method_exists( $field, 'renderTemplate' ) )\n\t\t\t\t\techo $field->renderTemplate();\n\n\t\t\t}\n\n\t\techo '</div>';\n\t\techo '<div class=\"side-content\">';\n\t\t\t\n\t\t\t$this->saveButton();\n\n\t\techo '</div>';\n\t}", "public function createNestedPagesAndCopyLiveParentPage() {}", "public function build_tree(isys_component_tree $p_tree, $p_system_module = true, $p_parent = null)\n {\n ;\n }", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function initializeTreeData() {}", "public function initializeTreeData() {}", "protected function _Add_Child_Fields($container_instance) {\r\n\t\t$form_instance = $this->form_instance;\r\n // Retrieve the container's children\r\n $el_children = $container_instance->el_children; \r\n // If no shortcodes were returned\r\n if (!$el_children || !is_array($el_children)) { return; } \r\n // Loop through each shortcode\r\n foreach ($el_children as $k => $el) {\r\n // If this is not a tag\r\n if (!$el->is_tag || !$el->tag) { continue; }\r\n // Retrieve the attributes\r\n $_attributes = $el->attributes;\r\n // If no machine code, move on\r\n if (!isset($_attributes['machine_code'])) { continue; }\r\n // Retrieve the field instance\r\n $field_instance = $form_instance->Get_Field($_attributes['machine_code']);\r\n // If no field instance was returned\r\n if (!$field_instance) { continue; } \r\n // Add the field instance to the container\r\n $container_instance->Add_Field($field_instance);\r\n // Do any create actions\r\n $container_instance->Do_Action('add_field',array('field_instance' => $field_instance));\r\n // Do a wordpress hook\r\n do_action('vcff_container_add_field',$container_instance,$field_instance);\r\n }\r\n }", "private function setParentChildrenClass() {\n $tmp_schemedata = $this->schemedata;\n \n // replace parents with primary key.\n foreach($this->schemedata as $index => $class) {\n $parents = array();\n $see = array();\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $parent) {\n $tmp = $tmp_class['pkFields'];\n $tmp_cols = $cols;\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n $key = array_shift($tmp_cols);\n $tmp2[$key] = $val;\n }\n $parents[$tmp_class['name']] = $tmp2;\n $see[] = $tmp_class['name'];\n }\n }\n }\n $this->schemedata[$index]['parents'] = $parents;\n $this->schemedata[$index]['see'] = $see;\n }\n\n // children\n foreach($this->schemedata as $index => $class) {\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $this->schemedata[$parent]['table']) {\n if ($class['type'] != 'TO' AND $class['type'] != 'TS' AND $class['type'] != 'TB') {\n $tmp = $class['parents']; // children's parent def\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n if($key == $tmp_class['name']) {\n $tmp2 = $val;\n }\n }\n if($class['name']) {\n $this->schemedata[$tmp_class['name']]['children'][$class['name']] = $tmp2;\n $this->schemedata[$tmp_class['name']]['see'][] = $class['name'];\n } else {\n $this->schemedata[$tmp_class['name']]['children'][$index] = $tmp2;\n }\n }\n }\n }\n }\n }\n\n // relationships\n foreach($this->schemedata as $class) {\n if ($class['type'] == 'TO' OR $class['type'] == 'TS' OR $class['type'] == 'TB') {\n foreach ($class['parents'] as $parent=>$pkFields) {\n if(!isset($this->schemedata[$parent]['relationships'])) {\n $this->schemedata[$parent]['relationships'] = array();\n }\n // add parent to another parent list getter\n foreach ($class['parents'] as $p=>$fs) {\n if ($parent != $p) {\n $type = 'List';\n $mname = '';\n foreach($fs as $k => $v) {\n $name = $k;\n }\n foreach($class['params'] as $param) {\n if($name == $param['name']) {\n $type = ($param['pair']=='N')?'List':'Class';\n break;\n }\n }\n\n $this->schemedata[$parent]['relationships'][$p]= array(\n 'table' => $class['table'],\n 'myFields' => $pkFields,\n 'fields' => $fs,\n 'type' => $type\n );\n }\n }\n }\n }\n }\n\n // rewrite relation key for parents, children and relations\n foreach($this->schemedata as $key => $class) {\n // parent\n foreach($class['parents'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$k2) {\n unset($this->schemedata[$key]['parents'][$k1][$k2]);\n $this->schemedata[$key]['parents'][$k1][$param['mname']] = $value;\n break;\n }\n }\n }\n }\n // children\n foreach($class['children'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['children'][$k1][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n // relations\n if(isset($class['relationships'])) {\n foreach($class['relationships'] as $k1 => $values) {\n foreach($values['myFields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['myFields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n foreach($values['fields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['fields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n }\n }\n }", "function initChildrenRecursive() {\n $this->initChildControls();\n if ($this->HasControls()) {\n $keys = array_keys($this->Controls);\n $count = count($this->Controls);\n for ($i = 0; $i < $count; $i++) {\n @$control = &$this->Controls[$keys[$i]];\n $control->initChildrenRecursive();\n }\n }\n\n }", "function prepare() {\n $this->addChild(new fapitng_FormHidden('form_build_id', array(\n 'value' => $this->build_id,\n )));\n $this->addChild(new fapitng_FormHidden('form_id', array(\n 'value' => $this->id,\n )));\n if ($this->token) {\n $this->addChild(new fapitng_FormHidden('form_token', array(\n 'value' => $this->token,\n )));\n }\n }", "function loadedChildren()\r\n {\r\n //Calls childrens loaded recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->loaded();\r\n }\r\n }", "public function renderChildren() {}", "protected function buildMainFields(): void\n {\n $groupName = \"Address\";\n\n //====================================================================//\n // Addess\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address1\")\n ->name(\"Street 1\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"streetAddress\")\n ->isIndexed()\n ;\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address2\")\n ->name(\"Street 2\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"streetAddress2\")\n ;\n //====================================================================//\n // Zip Code\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"zip\")\n ->name(\"Zip\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"postalCode\")\n ->isIndexed()\n ->addOption('maxLength', (string) 18)\n ;\n //====================================================================//\n // City Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"city\")\n ->name(\"Town\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"addressLocality\")\n ;\n //====================================================================//\n // Country Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"country_name\")\n ->name(\"Country\")\n ->group($groupName)\n ->isReadOnly()\n ;\n //====================================================================//\n // Country ISO Code\n $this->fieldsFactory()->create(SPL_T_COUNTRY)\n ->identifier(\"country_code\")\n ->name(\"Country Code\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"addressCountry\")\n ;\n //====================================================================//\n // State Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"province\")\n ->group($groupName)\n ->name(\"State\")\n ->isReadOnly()\n ;\n //====================================================================//\n // State code\n $this->fieldsFactory()->create(SPL_T_STATE)\n ->identifier(\"province_code\")\n ->name(\"State Code\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"addressRegion\")\n ->isReadOnly()\n ->isNotTested()\n ;\n }", "function CreateChildControls() {\n }", "public function initializeChildren() {\n\t\tif ($this->initialized === TRUE) {\n\t\t\treturn;\n\t\t}\n\t\t/** @var \\TYPO3\\CMS\\Core\\Resource\\Folder $folder */\n\t\t$subFolders = $this->folder->getSubfolders();\n\t\tforeach ($subFolders as $folder) {\n\t\t\t$f = new Storage($this->mapFolderIdToEntityName($folder->getName()), array());\n\t\t\t$f->setStorage($this->storage);\n\t\t\t$f->setFolder($folder);\n\t\t\t$this->addChild($f);\n\t\t}\n\n\t\t$files = $this->folder->getFiles();\n\t\tforeach ($files as $file) {\n\t\t\t$f = new File();\n\t\t\t$f->setFalFileObject($file);\n\t\t\t$this->addChild($f);\n\t\t}\n\t\t$this->initialized = TRUE;\n\t}", "protected function childLoad() {}", "public function buildFields()\n {\n $this->addField('name', 'kuma_menu.menu.adminlist.field.name', true);\n }", "private function build()\n {\n foreach ($this->getChildVariables() as $element) {\n if ($element instanceof BuildableInterface) {\n $element->build($this, $this->_rootNode);\n } elseif ($element instanceof MultipleElementsStore) {\n $this->buildStore($element);\n }\n }\n }", "public function __construct()\n {\n $this->children = [];\n }", "function InitChildControls() {\n }", "public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form)\n\t{\n\t\t$fieldNode = parent::onCustomFieldsPrepareDom($field, $parent, $form);\n\n\t\tif (!$fieldNode)\n\t\t{\n\t\t\treturn $fieldNode;\n\t\t}\n\n\t\t$readonly = false;\n\n\t\tif (!FieldsHelper::canEditFieldValue($field))\n\t\t{\n\t\t\t$readonly = true;\n\t\t}\n\n\t\t$fieldNode->setAttribute('type', 'subform');\n\t\t$fieldNode->setAttribute('multiple', 'true');\n\t\t$fieldNode->setAttribute('layout', 'joomla.form.field.subform.repeatable-table');\n\n\t\t// Build the form source\n\t\t$fieldsXml = new SimpleXMLElement('<form/>');\n\t\t$fields = $fieldsXml->addChild('fields');\n\n\t\t// Get the form settings\n\t\t$formFields = $field->fieldparams->get('fields');\n\n\t\t// Add the fields to the form\n\t\tforeach ($formFields as $index => $formField)\n\t\t{\n\t\t\t$child = $fields->addChild('field');\n\t\t\t$child->addAttribute('name', $formField->fieldname);\n\t\t\t$child->addAttribute('type', $formField->fieldtype);\n\t\t\t$child->addAttribute('readonly', $readonly);\n\n\t\t\tif (isset($formField->fieldfilter))\n\t\t\t{\n\t\t\t\t$child->addAttribute('filter', $formField->fieldfilter);\n\t\t\t}\n\t\t}\n\n\t\t$fieldNode->setAttribute('formsource', $fieldsXml->asXML());\n\n\t\t// Return the node\n\t\treturn $fieldNode;\n\t}", "public static final function inject_trees(&$parent_array,&$children_trees,$parent_ident_field,$kids_field){\n\t\tforeach($children_trees as $kid){\n\t\t\tif(isset($parent_array[$kid->$parent_ident_field])){\n\t\t\t\t$parent_array[$kid->$parent_ident_field]->insert_kids($kid,'e'); //insert at end.\n\t\t\t}\n\t\t}\n\t}", "public function boot()\n {\n Event::listen('backend.form.extendFields', function ($form) {\n if (get_class($form->config->model) == 'Cms\\Classes\\Page' && Settings::get('klyp_builder_cms', true)) {\n // remove the existing two fields and add them back again later\n // in order to reorder these fields\n $form->removeField('markup');\n $form->removeField('code');\n\n // add our custom page builder field\n $form->addSecondaryTabFields(\n [\n 'markup' => [\n 'tab' => 'Klyp Builder',\n 'stretch'=> true,\n 'type'=>'Klyp\\PageBuilder\\FormWidgets\\PageBuilder'\n ],\n 'code' => [\n 'tab' => 'cms::lang.editor.code',\n 'stretch'=> true,\n 'type'=> 'codeeditor',\n 'language'=> 'php'\n ]\n ]\n );\n }\n\n return;\n });\n }", "public function initSubFields() {\n $post = $this->getData('post');\n switch ($post['custom_type']) {\n case 'shop_customer':\n case 'import_users':\n $optionName = 'wpcf-usermeta';\n break;\n case 'taxonomies':\n $optionName = 'wpcf-termmeta';\n break;\n default:\n $optionName = 'wpcf-field';\n break;\n }\n\n $this->fieldsData = wpcf_admin_fields_get_fields_by_group(\n $this->groupPost->ID,\n 'slug',\n false,\n false,\n false,\n TYPES_CUSTOM_FIELD_GROUP_CPT_NAME,\n $optionName,\n true\n );\n\n foreach ($this->getFieldsData() as $fieldData) {\n $field = FieldFactory::create($fieldData, $post, $this->getFieldName(), $this);\n $this->subFields[] = $field;\n }\n }", "protected function populateFields()\n {\n $currentLocale = TranslateLocale::current_locale();\n\n $fields = FieldList::create(TabSet::create('Root', Tab::create('Main')));\n\n $fields->push(HiddenField::create('Locale', 'Locale', $currentLocale));\n $fields->addFieldToTab('Root.Main', Language\\Fields\\LocaleSwitcher::create('LocaleSwitcher'));\n\n $groups = [];\n\n TranslateService::flush();\n\n ksort($this->translations);\n\n foreach ($this->translations as $entity => $translation) {\n list($group, $key) = explode('.', $entity);\n\n $groups[$group][$key] = TextField::create($entity, $this->niceLabel($key))\n ->setValue(TranslateService::lookup_translation($entity, $currentLocale))\n ->setDescription(Convert::raw2xml(TranslateService::translate($entity, $translation, null, 'en')));\n }\n\n foreach ($groups as $groupName => $subFields) {\n $fields->addFieldToTab('Root.Main', ToggleCompositeField::create($groupName, $groupName, $subFields));\n }\n\n $this->setFields($fields);\n }", "public function run()\n\t{\n\t\tChildren::truncate();\n\n\t\tChildren::create(['name'=>'Inga']);\n\t\tChildren::create(['name'=>'Heltid']);\n\t\tChildren::create(['name'=>'Delad vårdnad']);\n\t\tChildren::create(['name'=>'Inga vill inte ha']);\n\t\tChildren::create(['name'=>'Inga men vill ha']);\n\t}", "public function renderField(array &$parameters, &$parentObject) {\n \n \n // Vars\n $uid = &$parameters[\"row\"][\"uid\"];\n $pid = $parameters[\"row\"][\"pid\"];\n\t\t$name = $parameters['itemFormElName'];\n\t\t$value = $parameters['itemFormElValue'];\n \n \n // Initial Wert\n if(trim($value)==\"\") {\n $value = 'none none none none';\n }\n $values = explode(' ', $value);\n\n\n // FTM Template-Verzeichnis ermitteln\n $rootlinePages = \\CodingMs\\Ftm\\Utility\\Tools::getRootlinePids($pid);\n $rootlineFtms = \\CodingMs\\Ftm\\Utility\\Tools::getRootlineFtms($rootlinePages);\n if(!empty($rootlineFtms) && count($rootlineFtms)==1) {\n $ftmTemplateDir = $rootlineFtms[0];\n }\n else {\n return \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\"tx_ftm_backend_gridelementclassesrow.error_multiple_ftm_templates_on_rootline\", \"Ftm\");\n // return \"Error: Multiple FTM-Templates on rootline! Only one is valid!\";\n }\n\n\n // echo \"<pre>\";\n // var_dump(&$parameters[\"row\"][\"uid\"]);\n // var_dump($rootlineFtms);\n // echo \"</pre>\";\n // exit;\n // die(serialize(&$parentObject['_THIS_UID']));\n\n \n // Hidden-Field zum Speichern\n $hidden = '<input type=\"hidden\" name=\"'.htmlspecialchars($name).'\" value=\"'.htmlspecialchars($value).'\" id=\"ftm_gridElementClasses_'.$uid.'\"/>';\n \n $templateDir = \\CodingMs\\Ftm\\Utility\\Tools::getDirectory(\"DyncssGridElementLayouts\", $ftmTemplateDir);\n $directory = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getFileAbsFileName($templateDir);\n\n // Select-Boxen bauen\n $select = '';\n for($i=0; $i<=3; $i++) {\n $options = array();\n $select.= '<select name=\"'.htmlspecialchars($name).'['.$i.']\" class=\"formField select\" onchange=\"ftm_updateGridElementClasses_'.$uid.'(this.value, '.$i.')\">' . LF;\n $select.= '<option value=\"none\">-</option>' . LF;\n if($handleLess=opendir($directory)) {\n while($fileLess=readdir($handleLess)){\n if(substr($fileLess , 0, 1) != \".\") {\n $selected = (str_replace(\".less\", \"\", $fileLess) === $values[$i] ? ' selected=\"selected\"' : '');\n $options[$fileLess] = '<option value=\"'.str_replace(\".less\", \"\", $fileLess).'\" '.$selected.'>'.str_replace(\".less\", \"\", $fileLess).'</option>' . LF;\n }\n }\n }\n ksort($options);\n $select.= implode('', $options).'</select>&nbsp;&nbsp;'; \n }\n \n \n $script = '<script type=\"text/javascript\">'.LF;\n $script.= 'function ftm_updateGridElementClasses_'.$uid.'(value, no) {'.LF;\n $script.= ' var tempValue = document.getElementById(\"ftm_gridElementClasses_'.$uid.'\").value;'.LF;\n $script.= ' var valueParts = tempValue.split(\\' \\');'.LF;\n $script.= ' valueParts[no] = value;'.LF;\n $script.= ' document.getElementById(\"ftm_gridElementClasses_'.$uid.'\").value = valueParts.join(\\' \\');'.LF;\n $script.= '}'.LF;\n $script.= '</script>'.LF;\n \n \n $notice1 = \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\"tx_ftm_backend_gridelementclassesrow.directory_notice\", \"Ftm\", array(\"<b>\".$templateDir.\"</b>\"));\n //$notice1 = 'Options were created from '.$templateDir.' directory.';\n $notice2 = \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\"tx_ftm_backend_gridelementclassesrow.documentation_notice\", \"Ftm\", array('<a href=\"http://fluid-template-manager.de/documentation/Dyncss.html\" target=\"_blank\"><u>http://fluid-template-manager.de/documentation/Css-Less.html</u></a>'));\n //$notice2 = 'How to manage the provided classes, you can read here: .';\n \n return '<div>'.$select.$hidden.$script.'<br />'.$notice1.'<br/>'.$notice2.'</div>'.LF;\n\t}", "public function get_element_extend_fields($parent, $id_parent=NULL)\n\t{\n\t\t// Element extend fields\n\t\t$where = array('parent' => $parent);\n\t\t$extend_fields = $this->get_list($where);\n\n\t\t// Current element extend field\n\t\t$this->{$this->db_group}->where(\n\t\t\tarray(\n\t\t\t\t'extend_field.parent' => $parent,\n\t\t\t\t$this->elements_table.'.id_parent' => $id_parent\n\t\t\t)\n\t\t);\n\n\t\t$this->{$this->db_group}->join(\n\t\t\t$this->elements_table,\n\t\t\t$this->elements_table.'.id_'.$this->table.' = ' .$this->table.'.id_'.$this->table,\n\t\t\t'inner'\n\t\t);\n\n\t\t$query = $this->{$this->db_group}->get($this->get_table());\n\n\t\t$result = array();\n\t\tif ( $query->num_rows() > 0)\n\t\t\t$result = $query->result_array();\n\n\t\t$langs = Settings::get_languages();\n\t\t$element_fields = $this->{$this->db_group}->list_fields($this->elements_table);\n\n\t\tforeach($extend_fields as $k => &$extend_field)\n\t\t{\n\t\t\t// One not tranlated extend field...\n\t\t\tif ($extend_field['translated'] != '1')\n\t\t\t{\n\t\t\t\t// fill the base data with empty values\n\t\t\t\t$extend_field = array_merge(array_fill_keys($element_fields, ''), $extend_field);\n\t\t\t\n\t\t\t\tforeach($result as $row)\n\t\t\t\t{\n\t\t\t\t\tif($row['id_extend_field'] == $extend_field['id_extend_field'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$extend_field = array_merge($extend_field , $row);\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\tforeach($langs as $language)\n\t\t\t\t{\n\t\t\t\t\t// Lang code\n\t\t\t\t\t$lang = $language['lang'];\n\t\t\t\t\t\n\t\t\t\t\t// Feed lang key with blank array\n\t\t\t\t\t$extend_field[$lang] = array();\n\t\t\t\t\t$extend_field[$lang]['content'] = '';\n\t\t\t\t\t\n\t\t\t\t\t// Feeding of template languages elements\n\t\t\t\t\tforeach($result as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($row['id_extend_field'] == $extend_field['id_extend_field'] && $row['lang'] == $lang)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extend_field[$lang] = $row;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $extend_fields;\n\t}", "public function build() {\n parent::build();\n $this->addDependantWidgets($this->databaseName, $this->tableName);\n return $this;\n }", "public static function initFileTree()\n {\n //-- Add css\n ecrStylesheet('php_file_tree');\n\n //-- Add javascript\n ecrScript('php_file_tree');\n }", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "protected function prepareMyData(){\n\t\tglobal $C;\n if( $this->id > 0 ){\n $this->get( \"`id`={$this->id}\" );\n $this->unstoreSfield();\n }\n\t\t$C->setID( $this->data['parent'] );\n\t\t$C->get( \"`id`={$this->data['parent']}\" );\n\t\t$C->unstoreSfield();\n $p = $C->getData();\n if( is_array( $p ) ){\n\t\t\tT::assign( \"parent\", $p[\"name\"] );\n\t\t\t$fieldlist=array();\n if( is_array( $p[\"fields\"] ) )\n foreach( $p[\"fields\"] as $key => $item ){\n $fieldlist[] = array( \"cnt\" => $key, \"name\" => $item, \"value\"=> $this->data[$this->sfield][$key] );\n }\n\t\t\tT::assign( \"fieldlist\", $fieldlist );\n }\n\t\tT::assign( \"f\", $this->sfield );\n\t\tT::assign( \"item\",$this->data );\t\t\n\t}", "public function buildNodes() {\n\t\t// build pip nodes\n\t\t$this->buildPluginNodes();\n\t\t\n\t\t// remove package\n\t\t$this->buildPackageNode();\n\t}", "public function on_root_element_start() {\n\n // create ids temp table\n backup_controller_dbops::create_backup_ids_temp_table($this->converter->get_id());\n }", "public function build()\n {\n\n if ($this->html)\n return $this->html;\n\n if (count($this->data) == 0) {\n $this->html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n $this->html .= '</ul>'.NL;\n\n return $this->html;\n }\n\n $html = '';\n\n $html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n<li id=\"{$this->id}_{$id}\" >\n\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n\n</li>\n\nHTML;\n\n\n }\n\n $html .= '</ul>'.NL;\n\n\n $this->html = $html;\n\n return $this->html;\n\n }", "public function buildFields() {\n }", "protected static function boot()\n {\n parent::boot();\n\n //\n }", "function load_content_builder() {\n\t// acf-content-builder-fieldset.php\n\tlist_all_cpts();\n\tlist_all_module_names();\n\t\n // INCLUDE DEFAULT CONTENT BUILDER FIELDSET\n include_once( EFFLAB_CB_BASE_DIR . '/acf-content-builder-fieldset.php' );\n \n // ADD IN CONTENT BUILDER FIELDSETS \n // FROM PLUGIN AND THEME\n echo efflab_cb_get_module_fieldset();\n \n}", "function serializeChildren()\r\n {\r\n //Calls children's serialize recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->serialize();\r\n }\r\n }", "public static function boot() \n\t{\n parent::boot();\n }", "function build() {\n $this->built = TRUE;\n foreach ($this->build_callbacks as $callback) {\n call_user_func($callback, $this);\n drupal_alter(\"fapitng_form_$callback\", $this);\n }\n drupal_alter('fapitng_form', $this);\n }", "private function initBuilder()\n {\n $this->modx->loadClass('transport.modPackageBuilder', '', false, true);\n $this->builder = new \\modPackageBuilder($this->modx);\n }", "protected function build()\n\t{\n\t}", "public function buildFields()\n {\n $this->addField('name', 'media.adminlist.configurator.name', true);\n $this->addField('contentType', 'media.adminlist.configurator.type', true);\n $this->addField('updatedAt', 'media.adminlist.configurator.date', true);\n $this->addField('filesize', 'media.adminlist.configurator.filesize', true);\n }", "abstract protected function getNewChildren(): array ;", "protected function loadTreeData() {}", "protected static function boot()\n {\n parent::boot();\n }", "function buildAllNodeInstance( $cms, $parent )\n\t\t{\n\t\t$ni = $this->buildNodeInstance( $cms, $parent ) ;\n\t\tforeach( $this->childs as $nc )\n\t\t\t{\n\t\t\t$nni = $nc->buildAllNodeInstance( $cms, $ni ) ;\n\t\t\t$ni->addChild( $nni ) ;\n\t\t\t}\n\t\treturn $ni ;\n\t\t}", "function init()\r\n {\r\n //Copy components to comps, so you can alter components properties\r\n //on init() methods\r\n $comps=$this->components->items;\r\n //Calls children's init recursively\r\n reset($comps);\r\n while (list($k,$v)=each($comps))\r\n {\r\n $v->init();\r\n }\r\n }", "protected function populateStructure()\n {\n $this->treeStructure = \\Genesis\\Utils\\Common::createArrayObject(\n $this->getRequestStructure()\n );\n }", "function build () {\n foreach ( $this->items as $item ) {\n if ( $item->isRoot() ) {\n $this->menu[]=$item;\n $this->appendChildren($item);\n }\n }\n reset ( $this->menu );\n }", "protected function build()\n {\n if ($this->relations) {\n $this->addRelational();\n }\n $this->loadSubQueries();\n }", "private static function rec_xmlDeserialize($child, $parent_node)\n\t{\n\t\tif($child['value'] instanceof Component)\n\t\t{\n\t\t\t$child['value']->_parent\t= $parent_node;\n\t\t\t$child['value']->_fullname\t= $child['name'];\n\n\t\t\t$node_name = get_class($child['value']);\n\t\t\tif(strncmp('Biome\\\\Component\\\\', $node_name, 16) == 0)\n\t\t\t{\n\t\t\t\t$node_name = substr($node_name, 16);\n\t\t\t}\n\n\t\t\t$child['value']->_nodename\t\t= strtolower(substr($node_name, 0, -strlen('Component')));\n\t\t\t$child['value']->_attributes = $child['attributes'];\n\t\t\t$child['value']->getId(); // Generate ID.\n\t\t\t$child['value']->building();\n\t\t\treturn $child['value'];\n\t\t}\n\n\t\t/* Load standard HTML markup. */\n\t\tif(is_array($child['value']))\n\t\t{\n\t\t\t$list = array();\n\t\t\tforeach($child['value'] AS $c)\n\t\t\t{\n\t\t\t\t$list[] = self::rec_xmlDeserialize($c, $parent_node);\n\t\t\t}\n\t\t\t$child['value'] = $list;\n\t\t\treturn $child;\n\t\t}\n\n\t\treturn $child;\n\t}", "public function getCMSFields()\n {\n $fields = parent::getCMSFields();\n\n // Remove _this_ object's redundant fields (Their values are set in onBeforeWrite()\n $fields->removeByName('BlockID');\n $fields->removeByName('BlockSort');\n $fields->removeByName('ParentPageID');\n $fields->removeByName('ParentDataID');\n $fields->removeByName('ViewGroups');\n $fields->removeByName('EditGroups');\n\n $blockTypes = $this->acService->getBlockTypes()->map('ClassName', 'SingularName');\n $blockTypeField = DropdownField::create(\n 'BlockClass',\n 'Block type',\n $blockTypes\n );\n \n $fields->addFieldToTab('Root.Main', $blockTypeField);\n\n $blockRecordClass = $this->getField('BlockClass');\n if ($blockRecordClass && $this->exists()) {\n $blockRecord = $this->getProxiedObject();\n \n // Now that a block class selection exists, we don't need it anymore.\n $fields->dataFieldByName('BlockClass')\n ->setDisabled(true)\n ->setReadonly(true)\n ->setEmptyString('dummy'); // The only way to disable validation\n \n $cmsFields = $blockRecordClass::create()->getCMSFields();\n // Populate the proxied model field's data\n if ($blockRecord) {\n $cmsFields->setValues($blockRecord->toMap());\n }\n $attFields = $this->attributeControls(AdvancedContentAttribute::ADV_ATTR_TYPE_FORM)->toArray();\n $blockFields = FieldList::create(array_merge($cmsFields->toArray(), $attFields));\n \n // Add the block-class's fields along with those of its attribute(s)\n $fields->addFieldsToTab('Root.Main', $blockFields);\n }\n\n return $fields;\n }", "public static function boot() {\n parent::boot();\n }", "public static function boot() {\n parent::boot();\n }", "public function install($parent)\n {\n $fields_definition_xml = file_get_contents(__DIR__ . '/fields_definition.xml');\n $fields_definition = new SimpleXMLElement($fields_definition_xml);\n $d = $fields_definition;\n\n // Check that the necessary fields exist:\n\n JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fields/models', 'FieldsModel');\n\n // Group:\n\n $field_groups_model = JModelLegacy::getInstance('Groups', 'FieldsModel', array('ignore_request' => true));\n $field_groups_model->setState('filter.context', 'com_content.article');\n $field_groups = $field_groups_model->getItems();\n\n $projects_group = false;\n foreach ($field_groups as $group) {\n if ($group->title == $d->group_title) {\n $projects_group = $group;\n break;\n }\n }\n\n // If there's no matching group, make it:\n if (!$projects_group) {\n\n $field_group_model = JModelLegacy::getInstance('Group', 'FieldsModel', array('ignore_request' => true));\n\n $new_group_data = array(\n 'context' => 'com_content.article',\n 'title' => (string) $d->group_title,\n 'description' => (string) $d->group_desc,\n 'state' => 1,\n 'params' => '{\"display_readonly\":\"1\"}',\n 'language' => '*'\n );\n\n $field_group_model->save($new_group_data);\n $item = $field_group_model->getItem();\n $group_id = $item->get('id');\n\n // Add the fields:\n $new_fields = array();\n foreach ($d->fields as $field) {\n $field->id = null;\n $field->label = $field->title;\n $field->language = '*';\n $field->group_id = $group_id;\n $field->context = 'com_content.article';\n if (!isset($field->name)) {\n $field->name = JApplication::stringURLSafe($field->title);\n }\n if (!isset($field->state)) {\n $field->state = 1;\n }\n if (!isset($field->required)) {\n $field->required = 0;\n }\n\n $field_model = JModelLegacy::getInstance('Field', 'FieldsModel', array('ignore_request' => true));\n $field_model->save($field);\n $item = $field_model->getItem();\n $field_id = $item->get('id');\n\n // Store a copy of the fields ID and Name:\n $new_fields[$field_id] = (string) $field->name;\n }\n\n // Store the fields id/name map so we have an immutable reference to each field when the\n // plugin is in use. The reason for this is that as we're using Custom Fields, not a\n // hard-coded form definition file, it's possible that the title, name or order of the\n // Custom Fields will be changed by the user, and we need to have something that's\n // immutable so that code can run properly. Without this, things could break.\n $fields_definition_dir = JPATH_PLUGINS . '/system/futurepublish/';\n\n if (!is_writable($fields_definition_dir)) {\n echo 'Dir not writable: ' . $fields_definition_dir;\n exit;\n }\n file_put_contents($fields_definition_dir . '/fields_id_name_map.json', json_encode($new_fields));\n }\n\n // Note: if there's already a group of the correct name, I'm assuming it already has the\n // necessary fields, for now.\n\n // Update the JS and CSS to use the new (correct) ID:\n /*$css = file_get_contents(JPATH_PLUGINS . '/system/projects/css/projects-categories.css');\n $css = str_replace('{{ ID }}', $group_id, $css);\n file_put_contents(JPATH_PLUGINS . '/system/projects/css/projects-categories.css', $css);\n\n $js = file_get_contents(JPATH_PLUGINS . '/system/projects/js/projects-categories.js');\n $js = str_replace('{{ ID }}', $group_id, $js);\n file_put_contents(JPATH_PLUGINS . '/system/projects/js/projects-categories.js', $js);*/\n }", "function CreateChildControls(){\n\t for($i=0; $i<sizeof($this->libs); $i++){\n\t\tif(!$this->error[$this->libs[$i]]){\n\t\t\t$this->AddControl(new ItemsListControl(\"ItemsList_\".$this->libs[$i], \"list\", $this->Storage));\n\t\t\t //Add control to controls\n\t\t\t$extra_url=\"\"; // Clearing ExtraUrl\n\t\t\tfor($j=0; $j<sizeof($this->libs); $j++){ // MAking ExtraUrl based on current controls state\n\t\t\t\t $extra_url .= \"&amp;\".$this->libs[$j].\"_start=\".$this->start[$this->libs[$j]].\"&amp;\".$this->libs[$j].\"_order_by=\".$this->order_by[$this->libs[$j]].($this->is_context_frame ? \"&amp;contextframe=1\" : \"\");\n\t\t\t}\n\t\t\t// Adding ItemsList control\n\t\t\t$this->Controls[\"ItemsList_\".$this->libs[$i]]->InitControl(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t //\"fields\" => $this->fields,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"library_ID\" => $this->libs[$i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"self\" => $this->self.\"\".$extra_url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"handler\" =>$this->handler,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"package\" =>$this->Package,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"order_by\" => $this->order_by[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"start\" => $this->start[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"data_extractor\" => $this->extractor_method,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"parent_id\" => $this->parent_id[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"data\" => $this->data[$this->libs[$i]]\n\t\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t // Getting list of subcategories\n\t\t $sub_categories = $this->Controls[\"ItemsList_\".$this->libs[$i]]->GetSubCategories();\n\t\t $tree_control = $this->Controls[\"ItemsList_\".$this->libs[$i]]->GetTreeControl();\n\t\t $nodelevels = $this->Controls[\"ItemsList_\".$this->libs[$i]]->GetNodeLevels();\n\t\t // Geting current level in catalog\n\t\t $nodelevel = (empty($nodelevels) ? 0 : $nodelevels[$this->parent_id[$this->libs[$i]]]+1);\n\t\t if($sub_categories !== false){\n\t\t\t for($k=0; $k<sizeof($sub_categories); $k++){\n\t\t\t\t if((!empty($sub_categories[$k][\"levels\"]) && in_array($nodelevel, $sub_categories[$k][\"levels\"])) ||\n\t\t\t\t\t(empty($sub_categories[$k][\"levels\"]))\n\t\t\t\t ) {\n\t\t\t\t // Preparing data for Sub-categories controls\n\t\t\t\t $sub_start=\"\";\n\t\t\t\t $sub_order_by=\"\";\n\t\t\t\t $append_str=\"\";\n\t\t\t\t // Building parts of url to preserve host-catalog sorting orders and paging\n\t\t\t\t for($l=0; $l<sizeof($sub_categories); $l++){\n\t\t\t\t\t $sub_start[$l] = $this->Request->ToNumber($sub_categories[$l][\"library\"].\"_start\",0);\n\t\t\t\t\t $sub_order_by[$l] = $this->Request->ToString($sub_categories[$l][\"library\"].\"_order_by\",\"\");\n\t\t\t\t\t $append_str .= \"&amp;\".$sub_categories[$l][\"library\"].\"_start=\".$sub_start[$l].\"&amp;\".$sub_categories[$l][\"library\"].\"_order_by=\".$sub_order_by[$l];\n\t\t\t\t }\n\t\t\t\t $host_extra_url = \"&amp;\".$this->libs[$i].\"_parent_id=\".$this->parent_id[$this->libs[$i]].\"&amp;\".$this->libs[$i].\"_start=\".$this->start[$this->libs[$i]].\"&amp;\".$this->libs[$i].\"_order_by=\".$this->order_by[$this->libs[$i]];\n\t\t\t\t // Appending built extra url to host-catalog control\n\t\t\t\t $this->Controls[\"ItemsList_\".$this->libs[$i]]->AppendSelfString($append_str);\n\t\t\t\t // Adding Child catalog to current host\n\t\t\t\t $this->AddControl(new ItemsListControl(\"ItemsList_sub_\".$sub_categories[$k][\"library\"], \"list\", $this->Storage));\n\t\t\t\t $this->Controls[\"ItemsList_sub_\".$sub_categories[$k][\"library\"]]->InitControl(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"library_ID\" => $sub_categories[$k][\"library\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"host_library_ID\" => $this->libs[$i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"self\" => $this->self.\"\".$extra_url.\"\".$host_extra_url.$append_str,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"handler\" =>$this->handler,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"package\" =>$this->Package,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"order_by\" => $sub_order_by[$k],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"start\" => $sub_start[$k],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"data_extractor\" => $this->extractor_method,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"parent_id\" => $this->parent_id[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"data\" => array($sub_categories[$k][\"link_field\"] => $this->parent_id[$this->libs[$i]]),\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"custom_var\" => $sub_categories[$k][\"link_field\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"custom_val\" => $this->parent_id[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"tree_control\" => $tree_control,\n\t\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\t\t}// if\n\t\t\t } // for k\n\n\t\t } // if sub_categories\n\t\t} // if !error\n\t\t} // for i\n\t}", "function append_children(\\navigation_node $parent, \\part_of_admin_tree $branch, \\context $context) {\n // We have a reference branch that we can access and is not hidden `hurrah`\n // Now we need to display it and any children it may have\n if (!$branch->check_access()) {\n // ACCESS DENIED!!!\n return;\n }\n global $CFG;\n $url = null;\n $icon = null;\n if ($branch instanceof admin_settingpage) {\n $url = new moodle_url('/local/advancedconfig/conf.php', array('section' => $branch->name, 'context' => $context->id));\n } else if ($branch instanceof admin_externalpage) {\n $url = $branch->url;\n } else if (!empty($CFG->linkadmincategories) && $branch instanceof admin_category) {\n $url = new moodle_url('/'.$CFG->admin.'/category.php', array('category' => $branch->name));\n }\n\n // Add the branch\n $reference = $parent->add($branch->visiblename, $url, navigation_node::TYPE_SETTING, null, $branch->name, $icon);\n\n if ($branch->is_hidden()) {\n if (($branch instanceof admin_externalpage || $branch instanceof admin_settingpage) && $branch->name == $parent->adminsection) {\n $reference->add_class('hidden');\n } else {\n $reference->display = false;\n }\n }\n\n // Check if this branch has children\n if ($reference && isset($branch->children) && is_array($branch->children) && count($branch->children)>0) {\n foreach ($branch->children as $branch) {\n // Generate the child branches as well now using this branch as the reference\n append_children($reference, $branch, $context);\n }\n } else {\n $reference->icon = new pix_icon('i/settings', '');\n }\n}", "public static function boot()\n {\n parent::boot();\n\n // 创建或更新后同步关联字段\n // 字段数据保存在 $raw 属性中\n static::saved(function(EntityMoldBase $mold) {\n if ($mold->getRaw()) {\n $mold->syncFields();\n $mold->clearRaw();\n }\n $mold->pocket()->clear('fieldsToControls');\n });\n\n // 删除时移除关联字段\n static::deleting(function(EntityMoldBase $mold) {\n $mold->fields()->detach();\n $mold->pocket()->clear('fieldsToControls');\n });\n }", "public function __construct()\n {\n $this->parent = null;\n $this->children = array();\n }", "public function init_fields() {\n\t\t/**\n\t\t * @var \\WPO\\Container $options\n\t\t * @var \\WPO\\Container $section\n\t\t */\n\t\tforeach ( $this->fields()->get() as $options ) {\n\t\t\tif ( $options->has_callback() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $options->has_containers() ) {\n\t\t\t\tforeach ( $options->containers() as $section ) {\n\t\t\t\t\tif ( ! $section->has_callback() && $section->has_fields() ) {\n\t\t\t\t\t\tforeach ( $section->fields() as $field ) {\n\t\t\t\t\t\t\t$this->render_field( $field, $options, $section );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ( $options->has_fields() ) {\n\t\t\t\tforeach ( $options->fields() as $field ) {\n\t\t\t\t\t$this->render_field( $field, $options, false );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function addFields()\n {\n $groupCustomOptionsName = CustomOptions::GROUP_CUSTOM_OPTIONS_NAME;\n $optionContainerName = CustomOptions::CONTAINER_OPTION;\n $commonOptionContainerName = CustomOptions::CONTAINER_COMMON_NAME;\n\n // Add fields to the option\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'] = array_replace_recursive(\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'],\n $this->getOptionFieldsConfig()\n );\n\n // Add fields to the values\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'] = array_replace_recursive(\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'],\n // $this->getValueFieldsConfig()\n // );\n }", "function m_leadBuilder()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_LEAD_FILE\",$this->leadTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_LEAD_FILE\",\"TPL_DEPARTMENT_BLK\", \"dept_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_LEAD_FILE\",\"TPL_ITEMS_BLK\", \"items_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_LEAD_FILE\",\"TPL_MAINATTACHED_BLK\", \"mainattached_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_MAINATTACHED_BLK\",\"TPL_ATTACHED_BLK\", \"attached_blk\");\n\t\t#INTIALIZING VARIABLES\n\t\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SITEURL\",SITE_URL);\n\t\t$this->ObTpl->set_var(\"dept_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"attached_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"mainattached_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_TODATE\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_FROMDATE\",\"\");\n\t\tif(!isset($this->request['postOwner']))\n\t\t{\n\t\t\t$this->request['postOwner']=\"0\";\n\t\t}\n\t\tif(!isset($this->request['leadid']))\n\t\t{\n\t\t\t$this->request['leadid']=\"\";\n\t\t}\n\t\t$this->ObTpl->set_var(\"TPL_VAR_LEADID\",$this->request['leadid']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",$this->request['postOwner']);\n\t\t#START DISPLAY DEPARETMENT BLOCK\n\t\t$this->obDb->query = \"SELECT vTitle,iDeptId_PK FROM \".DEPARTMENTS.\", \".FUSIONS.\" WHERE iDeptId_PK=iSubId_FK AND vType='department'\";\n\t\t$deptResult = $this->obDb->fetchQuery();\n\t\t $recordCount=$this->obDb->record_count;\n\t\t#PARSING DEPARTMENT BLOCK\n\t\t$this->ObTpl->set_var(\"SELECTED1\",\"selected\");\n\t\tif($recordCount>0)\n\t\t{\n\t\t\tfor($i=0;$i<$recordCount;$i++)\n\t\t\t{\n\t\t\t\t$_SESSION['dspTitle']=\"\";\t\t\n\t\t\t\t $this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->m_getTitle($deptResult[$i]->iDeptId_PK,'department'));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$deptResult[$i]->iDeptId_PK);\n\t\t\t\tif(isset($this->request['postOwner']) && $this->request['postOwner'] == $deptResult[$i]->iDeptId_PK)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED1\",\"\");\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"selected\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ObTpl->parse(\"dept_blk\",\"TPL_DEPARTMENT_BLK\",true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#END DISPLAY DEPARETMENT BLOCK\n\t\tif($this->request['postOwner']==\"orphan\")\n\t\t{\n\t\t\t $this->obDb->query= \"SELECT vTitle,fusionid,iProdId_PK FROM \".PRODUCTS.\" LEFT JOIN \".FUSIONS.\" ON iProdId_PK = iSubId_FK \" ;\n\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t$recordCount=$this->obDb->record_count;\n\n\t\t\tif(!isset($this->request['owner'])){\n\t\t\t\t$this->request['owner'] = \"\";\n\t\t\t}\n\t\t\t\t\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(empty($queryResult[$j]->fusionid) && $this->request['owner']!=$queryResult[$j]->iProdId_PK)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{#IF OTHER THAN ORPHAN\n\t\t\t\t$query = \"SELECT vTitle,iProdId_PK FROM \".PRODUCTS.\", \".FUSIONS.\" WHERE iProdId_PK=iSubId_FK AND iOwner_FK='\".$this->request['postOwner'].\"' AND vOwnerType='department' AND vType='product'\";\n\t\t\t\t$this->obDb->query=$query;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t/*if($this->request['owner']!=$queryResult[$j]->iProdId_PK)\n\t\t\t\t\t\t{*/\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t\t//}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\n\t\t#TO DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t\t$query1 = \"SELECT vTitle,iLeadProductId_PK,iProductid_FK FROM \".LEADPRODUCT.\" ,\".PRODUCTS.\" WHERE iProductid_FK=iProdid_PK AND iLeadId_FK='\".$this->request['leadid'].\"'\";\n\t\t\t$this->obDb->query=$query1;\n\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\tif($recordCount>0)\n\t\t\t{\n\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iLeadProductId_PK);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PID\",$queryResult[$j]->iProductid_FK);\n\t\t\t\t\t$this->ObTpl->parse(\"attached_blk\",\"TPL_ATTACHED_BLK\",true);\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"mainattached_blk\",\"TPL_MAINATTACHED_BLK\",true);\n\t\t\t}\n\t\t\t\n\t\t#END DISPLAY CURRENTLY ATTACHED ITEMS\n\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_LEAD_FILE\"));\n\t}", "protected function initCreatingFields() : void\n\t{\n\n\t\t$this->creating_fields = ['text', 'user_id', 'parent_id'];\n\n\t}", "function renderChildrenOf($pa, $root = null, $output = '', $level = 0) {\n if(!$root) $root = wire(\"pages\")->get(1);\n $output = '';\n $level++;\n foreach($pa as $child) {\n $class = '';\n $has_children = ($child->id == \"1018\" || $child->id == \"1263\" || count($child->children('include=all'))) ? true : false;\n\n if($has_children && $child !== $root) {\n if($level == 1){\n $class .= 'parent'; // first level boostrap dropdown li class\n //$atoggle .= ' class=\"dropdown-toggle\" data-toggle=\"dropdown\"'; // first level anchor attributes\n }\n }\n\n // make the current page and only its first level parent have an active class\n if($child === wire(\"page\") && $child !== $root){\n $class .= ' active';\n } else if($level == 1 && $child !== $root){\n if($child === wire(\"page\")->rootParent || wire(\"page\")->parents->has($child)){\n $class .= ' active';\n }\n }\n\n $class = strlen($class) ? \" class='\".trim($class).\"'\" : '';\n if($child->menu_item_url) {$childlink = $child->menu_item_url; } else { $childlink = $child->url; }\n $output .= \"<li$class><a href='$childlink'>$child->title</a>\";\n\n // If this child is itself a parent and not the root page, then render its children in their own menu too...\n \n if($has_children && $child !== $root) {\n \n // check for special menu items\n if ($child->id == \"1263\") { //services main item\n\n $output .= '<div class=\"megamenu\"><div class=\"megamenu-row\">';\n \n // promo\n $output .= '<div class=\"col3\">';\n $output .= '<h4 class=\"megamenu-col-title\">Promotional Offer:</h4>';\n $output .= '<a href=\"#\"><img src=\"http://placehold.it/270x244\" alt=\"\"></a>';\n $output .= '</div>';\n // end promo\n \n // first column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuServicesList('General');\n $output .= '</div>';\n // end first column\n\n // second column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuServicesList('Cosmetic Dentistry');\n $output .= megaMenuServicesList('Dental Restorations');\n $output .= '</div>';\n // end second column\n\n // third column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuServicesList('Specialty');\n $output .= '</div>';\n // end third column\n\n $output .= '</div></div>';\n }elseif ($child->id == \"1018\") {// blog main menu item\n \n $output .= '<div class=\"megamenu\"><div class=\"megamenu-row\">';\n\n // first column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuBlogCatList('general-dentistry');\n $output .= megaMenuBlogCatList('sleep-apnea-snoring');\n $output .= '</div>';\n // end first column\n\n // second column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuBlogCatList('cosmetic-dentistry');\n $output .= '</div>';\n // end second column\n\n // third column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuBlogCatList('childrens-dentistry');\n $output .= '</div>';\n // end third column\n\n // dourth column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuBlogCatList('sedation-dentistry'); \n $output .= megaMenuBlogCatList('restorations');\n $output .= '</div>';\n // end dourth column\n\n $output .= '</div></div>';\n \n }else {// default case for all other menu items\n\n $output .= renderChildrenOf($child->children('include=all'), $root, $output, $level);\n\n }\n }\n $output .= '</li>';\n\n\n }\n $outerclass = ($level == 1) ? \"menuzord-menu\" : 'dropdown';\n return \"<ul class='$outerclass'>$output</ul>\";\n}", "public function flatten(){\n\t\t$this->content=$this->flatten_array_build(\"first\");\n\t\tforeach($this->content as $item){\n\t\t\tif(is_a($item,\"elem\")){\n\t\t\t\t$item->master=$this;\n\t\t\t\t$item->self_closing=true;\n\t\t\t\t$item->content=array();\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}", "public function __clone()\n\t{\n\t\t$this->children=[];\n\t}", "public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }", "public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }", "private function executeFieldsSerially(\\GraphQL\\Type\\Definition\\ObjectType $parentType, $rootValue, array $path, \\ArrayObject $fields)\n {\n }", "function RenderChildren() {\n if ($this->HasControls()) {\n foreach($this->Controls as $control) {\n $control->Render();\n }\n }\n }", "protected function collectChildren(): void\n {\n $this->collection = new Collection();\n foreach ($this->rawResults as $blockChildContent) {\n $this->collection->add(Block::fromResponse($blockChildContent));\n }\n }", "public function boot(): void\n {\n parent::boot();\n }", "public function boot(): void\n {\n parent::boot();\n }", "public function boot()\n {\n parent::boot();\n //\n }", "public function boot()\n {\n parent::boot();\n //\n }", "public function save_data($parent, $id_parent, $post)\n\t{\n\t\t// Get all extends fields with this element OR kind of parent\n\t\t$extend_fields = (!empty($post['id_element_definition'])) ? $this->get_list(array('id_element_definition' => $post['id_element_definition'])) : $this->get_list(array('parent' => $parent));\n\n\t\tforeach ($extend_fields as $extend_field)\n\t\t{\n\t\t\t$id_extend = $extend_field[$this->get_pk_name()];\n\n\t\t\t// Link between extend_field and the current parent\n\t\t\t$where = array(\n\t\t\t\t$this->get_pk_name() => $id_extend,\n\t\t\t\t'id_parent' => $id_parent\n\t\t\t);\n\t\t\t\n\t\t\t// Checkboxes : first clear values from DB as the var isn't in $_POST if no value is checked\n\t\t\t// furthermore, make sure that if all checkbox values are unchecked, we do not fallback to the\n\t\t\t// default values, we do that by storing the special `-` value in the database. \n\t\t\t$langs = Settings::get_languages();\n\n\t\t\tif ($extend_field['type'] == '4')\n\t\t\t{\n\t\t\t\tif ($this->exists($where, $this->elements_table))\n\t\t\t\t{\n\t\t\t\t\t$this->{$this->db_group}->where($where);\n\t\t\t\t\t$this->{$this->db_group}->update($this->elements_table, array('content' => '-'));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'content' => '-',\n\t\t\t\t\t\t'lang' => '',\n\t\t\t\t\t\t'id_parent' => $id_parent,\n\t\t\t\t\t\t$this->pk_name => $id_extend,\n\t\t\t\t\t);\n\n\t\t\t\t\tif ($extend_field['translated'] != '1')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->{$this->db_group}->insert($this->elements_table, $data);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($langs as $language)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$data['lang'] = $language['lang'];\n\t\t\t\t\t\t\t$this->{$this->db_group}->insert($this->elements_table, $data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get the value from _POST values and feed the data array\n\t\t\tforeach ($post as $k => $value)\n\t\t\t{\n\t\t\t\tif (substr($k, 0, 2) == 'cf')\n\t\t\t\t{\n\t\t\t\t\t// id of the extend field\n\t\t\t\t\t$key = explode('_', $k);\n\n\t\t\t\t\tif (isset($key[1]) && $key[1] == $id_extend)\n\t\t\t\t\t{\n\t\t\t\t\t\t// if language code is set, use it in the query\n\t\t\t\t\t\t$lang=NULL;\n\n\t\t\t\t\t\tif (isset($key[2]))\n\t\t\t\t\t\t\t$lang = $key[2];\n\n\t\t\t\t\t\t$this->save_extend_field_value($id_extend, $parent, $id_parent, $value, $lang);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.6045651", "0.55777663", "0.5562814", "0.5558915", "0.5379437", "0.5373707", "0.5341585", "0.5324784", "0.5294674", "0.52686405", "0.52046895", "0.51608795", "0.5156325", "0.5151352", "0.5129063", "0.5098962", "0.5073758", "0.5071496", "0.50700426", "0.5050326", "0.50502783", "0.50250304", "0.50063235", "0.50057524", "0.50034314", "0.49902084", "0.49872857", "0.49872857", "0.49869883", "0.49801192", "0.4979837", "0.49758413", "0.4960722", "0.4956522", "0.495495", "0.49515098", "0.4928412", "0.4917231", "0.49151137", "0.4908119", "0.49069592", "0.49060813", "0.48601624", "0.48538658", "0.4851211", "0.48454928", "0.48426807", "0.4839608", "0.4839465", "0.48284626", "0.48083755", "0.48004895", "0.47999784", "0.47987503", "0.47915968", "0.47860685", "0.47827357", "0.47821426", "0.47594935", "0.4759225", "0.4750825", "0.4740802", "0.47405788", "0.4729499", "0.47223124", "0.47066242", "0.47062474", "0.46982434", "0.46932533", "0.46850112", "0.4676636", "0.4673483", "0.46709433", "0.46663442", "0.4663352", "0.466308", "0.4656264", "0.4656264", "0.4653718", "0.46531647", "0.4650291", "0.46415323", "0.4635102", "0.46336603", "0.46331117", "0.46323612", "0.463104", "0.4630975", "0.46302626", "0.4629727", "0.46280736", "0.46280736", "0.4626508", "0.46253198", "0.46220213", "0.461281", "0.461281", "0.46085656", "0.46085656", "0.45920238" ]
0.57103914
1
Get the URI to where this request should be sent
public function getEndpoint();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUri() {\n return $this->request->getUri();\n }", "public function uri()\n {\n return $this->_requestUri;\n }", "public function getRequestUri() {}", "public function getRequestUri()\n {\n return $this->getServer('REQUEST_URI');\n }", "public function getRequestUri() : string\n {\n return $this->requestUri;\n }", "public function getRequestUri()\n\t{\n\t\tif (isset($this->getServerParams()['REQUEST_URI'])) {\n\t\t\treturn $this->getServerParams()['REQUEST_URI'];\n\t\t}\n\t}", "public function getRequestUri()\n {\n return $this->getRequest()->getRequestUri();\n }", "function getRequestUri() {\n\t\treturn $this->getParam(self::PARAM_REQUEST_URI);\n\t}", "public function requestUri() {}", "public function getRequestUri() {\n\t\treturn $this->requestUri;\n\t}", "public function getRequestUri() {\n\t\t$final = '';\n\t\tif($this->path) {\n\t\t\t$final .= $this->path;\n\t\t}\n\t\tif($this->query) {\n\t\t\t$final .= '?' . $this->query;\n\t\t}\n\t\treturn $final;\n\t}", "public function getRequestUri()\n {\n return $this->_requestUri;\n }", "public function requestUri()\n {\n return $this->listURL();\n }", "public function getFullRequestUri() {\n return $GLOBALS['base_url'] . request_uri();\n }", "public function getRequestUri(): string\n {\n return $_SERVER['REQUEST_URI'];\n }", "public function getRequestUri()\n {\n if ( $this->uri === null )\n {\n $this->uri = UTIL_Url::getRealRequestUri(OW::getRouter()->getBaseUrl(), $_SERVER['REQUEST_URI']);\n }\n\n return $this->uri;\n }", "public function getRequestedUri() {\n return $this->requestedUri;\n }", "public function getRequestUri()\n {\n if (empty($this->requestUri)) {\n $this->setRequestUri();\n }\n\n return $this->requestUri;\n }", "public function getRequestUri()\n {\n return (string) $_SERVER['REQUEST_URI'];\n }", "public function getURI()\n {\n return $this->server['REQUEST_URI'];\n }", "public function requestURI() {\n return $_SERVER['REQUEST_URI'];\n }", "public function requestURI()\n {\n return $_SERVER['REQUEST_URI'];\n }", "protected function getRequestedUrl()\n {\n $scheme = $this->getScheme();\n\n return $scheme . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n }", "public function getUri()\n {\n $server = provider::access('server');\n\n return ($server->isExist('REQUEST_URI') && $server->isValid('REQUEST_URI', validate::T_PRINTABLE)\n ? $server->getValue('REQUEST_URI')\n : '/');\n }", "public function getRequestURL() {\n\t\t$scheme = $this->getScheme();\n\t\t$port = $this->getServerPort();\n\t\t$url = $scheme . '://';\n\t\t$url .= $this->getServerName();\n\t\tif(($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443)) {\n\t\t\t$url .= ':' . $port;\n\t\t}\n\t\t$url .= $this->getRequestURI();\n\t\treturn $url;\n\t}", "public function uri()\r\n {\r\n return $this->server->get('REQUEST_URI', '/');\r\n }", "public function getUri()\n {\n return $this->getUrl();\n }", "public function requestTarget()\n {\n if ($this->method() === 'CONNECT' || $this->mode() === 'authority') {\n $credential = $this->credential();\n return ($credential ? $credential. '@' : '') . $this->host();\n }\n if ($this->mode() === 'absolute') {\n return $this->url();\n }\n if ($this->mode() === 'asterisk') {\n return '*';\n }\n $query = $this->query() ? '?' . http_build_query($this->query()) : '';\n $fragment = $this->fragment();\n return $this->path() . $query . ($fragment ? '#' . $fragment : '');\n }", "public function uri() {\n\t\treturn $this->getUri();\n\t}", "function getUri() {\n\t\tif($this->_uri === null) {\n\t\t\t$this->_uri = rtrim($_SERVER['REQUEST_URI'], '/') . '/';\n\t\t}\n\t\treturn $this->_uri;\n\n\t}", "function getRequestUrl() {\n\t\treturn $this->requestUrl;\n\t}", "public function getUri()\n {\n return $this->normalize($this->service->uri()) . '/' . $this->normalize($this->uri ?: '');\n }", "public function getRequestUrl()\r\n {\r\n return $this->request_url;\r\n }", "public function fullUri()\n\t{\n\t\treturn $_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : '/';\n\t}", "public function getURL()\n\t{\n $url = $this->_internal_request->get_normalized_http_url();\n \n if ( $this->getMethod() == KHttpRequest::GET ) \n {\n $url = $this->_internal_request->to_url();\n }\n \n\t\treturn $url;\n\t}", "public function url(): string\n {\n return rtrim($this->request->getUriForPath('/'), '/');\n }", "public function uri() {\n\t\treturn isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/';\n\t}", "public function getRequestUrl() {\n\t}", "protected function getUri()\n {\n $uri = $this->request['REQUEST_URI'];\n $prefix = config('router', 'base_uri');\n if (substr($uri, 0, strlen($prefix)) == $prefix) {\n $uri = substr($uri, strlen($prefix));\n }\n\n $this->uri = rtrim($uri, \"/\");\n }", "public static function getUri()\n {\n if (isset($_SERVER['REQUEST_URI'])) {\n return $_SERVER['REQUEST_URI'];\n } else {\n return \"/\";\n }\n }", "public function getRequestUrl()\n {\n return $this->getRequest()->getRequestUrl();\n }", "function getURI() {\n\t\t\t$requestURI = $_SERVER['REQUEST_URI'];\n\n\t\t\tif (strpos($requestURI, '?') !== FALSE) { // hack for IE which does not pass querystring in URI element of Digest string or in response hash\n\t\t\t\t$requestURI = substr($requestURI, 0, strlen($uri[1]));\n\t\t\t}\n\t\t\t\n\t\t\treturn $requestURI;\n\t\t}", "abstract public function getRawRequestUrl();", "public static function getRequestedURL()\n {\n return self::getInstance()->requestedUrl;\n }", "public function getRequestTarget()\n {\n $url = $this->getUrl(true);\n\n return ($path = $url->getPath()) ? $path : '/';\n }", "public function get_requestUrlFull()\n {\n return $this->requestUrlFull;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function getUri()\n {\n return $this->uri;\n }", "public function uri()\n {\n $uri = '';\n if (isset($this->server['REQUEST_URI'])) {\n $uri = $this->server['REQUEST_URI'];\n }\n\n $uri = ltrim($uri, '/');\n\n if (!$this->hasQueryPart($uri)) {\n $uri = rtrim($uri, '/');\n }\n\n return $uri;\n }", "public function getUri(): string\n {\n return $this->uri;\n }", "public static function getRequestUrl() {\n\t\t$protocol = 'http';\n\t\tif (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") {\n\t\t\t$protocol = 'https';\n\t\t}\n\t\n\t\t$port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\n\t\treturn $protocol . \"://\" . self::getRequestHost() . $port . $_SERVER['REQUEST_URI'];\n\t}", "function _request_uri() {\n if (isset($_SERVER['REQUEST_URI'])) {\n $uri = $_SERVER['REQUEST_URI'];\n }\n else {\n if (isset($_SERVER['argv'])) {\n $uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['argv'][0];\n }\n elseif (isset($_SERVER['QUERY_STRING'])) {\n $uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['QUERY_STRING'];\n }\n else {\n $uri = $_SERVER['SCRIPT_NAME'];\n }\n }\n // Prevent multiple slashes to avoid cross site requests via the FAPI.\n $uri = '/'. ltrim($uri, '/');\n\n return $uri;\n}", "public function getUri() {}", "public function getUri() {}", "public function uri()\n {\n return $this->uri;\n }", "public function uri()\n {\n return $this->uri;\n }", "public function url() \n\t{\n\t\treturn static::protocol().'://'.static::host().$this->server('REQUEST_URI', '/' );\n\t}", "static public function getURI()\n {\n return explode('?', $_SERVER['REQUEST_URI'])[0] . '/';\n }", "public function getURI()\n {\n return $this->uri;\n }", "private function getURI()\n {\n if (!empty($_SERVER['REQUEST_URI'])) {\n return trim($_SERVER['REQUEST_URI'], '/');\n }\n }", "public function get_uri()\n {\n }", "public function getUri()\n\t{\n\t\treturn $this->uri;\n\t}", "private function getURI() : string\n {\n if (!empty($_SERVER['REQUEST_URI'])){\n return trim($_SERVER['REQUEST_URI'], '/');\n }\n }", "public function getUri()\n {\n return $this->_uri;\n }", "public function getLastRequestUri()\n\t{\n\t\treturn $this->_lastRequestUri;\n\t}", "public function uri() \n\t{\n\t\treturn $this->uri;\n\t}", "public function getLastRequestUri()\n {\n return $this->_lastRequestUri;\n }", "private function getURI(): string\n {\n if (!empty($_SERVER['REQUEST_URI'])) {\n return trim($_SERVER['REQUEST_URI'], '/');\n }\n }", "public function getUri() {\n\t\treturn $this->uri;\n\t}", "public function getCurrentUri()\n {\n // Get the current Request URI and remove rewrite base path from it (= allows one to run the router in a sub folder)\n $uri = substr(rawurldecode($_SERVER['REQUEST_URI']), strlen($this->getBasePath()));\n\n // Don't take query params into account on the URL\n if (strstr($uri, '?')) {\n $uri = substr($uri, 0, strpos($uri, '?'));\n }\n\n // Remove trailing slash + enforce a slash at the start\n return '/' . trim($uri, '/');\n }", "public function getUri()\n {\n if (isset($_SERVER['QUERY_STRING'])) {\n return filter_var(trim(str_replace('?'.$_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']), '/'), FILTER_SANITIZE_URL);\n }\n return filter_var(trim($_SERVER['REQUEST_URI'], '/'), FILTER_SANITIZE_URL);\n }", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "function request_uri() {\n\t\tif(isset($_SERVER['argv'])) {\n\t\t\t$protocol = 'cli';\n\t\t\t$host = gethostname();\n\t\t\t$path = '/' . $_SERVER['SCRIPT_FILENAME'];\n\t\t\tif(count($_SERVER['argv']) > 1) {\n\t\t\t\tunset($_SERVER['argv'][0]);\n\t\t\t\t$query_string = '?' . http_build_query($_SERVER['argv']);\n\t\t\t} else {\n\t\t\t\t$query_string = '';\n\t\t\t}\n\n\t\t\treturn $protocol . '://' . $host . $path . $query_string;\n\t\t} else {\n\t\t\tif (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {\n\t\t\t\t$protocol = 'https';\n\t\t\t} else {\n\t\t\t\t$protocol = 'http';\n\t\t\t}\n\t\t\t$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';\n\t\t\t$path = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';\n\t\t\t$query_string = isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? ('?' . $_SERVER['QUERY_STRING']) : '';\n\t\t\treturn $protocol . '://' . $host . $path . $query_string;\n\t\t}\n\t}", "function getRequestUri(){\n\tif (isset($_SERVER['REQUEST_URI'])) {\n\t\t$uri = $_SERVER['REQUEST_URI'];\n\t} else {\n\t\tif (isset($_SERVER['argv'])) {\n\t\t\t $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0];\n\t\t} else {\n\t\t\t$uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING'];\n\t\t}\n\t}\n\treturn $uri;\n}", "static function getURI() {\n return '/';\n }", "public function getUri()\n {\n return 'https://'.$this->getAuth().'@'.self::BASE_URI.'/v1/';\n }", "public function getUri(){\n return $this->uri;\n }", "public function uri() {\n return $this->uri;\n }", "public static function uri() {\n\t\treturn isset($_SERVER['REQUEST_URI'])\n\t\t\t? $_SERVER['REQUEST_URI']\n\t\t\t: null;\n\t}", "protected function get_uri()\n {\n }", "public function getRequestUri(): ?string\n {\n return $this->requestUri;\n }", "abstract protected function buildSpecificRequestUri();", "public function URI()\n\t{\n\t\treturn $this->uri;\n\t}", "public function uri(): string\n {\n return $this->uri;\n }", "public function getURI();", "public function uri(): UriInterface\n {\n return $this->request()->getUri();\n }", "public function getCurrentUri()\n\t{\n\t\t// Current Request URI\n\t\tif (!isset($this->getServerParams()['REQUEST_URI'])) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$uri = $this->getServerParams()['REQUEST_URI'];\n\n\t\t// Don't take query params into account on the URL\n\t\tif (strstr($uri, '?')) $uri = substr($uri, 0, strpos($uri, '?'));\n\n\t\t// Remove trailing slash + enforce a slash at the start\n\t\t$uri = '/' . trim($uri, '/');\n\n\t\treturn $uri;\n\t}", "public function uri()\n {\n return $this->factory->getUri($this->handle);\n }", "public function getModuleRequestURI()\n {\n if (empty($this->module_request_uri)) {\n\n $this->module_request_uri = $this->getModuleName();\n }\n\n return $this->module_request_uri;\n }", "public function url()\n {\n return explode('?' ,$this->uri)[0];\n }" ]
[ "0.8445041", "0.84268934", "0.8402421", "0.83717275", "0.83510154", "0.8347441", "0.8320148", "0.8293699", "0.8280009", "0.8267417", "0.8263601", "0.8228059", "0.8209691", "0.8165358", "0.8158809", "0.8157109", "0.8033054", "0.79888153", "0.79870105", "0.7959325", "0.7909401", "0.7908345", "0.7892652", "0.7862244", "0.7845197", "0.7817404", "0.78166306", "0.77904874", "0.7770259", "0.7746857", "0.77200335", "0.7714674", "0.77111775", "0.7697059", "0.769263", "0.7687538", "0.7660583", "0.7631817", "0.7629131", "0.76216507", "0.76200056", "0.76133126", "0.7585522", "0.75698453", "0.75329846", "0.7531461", "0.7502601", "0.7502601", "0.7502601", "0.7502601", "0.7502601", "0.7502601", "0.7502601", "0.7502601", "0.7502601", "0.7502601", "0.7495515", "0.7463079", "0.7457571", "0.7449915", "0.7440449", "0.7440449", "0.74331784", "0.74331784", "0.7431481", "0.74268794", "0.74247944", "0.74140096", "0.7410397", "0.74053544", "0.7403344", "0.74033314", "0.73911566", "0.7389678", "0.7365703", "0.73597926", "0.7355003", "0.73536986", "0.7348319", "0.7339221", "0.7339221", "0.7339221", "0.7339221", "0.73284996", "0.73112583", "0.73044693", "0.7277244", "0.7276551", "0.7266823", "0.72599626", "0.72564834", "0.7250272", "0.72385573", "0.72362447", "0.723551", "0.72333306", "0.72276443", "0.7215417", "0.72122294", "0.721094", "0.72097933" ]
0.0
-1
Extracts trans message from PHP tokens.
public function parseFileTokens($file) { preg_match_all('/^(\$_\w+\[\'.+\'\]) = \'(.*)\';/m', file_get_contents($file), $matches); foreach ($matches[0] as $key => $match) { yield [ 'message' => $matches[2][$key], 'key' => $matches[1][$key], ]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dc_campaign_emails_rules_action_mail_token_replace($message, $settings, RulesState $state, RulesPlugin $element) {\n $message_body = $message;\n\n $datetime = new DateTime();\n $datetime->setTimestamp($state->variables['transaction_time']);\n $new_body = token_replace($message_body, array(\n 'redhen_donation' => $state->variables['redhen_donation']->value(),\n 'transaction_time' => $datetime,\n 'commerce_transaction' => $state->variables['commerce_transaction']->value(),\n ));\n $subtoken = array(\n 'subtoken' => $new_body,\n );\n return $subtoken;\n}", "function parseMessage(string $message): array\n{\n $result = [\n 'code' => null,\n 'amount' => null,\n 'receiver' => null,\n ];\n\t\n\t\n\t// The first - check for yandex account number 41001XXXXX..XXX\n\t// Y.M. test accounts: 41003XXXXX..XXX\n preg_match_all('/(^(?:.*?\\D|))(4100[\\d\\-]{7,})((?:[\\s.,].*?|)$)/isu', $message, $matches, PREG_SET_ORDER);\n if (empty($matches)) {\n throw new \\Exception('Receiver not found');\n }\n if (count($matches) > 1) {\n throw new \\Exception('Multiple receivers found');\n }\n\t\n $result['receiver'] = preg_replace('/\\D+/', '', $matches[0][2]);\n\n\t// Exclude found entity from next searches\n $message = $matches[0][1] . $matches[0][count($matches[0]) - 1];\n\t\n\t\n\t// Detect amount of money transfered\n\t// It may have 1-2 fractional digits, and may not (integer amount)\n\t// Also fractional part may apeears in different formats - \".\", \",\" \n\t// or even smth like \"XXX р. YY к.\" (\"...YY коп\")\n\t$rurReg = 'р\\.|р\\b|руб|rub|rur|₽|&\\#8381;';\n\t$rurFracReg = 'к\\.|к\\b|коп|kop';\n preg_match_all(\n\t\t\"/(^(?:.*?\\\\s|))(\n\t\t\t(\\\\d+)((,|\\\\.|\\\\s*(?:{$rurReg})\\\\s*)(\\\\d{1,2})|)\\\\s*(?:{$rurReg}|{$rurFracReg})\n\t\t)((?:[\\\\s.,].*?|)$)/isux\", $message, $matches, PREG_SET_ORDER);\n if (empty($matches)) {\n throw new \\Exception('Amount not found');\n }\n if (count($matches) > 1) {\n throw new \\Exception('Multiple amounts found');\n }\n $result['amount'] = floatval($matches[0][3] . '.' . $matches[0][6]);\n\n $message = $matches[0][1] . $matches[0][count($matches[0]) - 1];\n\t\n\n\t// Detect verification code (verification password)\n\t// For now, we sincerelly believe it must be just set of 4-6 digits\n preg_match_all('/(^|\\D)(\\d{4,})(\\D|$)/isu', $message, $matches, PREG_SET_ORDER);\n if (empty($matches)) {\n throw new \\Exception('Code not found');\n }\n if (count($matches) > 1) {\n throw new \\Exception('Multiple codes found');\n }\n $result['code'] = $matches[0][2];\n\n return $result;\n}", "private function parseMo() {\n /*\n * TODO: gucken, ob file existiert\n */\n $content = file_get_contents(BASE_PATH.'/lang/'.LANGUAGE.'.mo');\n\t $fileSize = strlen($content);\n\t \n\t // Find the byte order of the MO file creator\n\t $byteOrder = substr($content, 0, 4);\n\t \n\t // Little endian\n\t if ($byteOrder == \"\\xde\\x12\\x04\\x95\") {\n\t \t$tmpl = \"V\";\n\t // Big endian\n\t } elseif ($byteOrder == \"\\x95\\x04\\x12\\xde\") {\n\t $tmpl = \"N\";\n\t // Wrong magic number. Not a valid MO file.\n\t } else {\n\t return 'wrong magic number';\n\t }\n\t \n\t // Check the MO format revision number\n\t $revision = unpack($tmpl, substr($content, 4, 4));\n\t if ($revision[1] > 0) return 'wrong revision';\n\t \n\t // Number of strings\n\t $numberOfStrings = unpack($tmpl, substr($content, 8, 4));\n\t \n\t // Offset to the beginning of the original strings\n\t $offo = unpack($tmpl, substr($content, 12, 4));\n\t \n\t // Offset to the beginning of the translated strings\n\t $offt = unpack($tmpl, substr($content, 16, 4));\n\t \n\t $trans = array();\n\t for ($i = 0; $i < $numberOfStrings[1]; $i++) {\n\t // The first word is the length of the string\n\t $len = unpack($tmpl, substr($content, $offo[1]+($i*8), 4));\n\t \n\t // The second word is the offset of the string\n\t $off = unpack($tmpl, substr($content, $offo[1]+($i*8)+4, 4));\n\t \n\t // Original string\n\t $stro = substr($content, $off[1], $len[1]);\n\t \n\t // The first word is the length of the string\n\t $len = unpack($tmpl, substr($content, $offt[1]+($i*8), 4));\n\t \n\t // The second word is the offset of the string\n\t $off = unpack($tmpl, substr($content, $offt[1]+($i*8)+4, 4));\n\t \n\t // Translated string\n\t $strt = substr($content, $off[1], $len[1]);\n\t \n\t // Hash it baby\n\t $trans[$stro] = $strt;\n\t \n\t }\n\t \n\t return $trans;\n }", "private static function parseToken(array $token, array $values, $locale)\n {\n if (!isset($values[$param = trim($token[0])])) {\n return '{'.$param.'}';\n }\n\n $arg = $values[$param];\n $type = isset($token[1]) ? trim($token[1]) : 'none';\n switch ($type) {\n case 'date': // XXX use DateFormatter?\n case 'time':\n case 'spellout':\n case 'ordinal':\n case 'duration':\n case 'choice':\n case 'selectordinal':\n throw new \\DomainException(sprintf('The PHP intl extension is required to use the \"%s\" message format.', $type));\n case 'number':\n $format = isset($token[2]) ? trim($token[2]) : null;\n if (!is_numeric($arg) || (null !== $format && 'integer' !== $format)) {\n throw new \\DomainException('The PHP intl extension is required to use the \"number\" message format with non-integer values.');\n }\n\n $number = number_format($arg); // XXX use NumberFormatter?\n if (null === $format && false !== $pos = strpos($arg, '.')) {\n // add decimals with unknown length\n $number .= '.'.substr($arg, $pos + 1);\n }\n\n return $number;\n\n case 'none':\n return $arg;\n\n case 'select':\n /* http://icu-project.org/apiref/icu4c/classicu_1_1SelectFormat.html\n selectStyle = (selector '{' message '}')+\n */\n if (!isset($token[2])) {\n throw new \\DomainException('Message pattern is invalid.');\n }\n $select = self::tokenizePattern($token[2]);\n $c = \\count($select);\n $message = false;\n for ($i = 0; 1 + $i < $c; ++$i) {\n if (\\is_array($select[$i]) || !\\is_array($select[1 + $i])) {\n throw new \\DomainException('Message pattern is invalid.');\n }\n $selector = trim($select[$i++]);\n if (false === $message && 'other' === $selector || $selector == $arg) {\n $message = implode(',', $select[$i]);\n }\n }\n if (false !== $message) {\n return self::parseTokens(self::tokenizePattern($message), $values, $locale);\n }\n break;\n\n case 'plural': // TODO make it locale-dependent based on symfony/translation rules\n /* http://icu-project.org/apiref/icu4c/classicu_1_1PluralFormat.html\n pluralStyle = [offsetValue] (selector '{' message '}')+\n offsetValue = \"offset:\" number\n selector = explicitValue | keyword\n explicitValue = '=' number // adjacent, no white space in between\n keyword = [^[[:Pattern_Syntax:][:Pattern_White_Space:]]]+\n message: see MessageFormat\n */\n if (!isset($token[2])) {\n throw new \\DomainException('Message pattern is invalid.');\n }\n $plural = self::tokenizePattern($token[2]);\n $c = \\count($plural);\n $message = false;\n $offset = 0;\n for ($i = 0; 1 + $i < $c; ++$i) {\n if (\\is_array($plural[$i]) || !\\is_array($plural[1 + $i])) {\n throw new \\DomainException('Message pattern is invalid.');\n }\n $selector = trim($plural[$i++]);\n\n if (1 === $i && 0 === strncmp($selector, 'offset:', 7)) {\n $pos = strpos(str_replace([\"\\n\", \"\\r\", \"\\t\"], ' ', $selector), ' ', 7);\n $offset = (int) trim(substr($selector, 7, $pos - 7));\n $selector = trim(substr($selector, 1 + $pos, \\strlen($selector)));\n }\n if (false === $message && 'other' === $selector ||\n '=' === $selector[0] && (int) substr($selector, 1, \\strlen($selector)) === $arg ||\n 'one' === $selector && 1 == $arg - $offset\n ) {\n $message = implode(',', str_replace('#', $arg - $offset, $plural[$i]));\n }\n }\n if (false !== $message) {\n return self::parseTokens(self::tokenizePattern($message), $values, $locale);\n }\n break;\n }\n\n throw new \\DomainException('Message pattern is invalid.');\n }", "function translate_parse($dataStr)\n\t\t{\n\t\t if($dataStr)\n\t\t {\n\t\t\t $arr = json_decode($dataStr,true); \n\t\t\t\t return $arr['responseData']['translatedText'];\n\t\t }\n\t\t return \"\";\n\t\t}", "public function decode(string $token): array;", "private function get_token() \n {\n if ($this->last_token === 'TK_TAG_SCRIPT' || $this->last_token === 'TK_TAG_STYLE') { //check if we need to format javascript\n $type = substr($this->last_token, 7);\n $token = $this->get_contents_to($type);\n if (!is_string($token)) {\n return $token;\n }\n return array($token, 'TK_' . $type);\n }\n if ($this->current_mode === 'CONTENT') {\n $token = $this->get_content();\n \n if (!is_string($token)) {\n return $token;\n } else {\n return array($token, 'TK_CONTENT');\n }\n }\n\n if ($this->current_mode === 'TAG') {\n $token = $this->get_tag();\n\n if (!is_string($token)) {\n return $token;\n } else {\n $tag_name_type = 'TK_TAG_' . $this->tag_type;\n return array($token, $tag_name_type);\n }\n }\n }", "public function decode(string $token): Token;", "public function getRawMessage()\n {\n return $this->phrase->getText();\n }", "private function retrieveMessage() : ?string {\n $message = [];\n\n // The regex to find the head of the message wrapper (message lies between head and foot wrapper)\n $messageHeadWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD ,\n self::REGEX_MESSAGE_WRAPPER_BODY,\n \"(\\s{2})\"\n ], \"\", \"\");\n\n // The regex to find the foot of the message wrapper (message lies between head and foot wrapper)\n $messageFootWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD,\n self::REGEX_MESSAGE_WRAPPER_BODY\n ], \"\", \"\");\n\n // The regex for querying the message, including its queried wrapper\n $messageRegex = $this->buildRegex([\n $messageHeadWrapperRegex,\n self::REGEX_ALL,\n $messageFootWrapperRegex\n ]);\n\n // Querying the message\n preg_match($messageRegex, $this->currentEmail, $message);\n\n // If the message not found, there is most likely no message, so return null\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n if (!isset($message[4]))\n return null;\n\n // Return the quoted-printable decoded and trimmed message\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n $message = quoted_printable_decode($message[4]);\n return trim($message);\n }", "static function decodeToken($token) {\n return (array)Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting(self::getSettingsNamespace(), 'token_key')));\n }", "public function readToken() {}", "function mLANGTAG(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$LANGTAG;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:336:3: ( '@' ( ( 'a' .. 'z' ) )+ ( MINUS ( ( 'a' .. 'z' ) ( '0' .. '9' ) )+ )* ) \n // Tokenizer11.g:337:3: '@' ( ( 'a' .. 'z' ) )+ ( MINUS ( ( 'a' .. 'z' ) ( '0' .. '9' ) )+ )* \n {\n $this->matchChar(64); \n // Tokenizer11.g:337:7: ( ( 'a' .. 'z' ) )+ \n $cnt3=0;\n //loop3:\n do {\n $alt3=2;\n $LA3_0 = $this->input->LA(1);\n\n if ( (($LA3_0>=$this->getToken('97') && $LA3_0<=$this->getToken('122'))) ) {\n $alt3=1;\n }\n\n\n switch ($alt3) {\n \tcase 1 :\n \t // Tokenizer11.g:337:9: ( 'a' .. 'z' ) \n \t {\n \t // Tokenizer11.g:337:9: ( 'a' .. 'z' ) \n \t // Tokenizer11.g:337:10: 'a' .. 'z' \n \t {\n \t $this->matchRange(97,122); \n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( $cnt3 >= 1 ) break 2;//loop3;\n $eee =\n new EarlyExitException(3, $this->input);\n throw $eee;\n }\n $cnt3++;\n } while (true);\n\n // Tokenizer11.g:338:3: ( MINUS ( ( 'a' .. 'z' ) ( '0' .. '9' ) )+ )* \n //loop5:\n do {\n $alt5=2;\n $LA5_0 = $this->input->LA(1);\n\n if ( ($LA5_0==$this->getToken('45')) ) {\n $alt5=1;\n }\n\n\n switch ($alt5) {\n \tcase 1 :\n \t // Tokenizer11.g:339:5: MINUS ( ( 'a' .. 'z' ) ( '0' .. '9' ) )+ \n \t {\n \t $this->mMINUS(); \n \t // Tokenizer11.g:340:5: ( ( 'a' .. 'z' ) ( '0' .. '9' ) )+ \n \t $cnt4=0;\n \t //loop4:\n \t do {\n \t $alt4=2;\n \t $LA4_0 = $this->input->LA(1);\n\n \t if ( (($LA4_0>=$this->getToken('97') && $LA4_0<=$this->getToken('122'))) ) {\n \t $alt4=1;\n \t }\n\n\n \t switch ($alt4) {\n \t \tcase 1 :\n \t \t // Tokenizer11.g:341:7: ( 'a' .. 'z' ) ( '0' .. '9' ) \n \t \t {\n \t \t // Tokenizer11.g:341:7: ( 'a' .. 'z' ) \n \t \t // Tokenizer11.g:341:8: 'a' .. 'z' \n \t \t {\n \t \t $this->matchRange(97,122); \n\n \t \t }\n\n \t \t // Tokenizer11.g:341:18: ( '0' .. '9' ) \n \t \t // Tokenizer11.g:341:19: '0' .. '9' \n \t \t {\n \t \t $this->matchRange(48,57); \n\n \t \t }\n\n\n \t \t }\n \t \t break;\n\n \t \tdefault :\n \t \t if ( $cnt4 >= 1 ) break 2;//loop4;\n \t $eee =\n \t new EarlyExitException(4, $this->input);\n \t throw $eee;\n \t }\n \t $cnt4++;\n \t } while (true);\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop5;\n }\n } while (true);\n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function process($token){\n if($token !== RANDOM_TOKEN)\n return 'false';\n \n app('App\\Commands\\CommandParsers\\CommandParser')->processUpdates(true);\n //$update = $telegram->getWebhookUpdates();\n //$update = $telegram->commandsHandler(true);\n \n // Commands handler method returns an Update object.\n // So you can further process $update object \n // to however you want.\n\t\n return 'ok';\n\n }", "public function getTokens();", "public function parsePayload()\n {\n $_MTI_url = 'http://ii.nlm.nih.gov/cgi-bin/II/Interactive/interactiveMTI.pl'; \n $dom = new DOMDocument;\n $fields = array('InputText' => urlencode($this->_payload));\n\n $curl_ressource = curl_init();\n \n curl_setopt($curl_ressource,CURLOPT_URL, $_MTI_url);\n curl_setopt($curl_ressource,CURLOPT_POST, count($fields));\n curl_setopt($curl_ressource,CURLOPT_POSTFIELDS, $fields);\n curl_setopt($curl_ressource, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($curl_ressource, CURLOPT_TIMEOUT, 40);\n \n // Parses result html to extract MTI semantical parser results\n $dom->loadHTML(curl_exec($curl_ressource));\n $pres = $dom->getElementsByTagName('pre');\n \n foreach($pres as $pre)\n if(strstr($pre->nodeValue,\"Command: MTI\"))\n {\n $array = explode(\"\\n\", $pre->nodeValue);\n array_shift($array);\n array_shift($array);\n array_shift($array);\n array_shift($array);\n $result = implode(\"\\n\", $array); \n $this->_parsed_payload = $result; \n }\n \n curl_close($curl_ressource);\n \n return $result;\n }", "public function parseRequest($message);", "#[Pure]\nfunction http_parse_message($message) {}", "protected function parseWatsonMessage($message)\n {\n return $message;\n }", "public static function extractMsg (string $msg) : string {\n\t\tif (($pos = strpos ($msg, ':')) === false || ($command = \\DataLib::isInt (substr ($msg, 0, $pos))) === false || !Command::isCommand ($command)) {\n\t\t\treturn '';\n\t\t}\n\t\treturn substr ($msg, $pos + 1);\n\t}", "function filtrarMensage($msg) {\n $INI = strpos($msg, '<?xml');\n $FIN = strpos($msg, ':Envelope>');\n return substr($msg, $INI, ($FIN + strlen(':Envelope>')) - $INI);\n }", "public function testMessageNormalizationWithTokenTranslation()\n {\n $message = 'Parse error: unexpected T_FILE, expecting T_STRING in test.php on line 2';\n $expected = 'Unexpected __FILE__ (T_FILE), expecting T_STRING';\n\n $error = new SyntaxError('test.php', $message);\n $this->assertSame($expected, $error->getNormalizedMessage(true));\n }", "public function extractMessage($object);", "private function _Parsing_Translation1($matches)\n {\n return Zero_I18n::View($matches[1], Zero_App::$Config->Site_Language);\n }", "public static function decomposeMsg (string $msg) : array {\n\t\tif (($pos = strpos ($msg, ':')) === false || ($command = \\DataLib::isInt (substr ($msg, 0, $pos))) === false || !Command::isCommand ($command)) {\n\t\t\treturn [ Command::INVALID ];\n\t\t}\n\t\treturn [\n\t\t\t$command,\n\t\t\tjson_decode (substr ($msg, $pos + 1), true)\n\t\t];\n\t}", "private function translation_callback($matches) {\r\n\t\treturn $this->pi_getLL($matches[1], 'no translation found');\r\n\t}", "public function decodeJWE($tokenString)\n {\n $result = Loader::load($tokenString);\n $decrypter = DecrypterFactory::createDecrypter(['A256CBC-HS512','RSA-OAEP-256']);\n $decrypter->decryptUsingKeySet($result, $this->keys);\n return $result->getPayload();\n }", "private function parseMessage() {\n\n\t\t# Regexp to parse a formatted message\n\t\t# The message should come in format of\n\t\t# :(.*)\\!(.*)\\@(.*) PRIVMSG #channelname \\:(.*) for regular chatter\n\t\t# thus returning nickname, realname, hostmask, (command, arguments) || (botname: command (arguments)) || (chatter)\n\t\t$matched = false;\n\n # Try to match against the bots name!\n # This could mean it is a direct message in chan followed by a command request\n if(!$matched) {\n $pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:('.$this->config['username'].')\\:(?: +)?([^\\s]*) (.*)/';\n preg_match($pattern, $this->inbound, $matches);\n if(count($matches) > 1) {\n $matched = true;\n $this->lastMessage = array(\n 'nickname' => $matches[1],\n 'realname' => $matches[2],\n 'hostname' => $matches[3],\n 'command' => $matches[5],\n 'args' => rtrim($matches[6],\"\\n\\r\"),\n 'chatter' => ''\n );\n # Have to match a case whereby a command of 'botname: command' with no args is provided (for help)\n # If this case occurs we have to do some arg movement otherwise the command parser won't get a hit\n if($this->lastMessage['args'] != \"\" && $this->lastMessage['command'] == '') {\n $this->lastMessage['command'] = $this->lastMessage['args'];\n $this->lastMessage['args'] = \"\";\n }\n }\n }\n\n\t\tif(!$matched) {\n\t\t\t$pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:(.*)/';\n\t\t\tpreg_match($pattern, $this->inbound, $matches);\n\t\t\tif(count($matches) > 1) {\n\t\t\t\t$this->lastMessage = array(\n\t\t\t\t\t'nickname' => $matches[1],\n\t\t\t\t\t'realname' => $matches[2],\n\t\t\t\t\t'hostname' => $matches[3],\n\t\t\t\t\t'command' => '',\n\t\t\t\t\t'args' => '',\n\t\t\t\t\t'chatter' => rtrim($matches[4],\"\\n\\r\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function get_transarmor_token() {\n\n\t\treturn $this->transarmor_token;\n\t}", "public function translate();", "private function parseTranslateInvokes($file_path) {\n $tokens = \\token_get_all(\\file_get_contents(APP_DIR . \"/\" . $file_path));\n // Declare iteration variables.\n $translate_invokes = array();\n $line = 0;\n $token = null;\n $token_type = null;\n $ignore_next_string = false;\n $function_started = false;\n $pending_arguments = 0;\n $arguments = array();\n $pending_function = null;\n foreach ($tokens as $token_data) {\n $expected = false;\n if (!is_array($token_data))\n $token = $token_type = $token_data;\n else\n list($token_type, $token, $line) = $token_data;\n switch ($token_type) {\n case \"(\":\n if ($function_started || $pending_arguments == 0)\n break;\n $function_started = true;\n $expected = true;\n break;\n case \",\":\n case \\T_WHITESPACE:\n case \\T_COMMENT:\n case \\T_DOC_COMMENT:\n $expected = true;\n break;\n case \\T_FUNCTION:\n case \\T_CLASS:\n $ignore_next_string = true;\n break;\n case \\T_CONSTANT_ENCAPSED_STRING:\n if (!$function_started)\n break;\n $arguments[] = eval(\"return $token;\");\n $pending_arguments--;\n $reference = \"$file_path:$line\";\n if ($pending_arguments == 0) {\n switch ($pending_function) {\n case \"gettext\":\n $translate_invokes[] = array($arguments[0], \"\", \"\", $reference);\n break;\n case \"ngettext\":\n $translate_invokes[] = array($arguments[0], $arguments[1], \"\", $reference);\n break;\n case \"pgettext\":\n $translate_invokes[] = array($arguments[1], \"\", $arguments[0], $reference);\n break;\n }\n $function_started = false;\n $arguments = array();\n }\n $expected = true;\n break;\n case \\T_STRING:\n if ($ignore_next_string) {\n $ignore_next_string = false;\n break;\n } else if ($pending_arguments > 0)\n break;\n if ($token[0] == \"\\\\\")\n $token = \\substr($token, 1);\n if ($token == \"__\" || $token == \"_\" || $token == \"gettext\") {\n $pending_arguments = 1;\n $pending_function = \"gettext\";\n $expected = true;\n } else if ($token == \"ngettext\" || $token == \"jsngettext\") {\n $pending_arguments = 2;\n $pending_function = \"ngettext\";\n $expected = true;\n } else if ($token == \"pgettext\") {\n $pending_arguments = 2;\n $pending_function = \"pgettext\";\n $expected = true;\n }\n break;\n }\n if (!$expected && $pending_arguments > 0)\n trigger_error(\"Error when when updating translation at $file_path:$line.\\n\"\n . \"Expected literal string expression (T_CONSTANT_ENCAPSED_STRING) in translation invoke. Found: \" . (is_integer($token_type)? \\token_name($token_type): $token), \\E_USER_ERROR);\n }\n return $translate_invokes;\n }", "public function parse(array &$tokens) {\n\t\t$token = current($tokens);\n\t\t$this->content = substr($token['value'], 4, -3);\n\t}", "function read($token);", "public function injectParser($message) {\n global $mybb, $post;\n \n if (THIS_SCRIPT == 'showthread.php' \n && $mybb->user['uid'] > 0 \n && $mybb->settings['fastQuoteStatus']\n ) {\n self::$posts[$post['pid']] = htmlspecialchars($post['message']);\n }\n \n return $message;\n }", "function ParseMsg($msg) {\n\t$parts = explode(\"&\",$msg);\n\t$result = array();\n\tforeach($parts as $i => $value) {\n\t\t$bits = explode(\"=\", $value, 2);\n\t\t$result[$bits[0]] = urldecode($bits[1]);\n\t}\n\n\treturn $result;\n}", "private function messageFrom($response)\n {\n return $response['Message'];\n }", "function getMessage($msgid)\n{\n\tglobal $lang;\n\n\t$message = \\dal\\messages\\getMessage($msgid, 'recipient');\n\n\tif ($message)\n\t{\n\t\t$message['sender'] = \\bl\\general\\uid2nick($message['uid_sender']);\n\t\t$messageDate = \\DWDateTime::createFromFormat('Y-m-d H:i:s', $message['create_datetime']);\n\t\t$message['sentDate'] = $messageDate->format($lang['messageTimeFormat']);\n\t}\n\n\t$parser = new \\bl\\wikiParser\\WikiParser();\n\t$message['message'] = preg_replace('#(\\\\\\\\r\\\\\\\\n|\\\\\\\\\\\\\\\\r\\\\\\\\\\\\\\\\n|\\\\\\\\n|\\\\\\\\\\\\\\\\n)#', \"\\r\\n\", $message['message']);\n\t$message['message'] = $parser->parseIt($message['message']);\n\n\treturn $message;\n}", "function translate($message, $count = NULL);", "public function decode($challenge_message);", "private function _Parsing_Translation2($matches)\n {\n return Zero_I18n::View($matches[1], $matches[2]);\n }", "public function getMessageText() {\n\treturn ($this->messageText);\n}", "public function parseResponse($message);", "abstract public function token();", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function getTranslatedMessage(): string\n\t{\n\t\tif(self::$resolver === null)\n\t\t{\n\t\t\tself::$resolver = new DefaultMessageResolver();\n\t\t}\n\t\t\n\t\treturn self::$resolver->resolveMessage($this->name, $this->key, $this->args);\n\t}", "abstract public function get_message();", "private static function _getText()\n {\n return geoAddon::getText('geo_addons', 'tokens');\n }", "protected function getTranslation()\n {\n $language = $this->request->getBestLanguage();\n\n // Check if we have a translation file for that lang\n // TODO 处理英文\n if (file_exists(APP_PATH . \"/app/messages/\" . $language . \".php\")) {\n require_once APP_PATH. '/app/messages/'. $language . \".php\";\n } else {\n require_once APP_PATH. '/app/messages/zh-CN.php';\n // Fallback to some default\n// require \"../messages/en.php\";\n }\n\n // Return a translation object\n return new NativeArray(\n array(\n \"content\" => $messages\n )\n );\n }", "function tokenText($str)\n{\n $matches = preg_split(\"/\\;\\s*\\\\$/uism\", $str);\n $object = array();\n foreach ($matches as $match) {\n preg_match(\"/\\\\$?(\\w+)\\:(.*)/uism\", trim($match), $_matches);\n $object[$_matches[1]] = rtrim($_matches[2], \";\");\n }\n return $object;\n}", "public static function parseGettextData( $data, $useCtxtAsKey = false, $mangler ) {\n\t\t$potmode = false;\n\n\t\t// Normalise newlines, to make processing easier\n\t\t$data = str_replace( \"\\r\\n\", \"\\n\", $data );\n\n\t\t/* Delimit the file into sections, which are separated by two newlines.\n\t\t * We are permissive and accept more than two. This parsing method isn't\n\t\t * efficient wrt memory, but was easy to implement */\n\t\t$sections = preg_split( '/\\n{2,}/', $data );\n\n\t\t/* First one isn't an actual message. We'll handle it specially below */\n\t\t$headerSection = array_shift( $sections );\n\t\t/* Since this is the header section, we are only interested in the tags\n\t\t * and msgid is empty. Somewhere we should extract the header comments\n\t\t * too */\n\t\t$match = self::expectKeyword( 'msgstr', $headerSection );\n\t\tif ( $match !== null ) {\n\t\t\t$headerBlock = self::formatForWiki( $match, 'trim' );\n\t\t\t$headers = self::parseHeaderTags( $headerBlock );\n\n\t\t\t// Check for pot-mode by checking if the header is fuzzy\n\t\t\t$flags = self::parseFlags( $headerSection );\n\t\t\tif ( in_array( 'fuzzy', $flags, true ) ) {\n\t\t\t\t$potmode = true;\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new MWException( \"Gettext file header was not found:\\n\\n$data\" );\n\t\t}\n\n\t\t$template = array();\n\t\t$messages = array();\n\n\t\t// Extract some metadata from headers for easier use\n\t\t$metadata = array();\n\t\tif ( isset( $headers['X-Language-Code'] ) ) {\n\t\t\t$metadata['code'] = $headers['X-Language-Code'];\n\t\t}\n\n\t\tif ( isset( $headers['X-Message-Group'] ) ) {\n\t\t\t$metadata['group'] = $headers['X-Message-Group'];\n\t\t}\n\n\t\t/* At this stage we are only interested how many plurals forms we should\n\t\t * be expecting when parsing the rest of this file. */\n\t\t$pluralCount = false;\n\t\tif ( isset( $headers['Plural-Forms'] ) ) {\n\t\t\tif ( preg_match( '/nplurals=([0-9]+).*;/', $headers['Plural-Forms'], $matches ) ) {\n\t\t\t\t$pluralCount = $metadata['plural'] = $matches[1];\n\t\t\t}\n\t\t}\n\n\t\t// Then parse the messages\n\t\tforeach ( $sections as $section ) {\n\t\t\tself::parseGettextSection(\n\t\t\t\t$section,\n\t\t\t\t$useCtxtAsKey,\n\t\t\t\t$pluralCount,\n\t\t\t\t$mangler,\n\t\t\t\t$potmode,\n\t\t\t\t$messages,\n\t\t\t\t$template,\n\t\t\t\t$metadata\n\t\t\t);\n\t\t}\n\n\t\treturn array(\n\t\t\t'MESSAGES' => $messages,\n\t\t\t'TEMPLATE' => $template,\n\t\t\t'METADATA' => $metadata,\n\t\t\t'HEADERS' => $headers\n\t\t);\n\t}", "private function getCurrentToken() {\n\t\tif(isset($_GET) && isset($_GET['token'])) {\n\t\t\t$sToken = $_GET['token'];\n\t\t} else {\n\t\t\techo $this->_translator->error_token;\n\t\t\texit();\n\t\t}\n\t\treturn $sToken;\n\t}", "protected function extractCipherText($payload)\n {\n return mb_substr($payload, $this->getNonceLength(), mb_strlen($payload, '8bit'), '8bit');\n }", "public static function extract(string $token) : ?array\n {\n $dataEncoded = Crypt::decrypt($token);\n\n if ($dataEncoded === null) {\n\n return null;\n }\n\n return JSON::decode($dataEncoded) ?? null;\n }", "public function responseMsg()\r\n\t{\r\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\r\n\r\n\t\t//extract post data\r\n\t\tif (!empty($postStr)){\r\n\t\t\t\t\r\n\t\t\t\t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\r\n\t\t\t\t$fromUsername = $postObj->FromUserName;\r\n\t\t\t\t$toUsername = $postObj->ToUserName;\r\n\t\t\t\t$keyword = trim($postObj->Content);\r\n\t\t\t\t$time = time();\r\n\r\n\t\t\t\t/*文字回复*/\r\n\t\t\t\t$textTpl = \"<xml>\r\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\r\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\r\n\t\t\t\t\t\t\t</xml>\"; \r\n\r\n\t\t\t\t/*图文回复*/\r\n\t\t\t\t$itemTpl = \"<xml>\r\n\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t<ArticleCount>1</ArticleCount>\r\n\t\t\t\t\t\t<Articles>\r\n\t\t\t\t\t\t<item>\r\n\t\t\t\t\t\t<Title><![CDATA[%s]]></Title> \r\n\t\t\t\t\t\t<Description><![CDATA[%s]]></Description>\r\n\t\t\t\t\t\t<PicUrl><![CDATA[%s]]></PicUrl>\r\n\t\t\t\t\t\t<Url><![CDATA[%s]]></Url>\r\n\t\t\t\t\t\t</item>\r\n\t\t\t\t\t\t</Articles>\r\n\t\t\t\t\t\t</xml>\";\r\n\r\n\r\n\r\n\t\t\t\tif(!empty( $keyword )){\r\n\t\t\t\t\t$keyworde = $this -> FindKeyword($keyword,$fromUsername);\r\n\t\t\t\t\tswitch ($keyworde) {\r\n\t\t\t\t\t\tcase '红包':\r\n\t\t\t\t\t\t\t// $msgType = \"news\";\r\n\t\t\t\t\t\t\t// $contentStr = \"恭喜你获得一个红包!\";\r\n\t\t\t\t\t\t\t// $contentStr2 = \"点击图片领取你的红包!\";\r\n\t\t\t\t\t\t\t// // $PicUrl = \"http://imgsrc.baidu.com/forum/w%3D580/sign=6926f2cad488d43ff0a991fa4d1fd2aa/3e8ad5dcd100baa1583412044510b912c9fc2ea8.jpg\";\r\n\t\t\t\t\t\t\t// $url = \"http://i.shuilaile.com/index.php?s=/Home/Get/pay/openid/\".$fromUsername.\"/code/\".$keyword.\".html\";\r\n\t\t\t\t\t\t\t// $resultStr = sprintf($itemTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr, $contentStr2, $PicUrl, $url);\r\n\t\t\t\t\t\t\t// echo $resultStr;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//执行发红包\r\n\t\t\t\t\t\t\t$this -> pay($fromUsername,$keyword);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t$msgType = \"text\";\r\n\t\t\t\t\t\t\t$contentStr = $keyworde;\r\n\t\t\t\t\t\t\t// $contentStr = \"Welcome to wechat world!\";\r\n\t\t\t\t\t\t\t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\r\n\t\t\t\t\t\t\techo $resultStr;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo \"Input something...\";\r\n\t\t\t\t}\r\n\r\n\t\t}else {\r\n\t\t\techo \"\";\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "function translate_raw_string ( $raw ) {\n\t\t$res = $this->bt->translate ( $raw );\n\t\t$res = $this->code_to_utf8( $res );\n\t\t$res = $this->import_utf8_string( $res );\n\t\treturn $res;\n\t}", "protected function parseMessage($messageText)\n {\n\n $lines = explode(PHP_EOL, $messageText);\n\n // [*17-Aug-2010 13:57:24*] PHP Notice: Undefined variable...\n $time = substr($lines[0], 1, 20);\n $data = array();\n\n // [17-Aug-2010 13:57:24] PHP Notice*:* Undefined variable...\n $typeEndPos = strpos($lines[0], ':', 27);\n // [17-Aug-2010 13:57:24] PHP *Notice*: Undefined variable...\n $type = substr($lines[0], 27, $typeEndPos - 27);\n // [17-Aug-2010 13:57:24] PHP Notice: *Undefined variable...*\n $text = substr($lines[0], $typeEndPos + 2);\n\n // $lines[1] == 'Stack trace:'\n $stackTrace = '';\n $i = 2;\n do {\n $stackTrace .= $lines[$i] . PHP_EOL;\n $i++;\n } while ( strncasecmp('Url:', $lines[$i], 4) !== 0 );\n\n // Url: http://localhost/tlumoceni-preklady.cz/portal/tlumoceni-preklady.cz/htdocs/\tReferer: unknown\n list($url, $referer, $ip) = explode(\"\\t\", $lines[$i]);\n $url = substr($url, 5);\n $referer = substr($referer, 9);\n $ip = substr($ip, 4);\n $key = md5($type . $text);\n\n return new Message(array(\n 'time' => $time,\n 'type' => $type,\n 'text' => $text,\n 'key' => $key,\n 'stackTrace' => $stackTrace,\n 'url' => $url,\n 'referer' => $referer,\n 'ip' => $ip\n ));\n }", "function initlab_section_mailman_token_callback($args) {\n ?>\n <p><?php _e('Please input the correct settings so the [initlab_mailman_token] shortcode can operate properly.', 'initlab-addons'); ?></p>\n <?php\n}", "private function parse(string $error, array $context): string\n {\n return $this->getTranslator()->translate($error, $context, null);\n }", "public function messages()\n {\n $pieces = explode('\\\\', __CLASS__);\n $pack = mb_strtolower($pieces[1]);\n // dddx($pieces);\n $pieces = \\array_slice($pieces, 3);\n $pieces = collect($pieces)->map(\n function ($item) {\n return snake_case($item);\n }\n )->all();\n $trad_name = $pack.'::'.implode('.', $pieces);\n $trad = trans($trad_name);\n if (! \\is_array($trad)) {\n // dddx($trad_name.' is not an array');\n $trad = [];\n }\n $tradGeneric = trans('ui::generic'); // deve funzionare anche senza il pacchetto \"food\", invece \"extend\" e' un pacchetto primario\n if (! \\is_array($tradGeneric)) {\n $tradGeneric = [];\n }\n $trad = array_merge($tradGeneric, $trad);\n\n return $trad;\n }", "function decode_token ($token) {\n return JWT::decode($token, $this->server_key, array('HS256'));\n }", "public function get_token() {\n\t\treturn $this->token;\n\t}", "private function _process_token($token)\n\t{\n\t\t//check string format? Xyz.Xyz?\n\t\tif(is_string($token) && preg_match('#^[A-Z][a-z]*(?:\\.[A-Z][a-z]*)*$#', $token)) {\n\t\t\t$token = Token::getToken($token);\n\t\t}\n\t\t\n\t\tif(!(($token instanceof \\Phygments\\_TokenType) || is_callable($token))) {\n\t\t\tthrow new \\Exception(sprintf('token type must be simple type or callable, not %s', gettype($token)));\n\t\t}\n\n\t\t/*\n assert type(token) is _TokenType or callable(token), \\\n 'token type must be simple type or callable, not %r' % (token,)\n\t\t*/\n return $token;\n\t}", "function getToken($thisString) {\n\n\n\n // List the possible tokens\n\n $Tokens = array(\n\n \"Status\",\n\n \"StatusDetail\",\n\n \"VendorTxCode\",\n\n \"VPSTxId\",\n\n \"TxAuthNo\",\n\n \"Amount\",\n\n \"AVSCV2\", \n\n \"AddressResult\", \n\n \"PostCodeResult\", \n\n \"CV2Result\", \n\n \"GiftAid\", \n\n \"3DSecureStatus\", \n\n \"CAVV\" );\n\n\n\n // Initialise arrays\n\n $output = array();\n\n $resultArray = array();\n\n \n\n // Get the next token in the sequence\n\n for ($i = count($Tokens)-1; $i >= 0 ; $i--){\n\n // Find the position in the string\n\n $start = strpos($thisString, $Tokens[$i]);\n\n // If it's present\n\n if ($start !== false){\n\n // Record position and token name\n\n $resultArray[$i]->start = $start;\n\n $resultArray[$i]->token = $Tokens[$i];\n\n }\n\n }\n\n \n\n // Sort in order of position\n\n sort($resultArray);\n\n\n\n // Go through the result array, getting the token values\n\n for ($i = 0; $i<count($resultArray); $i++){\n\n // Get the start point of the value\n\n $valueStart = $resultArray[$i]->start + strlen($resultArray[$i]->token) + 1;\n\n // Get the length of the value\n\n if ($i==(count($resultArray)-1)) {\n\n $output[$resultArray[$i]->token] = substr($thisString, $valueStart);\n\n } else {\n\n $valueLength = $resultArray[$i+1]->start - $resultArray[$i]->start - strlen($resultArray[$i]->token) - 2;\n\n $output[$resultArray[$i]->token] = substr($thisString, $valueStart, $valueLength);\n\n } \n\n\n\n }\n\n\n\n // Return the ouput array\n\n return $output;\n\n\n\n}", "public function get_message() {\n return \"Add APNs Token test\";\n }", "protected function responseMsg()\n {\n $postStr = file_get_contents('php://input', 'r');\n\n //extract post data\n if (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if(!empty( $keyword ))\n {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }\n }", "protected function extractPayload($message, $headers) \n\t{\n\t\t$offset = 2;\n\n\t\tif ( $headers['hasmask'] )\n\t\t\t$offset += 4;\n\n\t\tif ( $headers['length'] > 65535 )\n\t\t\t$offset += 8;\n\t\telseif ( $headers['length'] > 125 )\n\t\t\t$offset += 2;\n\n\t\treturn substr($message,$offset);\n\t}", "function training_token_callback() {\n global $user;\n $task_object = (object) array(\n 'id' => 1,\n 'uid' => 1,\n 'name' => '<b>Admin</b>',\n );\n $data = array(\n 'task' => $task_object,\n 'user' => $user,\n );\n $pattern = 'Some text [task:uid:name] of [user:name].';\n $output = token_replace($pattern, $data);\n //$output .= drupal_get_form('training_token_form');\n drupal_mail('training', 'some_key_' . $user->uid, '[email protected]', language_default());\n\n return array(\n array(\n '#type' => 'markup',\n '#markup' => $output,\n ),\n );\n}", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n \t//extract post data\n\t\tif (!empty($postStr))\n { \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $msgType = $postObj->MsgType;\n \n $time = time();\n \n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\";\n \n if($msgType == \"text\")\n {\n \t/*\n $keyword = trim($postObj->Content);\n\t\t\t\t\n\t\t\t\t\n $msgType = \"text\";\n \n $contentStr = $keyword;\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n\t\t\t\t * \n\t\t\t\t */\n }\n else if($msgType == \"event\")\n {\n $event = $postObj->Event;\n if($event == \"subscribe\")\n {\n $msgType = \"text\";\n \n $contentStr = \"你好,欢迎你的关注!\";\n \n \n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }\n\t\t\t\telse if($event == \"CLICK\")\n\t\t\t\t{\n\t\t\t\t\t$eventKey = $postObj->EventKey;\n\t\t\t\t\t\n\t\t\t\t\tif($eventKey == \"VK_RECENT\")\n\t { \n\t \n\t $query = \"select `id`, `post_title`, `post_content`\n\t from `wp_posts`\n\t where `post_status` like 'publish' and `post_type` like 'post'\n\t order by `post_date` desc\n\t limit 0, 5\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t$sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"近期文章:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= '「<a href=\"'. SITE . '/?p=' . $row['id'] . '\">';\n\t\t $strTitle .= $row['post_title'];\n\t\t $strTitle .= \"</a>」\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\n\t \n\t }\n\t else if($eventKey == \"VK_DATE\")\n\t {\n\t $query = \"select year(`post_date`), month(`post_date`), extract(year_month from(`post_date`)), count(extract(year_month from(`post_date`))) \n\t from `wp_posts`\n\t where `post_status` like 'publish' and `post_type` like 'post' \n\t group by extract(year_month from(`post_date`))\n\t order by extract(year_month from(`post_date`)) desc\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"文章归档:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?m=' . $row['extract(year_month from(`post_date`))'] . '\">';\n\t\t $strTitle .= $row['year(`post_date`)'] . \"年\".\n\t\t chineseMonth($row['month(`post_date`)']) . \"月\";\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count(extract(year_month from(`post_date`)))']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t \t}\n\t \n\t }\n\t else if($eventKey == \"VK_CATEGORY\")\n\t {\n\t \t$query = \"select `wp_terms`.`term_id`, `wp_terms`.`name`, `wp_term_taxonomy`.`count`\n\t from `wp_terms`, `wp_term_taxonomy`\n\t where `wp_term_taxonomy`.`taxonomy` like 'category' and `wp_term_taxonomy`.`count` != 0\n\t and `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id`\";\n\t \n\t \n\t $sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"分类目录:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?cat=' . $row['term_id'] . '\">';\n\t\t $strTitle .= $row['name'];\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t} \n\t }\n\t else if($eventKey == \"VK_TAG\")\n\t {\n\t $query = \"select `wp_terms`.`slug`, `wp_terms`.`name`, `wp_term_taxonomy`.`count`\n\t from `wp_terms`, `wp_term_taxonomy`\n\t where `wp_term_taxonomy`.`taxonomy` like 'post_tag' and `wp_term_taxonomy`.`count` != 0\n\t and `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id`\";\n\t \n\t \n\t $sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"标签列表:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?tag=' . $row['slug'] . '\">';\n\t\t $strTitle .= $row['name'];\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t }\t\t\t\t\t\n\t\t\t\t}\n }\n\n }\n else\n {\n \techo \"\";\n \texit;\n }\n }", "public function parsePayload()\n { \n return $this->_payload;\n }", "public static function getMessage() {\n return unserialize($_COOKIE[self::$_name]);\n }", "protected function expect($token, $message = null)\n {\n $result = $this->match($token);\n if (!$result) {\n $excerpt = substr($this->input, $this->position, strpos($this->input, \"\\n\", $this->position) - $this->position);\n throw new ILess_Exception_Parser(\n $message ? $message :\n sprintf('Error parsing the string. Expected \"%s\", but got \"%s\" near `%s`', $token,\n $this->input[$this->position], $excerpt),\n null, $this->position, $this->env->currentFileInfo);\n } else {\n return $result;\n }\n }", "protected function _getNextToken() {}", "protected function _getNextToken() {}", "protected function unwrap($msg,$bytes){ return substr($msg,1,$bytes-2); }", "function ppmess_shortcode_all_messages(){\n\t\n\tglobal $post;\n\t\n\t$url_page = get_permalink($post);\n\t$current_user = wp_get_current_user();\n\t\n\tif(isset($_GET['message_id']) && isset($_GET['post_id']) && isset($_GET['token_single_commun']))\n\t\t$token = md5(SALT_SINGLE_COMMUN_PPMESS . $_GET['message_id'] . $_GET['post_id'] . $current_user->ID );\n\telse\n\t\treturn array('errors' => 'isset_fail');\n\t\n\tif( ! ($token == $_GET['token_single_commun']) ){\n\t\treturn array('errors' => 'token_fail');\n\t}\n\t\n\t$message_id = intval($_GET['message_id']);\n\t$post_id = intval($_GET['post_id']);\n\t\n\tif( ! ppmess_user_legality($message_id, $post_id, $current_user->ID)){\n\t\treturn array('errors' => 'user_legality_fail');\n\t}\n\t\n\t$user2_id = ppmess_get_user2($message_id, $post_id, $current_user->ID);\n\t$user2_info = get_userdata($user2_id);\n\t\n\t$messages = ppmess_get_all_messages($message_id, $post_id);\t// FALSE or Array\n\t\n\tppmess_change_commun_status($message_id, $post_id, $current_user->ID);\n\t\n\t$post_info = get_post($post_id);\n\t\n\tif( ! empty($post_info->post_title) )\n\t\t$post_title = $post_info->post_title;\n\telse\n\t\t$post_title = $messages[0]['post_name'];\n\t\t\t\n\t$data = array(\n\t\t'user_id'\t\t=>\t!empty($current_user) ? $current_user->ID : '',\n\t\t'user_login'\t=>\t!empty($current_user) ? $current_user->user_login : '',\n\t\t'message_id'\t=> \tisset($message_id) ? $message_id : '',\n\t\t'post_id'\t\t=>\tisset($post_id) ? $post_id : '',\n\t\t'user2_id'\t\t=>\t!empty($user2_info) ? $user2_info->ID : '',\n\t\t'user2_login'\t=>\t!empty($user2_info) ? $user2_info->user_login : '',\n\t\t'post_title'\t=>\t!empty($post_title) ? $post_title : '',\n\t\t'post_status'\t=> !empty($post_info->post_status) && $post_info->post_status == 'publish' ? TRUE : FALSE,\n\t\t'post_author'\t=>\t!empty($post_info->post_author) ? $post_info->post_author : '',\n\t\t'page_url'\t\t=>\tesc_url($url_page),\n\t\t'messages'\t\t=>\t$messages // FALSE or array\n\t);\n\t\t\n\treturn $data;\n}", "public function translated();", "public function translated();", "function extractMessageArray($line)\r\n{\r\n\t$linearray = explode('||', $line);\r\n\r\n\t// Snag the unix timestamp and perform some date calculations\r\n\t$datetime = array_shift($linearray);\r\n\r\n\t// Time elapsed (e.g. 1.5 hours, 4 days, etc.)\r\n\t$age = duration_str(time() - $datetime, false, 2);\r\n\r\n\t// Long format date\r\n $date_full = date(\"l, d F Y\", $datetime);\r\n\r\n // Short format date\r\n $date = date('m/d/Y', $datetime);\r\n\r\n // Time of day\r\n $time = date('H:i', $datetime);\r\n\r\n // Day of week\r\n $day = date('l', $datetime);\r\n\r\n\t// Hour\r\n\t$hour = date('H', $datetime);\r\n\r\n // Next snag the name\r\n $name = array_shift($linearray);\r\n\r\n\t// Check for action or system notice\r\n\t$action = ($name{0} == '*') ? true : false;\r\n\t$notice = ($name{0} == '!') ? true : false;\r\n\r\n\tif ($action || $notice)\r\n\t\t$name = mb_substr($name, 1);\r\n\r\n\t// Now put the post back together\r\n\t$words = trim(implode(' ', $linearray));\r\n\r\n\t// return this mess of info\r\n\treturn array\r\n\t(\r\n\t\t'timestamp' => $datetime,\r\n\t\t'date_full' => $date_full,\r\n\t\t'date' => $date,\r\n\t\t'time' => $time,\r\n\t\t'day' => $day,\r\n\t\t'hour' => $hour,\r\n\t\t'age' => $age,\r\n\t\t'action' => $action,\r\n\t\t'notice' => $notice,\r\n\t\t'name' => $name,\r\n\t\t'text' => $words\r\n\t);\r\n}", "protected function _readTokens($matches)\n {\n return array_shift($this->_tokens);\n }", "public function ReadToken($token) {\r\n\t\t$sql = \"\r\n\t\tSELECT * FROM redefinicao_senha WHERE = '$token'\";\t\t\r\n\t\t\r\n\t\t$DB = new DB();\r\n\t\t$DB->open();\r\n\t\t$Data = $DB->fetchData($sql);\r\n\t\t\r\n\t\t$DB->close();\r\n\t\treturn $Data[0]; \r\n\t}", "public function get_messages() {\n\t\t$messages = $this->_read_messages();\n\t\t$this->clear_messages();\n\t\treturn apply_filters( 'tn_get_messages', $messages );\t\n\t}", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getTokenParsers();", "public function receiveToken() {\n\n\t\t$parseToken = ($this->JWTParser);\n\t\t$TokenObject = $parseToken->parse($this->Token);\n\n\t\t$this->setTokenObject($TokenObject);\n\t}", "private static function parse($token)\n {\n return (new Parser())->parse((string)$token);\n }", "function get_token(){\n global $token;\n global $identifier;\n global $array_stream;\n global $key_val;\n global $keywords;\n\n global $c_commentary;\n\n $token_end = True;\n $token_type = tokenType::start;\n init_token();\n\n while($token_end){\n /**\n * @warning end of Array works only for PHP7.3!!!!\n */\n if($key_val === array_key_last($array_stream)){\n $token->last = False;\n if($token->data !== PHP_EOL){\n $token->type = tokenType::EOL;\n $token_end = False;\n }\n }\n /* State automaton for lexical analysis combined with usage of regular expressions */\n switch ($token_type) {\n case tokenType::start:\n {\n if($array_stream[$key_val] === \".\"){ //header dection\n $token_type = tokenType::header;\n break;\n }\n elseif($array_stream[$key_val] === \"@\"){ //at mark detected\n $token->data = $array_stream[$key_val];\n $token->type = tokenType::marker;\n identify_operand();\n preset_label();\n $key_val++;\n $token_end = False;\n break;\n }\n elseif($array_stream[$key_val] === \"#\"){ //start of commentary\n $token_type = tokenType::commentary;\n break;\n }\n elseif($array_stream[$key_val] === PHP_EOL){ //EOL detected\n $token_type = tokenType::EOL;\n break;\n }\n elseif($array_stream[$key_val] === \"\\t\" || $array_stream[$key_val] === \" \"){ //white spaces before instruction/commentary\n $key_val++;\n preset_identifier();\n }\n elseif(ctype_alpha($array_stream[$key_val]) || ctype_digit($array_stream[$key_val]) || preg_match(\"/^_|\\-|\\$|&|%|\\*|!|\\?$/\", $array_stream[$key_val])){ //var/string/int catch\n $token_type = tokenType::charStream;\n break;\n }\n else {\n fwrite(STDERR, \"ERROR : Input doesn't start with .IPPcode19 header\\n\");\n exit(21);#appropriate exit code\n }\n break;\n }\n case tokenType::header:\n {\n /* Load header in loop, until new line space or commentary right after header */\n while(1){\n if($array_stream[$key_val] === PHP_EOL || preg_match(\"/^[ \\t#]$/\",$array_stream[$key_val]) || $key_val === array_key_last($array_stream)){\n if(preg_match(\"/^.ippcode19$/\", strtolower($token->data))){\n $token->type = tokenType::header;\n $token_end = False;\n break;\n }\n else {\n fwrite(STDERR,\"ERROR : Innapropriate header detected\\n\");\n exit(21);//no ippcode header;\n }\n }\n $token->data .= $array_stream[$key_val];\n $key_val++;\n }\n break;\n }\n /* Creates EOL token */\n case tokenType::EOL:\n {\n $token->data = $array_stream[$key_val];\n $token->type = tokenType::EOL;\n $key_val++;\n preset_identifier();\n preset_label();\n $token_end = False;\n break;\n }\n /* Catches commentary, all character are trimmed until EOL*/\n case tokenType::commentary:\n {\n while($array_stream[$key_val] !== PHP_EOL)\n {\n if($key_val === array_key_last($array_stream)) break;\n $key_val++;\n }\n $c_commentary++;\n $token_type = tokenType::EOL;\n break;\n }\n /* string/int or var stream stored into token */\n case tokenType::charStream:\n {\n while(1){\n if(preg_match(\"/^[ \\t@]$/\",$array_stream[$key_val])){\n $token_type = tokenType::identifyStream;\n break;\n }\n elseif($array_stream[$key_val] === PHP_EOL || $array_stream[$key_val] === \"#\"){ //read until newline or commentary start\n $token_type = tokenType::identifyStream;\n break;\n }\n elseif($key_val === array_key_last($array_stream)){ //read until EOF and add last character to token\n $token->data .= $array_stream[$key_val];\n $token_type = tokenType::identifyStream;\n break;\n }\n $token->data .= $array_stream[$key_val];\n $key_val++;\n }\n break;\n }\n case tokenType::identifyStream:\n {\n if(preg_match(\"/^[a-zA-Z_\\-\\$&%\\*!?][a-zA-Z_\\-\\$&%\\*!?0-9]*$/\", $token->data)){ //matching the identifier\n $token->type = tokenType::identifier;\n foreach ($keywords as $key => $value) { //searching for keyword\n $match_pattern = \"/\\b\" . \"$value\" . \"\\b/i\";\n if(preg_match($match_pattern, strtolower($token->data))){\n $token->type = $key + 110;\n if(preg_match(\"/^(bool)|(int)|(string)|(nil)|(gf)|(lf)|(tf)$/\", $token->data)){\n identify_operand();\n }\n break;\n }\n }\n isset_identif();\n $token_end = False;\n break;\n }\n if(preg_match(\"/^[+|-]?[0-9]*$/\", $token->data)){ //matching numbers //^[+|-]?[1-9][0-9]*|[+|-][0]|[0]$\n $token->type = tokenType::number;\n $token_end = False;\n break;\n }\n /* Match for string literal - all unicode numbers and escape sequences */\n elseif(preg_match(\"/^([\\x{0024}-\\x{005B}]|[\\x{0021}\\x{0022}]|[\\x{005D}-\\x{FFFF}]|[ěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮa-zA-Z0-9]|([\\\\\\\\][0-9]{3})?)*$/\", $token->data)){ //^([ěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮa-zA-Z0-9]|([\\\\\\\\][0-9]{3})?)*$\n $token->type = tokenType::stringStream;\n $token_end = False;\n }\n else {\n fwrite(STDERR,\"ERROR : LEX : detected lexical error in: $token->data\\n\");\n exit(23);\n }\n break;\n }\n\n default:\n break;\n }\n }\n }", "public function message()\n {\n return trans($this->message);\n }", "public function decodeJWES($tokenString)\n {\n $jws = $this->decodeJWE($tokenString);\n return $this->decodeJWS($jws);\n }", "public function parse(): array\n {\n // Text.\n if ($this->type === 'text') {\n return [\n 'text' => $this->message,\n ];\n }\n\n // Template.\n if ($this->type === 'template') {\n $payload = Arr::get($this->message, 'attachments.0.payload');\n\n // Generic template.\n if (Arr::get($payload, 'template_type') === 'generic') {\n return [\n 'generic' => $this->parseGenericTempalte($payload),\n ];\n }\n }\n\n // Image\n if ($this->type === 'image') {\n $payload = Arr::get($this->message, 'attachments.0.payload');\n return [\n 'image' => $this->parseImageAttachment($payload),\n ];\n }\n\n // This for unsupported messages.\n return [];\n }", "function parse(&$reader, &$ctxt)\r\n\t{\r\n\t\t$parser =& new PhaseParser($reader, $ctxt);\r\n\t\t$output = '';\r\n\t\t\r\n\t\t// NOTE: this method provides an easy way to setup the tag libraries\r\n\t\t$parser->loadTagLibraries();\r\n\r\n\t\twhile ($reader->hasMoreInput())\r\n\t\t{\r\n\t\t\t$output .= $parser->parseElements();\r\n\t\t}\r\n\r\n\t\t// tack on the tag functions, wrapping them in the namespace\r\n\t\t// for this phase context\r\n\t\tif (count($parser->tagFunctions))\r\n\t\t{\r\n\t\t\t$output .= \r\n\t\t\t'<?php' . \"\\n\" .\r\n\t\t\t'class ' . $parser->namespace . ' {' . \"\\n\" .\r\n\t\t\timplode(\"\\n\", array_reverse($parser->tagFunctions)) . \"\\n\" .\r\n\t\t\t'}' . \"\\n\" .\r\n\t\t\t'?>' . \"\\n\";\t\r\n\t\t}\r\n\r\n\t\t// merge sections where php tags have become adjacent (no need for them)\r\n\t\t$output = preg_replace('; *\\?><\\?php *;', ' ', $output);\r\n\r\n\t\treturn $output;\r\n\t}", "private function ParseMsg($msg) {\n\t\t$parts = explode(\"&\",$msg);\n\t\t$result = array();\n\t\tforeach($parts as $i => $value) {\n\t\t\t$bits = explode(\"=\", $value, 2);\n\t\t\t$result[$bits[0]] = urldecode($bits[1]);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getMessage()\n {\n $lastMsg = $this->getUpdates();\n if(count($lastMsg))\n {\n $lastMsg = $lastMsg[count($lastMsg) - 1];\n $this->currentChat = $lastMsg['message']['chat']['id'];\n $this->currentMsg = $lastMsg['message'];\n $this->currentMsgId = $lastMsg['message']['message_id'];\n $this->currentUser = $lastMsg['message']['from']['id'];\n $this->messageType = (isset($lastMsg['message']['contact'])) ? 'register' : 'text';\n $this->setLastUpdate($lastMsg['update_id'] + 1);\n }\n else\n {\n $this->currentMsg = array();\n }\n }", "private function getToken()\n {\n static $srcpos = 0; // current position in the source stream\n static $srclen; // the length of the source stream\n\n $statement = '';\n $token = null;\n if (empty($srclen)) {\n $srclen = strlen($this->source);\n }\n while (is_null($token) && $srcpos < $srclen) {\n $c = $this->source[$srcpos++];\n switch ($c) {\n case self::BEGIN_COMMENT:\n if (substr($this->source, $srcpos - 1, strlen(self::BEGIN_SL_COMMENT)) === self::BEGIN_SL_COMMENT) {\n $statement = self::BEGIN_SL_COMMENT;\n while ($this->source[$srcpos++] !== \"\\n\") {\n $statement .= $this->source[$srcpos];\n }\n $token = $this->createToken($statement);\n } elseif (substr($this->source, $srcpos - 1, strlen(self::BEGIN_ML_COMMENT))\n === self::BEGIN_ML_COMMENT) {\n if (ltrim($statement)) {\n throw new \\Exception('Invalid comment');\n }\n $statement .= $c.$this->source[$srcpos++];\n while (substr($this->source, $srcpos, strlen(self::END_ML_COMMENT))\n !== self::END_ML_COMMENT) {\n $statement .= $this->source[$srcpos++];\n }\n $srcpos += strlen(self::END_ML_COMMENT);\n $token = $this->createToken($statement.self::END_ML_COMMENT);\n } else {\n $statement .= $c;\n }\n break;\n case self::DOUBLE_QUOTE:\n case self::SINGLE_QUOTE:\n $statement .= $c;\n while ($this->source[$srcpos] !== $c) {\n $statement .= $this->source[$srcpos++];\n }\n $statement .= $this->source[$srcpos++];\n break;\n case self::BEGIN_INTERPOLATION:\n $statement .= $c;\n if (substr($this->source, $srcpos - 1, strlen(self::BEGIN_INTERPOLATION_BLOCK))\n === self::BEGIN_INTERPOLATION_BLOCK) {\n while ($this->source[$srcpos] !== self::END_BLOCK) {\n $statement .= $this->source[$srcpos++];\n }\n $statement .= $this->source[$srcpos++];\n }\n break;\n case self::BEGIN_BLOCK:\n case self::END_BLOCK:\n case self::END_STATEMENT:\n $token = $this->createToken($statement.$c);\n if (is_null($token)) {\n $statement = '';\n }\n break;\n default:\n $statement .= $c;\n break;\n }\n }\n\n if (is_null($token)) {\n $srclen = $srcpos = 0;\n }\n\n return $token;\n }", "function prepare_message($m)\n{\n\t\t/*CLEAN MESSAGE INPUT - Only want to sign the plain text*/\n\t\t//Strip html tags to prepare signing of message content\n\t\t$m = preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \" \", $m); //Remove empty white lines in message and replace with space.\n\t\t\n\t\t$m = preg_replace(\"/&#?[a-z0-9]{2,8};/i\",\"\",$m); //Removes special characters such as &nbsp; - http://stackoverflow.com/questions/657643/how-to-remove-html-special-chars\n\t\t\n\t\t$m = p_trim_line($m); //trim each line using <br> as delimiter\n\t\t\t\n\t\t$m = strip_all_tags($m); //remove html tags\n\t\t\n\t\t$m = trim($m);\n\t\t\n\t\t$m = preg_replace('!\\s+!', ' ', $m); //reduce multiple white space into one white space - Outlook does this when receiving mail - http://stackoverflow.com/questions/2368539/php-replacing-multiple-spaces-with-a-single-space\n\n\t\treturn $m;\n}", "public function translate2($word, $from, $tos)\n\t\t{\n\t\t\t//$tos is array of languages to translate to\n\t\t\t//returns array of translations as $result['en']=>'Hello'\n\t\t\t\n\t\t\t$access_token = $this->get_access_token();\n\t\t\t\n\t\t\t$result[$from] = $word;\n\t\t\t\n\t\t\tforeach($tos as $to)\n\t\t\t{\n\t\t\t\t$url = 'http://api.microsofttranslator.com/V2/Http.svc/Translate?text='. urlencode($word) .'&from='.$from.'&to='.$to;\n\t\t\t\t\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $url); \n\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization:bearer '.$access_token));\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n\t\t\t\t$rsp = curl_exec($ch); \n\t\t\t\t\n\t\t\t\tpreg_match_all('/<string (.*?)>(.*?)<\\/string>/s', $rsp, $matches);\n\t\n\t\t\t\t$result[$to] = $matches[2][0];\n\t\t\t}\n\t\t\t\n\t\t\treturn $result;\n\t\t}" ]
[ "0.5424453", "0.54055065", "0.527045", "0.52508307", "0.524374", "0.52317774", "0.5123165", "0.50346935", "0.50251776", "0.50019157", "0.50006145", "0.50000507", "0.4958771", "0.49373278", "0.49289954", "0.49284375", "0.49275059", "0.49220297", "0.49211568", "0.4911084", "0.49109927", "0.4902239", "0.4889166", "0.48828316", "0.48711088", "0.48664218", "0.48630714", "0.4853317", "0.48531052", "0.48435876", "0.48404074", "0.4839979", "0.48398057", "0.48311192", "0.4824198", "0.48202837", "0.48184207", "0.48179057", "0.48136106", "0.48125252", "0.4782098", "0.47766864", "0.47760105", "0.4767409", "0.4767409", "0.4767409", "0.4767409", "0.4739935", "0.47262427", "0.4719434", "0.47075546", "0.47001025", "0.46886176", "0.46696535", "0.46626854", "0.46571648", "0.46392366", "0.46347117", "0.4632746", "0.46302047", "0.46239266", "0.46207103", "0.4619806", "0.46122062", "0.46088848", "0.46037248", "0.46021473", "0.45997152", "0.4592745", "0.4591901", "0.45909518", "0.45873076", "0.4586592", "0.45859423", "0.4581814", "0.4581814", "0.45795906", "0.45649943", "0.45624337", "0.45624337", "0.45618182", "0.45567253", "0.45551038", "0.45536447", "0.4551776", "0.4551776", "0.4551776", "0.4551776", "0.45450327", "0.4542892", "0.45394364", "0.45391053", "0.45379803", "0.4534666", "0.45331436", "0.4531243", "0.45268527", "0.45241126", "0.45229766", "0.45204508", "0.45184556" ]
0.0
-1
Unlink this flight from all registrations. Delete model after removing from registrations
public function cleanRegistrations($delete = false) { foreach($this->getRegistrations()->each() as $r) { $r->flight_id = null; $r->save(); } if($delete) $this->delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public function purge()\n {\n $this->owner()->where('current_organization_id', $this->id)\n ->update(['current_organization_id' => null]);\n\n $this->users()->where('current_organization_id', $this->id)\n ->update(['current_organization_id' => null]);\n\n $this->users()->detach();\n\n $this->delete();\n }", "public function purge(): void\n {\n $this->owner()->where('current_team_id', $this->id)\n ->update(['current_team_id' => null]);\n\n $this->users()->where('current_team_id', $this->id)\n ->update(['current_team_id' => null]);\n\n $this->users()->detach();\n\n $this->delete();\n }", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }", "public function unemploy(){\n unset($this->staffId);\n unset($this->store);\n $connection = new Connection();\n $link = $connection->connect();\n $link->exec(\"DELETE FROM staff WHERE user_id = '$this->id'\");\n $connection = null;\n }", "public function unlink($id)\n {\n //\n Relation::destroy( $id );\t\n }", "public function destroy_it() {\n\t\t\t$this->Destroy_model->destroy_building();\n\t\t}", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "public function delete()\n {\n $this->abilities()->detach();\n parent::delete();\n }", "public function cleanup(){\n\t\t$accountBookings = Billing_Controller_AccountBooking::getInstance()->getByBookingId($this->getId());\n\t\t\n\t\tforeach($accountBookings as $accountBooking){\n\t\t\tBilling_Controller_AccountBooking::getInstance()->delete(array($accountBooking->getId()));\n\t\t}\n\t}", "public function uninstall()\n {\n //$this->getDb()->createCommand()->dropTable($this->getTable())->execute();\n //delete the term itself\n $model = TaxonomyDef::findOne($this->id);\n $model->delete();\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove() {\n\n // Updates DB (data & metadata)\n $this->attributes->removeAll($this->get(\"id\"));\n $this->db->delete(XCMS_Tables::TABLE_USERS, array(\n \"id\" => $this->get(\"id\")\n ));\n\n }", "public function unload()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->orm = null;\n\n $this->multiRef = [];\n $this->i18n = null;\n\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function deleteOrganiser() {\n $this->organiser = NULL;\n }", "public function delete(){\n\t\t$landlord= new Core_Model_Landlord( $this->dto );\n\t\tif( is_numeric( $company->id) && (int)$company->id > 0) {\n\t\t\t$company->delete( array( \"id\" => $this->dto->id) );\n\t\t\t}\n\t}", "public function destroy()\n {\n $this->getGraph()->removeEdge($this);\n foreach ($this->getVertices() as $vertex) {\n $vertex->removeEdge($this);\n }\n }", "function wp_listings_deactivation() {\n\n\t\tflush_rewrite_rules();\n}", "public function remove_friend()\n {\n //delete from db;\n $this->Friend_model->remove_friend_model();\n }", "public static function deactivation() {\n\t\t\tmonstroid_dashboard_updater()->remove_shedules();\n\t\t\tmonstroid_dashboard_updater()->clear_update_data();\n\t\t\tdelete_option( 'monstroid_dashboard_disable_auto_updates' );\n\t\t}", "public function __destruct()\n {\n\tunset($this->model);\n }", "public function action_remove(){\n $abuse = ORM::factory('BoardAbuse', $this->request->param('id'));\n if($abuse->loaded()){\n if($abuse->ad->loaded())\n $abuse->ad->delete();\n $abuse->delete();\n }\n $this->redirect('admin/boardAbuses' . URL::query());\n }", "public function onDeactivation(&$controller) {\n\t\t$controller->Croogo->removeAco('Route'); \n\t\t$this->_schema('drop');\n\t}", "protected function removeInstance() {}", "public function unregister(): void;", "public function unregister(): void;", "public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n $this->__destruct();\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function drop ()\n {\n //delete the records of the lookup value\n $records = LookupValue::where('lookup_type_id', 1)->get();\n foreach ( $records as $record )\n $record->forceDelete();\n\n //delete the lookup definition itself\n $record = LookupType::find(1);\n $record->forceDelete();\n }", "public function destroy(Registration $registration)\n {\n //\n }", "public function destroy()\n {\n $this->registry = array();\n\n $this->adaptor->deleteIndex($this->section);\n }", "public function destroy() {\n unset($this->items);\n $this->items = false;\n }", "public function unlinkLinkedIn() {\n $this->setLinkedinOauthToken(NULL);\n $this->setLinkedinOauthTokenSecret(NULL);\n $this->setLinkedInId(NULL);\n }", "public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}", "public function unpopulate();", "public function deleteLocal() \n {\n LocalDAC::deleteLocal($this);\n }", "public function delete()\n {\n Mage::getModel('amflags/order_flag')->removeLinks($this);\n return parent::delete();\n }", "public function undeleteGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Updated Gateway to be Registered';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n $gateway->REG_FLAG = 1;\n $gateway->save();\n\n return \"success\";\n }", "public function deleted(Flight $flight)\n {\n //\n }", "public function unlinkAccount()\n {\n }", "protected function tearDown()\n {\n // TODO Auto-generated FlightInstanceTest::tearDown()\n $this->flightInstance = null;\n \n parent::tearDown();\n }", "public function delete () {\n if(count($this->data[$this->id])) {\n foreach($this->data[$this->id] as $key=>$prop) {\n if($prop[\"link\"] == \"P127F\")\n $broader = $key;\n }\n }\n unset($this->data[$this->id][$broader]);\n \n // if there are still links, we must stop\n if(count($this->data[$this->id])) \n throw new Exception(\"Cannot remove because record has links! (remove them first)\");\n\n // remove table data linked to this record\n foreach($this->tables as $table) {\n $table->deleteMyData($this->id);\n }\n \n // remove link to class hierarchy and then the record itself\n IdaDb::deleteBy(\"_sys_classes_join\", array(\"subject\"=>$this->id));\n IdaDb::deleteBy(\"_sys_records\", array(\"id\"=>$this->id));\n \n }", "public function clearBreachLocations()\n {\n $scenario = Scenarios::getOrCreateUserScenario();\n $scenario->breachlocations()->detach();\n }", "public function unlinkAll()\n {\n return $this->pivotTable()->delete($this->wherePivot($this->parentKey(), null))->run();\n }", "public function destroy($id)\n {\n \n /* $n_room = reserve::where('id',$id)\n ->join ('room','reserve.id_room','=','room.id')\n ->first();\n\n $person= $n_room ->person;*/\n\n room::where('id',$id )\n ->update(['available' => 0, 'vacancies' => $person->person ]); \n\n\n\n\n reserve::where('id',$id)->delete();\n return redirect()->back();\n }", "public function deleteAddrMaps(){\n\t\t$guWlDevices = $this->getWlDevices();\n\t\tforeach($guWlDevices as $guDevice){\n\t\t\t$guWlIfaces = $guDevice->getWlIfaces();\n\t\t\tforeach($guWlIfaces as $guWlIface){\n\t\t\t\t$guWlIface->getAddrMap()->delete();\n\t\t\t}\n\t\t}\n\t}", "public function destroy($id)\n {\n $fleetTypes = Fleet::find($id);\n $vehicles = Vehicle::where('fleet_id', $id)->get();\n foreach($vehicles as $vehicle){\n $trips = Trip::where('vehicle_id', $vehicle->id)->get();\n foreach ($trips as $trip) {\n $trip->delete();\n }\n $vehicle->delete();\n }\n $fleetTypes->delete();\n return redirect('/fleets');\n }", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public function deleteOwners(): void\n {\n foreach ($this->attributes as $attributeName) {\n $this->removeOwner($this->owner->primaryKey, $this->name, $attributeName);\n }\n }", "public function uninstall(){\n MergeRequestComment::dropTable();\n MergeRequest::dropTable();\n CommitCache::dropTable();\n Repo::dropTable();\n Project::dropTable();\n }", "public function clearModels();", "public function destroy() {\n\t\t$sql = 'DELETE FROM ' . static::$table . ' WHERE id = ' . $this->get('id') . ';';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute();\n\t}", "public function destroy(): void\n {\n foreach ($this->getAll() as $k => $v) {\n if (strlen(strval($k)) > 0) {\n $this->remove($k);\n }\n }\n return;\n }", "public function unregister()\r\n {\r\n $this->unregisterBlock('l');\r\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "public function destroy($id) {\n $recette = Recette::find($id);\n //on supprime les relations de la recette\n $recette->ingredients()->detach();\n //peu importe si la recette fait partie d'un planning utilisateur\n $recette->plannings()->detach();\n $recette->delete();\n return redirect('recettes');\n }", "public function remove() {\n\t\t$this->setRemoved(TRUE);\n\t}", "function uninstall() {\nunsubscribeFromEvent($this->name, 'HOURLY');\nSQLExec('DROP TABLE IF EXISTS camshoter_devices');\nSQLExec('DROP TABLE IF EXISTS camshoter_config');\nSQLExec('DROP TABLE IF EXISTS camshoter_recognize');\nSQLExec('DROP TABLE IF EXISTS camshoter_people');\n\n\n parent::uninstall();\n\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function destroy(accidentsTravail $accidentsTravail)\n {\n //\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "public function removeAll()\n {\n foreach ($this->findAll() as $object) {\n $this->remove($object);\n }\n }", "public function register_deactivation();", "public function instance_deleted() {\n $this->purge_all_definitions();\n @rmdir($this->filestorepath);\n }", "public static function uninstallModel() {\r\n return GearSection::dropTables() && GearOption::dropTables();\r\n }", "public function destroy()\n {\n $this->items = array();\n }", "public function destroy()\n {\n foreach ($this->getEdges()->getEdgesDistinct() as $edge) {\n $edge->destroy();\n }\n $this->graph->removeVertex($this);\n }", "public function erase()\n {\n ActionHandler::getInstance()->deleteAction($this->deleteAction);\n ActionHandler::getInstance()->deleteAction($this->deleteActionf);\n $this->saveButton->destroy();\n $this->loadButton->destroy();\n $this->frame->clearComponents();\n $this->frame->destroy();\n $this->destroyComponents();\n\n parent::destroy();\n }", "public static function clearBootedModels();", "public function delete()\n {\n if($this->contactable!=null)\n {\n $this->contactable->delete(); \n }else\n {\n parent::delete(); \n } \n }", "function sunrail_api_deactivation() {\n global $wp_rewrite;\n $wp_rewrite->flush_rules();\n}", "public function deleteAction(){\n //farewell brave knight, your cosmo will stay with us forever...\n $this->getDM()->remove($this->getKnight());\n $this->getDM()->flush();\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }", "public function forceDeleted(OnlineInviteRegister $onlineInviteRegister)\n {\n //\n }", "public function delete(Identifiable $model);", "public function dissociate()\n {\n $this->farChild->setAttribute($this->firstKey, null);\n\n return $this->farChild->setRelation($this->relation, null);\n }", "public function remove() {}", "public function Deletar(){\n \n $idFrota = $_GET['id'];\n \n $frota = new Frota();\n \n $frota->id = $idFrota ;\n \n $frota::Delete($frota);\n \n }", "public function remove() {}", "public function uninstall()\n\t{\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_site;\n\t\t\t\");\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_incident;\n\t\t\t\");\n\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function destroy(Referral $referral)\n {\n //\n }", "function uninstall() {\n global $DB, $USER, $Controller;\n //if(!$USER->may(INSTALL)) return false;\n if (is_object($Controller->ldapImport))\n {\n $Controller->ldapImport->delete();\n }\n $DB->dropTable(self::$DBTable);\n }", "public function clear()\n\t{\n\t\t$this->id = null;\n\t\t$this->uf_id = null;\n\t\t$this->nome = null;\n\t\t$this->slug = null;\n\t\t$this->longitude = null;\n\t\t$this->latitude = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}", "function deleteEntry() \n { \n \n // before removing entry, make sure associated linkGroups & linkViewers\n // are removed as well\n $linkID = $this->getID();\n \n $linkMgr = new RowManager_NavLinkAccessGroupManager();\n $linkMgr->setLinkID( $linkID );\n $list = $linkMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n $linkViewerMgr = new RowManager_NavLinkViewerManager();\n $linkViewerMgr->setLinkID( $linkID );\n $list = $linkViewerMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n parent::deleteEntry();\n \n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "public function destroy() {\n $this->accessory->destroy();\n redirect('/backend/accessories', ['notice' => 'Successfully destroyed.']);\n }", "public function destroy($id)\n {\n $recepfind=Receptionist::findOrFail($id);\n $recepfind->delete();\n //receptionists table is reffering the primary key of the system_users table as a foreign key.\n //so after deleting a receptionist, data in both tables should be removed.\n //but need to discuss further about this destroy method !!!!!!!!!!!!!!\n $systemuser = SystemUser::findOrFail($id);\n $systemuser->delete();\n\n Session::flash('msgr3', 'Receptionist successfully deleted!'); //print flash msg after successfully updated\n\n return redirect('admin/receptionist');\n }", "public function destroy()\n {\n ConsultantAssignment::where('id','=',Input::get('id'))->delete();\n\n return Response::json(array('msg' => 'Registered consultancy deleted','success'=>true), 200);\n }", "public function force_destroy($id)\n {\n //\n $result = ScanResults::find($id);\n\n $result->forceDelete();\n\n // You may also use the forceDelete method when building Eloquent relationship queries:\n\n // $flight->history()->forceDelete();\n }", "static function uninstall()\n\t{\n\t\tglobal $wpdb;\n\n\t\tdelete_option( 'jumplead_version' );\n\t\tdelete_option( 'jumplead_tracker_id' );\n\t\tdelete_option( 'jumplead_capture_comments' );\n\n\t\t// @codingStandardsIgnoreStart\n\t\t$wpdb->query( 'DROP TABLE IF EXISTS ' . self::$tableFieldMapping );\n\t\t// @codingStandardsIgnoreEnd\n\t}", "public function delete()\n {\n Contest::destroy($this->modelId);\n $this->modalConfirmDeleteVisible = false;\n $this->resetPage();\n }", "public function down()\n {\n Schema::dropIfExists('personas');\n }", "public function uninstall()\r\n {\r\n // Remove\r\n ee()->dbforge->drop_table('tagger');\r\n ee()->dbforge->drop_table('tagger_links');\r\n ee()->dbforge->drop_table('tagger_groups');\r\n ee()->dbforge->drop_table('tagger_groups_entries');\r\n\r\n ee('Model')->get('Action')->filter('class', ucfirst($this->module_name))->all()->delete();\r\n ee('Model')->get('Module')->filter('module_name', ucfirst($this->module_name))->all()->delete();\r\n\r\n return true;\r\n }", "public function destroy($id)\n {\n $landunits = LandUnits::find($id);\n if($landunits==null){return redirect('/o4k/404');}\n else\n { \n try\n { \n $landunits->delete();\n \n LandUnits::where('parent_id',$id)->get()->each->delete();\n\n\n Session::flash('val', 1);\n Session::flash('msg', \"Land Unit deleted successfully !\");\n\n } catch (Exception $ex) {\n Session::flash('val', 1);\n Session::flash('msg', $ex->getMessage());\n } \n return redirect('o4k/land_unit');\n }\n }" ]
[ "0.60531455", "0.6033618", "0.6008089", "0.59493333", "0.59427375", "0.58216244", "0.582043", "0.5792366", "0.57690805", "0.57560253", "0.5724985", "0.5685354", "0.56444126", "0.5636645", "0.5625533", "0.56211835", "0.5584849", "0.55668825", "0.55576575", "0.5547372", "0.5536659", "0.550381", "0.54855365", "0.5477308", "0.5474659", "0.54632074", "0.54632074", "0.54560167", "0.5452767", "0.5448916", "0.54409677", "0.54381734", "0.5434669", "0.54335624", "0.5430964", "0.54291165", "0.54251796", "0.54094124", "0.5399598", "0.539347", "0.53900146", "0.538646", "0.5375025", "0.536511", "0.53596175", "0.53541356", "0.5352488", "0.5335084", "0.53308964", "0.5327069", "0.5323479", "0.5323291", "0.5312227", "0.5309871", "0.53072864", "0.5306459", "0.53043395", "0.5300381", "0.529488", "0.529318", "0.5292262", "0.52817065", "0.52804154", "0.52763605", "0.5272238", "0.5264136", "0.5253652", "0.52518994", "0.5247231", "0.52449936", "0.5238065", "0.5232578", "0.522358", "0.52195805", "0.5219233", "0.5217846", "0.52164763", "0.52139175", "0.521391", "0.5212774", "0.52113837", "0.52065104", "0.52013", "0.5196813", "0.5192009", "0.51886845", "0.5187787", "0.5187787", "0.5187787", "0.5187787", "0.5184466", "0.5182093", "0.51791716", "0.5174536", "0.5169815", "0.51683724", "0.5167894", "0.51566464", "0.51558256", "0.51548916" ]
0.5491057
22
ID matching the email, if any
private function id(string $email): int { return (int) (new Storage\TypedQuery( $this->connection, 'SELECT id FROM seekers WHERE email IS NOT DISTINCT FROM ?', [$email] ))->field(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function email2id($email) {\n // converts a user email to the id of the user\n // both id and email are indivitual to every user\n \n global $con;\n\n $sql = \"SELECT `id` FROM `user` WHERE `email` LIKE '\".$email.\"';\";\n $query = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($query)) {\n return intval($row['id']);\n }\n return NULL;\n }", "protected function userIDEmail ($email)\n {\n \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('email'=>$email),\n )\n ));\n if(!empty($user))\n {\n $id=0;\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n }\n return $id; \n } \n }", "function getUniqueEmail($email_id)\n\t\t{\n\t\t\t//getting all email id from database\n\t\t\t$allEmail = $this->manageContent->getValue('user_credentials','email_id');\n\t\t\t//initializing a parameter\n\t\t\t$emailCounter = 0;\n\t\t\tforeach($allEmail as $allEmails)\n\t\t\t{\n\t\t\t\tif($allEmails['email_id'] == $email_id)\n\t\t\t\t{\n\t\t\t\t\t$emailCounter = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\techo $emailCounter;\n\t\t}", "function getId($email) {\n\t\t$selectPrepa = self::$bdd -> prepare(\"SELECT id FROM utilisateur WHERE email = '$email'\");\n\t\t$selectPrepa -> execute();\n\t\t$result = $selectPrepa -> fetch();\n\t\treturn $result[0];\n\t}", "public function getIdEmailByEmail($email){\n $row = $this->db->run(\"SELECT id, username, email FROM users WHERE email=? LIMIT 1\", [$email])->fetch();\n return $row;\n }", "function get_user_id_from_email($email)\n\t{\n\t\t//$this->firephp->log(\"email=\".$email);\n\t\t\n\t\t$this->db->select($this->flexi_auth->db_column('user_acc', 'id'));\t\n\t\t$this->db->where($this->flexi_auth->db_column('user_acc', 'email'),$email);\t\n\t\t$qres=$this->db->get('user_accounts');\n\t\tif ($qres->num_rows() > 0) {\n\t\t\t$row=$qres->row_array();\n\t\t\t//$this->firephp->log($row['uacc_id'].\"for email=\".$email);\n\t\t\treturn $row['uacc_id'];\n\t\t} else {\n\t\t\t$this->firephp->log(\"Could not determine user id from user email\");\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getUserID($email){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$stmt = $conn->prepare(\"select id from login where Email=?\");\n\t\t$stmt->bind_param(\"s\", $email);\t\t\t\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($v_id);\n\t\t\n\t\tif($stmt->execute()){\n\t\t\twhile($stmt->fetch()){\n\t\t\t\t$id=$v_id;\n\t\t\t}\n\t\t}\n\n\t\t$stmt->free_result();\n\t\t$stmt->close();\n\t\t\n\t\treturn $id;\n\t\n\t}", "public function getId (){\n $conn = Connection::getConn();\n $sql = 'SELECT * FROM usuarios WHERE email = :email';\n $stmt = $conn->prepare($sql);\n\n $stmt->bindValue(':email',$this->email );\n\n $stmt->execute();\n\n if ($stmt->rowCount()){\n $result = $stmt->fetch(); \n }\n $id = $result['id']; \n return $id;\n }", "private function emailInUse( $email, $id )\n\t{\n\t\t$stmt = $this->connection->prepare('SELECT id FROM ' . Configure::get('database/prefix') . 'accounts WHERE email_hash = :email LIMIT 1');\n\t\t$stmt->bindValue(':email', $email, PDO::PARAM_STR);\n\t\t$stmt->execute();\n\t\t$data = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t$stmt->closeCursor();\n\n\t\tif( !empty($data) && $data['id'] != $id )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "static function buscarEmail($email) {\n \n //deberia instanciar a la persona??\n \n\t\tif($email==\"\") {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$conn = _connect();\n\n\t\t$sql=\"\tSELECT id\n\t\t\t\tFROM personas\n\t\t\t\tWHERE email='\".$conn->real_escape_string($email).\"'\";\n\n\t\t$result=$conn->query($sql) or trigger_error(\"Failed! SQL: $sql - Error: \".mysqli_error(), E_USER_ERROR);\n\t\t\n\t\tif($result->num_rows==0) {\n\t\t\treturn false;\n\t\t}\n\t\t\n $row=$result->fetch_assoc();\n \n//\t\treturn true;\n\t\treturn $row['id'];\n }", "function getUserIdByEmail($email) {\n\t$email = escape($email);\n\t$result = mysql_query(\"SELECT id FROM users WHERE email = '$email'\");\n\t\n\tif($row = mysql_fetch_array($result)) {\n\t\treturn $row[0];\n\t} else {\n\t\treturn false;\n\t}\n}", "public function getEntityIdByEmail($email)\r\n {\r\n $read = Mage::getSingleton('core/resource')->getConnection('core_read');\r\n $readresult = $read->query(\r\n 'SELECT entity_id,role_id,role_code FROM `customer_entity` ce LEFT JOIN axaltacore_user_role aur ON ce.entity_id = aur.user_id LEFT JOIN axaltacore_role ar ON aur.role_id = ar.axaltacore_role_id \r\n where ce.email = \"'.$email.'\" and ar.role_code=\"la_key_user\"'\r\n );\r\n while ($row = $readresult->fetch()) {\r\n $entityId = $row['entity_id'];\r\n }\r\n \r\n return $entityId;\r\n }", "public function getIdFromEmail($email)\n {\n $result = $this->find()\n ->select(['id'])\n ->where(['email' => $email])\n ->first();\n if ($result) {\n return $result->id;\n }\n\n return false;\n }", "public function getUserIdFromEmail($useremail)\n { \n try\n {\n $db_request = DB::table('user')\n ->select('id')\n ->where('Email', $useremail)\n ->first(); \n\n $id = $db_request->id;\n if($id!=NULL){\n return $id;\n }\n }\n catch(\\Exception $Exception)\n {\n return -1; \n }\n \n }", "Public Function getIdUsingEmail($Email)\n\t{\n\t\t$Result = $this->_db->fetchRow('SELECT * FROM bevomedia_user WHERE email = ?', $Email);\n\t\tif(!$Result || !sizeOf($Result))\n\t\t\treturn false;\n\t\treturn $Result->id;\n\t}", "public function get_id_from_email($email)\n {\n $this->db->select('id');\n $this->db->where('email', $email);\n $this->db->limit(1);\n if ($this->db->count_all_results('accounts') === 0)\n {\n return 0;\n }\n $this->db->select('id');\n $this->db->where('email', $email);\n return $this->db->get('accounts')->row()->id;\n }", "public function getExistingEmail($email)\n {\n $query = \"SELECT identifier FROM \".$this->_name.\" WHERE email = '\".$email.\"'\";\n if(($result = $this->getQuery($query,false)) != NULL)\n {\n return \"yes\";\n }\n else\n return \"no\";\n }", "function GetAffId($db, $email) {\n\t$query = \"SELECT m.member_link_id\n\t\t\t\tFROM members m\n\t\t\t\tWHERE m.email_username='$email'\"; \n\t$result = mysqli_query($db, $query) or die(mysqli_error($db));\n\t$table_rows = false;\n\tif($row = mysqli_fetch_assoc($result)) {\n\t\t$res = $row['member_link_id'];\n\t} else {\n\t\t$res = \"INVALID_AFF_ID\";\n\t}\n\t\n\treturn $res;\n}", "function get_user_id($db, $email)\n{\n\t$sql = \"SELECT id FROM users where email = :email\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email));\n\t$us = $st->fetchAll();\n\treturn $us[0]['id'];\n\n}", "public static function isEmailId($email){\n return (filter_var($email,FILTER_VALIDATE_EMAIL)?true:false);\n }", "public function search_id_user($email)\n {\n \treturn $this->db->select('id_client, name, last_name, email, country')->where('email', $email)->get('ec_client')->result_array();\n }", "function get_user_id_from_string($email_or_login)\n {\n }", "public function getUidFromEmail($email);", "function people_findByEmail($find_email) {\n $response = $this->execute(array('method' => 'flickr.people.findByEmail', 'find_email' => $find_email));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['user']['nsid'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function fetch_user_Idn($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email\t=\tsanitize($email);\n\n\t\t$query = \"SELECT `student_Idn` FROM `student` WHERE `email` = '$email'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\t\t$rows = mysqli_fetch_assoc($run_query);\n\t\t$student_Idn = $rows['student_Idn'];\n\t\treturn $student_Idn;\n\n\t}", "function getIdFromEmailUser($db, $user_email) {\n\n $SELECT_ID_USER = \"SELECT user_id FROM user WHERE user_email = ?\";\n\n $resultats = $db->prepare($SELECT_ID_USER);\n $resultats->execute(array($user_email));\n $row = $resultats->fetch(PDO::FETCH_OBJ);\n $user_id = $row->user_id;\n $resultats->closeCursor();\n\n return $user_id;\n}", "public static function getIdByEmail($email)\n\t{\n\t\treturn (int) FrontendModel::getDB()->getVar('SELECT p.id FROM profiles AS p WHERE p.email = ?', (string) $email);\n\t}", "function isEmailPresent($email = NULL){\t\t\t\n\t\t$query = \" SELECT id\";\n\t\t$query .= \" FROM \" . $this->config->item('ems_organisers','dbtables');\n\t\t$query .= \" WHERE email = ? \";\t\t\n\t\t$dataBindArr = array($email);\n\t\t$res = $this->db->query($query, $dataBindArr);\n\t\t$resArr = $res->result();\t\t\n\t\treturn count($resArr);\n\t}", "function email_exists($email,$id='')\n {\n $this->db->where('email', $email);\n if(!empty($id)){\n $this->db->where('id !=', $id);\n }\n $query = $this->db->get('users');\n if( $query->num_rows() > 0 ){ return True; } else { return False; }\n }", "function salesperson_select_id($email)\n{\n $conn = db_connect();\n\n // Prepared statement for selecting a salesperson's information from the database\n $salesperson_select_id_stmt = pg_prepare($conn, \"salesperson_select_id_stmt\", \"SELECT * FROM salespeople WHERE email_address = $1\");\n $id = pg_fetch_result(pg_execute($conn, \"salesperson_select_id_stmt\", array($email)), 0, \"id\");\n\n return $id;\n}", "function InfGetContactId($email) {\n\t\n\t$object_type = \"Contact\";\n $class_name = \"Infusionsoft_\" . $object_type;\n $object = new $class_name();\n // Order by most recent contact with that Email\n#\t$objects = Infusionsoft_DataService::query(new $class_name(), array('ContactId' => $payment['ContactId']));\n $objects = Infusionsoft_DataService::queryWithOrderBy(new $class_name(), array('Email' => $email), 'DateCreated', false);\n $contact_array = array();\n foreach ($objects as $i => $object) {\n $contact_array[$i] = $object->toArray();\n }\n foreach ($contact_array as $i => $contact) {\n\t\treturn $contact['Id'];\n\t}\n\treturn \"\";\n}", "private function verifyUser($email) {\n $userFound = $this->user->where('email', $email)->first();\n if ($userFound) {\n return $userFound['custID'];\n } else {\n return -1;\n }\n }", "public static function getIdByEmail($email) {\n\t\tif (Validate::isEmail($email))\n\t\t{\n\t\t\t$sql = \"select id_user from user where email='\" . pSQL($email) . \"'\";\n\t\t\t$result = Db::getInstance(false)->getValue($sql);\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function GetUserID($emailId) \n\t{\n $sql = \"SELECT userid\"\n . \" FROM user \"\n . \" WHERE email = '\" . $emailId . \"' \"\n . \" LIMIT 1\";\n \n\t\t $result=parent::query($sql);\n\t\t\t\n\t\t//print_r($result);\n\t\tif (empty($result))\n\t\t{return '0';}\n\t\telse\n\t\t{return $result[0]['userid'];}\n }", "function find_by_email($h, $email ){\n \n $sql = \"SELECT * FROM \" . TABLE_USERS . \" WHERE user_email=%s LIMIT 1\";\n $query = $h->db->prepare($sql, $email);\n \n\treturn $parents = $h->db->get_results($query);; \n }", "function get_email_from_id($id) {\n\t$con2=mysqli_connect(\"thetaDB.db.9489000.hostedresource.com\",\"thetaDB\",\"Venta#1001\",\"thetaDB\");\n\t\n\t//Grab userID from members table.\n\t$result = mysqli_query($con2,\"SELECT email FROM members WHERE id = $id\");\n\t\t\t\t\n\t$queryResultEmail = mysqli_fetch_row($result);\n\t\n\t$email = $queryResultEmail[0];\n\t\n\treturn($email);\n}", "function admin_fetch_user_Idn($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email\t=\tsanitize($email);\n\n\t\t$query = \"SELECT `admin_Idn` FROM `administrator` WHERE `email` = '$email'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\t\t$rows = mysqli_fetch_assoc($run_query);\n\t\t$admin_Idn = $rows['admin_Idn'];\n\t\treturn $admin_Idn;\n\n\t}", "function getEmailId() {\n\t\treturn $this->getData('emailId');\n\t}", "public static function idByEmail($email=NULL)\n {\n if($email!=NULL)\n {\n try \n {\n $count = User::where('email', $email)->count();\n if($count > 0)\n {\n $user = User::where('email', $email)->orderBy('name', 'asc')->first();\n return $user->id;\n }\n else\n {\n return null;\n }\n } \n catch (ModelNotFoundException $e) \n {\n Log::error(\"The user with email ` $email ` does not exist: \". $e->getMessage());\n //TODO: send email?\n return null;\n }\n }\n else\n {\n return null;\n }\n }", "public function getUserIdByEmail($email){\n try{\n $result = User::model()->checkIfUserExist($email,'Email');\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:getUserIdByEmail::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n }\n return $result;\n }", "public function getUserId($email)\n\t{\n\t\t$email= $this->_db -> quote($email);\n\t\t$queryStr = \"select id from users where email= $email;\";\n try\n \t{\n\t $result = $this->_db -> query($queryStr);\n\t \n\t // test for error conditions\n $err = $this->_db->error();\n\t if (!empty($err)) \n\t \tthrow new Exception(\"select failed: \".$err);\n\t \n\t \n\t //pull from result\n\t $userId = false;\n\t foreach($result as $arr){\n $userId = isset($arr[\"id\"])?$arr[\"id\"]:false ;\n } \n\t return $userId;\t\n }\n catch (Exception $e) \n\t\t{\n \terror_log( 'UserManager.getUserId: '. $e->getMessage() . \". Query: \".$queryStr );\n\t\t} \n\t\t\n\t\treturn false; \n\t\t\n\t}", "function email_exists($email)\n {\n $sql = \"\n SELECT id\n FROM {$this->_db}\n WHERE email = \" . $this->db->escape($email) . \"\n LIMIT 1\n \";\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows())\n {\n return TRUE;\n }\n\n return FALSE;\n }", "function getIdByMail($mail, $includeBlocked = FALSE) {\n if (trim($mail) != '') {\n $sql = \"SELECT surfer_id, surfer_email\n FROM %s\n WHERE surfer_email = '%s' %s\";\n $blockedClause = ($includeBlocked === FALSE) ? ' AND surfer_valid != 4' : '';\n $params = array($this->tableSurfer, $mail, $blockedClause);\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n return $row['surfer_id'];\n }\n }\n }\n return '';\n }", "public function getUserId($email) {\n $this->db->select('userid');\n $this->db->from($this->userTable);\n $this->db->where('email', $email);\n $query = $this->db->get();\n $user_id = $query->result_array();\n return !empty($user_id)?$user_id:false;\n }", "public function get_user_id($em){\r\n $this->db->select('id');\r\n $this->db->where('email', $em);\r\n $query = $this->db->get('users');\r\n foreach ($query->result() as $row)\r\n {\r\n return $row->id;\r\n }\r\n }", "function getIdUsuario($email) {\r\n $this->db->select('id_usuario');\r\n $this->db->where('email_usuario', $email);\r\n $this->db->limit(1);\r\n $consulta = $this->db->get('usuario');\r\n if ($consulta->num_rows() > 0) {\r\n $resultadoConsulta = $consulta->result();\r\n foreach ($resultadoConsulta as $campoDeLaTabla) {\r\n $salida = $campoDeLaTabla->id_usuario;\r\n }\r\n } else {\r\n $salida = FALSE;\r\n }\r\n return $salida; \r\n \r\n }", "function get_hotel_id($adminemail)\n\t{\n\t\t$this->db->select('sb_hotel_id');\n\t\t$this->db->where('sb_hotel_useremail',$adminemail);\n\t\t$query=$this->db->get('sb_hotel_users');\n\t\t$result= $query->result_array();\n\t\treturn $result[0]['sb_hotel_id'];\n\t}", "function email_exist($email)\n {\n $this->db->select(EMAIL_ID);\n $this->db->from(TBL_USERS);\n $this->db->where(EMAIL_ID, $email);\n $query = $this->db->get();\n if ($query->num_rows() == 1) {\n return $query->row();\n } else {\n return false;\n }\n }", "function getEmailId($eid)\n{\n\t$password=\"k4heNatH\";\n\t$ds=ldap_connect(\"ldap://prodldap.honeywell.com\");\n\tif ($ds) {\n\t\t$dn=\"cn=atlassian-prod,ou=ApplicationUsers,o=honeywell\";\n\t\t$r=ldap_bind($ds,$dn,$password);\n\t\t$sr=ldap_search($ds, \"o=honeywell\",\"uid=E$eid\");\n\t\t$info = ldap_get_entries($ds, $sr);\n\t\tfor ($i=0; $i<$info[\"count\"]; $i++) {\n\t\t\t$dn=$info[$i][\"dn\"];\n\t\t\t$name=$info[$i][\"cn\"][0] ;\n\t\t\t$email= $info[$i][\"mail\"][0];\n\t\t}\n\t\tldap_close($ds);\n\t}\n\telse {\n\t\techo \"<h4>Unable to connect to LDAP server</h4>\";\n\t}\n\treturn $email;\n}", "public function getUserIdByEmail($email)\n {\n \t$validator = new Zend_Validate_EmailAddress();\n \tif($validator->isValid($email))\n \t{\n \t\t$result = $this->getUserDbTable()->select()\n \t\t\t\t\t\t\t\t\t ->from($this->_getTableName(), array('user_id'))\n \t\t\t\t\t\t\t\t\t ->where('email = ?', $email, 'VARCHAR')\n \t\t\t\t\t\t\t\t\t ->query()->fetch();\n \t\tif($result) return $result['user_id'];\n \t}\n }", "function existsByEmail( $email, $oid=null);", "function fb_email_exist($email)\n {\n $this->db->select('userID,emailID');\n $this->db->from(TBL_USERS);\n $this->db->where(EMAIL_ID, $email);\n $query = $this->db->get();\n if ($query->num_rows() == 1) {\n $result = $query->result();\n return $result[0];\n } else {\n return false;\n }\n }", "public function idAusgeben($email){\n $stmt = $this->con->prepare(\"SELECT id FROM Kunde ORDER BY id DESC;\");\n\n $stmt->execute();\n return $stmt->get_result()->fetch_assoc();\n }", "function getUsuarioID($mail)\n {\n $sentencia = $this->db->prepare( \"SELECT id_usuario FROM usuario WHERE mail = ? LIMIT 1\");\n $sentencia->execute([$mail]);\n return $sentencia->fetch(PDO::FETCH_ASSOC);\n }", "public function findByEmail($email, $not_id = null)\n\t{\n\n\n\n\n\t\tif(!$not_id) {\n \t$this->db->select()\n ->from($this->getSource())\n ->where(\"email = ?\");\n $this->db->execute([$email]);\n } else {\n \t$this->db->select()\n ->from($this->getSource())\n ->where(\"email = ?\")\n ->andWhere(\"id <> ?\");\n $this->db->execute([$email, $not_id]);\n }\n\t \n\t return $this->db->fetchInto($this);\n\t}", "function email_exists($email)\n {\n // 1. Connect to the database.\n $link = connect();\n\n // 2. Protect variables to avoid any SQL injection\n $email = mysqli_real_escape_string($link, $email);\n\n // 3. Generate a query and return the result.\n $result = mysqli_query($link, \"\n SELECT id\n FROM tbl_users\n WHERE email = '{$email}'\n \");\n\n // 4. Disconnect from the database.\n disconnect($link);\n\n // 5. There should only be one row, or FALSE if nothing.\n return mysqli_num_rows($result) >= 1;\n }", "function checkExistingEmail($clientEmail){\n $db = acmeConnect();\n $sql = 'SELECT clientEmail FROM clients WHERE clientEmail = :email';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':email', $clientEmail, PDO::PARAM_STR);\n $stmt->execute();\n $matchEmail = $stmt->fetch(PDO::FETCH_NUM);\n $stmt->closeCursor();\n if(empty($matchEmail)){\n return 0;\n } else {\n return 1;\n }\n}", "public function email_by_id($email_id)\n {\n $result = common_select_values('*', 'email_details', ' status!=2 AND email_detail_id = \"'.$email_id.'\"', 'row');\n return $result; \n\n }", "function userExist($email){\n $users = json_decode($this->getAll());\n foreach ($users as &$user) {\n if($user->email == $email){\n return $user->counter;\n }\n }\n return NULL;\n }", "function userIdGet(PDO $db,$email)\n{\n $sql = \"SELECT id FROM users WHERE email = :email\";\n\n $stmt = $db->prepare($sql); \n $stmt->bindParam(':email', $email, PDO::PARAM_STR); \n $stmt->execute();\n $id=$stmt->fetch(PDO::FETCH_NUM);\n\n return $id;\n}", "public static function getUserVerified($email)\n {\n $query=\"select user_id from bimp_user where email='\".$email.\"'\";\n $email= Yii::app()->db->createCommand($query)->queryAll();\n $count=count($email);\n if($count==1){\n $result['userId']=$email[0]['user_id'];\n return $result;\n }else{\n return false;\n }\n \n }", "function getIdNom($email) {\n\t\t$selectPrepa = self::$bdd -> prepare(\"SELECT id, nom FROM utilisateur WHERE email = '$email'\");\n\t\t$selectPrepa -> execute();\n\t\t$result = $selectPrepa -> fetch();\n\t\treturn $result;\n\t}", "function email_existe($email){\n\t$sql = \"SELECT id FROM usuarios WHERE email = '$email'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "public function findEmail($email = \"[email protected]\") {\n\t\t$users = $this->em->createQuery ( \" SELECT PARTIAL u.{id} FROM App\\Entity\\User u WHERE u.email = ?1 \" )->setParameter ( 1, $email )->execute ();\n\t\treturn count ( $users );\n\t}", "public function check_email($email)\r\n\t{\r\n\t\t$query=$this->db->query(\"SELECT * FROM users WHERE emailid='\".$email.\"'\");\r\n\tforeach ($query->result() as $row)\r\n\t\t{\r\n\t\t$storeid=$row->storeid;\r\n\t\t}\r\n\t\t$rows=$query->num_rows();\r\n\t\t$result=array('afftected_rows'=>$rows,'storeid'=>$storeid);\r\n\t\treturn $result;\r\n\t}", "function getUserID($user) {\r\n $sql = $this->db->prepare(\"SELECT UserID FROM USER WHERE email='$user'\");\r\n if ($sql->execute()) {\r\n $result = $sql->fetch(PDO::FETCH_ASSOC);\r\n return $result['UserID'];\r\n }\r\n return false;\r\n }", "public function emailExists($email){\n $query = $this->conn->query(\"SELECT id FROM user WHERE email = '$email'\");\n $result = $query->fetchAll(PDO::FETCH_ASSOC);\n if($result){\n return true;\n }\n }", "function getByEmail($email);", "function findID($d) {\n\t\t$url = \"https://inpho.cogs.indiana.edu/thinker.json\";\n\t\t$data = @file_get_contents($url,o,null,null);\n\t\t$json = json_decode($data);\n\t\t$results = $json->responseData->results;\n\t\tforeach($results as $value) {\n\t\t\tif (strcasecmp($value->label,$d)==0) { \n\t\t\t\t$id = $value->ID;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//return value of $id when string matches\n\t\treturn $id;\n\t}", "public function searchUser($email) {\r\n\r\n\t\t//TODO: Look at bookmark class for sample try/catch block around DB code\r\n\t\t$sqlObj = new DataBase();\r\n\t\t$found = FALSE;\r\n\r\n\t\t$query = \"SELECT * FROM `user_credentials` WHERE `email`='$email'\";\r\n\r\n\t\ttry {\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$resultset = $sqlObj->GetData();\r\n\r\n\t\t\t$num = $sqlObj->getNumberOfRecords();\r\n\t\t} catch (MyException $e) {\r\n\t\t\t$e->getMyExceptionMessage();\r\n\t\t}\r\n\t\tif ($num == 1) {\r\n\t\t\t$id = $resultset[0]['id'];\r\n\t\t\t$found = $id;\r\n\t\t} else {\r\n\t\t\t$found = -1;\r\n\t\t}\r\n\t\t$sqlObj->destroy();\r\n\r\n\t\treturn $found;\r\n\t}", "public function checkEmailExist($email, $id = '') \n {\n $this->db->select('firstname,lastname,email');\n if ($id != '')\n $this->db->where('id !=', $id);\n $this->db->where('email', $email);\n $q = $this->db->get('users');\n return $q->row_array();\n }", "public function getIdentifier()\n {\n return $this->user->email;\n }", "function getByEmail($email){\n\t\t}", "function check_email_duplicate(){\n $this->SQL = \"SELECT email FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n return $this->results;\n \n }", "function email_exist($email) {\n\n $sql = \"SELECT id FROM users WHERE email = '$email'\";\n\n $result = query($sql);\n \n if(row_count($result) == 1) {\n return true;\n } else {\n return false;\n }\n}", "abstract public function getMailCrmId();", "static function id2email($id) {\n global $con;\n\n $sql = \"SELECT `email` FROM `user` WHERE `id` = \".$id.\";\";\n $query = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($query)) {\n return $row['email'];\n }\n return NULL;\n }", "function find_email_by_id($user_id,$connection)\n {\n $query=\"SELECT email FROM users WHERE user_id='$user_id'\";\n $result=mysqli_query($connection,$query);\n if($result)\n {\n $row=mysqli_fetch_assoc($result);\n return chop($row['email'],$salt_string);\n }\n }", "public function get_user_id_by_email($email)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('email', $email)\n\t\t\t->get('users');\n\t\t$result = $query->row_array();\n\t\treturn intval($result['user_id']);\n\t}", "function email_exists($email){\n $sql = \"SELECT id FROM users WHERE email='$email'\";\n $result = query($sql);\n\n if(row_count($result)==1){\n return true;\n }else{\n return false;\n }\n}", "function appliedId($id, $em){\n // echo $id.\" - \".$em.\":\";//debug code $\n $sql = \"SELECT * FROM Applies_For;\";\n $res = mysql_query($sql);\n while($row = mysql_fetch_assoc($res)){\n $tid = $row['O_ID'];\n // echo $tid.\" - \";//debug code $\n if($id == $tid){\n $tem = $row['MEmail'];\n // echo $tem;//debug code $\n if($em == $tem){\n $ap = $row['AP_ID'];\n return $ap;\n }\n }\n }\n return -1;\n}", "function verify($email,$code)\n {\n $sql = \"SELECT id\n FROM\n user\n WHERE\n verification = '$code'\n AND\n email='$email'\n \";\n $query = $this->db->query($sql);\n if($query->num_rows()>0)\n {\n $row = $query->row();\n $update['verification'] = 'done';\n $update['status'] = 1;\n $this->db->where('id', $row->id);\n $this->db->update('user', $update);\n return $row->id;\n }\n }", "public function findCustomerIdByEmail(string $email)\n {\n $qb = $this->connection->createQueryBuilder();\n\n $query = $qb->addSelect('c.id_customer')\n ->from(_DB_PREFIX_ . 'customer', 'c')\n ->where('c.email = :email')\n ->setParameter('email', $email)\n ;\n\n $result = $query->execute();\n $data = $result->fetchOne();\n\n if ($data) {\n return (int) $data;\n }\n\n return false;\n }", "private function is_duplicate () {\n $email = $this->payload['email'];\n $facebook_id = '0';\n if (!empty($this->payload['facebook_id'])) {\n $facebook_id = $this->payload['facebook_id'];\n }\n $sql = \"SELECT id FROM users WHERE email='$email' OR facebook_id='$facebook_id'\";\n $sql = $this->conn->query($sql);\n\n return $sql->num_rows > 0;\n }", "public function searchUserByEmail($email)\n {\n\n $pdo = DB::connect();\n $stmt = $pdo->prepare(\"SELECT id FROM users WHERE email = :email\");\n $stmt->bindParam(':email', $email);\n $stmt->execute();\n $result = $stmt->fetchColumn();\n return $result;\n }", "public function getIdWithEmail($email)\n {\n $user = $this->find('all')\n ->select(['id'])\n ->where(['email' => $email])\n ->limit(1);\n if ($user->isEmpty()) {\n return null;\n }\n\n return $user->first()->id;\n }", "function emetteur_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_emetteur\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }", "public function selectUserByEmail($email)\n {\n $result = $this->sdb->query(\"select id from appuser where lower(email) = lower($1) limit 1\",\n array($email));\n $row = $this->sdb->fetchrow($result);\n if ($row && array_key_exists('id', $row))\n {\n /*\n * Call selectUserByID() to avoid all copy/paste code.\n */\n $rec = $this->selectUserByID($row['id']);\n return $rec;\n }\n return false;\n }", "function checkUserByEmail($email){\n\t\t$rec\t= $this->query(\"SELECT `id` from `users` where `email` = '$email' AND `user_type` = '1'\");\t\t\n\t\tif($rec && mysql_num_rows($rec)>0){\t\t\t\n\t\t\t//if user with the email got found\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//if user with the email got not found\n\t\t\treturn false;\n\t\t}\n\t}", "public function getUserIdByEmail($email)\n {\n $CI = &get_instance();\n return $CI->user_model->getUserIdByEmail($email);\n }", "private function checkEmailDuplication($email, $id)\n {\n $profile = Profile::where('email', '=', $email)->first();\n if ($profile && $profile->id != $id) {\n throw new DomainException(self::MESSAGE_EMAIL_DUPLICATION);\n }\n }", "public function getUserIdByEmail($email)\n {\n $result = self::$dbInterface -> query(\"SELECT userID FROM user WHERE email='\".$email.\"'\");\n return $result;\n }", "public function verify() {\r\n $stmp = $this->_db->prepare(\"SELECT `id`,`email` FROM `anope_db_NickCore` WHERE `display`= ? AND `pass` = ?;\");\r\n $stmp->execute(array($this->_username,$this->_password));\r\n \r\n if ($stmp->rowCount() == \"1\") {\r\n $row = $stmp->fetch(PDO::FETCH_ASSOC);\r\n $this->_id = $row['id'];\r\n $this->_email = $row['email'];\r\n return $this->_id;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "public function buscarPorEmail($email){\n\t\t$conexion = $GLOBALS['conexion'];\t\t\n\t\t$query=\"SELECT * FROM persona WHERE email='$email'\";\n\t\t$enlace=$conexion->query($query);\n\t\t$dataPersona=array();\n\t\t//$id = 0;\n\t\twhile($fila=$conexion->fetch_array($enlace)){\n\t\t\t//$id = $fila['id'];\n\t\t\t$dataPersona = array(\n\t\t\t\t\t\t\t\t'id'=>$fila['id'],\n\t\t\t\t\t\t\t\t'estado_procesado'=>$fila['estado_procesado'],\n\t\t\t\t\t\t\t\t'estado'=>$fila['estado'],\n\t\t\t\t\t\t\t);\n\t\t}\n\t\treturn $dataPersona;\t\t\n\t\t//return $id;\n\t}", "public function EmailCheck($email=\"\"){\n\t\t$check=$this->db->prepare(\"SELECT id FROM users WHERE email=:email\");\n\t\t$check->execute(array(\"email\"=>$email));\n\t\t$rowchk=$check->fetch(PDO::FETCH_ASSOC);\n\t\tif(!empty($rowchk))\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function sGetUserByMail($email)\n {\n $addScopeSql = '';\n if ($this->scopedRegistration == true) {\n $addScopeSql = $this->db->quoteInto('AND subshopID = ?', $this->subshopId);\n }\n\n $result = $this->db->fetchOne(\n \"SELECT id FROM s_user WHERE email = ? AND accountmode != 1 $addScopeSql\",\n [$email]\n );\n\n return $result ? (int) $result : null;\n }", "public function get_user_id_by_email($email)\n {\n $query = $this->db\n ->where('email', $email)\n ->get('users');\n $result = $query->row_array();\n return intval($result['user_id']);\n }", "function existe_email(string $email): bool{\r\n global $objBanco;\r\n\r\n if(empty($email)) return false;\r\n $smtm = $objBanco -> prepare('SELECT PK_ID FROM TS_USUARIO WHERE DS_EMAIL = :EMAIL');\r\n $smtm -> bindParam(':EMAIL', $email);\r\n $smtm -> execute();\r\n\r\n $array = $smtm -> fetch();\r\n return isset($array['PK_ID']) ? true : false;\r\n var_dump($array);\r\n}", "public function getIdentificacao();", "public function email_is_found($str, $user_table = \"admin_user\") {\n\n $id = $this->ci->input->post(\"id\");\n\n $find_conf = array(\"email\" => $str);\n\n // exclude his own ID to search another profile's email. (edit only)\n if (! empty($id)) {\n $find_conf[\"id <>\"] = $id;\n }\n\n $result = $this->ci->generic_model->retrieve_one(\n $user_table,\n $find_conf\n );\n\n if ($result) { // there exists an email.\n return TRUE;\n } else { // email is not found.\n $this->ci->form_validation->set_message(\"email_is_found\", \"Email is not found.\");\n return FALSE;\n }\n }" ]
[ "0.75039726", "0.73292905", "0.70106196", "0.69059086", "0.68847936", "0.68417287", "0.6752509", "0.67402613", "0.6732584", "0.67199624", "0.6714724", "0.6709128", "0.66985255", "0.6650587", "0.66431844", "0.6624419", "0.66122323", "0.6610495", "0.6605915", "0.65673244", "0.65565556", "0.6519138", "0.65023816", "0.6500352", "0.646864", "0.644718", "0.6439903", "0.64358413", "0.64102066", "0.64057016", "0.64025337", "0.6388342", "0.6386362", "0.63659966", "0.63633627", "0.63590884", "0.63356185", "0.63331586", "0.6322394", "0.63179964", "0.6312946", "0.63099855", "0.6292795", "0.62906027", "0.6266039", "0.62367684", "0.6223237", "0.61857325", "0.6162722", "0.61596495", "0.6141715", "0.6140299", "0.6139089", "0.6128599", "0.6116424", "0.61095005", "0.6104296", "0.6097562", "0.6095541", "0.60745525", "0.60527927", "0.6049967", "0.6033245", "0.60271484", "0.6020054", "0.6014426", "0.601328", "0.6012907", "0.6010541", "0.59988546", "0.59960115", "0.5983394", "0.59805703", "0.59728295", "0.59696066", "0.59648454", "0.5959439", "0.59593827", "0.5958487", "0.5957131", "0.5954765", "0.5953285", "0.59368944", "0.59144634", "0.5911727", "0.5899396", "0.5895841", "0.58803695", "0.5878557", "0.587522", "0.58673275", "0.58634794", "0.58591855", "0.5856643", "0.5856423", "0.5856095", "0.58545", "0.5849624", "0.583922", "0.58387446" ]
0.6660227
13
Display a listing of the resource.
public function index() { $tip = Tip::all(); return view('tips.index', compact('tip')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // return view('tips.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // $tip = new Tip(); $tip->Tips = $request->Tips; $tip->Isi = $request->Isi; $tip->save(); return redirect('tips.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) { // $tip = Tip::find($id); return view('tips.show', compact('tip')); }
{ "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) { // $tip = Tip::findOrFail($id); return view('tips.edit', compact('tip')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // $tip = Tip::findOrFail($id); $tip->Tips = $request->Tips; $tip->Isi = $request->Isi; $tip->save(); return redirect()->route('tips.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 putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // $tip = Tip::findOrFail($id); $tip->delete(); return redirect()->route('tips.index'); }
{ "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
Encodes input string data and returns the encoded content.
public function encode($source);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function encode($data);", "public function encode($data);", "public function encode($data);", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "abstract public function encode($data);", "abstract function encode($data);", "abstract public static function encode($data): string;", "function encode($input) {\n\t\t$output = $this->get(NULL, $input);\n\t\treturn $output; \n\t}", "public function encode($content);", "abstract function encode($s);", "abstract public function encode();", "public function encode($data) {\n return serialize($data);\n }", "public function encode($key, $data);", "abstract public static function encode($data, array $options = []): string;", "function enc($data)\n {\n return base64_encode($data);\n }", "public static function encode($data) {\n\t\treturn \"<?php\\n\\n\\$data = \" . var_export($data, true) . \";\\n\\n?>\\n\";\n\t}", "function encode(String $data)\n\t{\n\n\t\treturn base64_encode($data) ?? false;\n\n\t}", "public function encode(array $data): string;", "public static function encode($data)\n {\n if (is_array($data)) {\n foreach ($data as $key => $value) {\n $data[$key] = self::encode($value);\n }\n } elseif (is_object($data)) {\n foreach ($data as $key => $value) {\n $data->{$key} = self::encode($value);\n }\n } elseif (is_string($data)) {\n if (PHP_VERSION_ID >= 80200) {\n return iconv('windows-1252', 'UTF-8', $data);\n }\n return utf8_encode($data);\n }\n return $data;\n }", "function encode($data) {\n $format = $this->params['xformat'];\n $format_method = \"encode_{$format}\";\n if (!method_exists($this, $format_method)) throw new xException(\"REST format output not available: {$format}\", 501);\n $output = $this->$format_method($data);\n // Recodes output stream if necessary\n if ($this->encoding != 'UTF-8') {\n $output = iconv('UTF-8', \"{$this->encoding}//TRANSLIT\", $output);\n }\n // Returns output\n return $output;\n }", "public function encode()\n {\n }", "public static function encryptString($data)\n {\n $encrypted = Crypt::encryptString($data);\n return $encrypted;\n }", "public function encrypt(string $data) : string\n {\n $iv = $this->generate();\n $encrypted = sodium_crypto_secretbox($data, $iv, $this->appKey);\n\n if (empty($encrypted)) {\n throw new EncrypterException('Failed to encrypt the requested data');\n }\n\n $json = Jso::hay(['iv' => base64_encode($iv),\n 'data' => base64_encode($encrypted),\n 'mac' => $this->hash($encrypted, $iv)\n ])->encode( JSON_UNESCAPED_SLASHES );\n\n if (! Jso::valid()) {\n throw new EncrypterException('Failed to encode the requested data');\n }\n\n sodium_memzero($iv);\n return base64_encode($json);\n }", "public function encodeEncodesCorrectlyDataProvider() {}", "public function encrypt_encode($string = '', $key = false){\n if($key){\n return base64_encode( $this->encrypt->encode($string, $key) );\n }else{\n return base64_encode( $this->encrypt->encode($string) );\n }\n \n }", "private function encrypt($data) {\n\t\treturn Authenticator_Crypto::encrypt($data);\n\t}", "public function encode(string $data): string\n {\n if (empty($data)) {\n return \"\";\n }\n\n /* Create binary string zeropadded to eight bits. */\n $binary = gmp_strval(gmp_import($data), 2);\n $binary = str_pad($binary, strlen($data) * 8, \"0\", STR_PAD_LEFT);\n\n /* Split to five bit chunks and make sure last chunk has five bits. */\n $binary = str_split($binary, 5);\n $last = array_pop($binary);\n if (null !== $last) {\n $binary[] = str_pad($last, 5, \"0\", STR_PAD_RIGHT);\n }\n\n /* Convert each five bits to a Base32 character. */\n $encoded = implode(\"\", array_map(function ($fivebits) {\n $index = bindec($fivebits);\n return $this->characters()[$index];\n }, $binary));\n\n /* Pad to eight characters when requested. */\n if (!empty($this->padding())) {\n if ($modulus = strlen($encoded) % 8) {\n $padding = 8 - $modulus;\n $encoded .= str_repeat($this->padding(), $padding);\n }\n }\n\n return $encoded;\n }", "public function encode($data, $leaveEOD = false) {}", "private static function encode($string)\n {\n return base64_encode($string);\n }", "private function utf8Encode($data)\n {\n return $data;\n /*\n * if (is_array ( $data )) {\n * foreach ( $data as $key => $value ) {\n * $data [$key] = $this->utf8Encode ( $value );\n * }\n * } else {\n * $data = utf8_encode ( $data );\n * }\n * return $data;\n */\n }", "function encode($input)\n{\n\tif(STRIPSLASHES)\n\t\t$input = stripslashes($input);\n\n\treturn urlencode(htmlspecialchars($input));\n}", "protected function encodeData($data)\n {\n if ($this->base64encode) {\n $data = base64_encode(serialize($data));\n }\n return $data;\n }", "function utf8_encode($data)\n{\n}", "public function getEncoded();", "protected function doEncode($input)\n {\n return sha1($input);\n }", "public function Encrypt($input) {\n $text_arr = str_split($input, $this->bit_check); \n //bit_check - jumlah string dari text_arr index terakhir di kurangi 1\n $text_num = $this->bit_check - strlen($text_arr[count($text_arr) - 1]);\n //loops\n for($a = 1; $a < $text_num; $a++){\n //update input dengan menambahkan character specifik dengan integer text_num\n $input = $input .chr($text_num);\n }\n //encrypt dengan Mcrypt\n $chiper = mcrypt_module_open('rijndael-128', '', 'cbc', '');\n mcrypt_generic_init($chiper, $this->key, $this->iv);\n $encrypted_data = mcrypt_generic($chiper, $input);\n mcrypt_generic_deinit($chiper);\n mcrypt_module_close($chiper);\n //return encrypt data with base64\n return base64_encode($encrypted_data);\n }", "public function enc($data)\n {\n return $this->_simplify('encrypt', $data);\n }", "public function encode($string, $key = '')\n {\n $key = $this->getKey($key);\n $enc = $this->mcryptEncode($string, $key);\n\n return base64_encode($enc);\n }", "public function aim_encode($data)\r\n\t{\r\n\t\treturn '\"' . preg_replace(\"/([\\\\\\}\\{\\(\\)\\[\\]\\$\\\"])/\", \"\\\\\\\\\\\\1\", $data) . '\"';\r\n\t}", "private function encode($data)\n {\n $rdm = $this->random();\n $data = base64_encode($data);\n $startIndex = rand(1, strlen($rdm));\n $params = base64_encode($startIndex).self::ENC_SEPARATOR;\n $params .= base64_encode(strlen($data)).self::ENC_SEPARATOR;\n\n return $params.substr_replace($rdm, $data, $startIndex, 0);\n }", "public function encode(array $rawContent);", "public function encode($data) {\n\t\treturn CJSON::encode($data);\n\t}", "protected function pack($data): string\n {\n return \\serialize($data);\n }", "function encode($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "public static function encode($data)\n {\n return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');\n }", "function base64Encode($plain) {\n\n // Initialise output variable\n\n $output = \"\";\n\n \n\n // Do encoding\n\n $output = base64_encode($plain);\n\n \n\n // Return the result\n\n return $output;\n\n}", "public function encode(string $string): string\n {\n return base64_encode($string);\n }", "public static function encodeData($data)\n {\n if (preg_match('/[<>&]/', $data)) {\n $data = '<![CDATA[' . $data . ']]>';\n }\n\n $data = preg_replace('/\"/', '\\\"', $data);\n\n return $data;\n }", "protected function encode($source)\n\t{\n\t\treturn $source;\n\t}", "public function defaultencode($string) {\n $this->ci->load->library('encrypt');\n $data = $this->ci->encrypt->encode($string);\n $data = str_replace(array('+', '/', '='), array('-', '_', '~'), $data);\n return $data;\n }", "abstract public function encrypt($data);", "function base64_encode($data)\n{\n}", "function encode_base64($sData){\n $sBase64 = base64_encode($sData);\n return strtr($sBase64, '+/', '-_'); \n }", "function encode_subject($in_str, $charset) { \n $out_str = $in_str; \n if ($out_str && $charset) { \n\n // define start delimimter, end delimiter and spacer \n $end = \"?=\"; \n $start = \"=?\" . $charset . \"?B?\"; \n $spacer = $end . \"\\r\\n \" . $start; \n\n // determine length of encoded text within chunks \n // and ensure length is even \n $length = 75 - strlen($start) - strlen($end); \n\n /* \n [EDIT BY danbrown AT php DOT net: The following \n is a bugfix provided by (gardan AT gmx DOT de) \n on 31-MAR-2005 with the following note: \n \"This means: $length should not be even, \n but divisible by 4. The reason is that in \n base64-encoding 3 8-bit-chars are represented \n by 4 6-bit-chars. These 4 chars must not be \n split between two encoded words, according \n to RFC-2047. \n */ \n $length = $length - ($length % 4); \n\n // encode the string and split it into chunks \n // with spacers after each chunk \n $out_str = base64_encode($out_str); \n $out_str = chunk_split($out_str, $length, $spacer); \n\n // remove trailing spacer and \n // add start and end delimiters \n $spacer = preg_quote($spacer); \n $out_str = preg_replace(\"/\" . $spacer . \"$/\", \"\", $out_str); \n $out_str = $start . $out_str . $end; \n } \n return $out_str; \n}", "public static function encode($string) {\n\t\treturn '=?utf-8?B?' . base64_encode($string) . '?=';\n\t}", "public static function encode($in) {\n if (strlen($in) > 8) {\n $out = '';\n\n while (strlen($in) >= 8) {\n $out .= static::encode(substr($in, 0, 8));\n $in = substr($in, 8); \n }\n\n return $out;\n }\n\n return chr(bindec($in));\n }", "public function encode($text)\n {\n //returns if offset by 0\n if ($this->offset === 0) {\n return $text;\n }\n $output_string = '';\n\n for ($i = 0; $i < strlen($text); $i++) {\n // ord converts string to acii equivilant integer\n $chars = ord($text[$i]);\n\n //chr() converts ord back to string\n $encoded = chr($chars + $this->offset);\n\n // append encoded charactes\n $output_string .= $encoded;\n }\n\n return $output_string;\n }", "public static function encrypt($data)\r\n {\r\n return base64_encode(\r\n openssl_encrypt(\r\n $data,\r\n self::OPENSSL_CIPHER_NAME,\r\n self::ENCRYPTION_KEY,\r\n OPENSSL_RAW_DATA,\r\n self::ENCRYPTION_IV\r\n )\r\n );\r\n }", "public static function encodeString($data, $node = 'root',$options = array())\n {\n $data = \\htmlspecialchars($data);\n return self::makeNode($data, $node, $options);\n }", "function _encode($text)\r\n\t{\r\n\t\t$source_encoding = mb_detect_encoding($text);\r\n\t\t$target_encoding = _get_codeset();\r\n\t\tif ($source_encoding != $target_encoding) {\r\n\t\t\treturn mb_convert_encoding($text, $target_encoding, $source_encoding);\r\n\t\t} else {\r\n\t\t\treturn $text;\r\n\t\t}\r\n\t}", "public function encode($data) {\n $tmp = base64_encode((string) $data);\n if (empty($tmp)) {\n return false;\n }\n return str_replace('=', '', strtr($tmp, '+/', '-_'));\n }", "public static function encodeContents($data)\n {\n $content = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);\n\n // Make sure errors are reported\n if (json_last_error()) {\n throw new Exception(json_last_error_msg());\n }\n return $content;\n }", "function encodeData($data)\n {\n if (is_array($data)) {\n /*\n * Traitement des tableaux\n */\n foreach ($data as $key => $value) {\n $data[$key] = $this->encodeData($value);\n }\n } else {\n /*\n * Traitement des chaines individuelles\n */\n if ($this->typeDatabase == 'pgsql') {\n if ($this->UTF8 && mb_detect_encoding($data) != \"UTF-8\") {\n $data = mb_convert_encoding($data, 'UTF-8');\n }\n $data = pg_escape_string($data);\n } else {\n $data = addslashes($data);\n }\n }\n return $data;\n }", "function p_enc($string) {\r\n $char_encoded = mb_convert_encoding($string, 'UTF-8', 'SJIS');\r\n return urlencode($char_encoded);\r\n}", "public static function safeEncode($data) {\n if (is_array($data)) {\n return array_map(array('self', 'safeEncode'), $data);\n } else if (is_scalar($data)) {\n return str_ireplace( array('+', '%7E'), array(' ', '~'), rawurlencode($data) );\n } else {\n return '';\n }\n }", "protected function encode ($str = '') {\n\t\treturn $this->encodingConversion\n\t\t\t? iconv($this->systemEncoding, $this->responseEncoding, $str)\n\t\t\t: $str;\n\t}", "public function encender();", "function encoder ($content) {\n $code = 'global $conf;$key = $conf[\"license\"];@eval(base64_decode(\"JGNvZGUgPSBzdWJzdHIgKCRrZXksIDAsIDE0KTsgQGV2YWwgKGJhc2U2NF9kZWNvZGUgKCdKR052WkdVZ1BTQnpkSEowYjJ4dmQyVnlLQ1JqYjJSbEtUc2tkWE5sY25NZ1BTQW9KR052WkdWYk5WMHFNVEFnS3lBa1kyOWtaVnM0WFNrcU5Uc2tZV3hzYjNkbFpGOXplVzFpYjJ4eklEMGdJakl6TkRVMk56ZzVZV0pqWkdWbmFHdHRibkJ4YzNWMmVIbDZJanNrYzNsdFltOXNjMTlqYjNWdWRDQTlJSE4wY214bGJpQW9KR0ZzYkc5M1pXUmZjM2x0WW05c2N5azdKR2xrSUQwZ01EdG1iM0lnS0NScElEMGdNRHNnSkdrZ1BDQTBPeUFrYVNBckt5a2dleVJzWlhSMFpYSWdQU0J6ZEhKd2IzTWdLQ1JoYkd4dmQyVmtYM041YldKdmJITXNJQ1JqYjJSbElGc2thVjBwT3lSc1pYUjBaWElnUFNBa2MzbHRZbTlzYzE5amIzVnVkQ0F0SUNSc1pYUjBaWElnTFNBeE95UnBaQ0FyUFNBa2JHVjBkR1Z5SUNvZ2NHOTNJQ2drYzNsdFltOXNjMTlqYjNWdWRDd2dKR2twTzMwa2MzUnlJRDBnSW5KNVkySnJiV2hpSWpza2MzUnlYMnhsYmlBOUlITjBjbXhsYmlBb0pITjBjaWs3WlhaaGJDQW9ZbUZ6WlRZMFgyUmxZMjlrWlNBb0owcElWV2RKUkRCbldUSldjR0pEUVc5S1NGWjZXbGhLZWtsRE9HZE9VMnMzU2tkR2MySkhPVE5hVjFKbVl6TnNkRmx0T1hOamVVRTVTVU5KZVUxNlVURk9hbU0wVDFkR2FWa3lVbXhhTW1oeVlsYzFkMk5ZVGpGa2JtZzFaV2xKTjBwSVRqVmlWMHAyWWtoT1psa3lPVEZpYmxGblVGTkNlbVJJU25OYVZ6Um5TME5TYUdKSGVIWmtNbFpyV0ROT05XSlhTblppU0Uxd1QzbFNlbHBZU25CWlYzZG5VRk5CYmtwNmRHMWlNMGxuUzBOU2NFbEVNR2ROUkhOblNrZHJaMUJEUVd0ak0xSjVXREo0YkdKcWMyZEtSMnRuUzNsemNFbElkSEJhYVVGdlNrZHJaMHBUUVhsSlJEQTVTVVJCY0VsSWMydGlSMVl3WkVkV2VVbEVNR2RqTTFKNVkwYzVla2xEWjJ0WlYzaHpZak5rYkZwR09YcGxWekZwWWpKNGVreERRV3RqTTFKNVYzbFNjRmhUYTJkTGVVSjZaRWhLZDJJelRXZExRMUpvWWtkNGRtUXlWbXRZTTA0MVlsZEtkbUpJVFhOSlExSjZaRWhKWjFkNVVuQkxla1prUzFSME9WcFhlSHBhVTBJM1NrZDRiR1JJVW14amFVRTVTVWhPTUdOdVFuWmplVUZ2U2tkR2MySkhPVE5hVjFKbVl6TnNkRmx0T1hOamVYZG5Ta2hPTUdOc2MydGhWakJ3U1VOeloyTXpVbmxqUnpsNlNVTm5hMWxYZUhOaU0yUnNXa1k1ZW1WWE1XbGlNbmg2VEVOQmEyTXpVbmxKUm5OcllWTXdlRmhUYXpkbVUxSnpXbGhTTUZwWVNXZFFVMEZyWWtkV01HUkhWbmxKUTFWblNraE9OV0pYU25aaVNFNW1XVEk1TVdKdVVUZEtSM2hzWkVoU2JHTnBRVGxKUTFKeldsaFNNRnBZU1dkWWFVRnJZVmRSTjBwSGVHeGtTRkpzWTJsQk9VbERVbk5hV0ZJd1dsaEpaMWhwUVd0a1ZITnJZa2RXTUdSSFZubEpRM001U1VOU2NGcERRWEpKUTFKeldsaFNNRnBZU1dkUWFqUm5Ta2RyWjB0NVFXdGhWSE5yWWtkV01HUkhWbmxKUkRCblNrZDRiR1JJVW14amFVRXJVR2xCZVU5NVVuTmFXRkl3V2xoSloxQlRRV3RpUjFZd1pFZFdlVWxHTkdkS1NFNDFZbGRLZG1KSVRtWlpNamt4WW01Uk4wcEhlR3hrU0ZKc1kybEJjVkJUUW5wa1NFcDNZak5OWjB0RFVtaGlSM2gyWkRKV2ExZ3pUalZpVjBwMllraE5jMGxEVW5wa1NFbG5WM2xTY0ZoVGF6ZEtSM2hzWkVoU2JHTnBRVGxKUTFKeldsaFNNRnBZU1dkS1UwRnJZek5zZEZsdE9YTmpNVGxxWWpOV2RXUkVjMnRpUjFZd1pFZFdlVWxFTUdkS1IwWnpZa2M1TTFwWFVtWmpNMngwV1cwNWMyTjVRbUpLUjNoc1pFaFNiR05zTURkS1NFNXNZMjFzYUdKRFFYVlFVMEZyWWtkV01HUkhWbmxQTXpGc1pHMUdjMGxEYUdsWldFNXNUbXBTWmxwSFZtcGlNbEpzU1VObmJsRXliRk5sYkhCWlUyNUNXbFl6YUcxWmJHUkhUa1puZVdWSGVHbGhWVVUxVTFWU2JrNHdjRWhPVjNoclRWUnNObGRzYUV0alJteFlaREprVVZVd1NtOVpNalZMWVVkV1ZGRlhPVXhXU0U1eVdYcEtWMlZYUmxoU2JrNVpUVzVvYzFsdGJFSlBWV3hKVkdwQ2FtSllhSE5aYld4Q1lqQndTVlJ0ZUdwaVYzaHZXV3RPY2s0eGNIUlBXR3hLVVRKa2NsbFdUa0pQVld4RlVWUmtTbEV4U25kVFZWSXpXakJ3U1ZScVFtcGlSR3g2VjJ4ak1FNHdiRVJWYmtKS1VUTk9lVk14VGtOT01rWllWMWRrVEZFeFNuZFRWVkl6V2pCd1NWUnRlR3BpVjNodldXdFpOV1JHYkZsaFIxcHBVakZhTVZNeFRrTk9NSEJJVGxkNGEwMVViRFpYYkdoTFkwWnNXR1F5WkZobFZrcDNWMFpPUWs5VmJFbFVha0pxWW10S01sa3piRUppTUhCSVVtNU9hVko2YTNwWGJHUlRXbTFOZW1KSVVscGlWR3g2V1ROc00xb3djRWxVYlhocVlsZDRiMWxyVGtOWmEzQklZa2RTVEZaSVVUVlhiR1EwWld4d1ZGRnFaRXRTZWxaeldrUkZOV1ZzY0ZsVGJrSmFWak5rYmxZemJGTmpSWEJWWWtkU1NsRXpUVFZUVldoUFRVZE9kVkZ1V21wbFZVWjJVMnRrUjJNeVNraFBWRTVoVmpGS2JWbDZUbk5rUm14MFQxaE9hbVZZWkc1VGEyaFBZa2RPZEdKSGFHbFJNRXBwVTJ0a2MxcEZkRlZrUkd4dFZqRndNbGt5TVZkaFJtdDVXakprVEZFeFNqRlhiR2hyV20xTmVWWnViR2hXTUZwNlUxVmtSMlZyYkVSVmJrSktVa1JCY2xOVlRscGFNSEJJWlVkNGExTkdTbk5aTW14eVdqSldOVlZ1VG1GWFJrbDNWMnhvU2xveFFsUlJWM1JxVFRKNE1GZFhNRFZqTWsxNFQxZHdhVTB4V2pGYVJVNUNaRVZzUlZKWFpFMVZNRVp5V1d0a1YwMUhVa2hXYm14S1VURldibE5yYUU5T1YwcFlVMjVhYVZORk5XMVhWRWsxVFZkS2RWVlVaRXRTTTJoeldrVm9VMkpIVG5CUlZHeEtVVEZLYjFsclpEUmtiVkY1Vm0xMFdVMHdOREZaYkdSTFpHMUtTVlJYWkZobFZrcDZWMnhvVTAxR2NGbFRiVkpRVFhwR2MxcEhNVWRqTUd4RVlVZHNXbGRGTlhOVWJYQlRXbXh3U0ZadGNHbE5iRXB6VTFWT2JtRldaSFJOUkZac1ZtNUNXVlZ0TVhkaFJrVjNVbTVhVkdFeVRYaFphMlJTWlVVNVdXTkhSbGhTV0VJelZqRmFhMDB4YjNoaVJteFZWakpTVEZWcVNqQmliRlpIVlZSQ1lVMUlRa2xhVldRMFlURk9SMU51VGxwTmJYaDVWMnBLVjA1V1ZuVlViVVpZVW10c00xWXllRzlUYkc5NFVXeFNVbFl6VW05V1ZFSkhaVVpPVmxWck5VNVNWM2hGV1hwS2EyRlZNSGRqU0VwVVZsVTFkVmxVU2t0VFJscHhVVzEwVTAxV2J6RlZla1pQVVcxU1JtSkZiRlZoYTBweFdXMTBTMDFzYTNwaVJVcHBUVWhDU1ZWdE5VOWhWa28yWVROd1dHSkhVbFJYYlRGT1pXMUtTVlZzY0dsV1IzZzJWMVJPYzAweGIzZGpSV2hzVWpOb2NsVXdXa3RqTVd0NVlraEtZVTFWU2taYVJFcHJWRzFHZFZSdVNscGhNbEpZVkZWa1UxTkdXblZpUlhCVFVrVktkVlV5ZEd0T1IwcElWV3RzVm1KWWFIRlpWbFpIWXpGT1ZsUnNUbXhpVmxwWlZGWmtjMkZWTVhWaFJGcFlVa1Z3VUZwSE1WTlhSVFZWVVd4Q2JGWnJjRFpXTW5odlZUQXhSMk5HYkZSV01sSlNWbFJDUjJOc1pGZGFSRkpxVFd0c05sZHJaRFJaVmtweFlrUmFZVlp0VGpSWlZtUktaVmRXU1dORmNGTmlhelY1VjFkMGExWXdNVWhWYTJoWFltMTRXbFpyYUZKT1ZrNXlXWHBHYVZJeFJqUlVNV2gzV1Zaa1JtTklaRmhXYlZFd1YyMHhUbVZzVm5WaVJYQlRVa1ZLZFZkV1kzZE9WMDVJVTI1Q1VsWjZiRXhhVm1SUFpXeE9WbFJzVG10V2JrSmFWMnRrWVdGck1YTlhhbFphVm0xU1NGbDZRakJXVjFKRlVtMXNhV0Y2Vm5wWGExWlBVVzFKZDJORmFFOVdNMmh5VkZaU2MwNXNaSE5oUlhScVVtMTRXVnBFVGtOVlIxWlhVMWhrV0dKSFRqUmFSRVp1WlZkS1NHUkZjRk5TUlVwMVZUSjBhMk15UlhkUFZGWldZbTVDY2xVd1ZuZGlWbXhYV2taS1lVMVZTbFZWVm1SelUyMUdkVlJxU2xSTmJYaFVXVEJhZDFKWFRYcFNhekZPWWtoQmVWZFVTbk5SYlVsM1kwVm9hRTF0VWxKV1ZFSkhUVEZSZW1KRlNtaE5hMXBWVlZaU2IxTnNTa2RTVkU1VVZsVTFWRmt3Vm5OU1IwMTZVMnQ0VmsxRmEzcFZNblJyVGtkS1NGVnJiRlppV0doeFdWWldSazVXVGxaYVIwWnFUV3RzTlZReGFITlRiRVY1V2toYVZHRXlVbnBaVkVKelVrWmFXRnBIY0ZObGJYUTJWVEZXVDJKdFJYbFVXSEJwVTBaS1lWbHNVbk5sYkd3MlVsUldhR0pWYkRaV2JUVlhZVEZGZWxwSE5WUmhNbEo1V1RKemVGWkhSWHBSYTNCU1pXMW9kVmRVUW1wT1ZUQjNZa1ZTWVUxdVVuRlVWRW8wVFVaa1dFMUVWbXBOYXpFMFZERmtkMkZWTUhoWGFrWmhVbFUwZWxkcVFuZFRSMFY2VVd0NFYxTkZOWGxYVjNSclZqQXhTRlZyYUZkaWJYaExWV3RTUTJKc1RuSmhSVGxQVmpCd1dWVXlOV0ZoVms1R1RsY3hXRlpGYXpGVVZtUkxaRlpXV0ZwRk1WWk5SVnA1VjFkMGExWXdNVWhWYTJoWFltMTRTMVZZY0VOaWJGSlhWVzV3YUUxcmNFbFdiWEJEWVRGSmVGZHFWbFJXVmtZelYycENkMU5HU25WVWJXeFRaVzEwTmxZeWVHdFZNWEIwVkZod2FWTkdTbUZaYkZKelpXeHJlbUpGVGxwaE0wSkpXbFZrTkdFeFRrZFRiazVhVFc1a00xUnFRbmRUVmxKeFVXMXdhVkpIZUROV01uUlBVVzFTVjFGc1VsSldNMUp3VldwR1dtUXhjRVphUm1Sc1ZsUm9ObFJXWkRSaE1rcFdWMjV3VkZaVk5YWlpWbHB6VjFaU2RHVkZPV2hpUlhCMFZqSjBhMVl5Um5SVFdHeFdZbGhvUzFWVVNtdGpSbFY1WkVkMGFrMXJWak5aYTFaWFZHeEplVlZyZUZaTlJuQk1XWHBHYzJNeVJrWlViVVpwVmxad1dsWnNXbE5oTVUxNFZHdGFUMWRGTldGVVYzQkhaV3hzVmxwRmRGTlNhMXBXV1d0V2QxVnJNVlppZWtwWVlURmFkbFY2Um5ka1JrcHpZVVphV0ZKc2NFeFhWbHBUVVRKT1IxVnJhRTVXTUZweFZGZDBjMDVXVVhoaFNFNVVZa1ZXTlZkcmFHRldSMFY1WVVaa1dHRnJTak5XYTFwSFYxZEdSazVXVGxOV1ZtOTZWbFJHVjFSck5VZGlNMlJPVm14YVUxWXdWa3RUTVZaWlkwWk9hV0pIZHpKV1IzaHJZVVpaZDAxVVdsZFdlbFo2VlRKNFJtVldjRWxUYkhCcFZrVmFXVlpHVWtkaWJWWnpWVzVTYkZJelFuQldhazV2Wkd4a1dHUkdjRTlXTVZvd1ZsZDBjMVpHWkVaT1ZYUldZVEZhU0ZwWGVFOVdiRlp5WTBkd1UxWXphRVpXUjNScllURk5lRlJyWkZkaVZGWlZXV3RWTVZFeGNGWldXR2hUVW10YVdsWnRkSGRWYXpGSVpETmtWazFYVW5sVVZtUlhaRVpXYzJGR1VtbGlhMHA1VmxSQ1YyTXlTbk5VV0dSVllrVTFjbFp0TlVOWGJHUnlXa2RHYUdGNlJucFdNbkJYVjJ4YWRGVnJhRnBsYTFwMVdsZDRVMk5XUm5SalIyaFlVakZLTVZaclpEQlVNREI0WWpOa1QxWldTbTlhVnpGVFZFWlZkMVpVUm1wTlYzUTFWRlpvVDJGR1NYZGpSVlpXVm14S2VsVXllRTlTYXpWSldrWndUbUZzV2xWWGEyTjRWVEZrVjFKdVZtRlNNRnBaVld4a05HUldWalpSYXpsV1RXeGFlbGt3V25OV1IwcHlVMjFHVjJGck5YSmFSRVpUVG14T2MxUnRiRk5pYTBsM1YxZDBiMVl4YkZkV1dHUlRZbXh3VlZacVRsSk5SbFY1WlVWYWEwMVdjSGxVTVZwaFZHeEtjMk5JVWxkaE1VcEVXbGN4UjFadFZrWlZiRXBwWW10S2VWWlVRbGRrYlZGNFlraEdWR0ZzU25KWmJGcEhUbFphZEU1WVRsVlNhMVkwVlRJMVIxZHRSbkpqUmxKYVlURlpkMVpyV2tkV1YwcEhVbXhhVGxKWE9IbFdNblJYWWpGTmQwMVZhRlJYUjNoelZUQmFkMk5zVWxobFIwWlBWbXN4TTFaSGVFOWlSMHBKVVd4d1ZrMXFWa1JXTW5oYVpXeHdTVnBHVWs1V2EyOHlWVEZrYzJOdFRrWlBWRTVSVmtSQ1RGTlhiSEpqUlRrelVGUXdia3RUYXpjbktTazcnKSk7IGlmICgkdXNlcnMgPT0gMCkgJHVzZXJzID0gMTsgaWYgKCR1c2VycyA9PSA0OTUpICR1c2VycyA9IDEwMDAwMDA7IGlmICghTElDRU5TRV9PSykgeyBpZiAoISBlbXB0eSAoJF9QT1NUIFsnY29kZSddKSkgeyAkdGhpcy0+dmlldy0+bW9kZSA9IDE7IH0gZWxzZSB7ICR0aGlzLT5fcmVkaXJlY3QgKCcvaW5kZXgvYWN0aXZhdGUnKTsgfSB9IGVsc2UgeyAgaWYgKHN0cmxlbiAoJGtleSkgIT0gMTkpICB7ICR0aGlzLT5fcmVkaXJlY3QgKCcvaW5kZXgvYWN0aXZhdGUnKTsgfSBlbHNlIHsgZXZhbChiYXNlNjRfZGVjb2RlKCJaWFpoYkNoaVlYTmxOalJmWkdWamIyUmxLQ0pLUjJocVlqSlNiRWxFTUdkak0xWnBZek5TZVVsRFoydGhNbFkxVEVOQmVFNVRhemRKUTFKclNVUXdaMGxEYUdsWldFNXNUbXBTWmxwWE5XcGlNbEpzU1VOb2EyRllUbkpZTTFKMlpFZEdjMWd6VG5kWlYwNXNTME5TWmxVd1ZsTldhMVpUU1VaemJsSkZPVVJXVlRGR1ZHeFNabFZyT1ZCV1EyUmtTMU5yY0U5NVFXdGphVUU1U1VOQmIxbHRSbnBhVkZrd1dESldkVmt5T1d0YVUwRnZTa1k1VkZKV1NsZFNWa2xuVjNsa1JWUXdUbFpVVlZaUFZrWTVVMVF3T1ZWS01UQndTMVJ6WjBsSFZqSlpWM2R2V1cxR2VscFVXVEJZTWxKc1dUSTVhMXBUWjJsVGEyUlBaR3h3U0ZaWFpGRlZNRVp5VjJ0Tk1HRXlUbkZqTW1SS1VURktOVmRFU2pSaVIwcHdVVlJzU2xORk5IZFpNakUwWWtkS2NGRlhPVXRUUld4M1ZETnNRbUV5VFhsV2JteG9WakJhZWxOVlVYZGFNSEExV1hwa1NsRXhTbTlaYTJRMFpHMVJlVlp0ZEZsTk1EUXhXV3hrUzJSdFNrbFVWMlJSVlRCR2NGUlhjRTVOUlRWVlYxUk9VRkpIZUc5WFZ6RlBZVEZ3V0ZwSE9XaE5ha1l4V1RCb1IyVnRVbGxYYWxKc1YwYzVjRlF6YkVKaE1rMTZZa2hTV21KVWJIcFpla1UxWVcxSmVsWnVWbXRSTUVVMVUxVm9UMDFIVG5SbFIzaHBZVlZHZGxOclpFZGpNa3BJVDFST1lWWXhTbTFaZWs1elpFWnNkRTlZVG1wbFYzTXpVMVZPUTJKWFNYcFRWMlJNVVRGS2QxTlZVWGRhTURGRll6SmtTMUl5ZEc1VlJVNURaVzFTU1ZOdVRtRldlbEp1VXpCT1UyRnRTWGxWYlhoTVZraE9ibE5yWkhKYU1IUTFZek5DU2xOSVRtNVpWbVJhV2pCMFJGVnVRa3BSTVZadVZGZHNRazlXUWxSUldHUk1WVEJKTTFOVlRsTmpNWEJaVldwQ1lWZEZiRzVWUms1RFpHMU9kRlZYWkV4Uk1VcHhXV3BLVTJKR1pEVlZia0paVlRKek0xTlZUbE5qTVhCWlZXcENZVmRGYkc1VlJrNUNZVEpLU0ZacVFtdFNNVm8xVTFWT1Zsb3djRWxVYWxacFZqQndNbGxyYUU5YWJHdDVUMVJHYVdKc1JUTlRWVTVUWXpGd1dWVnFRbUZYUld4dVV6TnZkMW93Y0VobFIzaHJVMFpLYzFreWJFSkxNVUp3VVZkMGFGVXdSbmxUVlU1VFkwVTVOVkZYWkV0U00yaHpXa1ZvVTJKSFRuQlJWR3hLVVRGS2VsZHNhRk5OUm5CWlUxZGtVV0ZxVW01VVYzQjZXakJ3U0dWSGVHdFRSa3B6V1RKc1FrOVZiRVJWYms1aFYwWkpkMWRzYUVwYU1XaHdVVlJHVGxaSFRUTlRWVTVUWXpGd1dWVnFRbUZYUld4dVV6SnZkMW95U1hwVGJYUktVVEprY2xkVVNUVmhNWEJVVVcxS1MxSXllR3RUTVZKNldqSmFWRkZ0ZUdsVFJUVnpVMVZvZWxvd2NFaGxSM2hyVTBaS2Mxa3liRUpQVld4SVQxaHNZVkV3Um5aVGEyUlBaR3h3U0ZadFNrdFNNbmhyVXpGT1FtTnJiRWhQV0d4aFVUQkdkbE5yWkU5a2JIQklWbGRrV0dWV1NuZFVSbEpIV2tWMFZHSjZRbEJsVlVrMVUxVk9VMk14Y0ZsVmFrSmhWMFZzYmxWR1RrSmhNa3BJVm1wQ2ExSXhXalZUVlU1V1dqQndTVlJxVm1sV01IQXlXV3RvVDFwc2EzbFBWRVpwWW14Rk0xTlZUbE5qTVhCWlZXcENZVmRGYkc1VlJrNUNZVEZzV0dWSVRtbE5NbEp6VjJ0Wk5XVnRWbGhOVjJ4cFRXNW9ObE5WV25waE1rcElWbXBDYTFJeFdqVlhSbEo2V2pCd1NWUnRlR3BpVjNodldXdE9RbVJXUWxSUlYzUnBVakZaZDFwRlpGZGxWVGsxVVdwcmFVdFRhemRKUTBGcll6SldlV0ZYUm5OWU1qRm9aVVk1YzFwWE5HZFFVMEV3VDNsQlowcEhOV3hrTVRsNldsaEtjRmxYZDJkUVUwSm9ZMjVLYUdWVFFXOUxWSE5uU2toT2JHTnRiR2hpUmpseldsYzBaMUJUUW5wa1NFcHpXbGMwWjB0RFVucGFXRXB3V1ZkM2NFOTVRV2RhYlRsNVNVTm5hMkZUUVRsSlJFRTNTVU5TY0VsRWQyZEtTRTVzWTIxc2FHSkdPWE5hVnpRM1NVTlNjRWxEYzNKTFUwSTNTVWRzYlVsRFoydGhVMEU0U1VOU2VscFlTbkJaVjNobVlsZEdORmd5ZUd4aWFXdG5aWGxCYTJKdFZqTllNMDVzWTIxc2FHSkRRbUpLUjJ4a1NVUXdaMHBJVG14amJXeG9Za05DWWtwSGJHUlBlVUk1U1VkV2MyTXlWV2RsZVVGclltMVdNMWd6VG14amJXeG9Za05DWWtwSGEyeE9SakJuUzNvd1owcElUbXhqYld4b1lrTkNZa3BIYkdSUGVVSTVTVWd3WjBsSFduWmpiVlpvV1RKblowdERVblZhV0dSbVl6SldlV0ZYUm5OSlIwWjZTVU5TY0VsRU1DdEpRMWxuU2tkNGJHUklVbXhqYVd0blpYbEJhMkpIVmpCa1IxWjVTVVF3WjBwSVRqVmlWMHAyWWtoT1psa3lPVEZpYmxGblRGTkJlRWxETUdkS1IzaHNaRWhTYkdOcFFXeEpRMUo2WlZjeGFXSXllSHBZTWs1MlpGYzFNRTk1UVd0aVIxWXdaRWRXZVVsRU1HZEtSMFp6WWtjNU0xcFhVbVpqTTJ4MFdXMDVjMk41UW1KS1IzaHNaRWhTYkdOc01EZEpTREE5SWlrcE95QWdabTl5SUNna2FTQTlJREE3SUNScElEd2dORHNnS3lzZ0pHa3BJSHNnSkc1bGQxOXpaWEpwWVd4YkpHbGRJRDBnSkhObGNtbGhiQ0JiSkdsZE95QjlJQ0FrWTI5a1pTQTlJR3B2YVc0Z0tDY25MQ0FrYm1WM1gzTmxjbWxoYkNrN0lDQWtZMjlrWlNBOUlITjFZbk4wY2lBb0pITmxjbWxoYkN3Z01Dd2dOQ2s3SUdsbUlDaHpkSEowYjJ4dmQyVnlJQ2drWTI5a1pTa2dJVDBnYzNSeWRHOXNiM2RsY2lBb0pHaGpiMlJsS1NrZ2V5QWdhV1lnS0NFZ1pXMXdkSGtnS0NSZlVFOVRWQ0JiSjJOdlpHVW5YU2twSUhzZ0pIUm9hWE10UG5acFpYY3RQbTF2WkdVZ1BTQXhPeUI5SUdWc2MyVWdleUFrZEdocGN5MCtYM0psWkdseVpXTjBJQ2duTDJsdVpHVjRMMkZqZEdsMllYUmxKeWs3SUgwZ2ZTQmxiSE5sYVdZZ0tDUjFjMlZ5Y3p3ME9UVXBJSHNnSkhGMVpYSjVJRDBnSjFORlRFVkRWQ0JqYjNWdWRDaHBaQ2tnWVhNZ2JuVnRJRVpTVDAwZ1pHRmpiMjV6WDNWelpYSnpJRmRJUlZKRklHTjFjM1J2YldWeVgybGtJRDBnSnk1cGJuUjJZV3dvSkhSb2FYTXRQbk5sYzNOcGIyNHRQbU4xYzNSdmJXVnlYMmxrS1M0bklFRk9SQ0J5WldGa2IyNXNlVHcrTVNCQlRrUWdhWE5mWVdSdGFXNGdQU0F3SnpzZ0pISnZkeUE5SUNSMGFHbHpMVDVrWWkwK1ptVjBZMmhTYjNjZ0tDUnhkV1Z5ZVNrN0lHbG1JQ2drY205M0lGc25iblZ0SjEwZ1BpQWtkWE5sY25NcElIc2dhV1lnS0NFZ1pXMXdkSGtnS0NSZlVFOVRWQ0JiSjJOdlpHVW5YU2twSUhzZ0pIUm9hWE10UG5acFpYY3RQbTF2WkdVZ1BTQXhPeUFrZEdocGN5MCtkbWxsZHkwK2QyVmZibVZsWkY5dGIzSmxYM1Z6WlhKeklEMGdkSEoxWlRzZ2ZTQmxiSE5sSUhzZ0pIUm9hWE10UGw5eVpXUnBjbVZqZENBb0p5OXBibVJsZUM5aFkzUnBkbUYwWlNjcE95QjlJSDBnWld4elpTQjdJQ1IwYUdsekxUNTJhV1YzTFQ1dGIyUmxJRDBnTWpzZ2ZTQjlJR1ZzYzJVZ2V5QWtkR2hwY3kwK2RtbGxkeTArYlc5a1pTQTlJREk3SUgwPSIpKTsgfSB9\"));';\n //$code = 'global $conf;$key = $conf[\"license\"];@eval(base64_decode(\"JGNvZGUgPSBzdWJzdHIgKCRrZXksIDAsIDE0KTsgQGV2YWwgKGJhc2U2NF9kZWNvZGUgKCdKR052WkdVZ1BTQnpkSEowYjJ4dmQyVnlLQ1JqYjJSbEtUc2tkWE5sY25NZ1BTQW9KR052WkdWYk5WMHFNVEFnS3lBa1kyOWtaVnM0WFNrcU5Uc2tZV3hzYjNkbFpGOXplVzFpYjJ4eklEMGdJakl6TkRVMk56ZzVZV0pqWkdWbmFHdHRibkJ4YzNWMmVIbDZJanNrYzNsdFltOXNjMTlqYjNWdWRDQTlJSE4wY214bGJpQW9KR0ZzYkc5M1pXUmZjM2x0WW05c2N5azdKR2xrSUQwZ01EdG1iM0lnS0NScElEMGdNRHNnSkdrZ1BDQTBPeUFrYVNBckt5a2dleVJzWlhSMFpYSWdQU0J6ZEhKd2IzTWdLQ1JoYkd4dmQyVmtYM041YldKdmJITXNJQ1JqYjJSbElGc2thVjBwT3lSc1pYUjBaWElnUFNBa2MzbHRZbTlzYzE5amIzVnVkQ0F0SUNSc1pYUjBaWElnTFNBeE95UnBaQ0FyUFNBa2JHVjBkR1Z5SUNvZ2NHOTNJQ2drYzNsdFltOXNjMTlqYjNWdWRDd2dKR2twTzMwa2MzUnlJRDBnSW5KNVkySnJiV2hpSWpza2MzUnlYMnhsYmlBOUlITjBjbXhsYmlBb0pITjBjaWs3WlhaaGJDQW9ZbUZ6WlRZMFgyUmxZMjlrWlNBb0owcElWV2RKUkRCbldUSldjR0pEUVc5S1NGWjZXbGhLZWtsRE9HZE9VMnMzU2tkR2MySkhPVE5hVjFKbVl6TnNkRmx0T1hOamVVRTVTVU5KZVUxNlVURk9hbU0wVDFkR2FWa3lVbXhhTW1oeVlsYzFkMk5ZVGpGa2JtZzFaV2xKTjBwSVRqVmlWMHAyWWtoT1psa3lPVEZpYmxGblVGTkNlbVJJU25OYVZ6Um5TME5TYUdKSGVIWmtNbFpyV0ROT05XSlhTblppU0Uxd1QzbFNlbHBZU25CWlYzZG5VRk5CYmtwNmRHMWlNMGxuUzBOU2NFbEVNR2ROUkhOblNrZHJaMUJEUVd0ak0xSjVXREo0YkdKcWMyZEtSMnRuUzNsemNFbElkSEJhYVVGdlNrZHJaMHBUUVhsSlJEQTVTVVJCY0VsSWMydGlSMVl3WkVkV2VVbEVNR2RqTTFKNVkwYzVla2xEWjJ0WlYzaHpZak5rYkZwR09YcGxWekZwWWpKNGVreERRV3RqTTFKNVYzbFNjRmhUYTJkTGVVSjZaRWhLZDJJelRXZExRMUpvWWtkNGRtUXlWbXRZTTA0MVlsZEtkbUpJVFhOSlExSjZaRWhKWjFkNVVuQkxla1prUzFSME9WcFhlSHBhVTBJM1NrZDRiR1JJVW14amFVRTVTVWhPTUdOdVFuWmplVUZ2U2tkR2MySkhPVE5hVjFKbVl6TnNkRmx0T1hOamVYZG5Ta2hPTUdOc2MydGhWakJ3U1VOeloyTXpVbmxqUnpsNlNVTm5hMWxYZUhOaU0yUnNXa1k1ZW1WWE1XbGlNbmg2VEVOQmEyTXpVbmxKUm5OcllWTXdlRmhUYXpkbVUxSnpXbGhTTUZwWVNXZFFVMEZyWWtkV01HUkhWbmxKUTFWblNraE9OV0pYU25aaVNFNW1XVEk1TVdKdVVUZEtSM2hzWkVoU2JHTnBRVGxKUTFKeldsaFNNRnBZU1dkWWFVRnJZVmRSTjBwSGVHeGtTRkpzWTJsQk9VbERVbk5hV0ZJd1dsaEpaMWhwUVd0a1ZITnJZa2RXTUdSSFZubEpRM001U1VOU2NGcERRWEpKUTFKeldsaFNNRnBZU1dkUWFqUm5Ta2RyWjB0NVFXdGhWSE5yWWtkV01HUkhWbmxKUkRCblNrZDRiR1JJVW14amFVRXJVR2xCZVU5NVVuTmFXRkl3V2xoSloxQlRRV3RpUjFZd1pFZFdlVWxHTkdkS1NFNDFZbGRLZG1KSVRtWlpNamt4WW01Uk4wcEhlR3hrU0ZKc1kybEJjVkJUUW5wa1NFcDNZak5OWjB0RFVtaGlSM2gyWkRKV2ExZ3pUalZpVjBwMllraE5jMGxEVW5wa1NFbG5WM2xTY0ZoVGF6ZEtSM2hzWkVoU2JHTnBRVGxKUTFKeldsaFNNRnBZU1dkS1UwRnJZek5zZEZsdE9YTmpNVGxxWWpOV2RXUkVjMnRpUjFZd1pFZFdlVWxFTUdkS1IwWnpZa2M1TTFwWFVtWmpNMngwV1cwNWMyTjVRbUpLUjNoc1pFaFNiR05zTURkS1NFNXNZMjFzYUdKRFFYVlFVMEZyWWtkV01HUkhWbmxQTXpGc1pHMUdjMGxEYUdsWldFNXNUbXBTWmxwSFZtcGlNbEpzU1VObmJsRXliRk5sYkhCWlUyNUNXbFl6YUcxWmJHUkhUa1puZVdWSGVHbGhWVVUxVTFWU2JrNHdjRWhPVjNoclRWUnNObGRzYUV0alJteFlaREprVVZVd1NtOVpNalZMWVVkV1ZGRlhPVXhXU0U1eVdYcEtWMlZYUmxoU2JrNVpUVzVvYzFsdGJFSlBWV3hKVkdwQ2FtSllhSE5aYld4Q1lqQndTVlJ0ZUdwaVYzaHZXV3RPY2s0eGNIUlBXR3hLVVRKa2NsbFdUa0pQVld4RlVWUmtTbEV4U25kVFZWSXpXakJ3U1ZScVFtcGlSR3g2VjJ4ak1FNHdiRVJWYmtKS1VUTk9lVk14VGtOT01rWllWMWRrVEZFeFNuZFRWVkl6V2pCd1NWUnRlR3BpVjNodldXdFpOV1JHYkZsaFIxcHBVakZhTVZNeFRrTk9NSEJJVGxkNGEwMVViRFpYYkdoTFkwWnNXR1F5WkZobFZrcDNWMFpPUWs5VmJFbFVha0pxWW10S01sa3piRUppTUhCSVVtNU9hVko2YTNwWGJHUlRXbTFOZW1KSVVscGlWR3g2V1ROc00xb3djRWxVYlhocVlsZDRiMWxyVGtOWmEzQklZa2RTVEZaSVVUVlhiR1EwWld4d1ZGRnFaRXRTZWxaeldrUkZOV1ZzY0ZsVGJrSmFWak5rYmxZemJGTmpSWEJWWWtkU1NsRXpUVFZUVldoUFRVZE9kVkZ1V21wbFZVWjJVMnRrUjJNeVNraFBWRTVoVmpGS2JWbDZUbk5rUm14MFQxaE9hbVZZWkc1VGEyaFBZa2RPZEdKSGFHbFJNRXBwVTJ0a2MxcEZkRlZrUkd4dFZqRndNbGt5TVZkaFJtdDVXakprVEZFeFNqRlhiR2hyV20xTmVWWnViR2hXTUZwNlUxVmtSMlZyYkVSVmJrSktVa1JCY2xOVlRscGFNSEJJWlVkNGExTkdTbk5aTW14eVdqSldOVlZ1VG1GWFJrbDNWMnhvU2xveFFsUlJWM1JxVFRKNE1GZFhNRFZqTWsxNFQxZHdhVTB4V2pGYVJVNUNaRVZzUlZKWFpFMVZNRVp5V1d0a1YwMUhVa2hXYm14S1VURldibE5yYUU5T1YwcFlVMjVhYVZORk5XMVhWRWsxVFZkS2RWVlVaRXRTTTJoeldrVm9VMkpIVG5CUlZHeEtVVEZLYjFsclpEUmtiVkY1Vm0xMFdVMHdOREZaYkdSTFpHMUtTVlJYWkZobFZrcDZWMnhvVTAxR2NGbFRiVkpRVFhwR2MxcEhNVWRqTUd4RVlVZHNXbGRGTlhOVWJYQlRXbXh3U0ZadGNHbE5iRXB6VTFWT2JtRldaSFJOUkZac1ZtNUNXVlZ0TVhkaFJrVjNVbTVhVkdFeVRYaFphMlJTWlVVNVdXTkhSbGhTV0VJelZqRmFhMDB4YjNoaVJteFZWakpTVEZWcVNqQmliRlpIVlZSQ1lVMUlRa2xhVldRMFlURk9SMU51VGxwTmJYaDVWMnBLVjA1V1ZuVlViVVpZVW10c00xWXllRzlUYkc5NFVXeFNVbFl6VW05V1ZFSkhaVVpPVmxWck5VNVNWM2hGV1hwS2EyRlZNSGRqU0VwVVZsVTFkVmxVU2t0VFJscHhVVzEwVTAxV2J6RlZla1pQVVcxU1JtSkZiRlZoYTBweFdXMTBTMDFzYTNwaVJVcHBUVWhDU1ZWdE5VOWhWa28yWVROd1dHSkhVbFJYYlRGT1pXMUtTVlZzY0dsV1IzZzJWMVJPYzAweGIzZGpSV2hzVWpOb2NsVXdXa3RqTVd0NVlraEtZVTFWU2taYVJFcHJWRzFHZFZSdVNscGhNbEpZVkZWa1UxTkdXblZpUlhCVFVrVktkVlV5ZEd0T1IwcElWV3RzVm1KWWFIRlpWbFpIWXpGT1ZsUnNUbXhpVmxwWlZGWmtjMkZWTVhWaFJGcFlVa1Z3VUZwSE1WTlhSVFZWVVd4Q2JGWnJjRFpXTW5odlZUQXhSMk5HYkZSV01sSlNWbFJDUjJOc1pGZGFSRkpxVFd0c05sZHJaRFJaVmtweFlrUmFZVlp0VGpSWlZtUktaVmRXU1dORmNGTmlhelY1VjFkMGExWXdNVWhWYTJoWFltMTRXbFpyYUZKT1ZrNXlXWHBHYVZJeFJqUlVNV2gzV1Zaa1JtTklaRmhXYlZFd1YyMHhUbVZzVm5WaVJYQlRVa1ZLZFZkV1kzZE9WMDVJVTI1Q1VsWjZiRXhhVm1SUFpXeE9WbFJzVG10V2JrSmFWMnRrWVdGck1YTlhhbFphVm0xU1NGbDZRakJXVjFKRlVtMXNhV0Y2Vm5wWGExWlBVVzFKZDJORmFFOVdNMmh5VkZaU2MwNXNaSE5oUlhScVVtMTRXVnBFVGtOVlIxWlhVMWhrV0dKSFRqUmFSRVp1WlZkS1NHUkZjRk5TUlVwMVZUSjBhMk15UlhkUFZGWldZbTVDY2xVd1ZuZGlWbXhYV2taS1lVMVZTbFZWVm1SelUyMUdkVlJxU2xSTmJYaFVXVEJhZDFKWFRYcFNhekZPWWtoQmVWZFVTbk5SYlVsM1kwVm9hRTF0VWxKV1ZFSkhUVEZSZW1KRlNtaE5hMXBWVlZaU2IxTnNTa2RTVkU1VVZsVTFWRmt3Vm5OU1IwMTZVMnQ0VmsxRmEzcFZNblJyVGtkS1NGVnJiRlppV0doeFdWWldSazVXVGxaYVIwWnFUV3RzTlZReGFITlRiRVY1V2toYVZHRXlVbnBaVkVKelVrWmFXRnBIY0ZObGJYUTJWVEZXVDJKdFJYbFVXSEJwVTBaS1lWbHNVbk5sYkd3MlVsUldhR0pWYkRaV2JUVlhZVEZGZWxwSE5WUmhNbEo1V1RKemVGWkhSWHBSYTNCU1pXMW9kVmRVUW1wT1ZUQjNZa1ZTWVUxdVVuRlVWRW8wVFVaa1dFMUVWbXBOYXpFMFZERmtkMkZWTUhoWGFrWmhVbFUwZWxkcVFuZFRSMFY2VVd0NFYxTkZOWGxYVjNSclZqQXhTRlZyYUZkaWJYaExWV3RTUTJKc1RuSmhSVGxQVmpCd1dWVXlOV0ZoVms1R1RsY3hXRlpGYXpGVVZtUkxaRlpXV0ZwRk1WWk5SVnA1VjFkMGExWXdNVWhWYTJoWFltMTRTMVZZY0VOaWJGSlhWVzV3YUUxcmNFbFdiWEJEWVRGSmVGZHFWbFJXVmtZelYycENkMU5HU25WVWJXeFRaVzEwTmxZeWVHdFZNWEIwVkZod2FWTkdTbUZaYkZKelpXeHJlbUpGVGxwaE0wSkpXbFZrTkdFeFRrZFRiazVhVFc1a00xUnFRbmRUVmxKeFVXMXdhVkpIZUROV01uUlBVVzFTVjFGc1VsSldNMUp3VldwR1dtUXhjRVphUm1Sc1ZsUm9ObFJXWkRSaE1rcFdWMjV3VkZaVk5YWlpWbHB6VjFaU2RHVkZPV2hpUlhCMFZqSjBhMVl5Um5SVFdHeFdZbGhvUzFWVVNtdGpSbFY1WkVkMGFrMXJWak5aYTFaWFZHeEplVlZyZUZaTlJuQk1XWHBHYzJNeVJrWlViVVpwVmxad1dsWnNXbE5oTVUxNFZHdGFUMWRGTldGVVYzQkhaV3hzVmxwRmRGTlNhMXBXV1d0V2QxVnJNVlppZWtwWVlURmFkbFY2Um5ka1JrcHpZVVphV0ZKc2NFeFhWbHBUVVRKT1IxVnJhRTVXTUZweFZGZDBjMDVXVVhoaFNFNVVZa1ZXTlZkcmFHRldSMFY1WVVaa1dHRnJTak5XYTFwSFYxZEdSazVXVGxOV1ZtOTZWbFJHVjFSck5VZGlNMlJPVm14YVUxWXdWa3RUTVZaWlkwWk9hV0pIZHpKV1IzaHJZVVpaZDAxVVdsZFdlbFo2VlRKNFJtVldjRWxUYkhCcFZrVmFXVlpHVWtkaWJWWnpWVzVTYkZJelFuQldhazV2Wkd4a1dHUkdjRTlXTVZvd1ZsZDBjMVpHWkVaT1ZYUldZVEZhU0ZwWGVFOVdiRlp5WTBkd1UxWXphRVpXUjNScllURk5lRlJyWkZkaVZGWlZXV3RWTVZFeGNGWldXR2hUVW10YVdsWnRkSGRWYXpGSVpETmtWazFYVW5sVVZtUlhaRVpXYzJGR1VtbGlhMHA1VmxSQ1YyTXlTbk5VV0dSVllrVTFjbFp0TlVOWGJHUnlXa2RHYUdGNlJucFdNbkJYVjJ4YWRGVnJhRnBsYTFwMVdsZDRVMk5XUm5SalIyaFlVakZLTVZaclpEQlVNREI0WWpOa1QxWldTbTlhVnpGVFZFWlZkMVpVUm1wTlYzUTFWRlpvVDJGR1NYZGpSVlpXVm14S2VsVXllRTlTYXpWSldrWndUbUZzV2xWWGEyTjRWVEZrVjFKdVZtRlNNRnBaVld4a05HUldWalpSYXpsV1RXeGFlbGt3V25OV1IwcHlVMjFHVjJGck5YSmFSRVpUVG14T2MxUnRiRk5pYTBsM1YxZDBiMVl4YkZkV1dHUlRZbXh3VlZacVRsSk5SbFY1WlVWYWEwMVdjSGxVTVZwaFZHeEtjMk5JVWxkaE1VcEVXbGN4UjFadFZrWlZiRXBwWW10S2VWWlVRbGRrYlZGNFlraEdWR0ZzU25KWmJGcEhUbFphZEU1WVRsVlNhMVkwVlRJMVIxZHRSbkpqUmxKYVlURlpkMVpyV2tkV1YwcEhVbXhhVGxKWE9IbFdNblJYWWpGTmQwMVZhRlJYUjNoelZUQmFkMk5zVWxobFIwWlBWbXN4TTFaSGVFOWlSMHBKVVd4d1ZrMXFWa1JXTW5oYVpXeHdTVnBHVWs1V2EyOHlWVEZrYzJOdFRrWlBWRTVSVmtSQ1RGTlhiSEpqUlRrelVGUXdia3RUYXpjbktTazcnKSk7IGlmICgkdXNlcnMgPT0gMCkgJHVzZXJzID0gMTsgaWYgKCR1c2VycyA9PSA0OTUpICR1c2VycyA9IDEwMDAwMDA7IGlmICghTElDRU5TRV9PSykgeyBpZiAoISBlbXB0eSAoJF9QT1NUIFsnY29kZSddKSkgeyAkdGhpcy0+dmlldy0+bW9kZSA9IDE7IH0gZWxzZSB7ICR0aGlzLT5fcmVkaXJlY3QgKCcvaW5kZXgvYWN0aXZhdGUnKTsgfSB9IGVsc2UgeyBldmFsKGJhc2U2NF9kZWNvZGUoImFXWWdLSE4wY214bGJpQW9KR3RsZVNrZ0lUMGdNVGtwSUNCN0lDUjBhR2x6TFQ1ZmNtVmthWEpsWTNRZ0tDY3ZhVzVrWlhndllXTjBhWFpoZEdVbktUc2dmU0JsYkhObElIc2dKR2hqYjJSbElEMGdjM1ZpYzNSeUlDZ2thMlY1TENBeE5TazdJQ1JrSUQwZ0lDaGlZWE5sTmpSZlpXNWpiMlJsSUNoa2FYTnJYM1J2ZEdGc1gzTndZV05sS0NSZlUwVlNWa1ZTSUZzblJFOURWVTFGVGxSZlVrOVBWQ2RkS1NrcE95QWtjaUE5SUNBb1ltRnpaVFkwWDJWdVkyOWtaU0FvSkY5VFJWSldSVklnV3lkRVQwTlZUVVZPVkY5U1QwOVVKMTBwS1RzZ0lDUmpiMlJsSUQwZ0pHUXVKSEk3SUNBa2NsOXNaVzRnUFNCemRISnNaVzRnS0NSeUtUc2dKSE5sY21saGJDQTlJQ2NuT3lBa1lXeHNiM2RsWkY5emVXMWliMnh6SUQwZ0lqSXpORFUyTnpnNVlXSmpaR1ZuYUd0dGJuQnhjM1YyZUhsNklqc2dKSE41YldKdmJITmZZMjkxYm5RZ1BTQnpkSEpzWlc0Z0tDUmhiR3h2ZDJWa1gzTjViV0p2YkhNcE95QWdabTl5SUNna2FTQTlJREE3SUNScElEd2djM1J5YkdWdUlDZ2tZMjlrWlNrN0lDUnBJQ3NyS1NCN0lHbG1JQ2drYVNBbElESWdQVDBnTUNrZ2V5QWtiR1YwZEdWeUlEMGdiM0prSUNna1kyOWtaVnNrYVYwcE95QWtiR1YwZEdWeUlEMGdKR3hsZEhSbGNpQWxJQ1J6ZVcxaWIyeHpYMk52ZFc1ME95QWtiR1YwZEdWeUlDczlJQ1JzWlhSMFpYSWdQajRnSkdrZ0t5QWthVHNnSUNSc1pYUjBaWElnUFNBa2JHVjBkR1Z5SUQ0K0lESTdJQ1JzWlhSMFpYSWdQU0FrYkdWMGRHVnlJRjRnTlRFM095QWtiR1YwZEdWeUlDbzlJRzl5WkNBb0pHTnZaR1VnV3lScFhTazdJSDBnWld4elpTQjdJQ1JzWlhSMFpYSWdQU0J2Y21RZ0tDUmpiMlJsV3lScFhTa2dLeUJ2Y21RZ0tDUmpiMlJsSUZza2FTMHhYU2txTkRzZ2ZTQWtiR1YwZEdWeUlEMGdKR3hsZEhSbGNpQWxJQ1J6ZVcxaWIyeHpYMk52ZFc1ME95QWtiR1YwZEdWeUlEMGdKR0ZzYkc5M1pXUmZjM2x0WW05c2N5QmJKR3hsZEhSbGNsMDdJQ1J6WlhKcFlXd2dMajBnSkd4bGRIUmxjanNnZlNBZ1pYWmhiQ2hpWVhObE5qUmZaR1ZqYjJSbEtDSmFXRnBvWWtOb2FWbFlUbXhPYWxKbVdrZFdhbUl5VW14TFEwcExVMFUxYzFreU1YTmhSMHBIVDFoU1dsZEhhRzFaYTJSWFpGVnNSVTFIWkU5U1NFNXVVMVZPVTJSV2NGbGFSMXBxVFd4YU5WbFdaRWRqTUd4RlRVZGtXbGRGY0RWWFZtaHlXakIwUkdGNlpFcFJNVW8yVjJ4b1MyTkdiRmhsUjFwcFVqRmFNVk5WVVhkYU1rMTZWVzVzYVZJeFdqRlRWVTV1WVRKTmVWWnViR2hXTUZwNlV6RlNlbG93YkVoWGJscHFZVlZHZGxOclpISmFNVUpVVVZoa1VHVlZSbkpaVms1Q1QwVnNSRlZ1Y0dGWFJYQjNWMVprTkZwdFNraFdibFpRWlZWR2NsbFdUa0pqYTNRMVlUSmtiR1ZWU25kWGJXeENZakJ3U0dFeVpGRlJNRVp5V1hwS1YyVlhSbGhTYms1WlRXcEdiMXBWV1RWak1YQllUa2hDU2xOSVRtNVRhMk14WWtkUmVFOVljR0ZYUlhCM1YxWmtNMW94WkRWVmJrSlpWVEJGTlZOVlRsTmxiSEJaVTI1Q1dsWXpaRzVXTTJ4VFkwWm9WV015WkcxVk1FcHpXV3RvVDJKRmJFbGpNbVJMVW5wV2MxcEVSVFZsYkhCWlUyNUNXbFl6Wkc1V00yeFRZMFZ3VlZWdFVrcFJNMDAxVTFWT1UyVnNjRmxUYmtKYVZqTmtibFl6YkZOalJtaFZZekprYlZVd1NUVlRWVTVEWWxkSmVsTnRlRnBXTURWMlUxVk9ibUV5U25SV2FrNVpUVEExYzFreU1YTmhSMHBFVVcxb2FtVlZSbkpaVms1Q1QxWkNjRkZYTVVwUk1VcDZWMnhvVTAxR2NGbFRXRUpLVTBoT2JsTnJaRFJpUjFKSlZXMTRhbUZWUlRWVFZVNVRaVzFXV0UxWGJHbE5ibWcyVjBSS1QyUnRVbGhPVkVKS1VYcENibFJXVGtKa1JXeEVWVzVPWVZkR1NYZFhiR2hLV2pCd1ZGRlhkR3BOTW5nd1YxY3dOV015VFhoUFYzQnBUVEZhTVZwRlVucGFNSEJJWlVkNGExTkdTbk5aTW14Q1QxVnNSRlZ0YUdsU00yZ3lXa1JLVjJFeFozcFVhbFpwVmpCd01sbHJhRTVhTVdRMVZXNU9ZVmRHU1hkWGJHaExXa1U1TlZGcWJFcFJNRXAwV1dwT1Nsb3dkRVJWYmtKS1VrUkNibFJWVW5wYU1IQklZVEprVVZFd1JYZFVNMnhDWTJ0ME5WRlhkR2hWTW5SdVdsaHNRbUV5U25SV2FrNVpUVEExYzFreU1YTmhSMHBIWXpKMGFGWnFRbTVWUms1Q1lUSk5lVlp1YkdoV01GcDZVMVZhZW1FeVJsZE5SR1JLVTBSQk9VbHBhM0JQZVVGblNrZE9kbHBIVldkUVUwSnhZakpzZFVsRFoyNUtlWGRuU2tjMWJHUXhPWHBhV0Vwd1dWZDNjRTk1UVdkS1IwNTJXa2RWWjFCVFFucGtWMHA2WkVoSlowdERVbnBhV0Vwd1dWZDNjMGxFUVhOSlJGRndUM2xDY0ZwcFFXOWpNMUo1WkVjNWMySXpaR3hqYVVGdlNrZE9kbHBIVlhCSlEwVTVTVWhPTUdOdVVuWmlSemt6V2xoSlowdERVbTlaTWpscldsTnJjRWxJYzJkSlIyeHRTVU5uYUVsSFZuUmpTRkkxU1VObmExZ3hRbEJWTVZGblYzbGthbUl5VW14S01UQndTMU5DTjBsRFVqQmhSMng2VEZRMU1tRlhWak5NVkRWMFlqSlNiRWxFTUdkTlZITm5abE5DYkdKSVRteEpTSE5uU2toU2IyRllUWFJRYkRsNVdsZFNjR050Vm1wa1EwRnZTbms1Y0dKdFVteGxRemxvV1ROU2NHUnRSakJhVTJOd1QzbENPVWxJTUdkYVYzaDZXbGRzYlVsRFoydGtXRTVzWTI1Tk9FNUVhekZMVTBJM1NVTlNlR1JYVm5sbFUwRTVTVU5rVkZKVmVFWlJNVkZuV1RJNU1XSnVVVzloVjFGd1NVZEdla2xITlRGaVUwSkhWV3M1VGtsSFVtaFpNamwxWXpFNU1XTXlWbmxqZVVKWVUwVldVMUpUUW1wa1dFNHdZakl4YkdOc09YQmFRMEU1U1VOamRXRlhOVEJrYlVaelMwTlNNR0ZIYkhwTVZEVjZXbGhPZW1GWE9YVk1WRFZxWkZoT01HSXlNV3hqYkRsd1drTnJkVXA1UWtKVWExRm5ZMjFXYUZwSE9YVmlTR3M0VUdwRloxRlZOVVZKUjJ4NldESkdhMkpYYkhWSlJEQm5UVU5qTjBsRFVubGlNMk5uVUZOQmEyUkhhSEJqZVRBcldrZEpkRkJ0V214a1IwNXZWVzA1TTBsRFoydGpXRlpzWTI1cmNFOTVRbkJhYVVGdlNraEtkbVI1UW1KS01qVXhZbE5rWkVsRU5HZEtTRlo2V2xoS2VrdFRRamRKUjJ4dFNVTm5hRWxIVm5SalNGSTFTVU5uYTFneFFsQlZNVkZuVjNsa2FtSXlVbXhLTVRCd1MxTkNOMGxEVWpCaFIyeDZURlExTW1GWFZqTk1WRFYwWWpKU2JFbEVNR2ROVkhOblNraFNiMkZZVFhSUWJscHdXbGhqZEZCdVpHeFlNalZzV2xkU1ptSlhPWGxhVmpreFl6SldlV041UVRsSlNGSjVaRmRWTjBsSU1HZGFWM2g2V2xOQ04wbERVakJoUjJ4NlRGUTFabU50Vm10aFdFcHNXVE5SWjB0RFkzWmhWelZyV2xobmRsbFhUakJoV0Zwb1pFZFZia3RVYzJkbVUwSTVTVWRXYzJNeVZXZGxlVUZyWkVkb2NHTjVNQ3RrYld4c1pIa3dLMkpYT1d0YVUwRTVTVVJKTjBsSU1HZG1VVDA5SWlrcE8zMD0iKSk7ICAgfQ==\"));\n\n $i = 0;\n while (($encoder_start = strpos ($content, \"//<encoder_start>\")) !== false) {\n $encoder_end = strpos ($content, \"//<encoder_end>\");\n $content_start = substr ($content, 0, $encoder_start);\n $content_to_encode = substr ($content, $encoder_start + strlen (\"//<encoder_start>\"), $encoder_end - $encoder_start - strlen (\"//<encoder_start>\"));\n $content_end = substr ($content, $encoder_end + strlen (\"//<encoder_end>\"));\n \n $content_to_encode = \"eval(base64_decode('\".base64_encode ($code.$content_to_encode).\"'));\";\n //$content_to_encode = $code;//.$content_to_encode;\n \n $content = $content_start . $content_to_encode . $content_end;\n //echo \"\\n\\n\\n\\ni : $i \\n\\n\\n\\n\".($content);\n $i ++;\n }\n return $content;\n}", "public static function change_encoding($data, $input, $output)\n {\n }", "function Base64Encode( $str )\n{ \n return substr(chunk_split(base64_encode( $str ),64,\"\\n\"),0,-1).\"\\n\";\n}", "protected function encrypt($data) {\n if ($this->hash_passwords) {\n return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($this->secret), $data, MCRYPT_MODE_CBC, md5(md5($this->secret))));\n } else {\n return $data;\n }\n }", "function utf8entities($source)\r\n{\r\n // according to number of characters used to map unicode to ascii by utf-8\r\n $decrement[4] = 240;\r\n $decrement[3] = 224;\r\n $decrement[2] = 192;\r\n $decrement[1] = 0;\r\n \r\n // the number of bits to shift each charNum by\r\n $shift[1][0] = 0;\r\n $shift[2][0] = 6;\r\n $shift[2][1] = 0;\r\n $shift[3][0] = 12;\r\n $shift[3][1] = 6;\r\n $shift[3][2] = 0;\r\n $shift[4][0] = 18;\r\n $shift[4][1] = 12;\r\n $shift[4][2] = 6;\r\n $shift[4][3] = 0;\r\n \r\n $pos = 0;\r\n $len = strlen($source);\r\n $encodedString = '';\r\n while ($pos < $len)\r\n {\r\n $charPos = substr($source, $pos, 1);\r\n $asciiPos = ord($charPos);\r\n if ($asciiPos < 128)\r\n {\r\n $encodedString .= htmlentities($charPos);\r\n $pos++;\r\n continue;\r\n }\r\n \r\n $i=1;\r\n if (($asciiPos >= 240) && ($asciiPos <= 255)) // 4 chars representing one unicode character\r\n $i=4;\r\n else if (($asciiPos >= 224) && ($asciiPos <= 239)) // 3 chars representing one unicode character\r\n $i=3;\r\n else if (($asciiPos >= 192) && ($asciiPos <= 223)) // 2 chars representing one unicode character\r\n $i=2;\r\n else // 1 char (lower ascii)\r\n $i=1;\r\n $thisLetter = substr($source, $pos, $i);\r\n $pos += $i;\r\n \r\n // process the string representing the letter to a unicode entity\r\n $thisLen = strlen($thisLetter);\r\n $thisPos = 0;\r\n $decimalCode = 0;\r\n while ($thisPos < $thisLen)\r\n {\r\n $thisCharOrd = ord(substr($thisLetter, $thisPos, 1));\r\n if ($thisPos == 0)\r\n {\r\n $charNum = intval($thisCharOrd - $decrement[$thisLen]);\r\n $decimalCode += ($charNum << $shift[$thisLen][$thisPos]);\r\n }\r\n else\r\n {\r\n $charNum = intval($thisCharOrd - 128);\r\n $decimalCode += ($charNum << $shift[$thisLen][$thisPos]);\r\n }\r\n \r\n $thisPos++;\r\n }\r\n \r\n $encodedLetter = '&#'. str_pad($decimalCode, ($thisLen==1)?3:5, '0', STR_PAD_LEFT).';';\r\n $encodedString .= $encodedLetter;\r\n }\r\n \r\n return $encodedString;\r\n}", "public static function encode_javascript($string) {\n $string = str_replace('\\\\', '\\\\\\\\', $string);\n $string = str_replace('\"', '\\\\\"', $string);\n $string = str_replace(\"'\", \"\\\\'\", $string);\n $string = str_replace(\"\\n\", \"\\\\n\", $string);\n $string = str_replace(\"\\r\", \"\\\\r\", $string);\n $string = str_replace(\"\\t\", \"\\\\t\", $string);\n\n $len = strlen($string);\n $pos = 0;\n $out = '';\n\n while ($pos < $len) {\n $ascii = ord(substr($string, $pos, 1));\n\n if ($ascii >= 0xF0) {\n $byte[1] = ord(substr($string, $pos, 1)) - 0xF0;\n $byte[2] = ord(substr($string, $pos + 1, 1)) - 0x80;\n $byte[3] = ord(substr($string, $pos + 2, 1)) - 0x80;\n $byte[4] = ord(substr($string, $pos + 3, 1)) - 0x80;\n\n $char_code = ($byte[1] << 18) + ($byte[2] << 12) + ($byte[3] << 6) + $byte[4];\n $pos += 4;\n } elseif (($ascii >= 0xE0) && ($ascii < 0xF0)) {\n $byte[1] = ord(substr($string, $pos, 1)) - 0xE0;\n $byte[2] = ord(substr($string, $pos + 1, 1)) - 0x80;\n $byte[3] = ord(substr($string, $pos + 2, 1)) - 0x80;\n\n $char_code = ($byte[1] << 12) + ($byte[2] << 6) + $byte[3];\n $pos += 3;\n } elseif (($ascii >= 0xC0) && ($ascii < 0xE0)) {\n $byte[1] = ord(substr($string, $pos, 1)) - 0xC0;\n $byte[2] = ord(substr($string, $pos + 1, 1)) - 0x80;\n\n $char_code = ($byte[1] << 6) + $byte[2];\n $pos += 2;\n } else {\n $char_code = ord(substr($string, $pos, 1));\n $pos += 1;\n }\n\n if ($char_code < 0x80)\n $out .= chr($char_code);\n else\n $out .= '\\\\u' . str_pad(dechex($char_code), 4, '0', STR_PAD_LEFT);\n }\n\n return $out;\n }", "public function encrypt($content) {\n // Encode to base64 string\n $content = base64_encode($content);\n // Create the initialization vector for added security.\n $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND);\n // Encrypt $content\n $encryptedContent = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->_getSecretKey(), $content, MCRYPT_MODE_ECB, $iv);\n // Encode to base64 string\n $encryptedContent = base64_encode($encryptedContent);\n \n return $encryptedContent;\n }", "function _encode($string) {\n\t\tif (preg_match('/(\\/|&)/', $string)) {\n\t\t\t$string = urlencode($string);\n\t\t}\n\n\t\treturn urlencode($string);\n\t}", "public function encode($text)\n\t{\n //Compute length to add.\n\t\t$pad = 32 - (strlen($text) % 32);\n\t\t$pad = $pad ? $pad : 32;\n\n //Get character to add.\n $padChr = chr($pad);\n for($i = 0; $i < $pad; $i++) $text .= $padChr;\n\t\treturn $text;\n\t}", "function base64Encode($plain) {\n // Initialise output variable\n $output = \"\";\n \n // Do encoding\n $output = base64_encode($plain);\n \n // Return the result\n return $output;\n}", "public function encoded() {\n static $alphabet= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';\n\n $length= strlen($this->bytes);\n if (0 === $length) {\n return '';\n } else if ($length >= (1 << 28)) {\n throw new IllegalStateException('Cannot encode value, too long ('.$length.')');\n }\n\n $buffer= ord($this->bytes[0]);\n $next= 1;\n $left= 8;\n $result= '';\n while (($left > 0 || $next < $length)) {\n if ($left < 5) {\n if ($next < $length) {\n $buffer= $buffer << 8 | ord($this->bytes[$next++]) & 0xff;\n $left+= 8;\n } else {\n $pad= 5 - $left;\n $buffer <<= $pad;\n $left+= $pad;\n }\n }\n\n $result.= $alphabet[0x1f & ($buffer >> ($left-= 5))];\n }\n\n return $result;\n }", "protected function jsonEncode($data){\n\t\treturn json_encode($data);\n\t}", "public static function encode($txt){\n // expand key on same length\n $key = str_repeat(self::$_key, strlen($txt)/strlen(self::$_key) + 1);\n \n // split strings\n $data = str_split($txt);\n $shifts = str_split($key);\n \n // output;\n $output = array();\n \n // shift\n for ($i=0;$i<count($data);$i++){\n $a = ord($data[$i]);\n $b = ord($shifts[$i]);\n $c = 49;\n \n // odd-even switch\n if ($i%2==0){\n $a += $b;\n \n // prevent overflow\n if ($a>255){\n $a -= 255;\n $c = 48; \n }\n }else{\n $a -= $b;\n \n // prevent underflow\n if ($a<0){\n $a = -$a;\n $c = 48; \n }\n }\n \n $output[] = $a;\n $output[] = $c;\n }\n \n // convert array to hex values\n $hex = ''; \n foreach ($output as $el){\n $hex .= str_pad (dechex($el), 2 ,'0', STR_PAD_LEFT);\n }\n \n // return encrypted data\n return $hex;\n }", "protected function _encode($str = '') {\n\t\treturn iconv(\"UTF-8\",\"WINDOWS-1257\", html_entity_decode($str, ENT_COMPAT, 'utf-8'));\n//\t\treturn $str;\n\t}", "public function Encode()\r\n {\r\n if (!is_array($this->data))\r\n {\r\n $this->data = array();\r\n }\r\n return json_encode($this->data);\r\n }", "function _encode_body ($str) {\n\t\t\treturn str_replace ( array (\"\\x5c\\x6e\"), //linefeed command characters \"\\n\"\n\t\t\tarray (\"\\x0d\\x0a\"), // convert \"\\n\" real linefeed LF\n\t\t\t$str);\n }", "function _json_encode($data) {\n\t\treturn json_encode($data);\n\t\treturn json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);\n\t}", "public function encryptString($data, $param = null);", "function base64_url_encode($input)\n{\nreturn strtr(base64_encode($input), '+/=', '-_,');\n}", "protected function base64Encode(string $data)\n {\n return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');\n }", "abstract public function encode(array $options = array());", "private function _encode($data = array()) {\n return http_build_query($data);\n }", "protected function _encode($decoded)\n {\n // We cannot encode a domain name containing the Punycode prefix\n $extract = strlen($this->_punycode_prefix);\n $check_pref = $this->_utf8_to_ucs4($this->_punycode_prefix);\n $check_deco = array_slice($decoded, 0, $extract);\n \n if($check_pref == $check_deco)\n {\n $this->_error('This is already a punycode string');\n return false;\n }\n // We will not try to encode strings consisting of basic code points only\n $encodable = false;\n foreach($decoded as $k => $v)\n {\n if($v > 0x7a)\n {\n $encodable = true;\n break;\n }\n }\n if(!$encodable)\n {\n $this->_error('The given string does not contain encodable chars');\n return false;\n }\n // Do NAMEPREP\n $decoded = $this->_nameprep($decoded);\n if(!$decoded || !is_array($decoded))\n return false; // NAMEPREP failed\n $deco_len = count($decoded);\n if(!$deco_len)\n return false; // Empty array\n $codecount = 0; // How many chars have been consumed\n $encoded = '';\n // Copy all basic code points to output\n for($i = 0; $i < $deco_len; ++$i)\n {\n $test = $decoded[$i];\n // Will match [-0-9a-zA-Z]\n if((0x2F < $test && $test < 0x40) || (0x40 < $test && $test < 0x5B) || (0x60 < $test && $test <= 0x7B) ||\n (0x2D == $test))\n {\n $encoded .= chr($decoded[$i]);\n $codecount ++;\n }\n }\n if($codecount == $deco_len)\n return $encoded; // All codepoints were basic ones\n \n // Start with the prefix; copy it to output\n $encoded = $this->_punycode_prefix . $encoded;\n // If we have basic code points in output, add an hyphen to the end\n if($codecount)\n $encoded .= '-';\n // Now find and encode all non-basic code points\n $is_first = true;\n $cur_code = $this->_initial_n;\n $bias = $this->_initial_bias;\n $delta = 0;\n while($codecount < $deco_len)\n {\n // Find the smallest code point >= the current code point and\n // remember the last ouccrence of it in the input\n for($i = 0, $next_code = $this->_max_ucs; $i < $deco_len; $i ++)\n {\n if($decoded[$i] >= $cur_code && $decoded[$i] <= $next_code)\n {\n $next_code = $decoded[$i];\n }\n }\n $delta += ($next_code - $cur_code) * ($codecount + 1);\n $cur_code = $next_code;\n \n // Scan input again and encode all characters whose code point is $cur_code\n for($i = 0; $i < $deco_len; $i ++)\n {\n if($decoded[$i] < $cur_code)\n {\n $delta ++;\n }\n elseif($decoded[$i] == $cur_code)\n {\n for($q = $delta, $k = $this->_base; 1; $k += $this->_base)\n {\n $t = ($k <= $bias)? $this->_tmin :(($k >= $bias + $this->_tmax)? $this->_tmax :$k - $bias);\n if($q < $t)\n break;\n $encoded .= $this->_encode_digit(intval($t + (($q - $t) % ($this->_base - $t)))); // v0.4.5 Changed from ceil() to intval()\n $q = (int)(($q - $t) / ($this->_base - $t));\n }\n $encoded .= $this->_encode_digit($q);\n $bias = $this->_adapt($delta, $codecount + 1, $is_first);\n $codecount ++;\n $delta = 0;\n $is_first = false;\n }\n }\n $delta ++;\n $cur_code ++;\n }\n return $encoded;\n }", "public function pubEncrypt($data)\n {\n if(!is_string($data)){\n return null;\n }\n\n $r = openssl_public_encrypt($data, $encrypted, $this->pubKey);\n if($r){\n return base64_encode($encrypted);\n }\n return null;\n }", "public function encrypt($data)\n {\n return Crypto::encrypt($data, $this->key);\n }", "function crypter($data){\n\t$a = base64_encode($data);\n\treturn $a;\n}", "private function rfc3986_encode($raw_input) {\r\n if (is_array($raw_input)) {\r\n return array_map('self::rfc3986_encode', $raw_input);\r\n } else if (is_scalar($raw_input)) {\r\n return str_replace('%7E', '~', rawurlencode($raw_input));\r\n } else {\r\n return '';\r\n }\r\n }", "public static function encodeAPIKey($data){ \n return BaseConverter::convertFromBinary($data, self::$characters);\n }", "public function encode(array $payload): string;" ]
[ "0.7470326", "0.7470326", "0.7470326", "0.7440866", "0.74406344", "0.74406344", "0.74406344", "0.74406344", "0.7393357", "0.7368723", "0.71585894", "0.7116421", "0.6814515", "0.6787514", "0.67502224", "0.65847206", "0.65819305", "0.6371296", "0.63247114", "0.6306171", "0.6263774", "0.6244246", "0.62372047", "0.619872", "0.6142566", "0.6135525", "0.6077178", "0.6049997", "0.6033133", "0.60184336", "0.60158664", "0.6015094", "0.5977865", "0.5949403", "0.5923577", "0.58993036", "0.5878254", "0.58509904", "0.58418334", "0.5815106", "0.5804537", "0.58038473", "0.5789162", "0.5777996", "0.5775945", "0.5768486", "0.5734639", "0.57262063", "0.57223207", "0.5708447", "0.5680915", "0.56775165", "0.56729716", "0.566892", "0.565908", "0.56589824", "0.5631465", "0.56291604", "0.56249946", "0.5620073", "0.5614564", "0.5607496", "0.5594005", "0.55862314", "0.5567279", "0.5563235", "0.55626065", "0.5561267", "0.5556959", "0.5551949", "0.55461764", "0.5543032", "0.5542682", "0.5528351", "0.5510896", "0.5505935", "0.5497648", "0.5494918", "0.5493327", "0.5487158", "0.5485944", "0.54855514", "0.54804105", "0.54753184", "0.54660386", "0.5456973", "0.54423267", "0.543019", "0.5429087", "0.5426846", "0.5413929", "0.5409279", "0.54082555", "0.5396197", "0.53956836", "0.53853863", "0.53777635", "0.53543574", "0.5352832", "0.5350328" ]
0.6230817
23
primo modo (ORM Eloquent)
public function indexProducts() { // $prods = Product::all() -> where('deleted', false); //secondo modo (ORM Eloquent) //$prods = Product::where('deleted', false) -> get(); // terzo modo (Query builder) $prods = DB::table('products') -> where('deleted', false) -> get(); return view('products.index', compact('prods')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function modulo(){\n return $this->belongsTo('App\\Models\\Modulo');\n }", "public function ormObject();", "public function prestamos()\n {\n return $this->belongsToMany(Prestamo::class);\n }", "abstract function model();", "abstract function model();", "abstract function model();", "abstract function model();", "public static function modulos()\n {\n\t //return Sistema::hasMany(Sistema::class);\n\n\t return (new Sistema())->hasManyThrough(\n\t\t\tnew Modulos(), //modelo final\n\t\t\tnew SistemaModulos(), //modelo intermedio\n\t\t\t'IDSISTEMA', // Foreign key on users table... . El tercer argumento es el nombre de la clave externa en el modelo intermedio\n\t\t\t'IDMODULO', // Foreign key on posts table...\n\t\t\t'IDSISTEMA', // Local key on countries table...\n\t\t\t'IDMODULO' // Local key on users table...\n\t\t)->with('objacceso');\n\n\n\n\t}", "public function modulos()\n {\n return $this->hasMany('App\\Modulo');\n }", "public function run()\n {\n $promo_1 = new Promo;\n $promo_1->product = 1;\n $promo_1->discount = 5;\n $promo_1->latest = 1;\n $promo_1->save();\n $promo_2 = new Promo;\n $promo_2->product = 2;\n $promo_2->discount = 5;\n $promo_2->latest = 1;\n $promo_2->save();\n $promo_3 = new Promo;\n $promo_3->product = 3;\n $promo_3->discount = 5;\n $promo_3->latest = 1;\n $promo_3->save();\n $promo_4 = new Promo;\n $promo_4->product = 4;\n $promo_4->discount = 5;\n $promo_4->latest = 1;\n $promo_4->save();\n $promo_5 = new Promo;\n $promo_5->product = 4;\n $promo_5->discount = 5;\n $promo_5->latest = 1;\n $promo_5->save();\n $promo_6 = new Promo;\n $promo_6->product = 5;\n $promo_6->discount = 5;\n $promo_6->latest = 1;\n $promo_6->save();\n $promo_7 = new Promo;\n $promo_7->product = 2;\n $promo_7->discount = 5;\n $promo_7->latest = 1;\n $promo_7->save();\n $promo_8 = new Promo;\n $promo_8->product = 1;\n $promo_8->discount = 5;\n $promo_8->latest = 1;\n $promo_8->save();\n $promo_9 = new Promo;\n $promo_9->product = 8;\n $promo_9->discount = 5;\n $promo_9->latest = 1;\n $promo_9->save();\n $promo_10 = new Promo;\n $promo_10->product = 7;\n $promo_10->discount = 5;\n $promo_10->latest = 1;\n $promo_10->save();\n }", "public function prodi(){\n\t\treturn $this->hasMany(Prodi::class, \"id_jurusan\", \"id\");\n\t}", "public function mObjetivo()\n {\n return $this->belongsTo('App\\Models\\MObjetivo', 'equipo_id', 'id');\n }", "public function historico(){\n return $this->hasOne(Patrimonio::class, 'id_patrimonio', 'id');\n }", "public function relation()\n {\n// exit();\n return \"this is relation mwthod\";\n // $user = User::find(2);\n // return $user->phone();\n\n // $phone = Phone::find(3);\n // return $phone->user;\n\n\n // return $post->comments();\n\n // $post = Post::find(1);\n // foreach($post->comments as $comment)\n // {\n // echo $comment->brief;\n // }\n\n // $comment = Comment::find(2);\n // return $comment->post->discription;\n\n // $user = User::find(1);\n // return $user->roles;\n\n // $roles = User::find(2)->roles()->orderBy('role_name')->get();\n // return $roles;\n\n // $role = Role::find(1);\n // return $role->users;\n\n\n //morph\n\n\n // $post = Post::find(1);\n // $image = $post->image;\n // return $image;\n\n // $image = Image::find(1);\n\n // $imageable = $image->imageable;\n\n\n // $image = Image::find(1);\n // $imageable = $image->imageable;\n // return $imageable;\n\n // $post = Post::find(1);\n\n // foreach ($post->comments as $comment) {\n // echo $comment->brief;\n // }\n\n // $comment = Comment::find(1);\n // $commentable = $comment->commentable;\n // echo $commentable->title;\n\n\n // $post = Post::find(1);\n // foreach ($post->tags as $tag) {\n // echo $tag->name;\n // echo '<br>';\n // ?\n\n // $user = User::find(1);\n // return $user->posts()->where('active', 1)->get();\n\n // return User::find(1)->posts()\n // ->where('active', 1)\n // ->orWhere('votes', '>=', 100)\n // ->get();\n\n // return User::find(4)->posts()\n // ->where(function (Builder $query) {\n // return $query->where('active', 1)\n // ->orWhere('votes', '>=', 100);\n // })\n // ->get();\n\n // return $posts = Post::has('comments')->get();\n\n // return $posts = Post::has('comments', '>=', 1)->get();\n\n // return $posts = Post::has('comments.image')->get();\n\n\n // return Post::whereHas('comments', function (Builder $query) {\n // $query->where('brief', 'like', 'y%');\n // })->get();\n\n // return $posts = Post::whereHas('comments', function (Builder $query) {\n // $query->where('brief', 'like', 'y%');\n // }, '>=', 2)->get();\n\n // return $posts = Post::doesntHave('comments')->get();\n\n // return $posts = Post::whereHas('comments', function (Builder $query) {\n // $query->where('brief', 'like','y%');\n // })->get();\n\n\n // return $comments = Comment::whereHasMorph(\n // 'commentable',\n // [Post::class, Video::class],\n // function (Builder $query) {\n // $query->where('title', 'like', 'php%');\n // }\n // )->get();\n\n\n // return $comments = Comment::whereHasMorph(\n // 'commentable',\n // [Post::class, Video::class],\n // function (Builder $query, $type) {\n // $column = $type === Post::class ? 'discription' : 'title';\n // $query->where($column, 'like', 'l%');\n // }\n // )->get();\n\n\n // return $comments = Comment::whereHasMorph('commentable', '*', function (Builder $query) {\n // $query->where('title', 'like', 'p%');\n // })->get();\n\n // $posts = Post::withCount('comments')->get();\n // foreach ($posts as $post) {\n // echo $post->comments_count;\n // }\n\n // return $posts = Post::withCount(['comments' => function (Builder $query) {\n // $query->where('brief', 'like', 'y%');\n // }])->get();\n\n // return $posts = Post::withCount([\n // 'comments',\n // 'comments as pending_comments_count' => function (Builder $query) {\n // $query->where('approved', false);\n // },\n // ])->get();\n\n // $post = Post::find(4);\n // return $post->loadCount(['comments' => function ($query) {\n // $query->where('approved', '=', 1);\n // }]);\n\n\n // return $posts = Post::withAvg('comments', 'votes')->get();\n\n // $post = Post::find(4);\n // return $post->loadSum('comments', 'votes');\n\n // return $activities = ActivityFeed::with([\n // 'parentable' => function (MorphTo $morphTo) {\n // $morphTo->morphWithCount([\n // Post::class => ['comments'],\n // Video::class => ['tags'],\n // ]);\n // }\n // ])->get();\n\n // $activities = ActivityFeed::with('parentable')->get();\n // return $activities->loadMorphCount('parentable', [\n // Video::class => ['tags'],\n // Post::class => ['comments'],\n // ]);\n\n\n // $users = User::all();\n\n // foreach ($users as $user) {\n // dump($user->roles);\n // }\n\n\n // return Contact::with('user.roles')->get();\n\n\n // return $activities = ActivityFeed::query()\n // ->with(['parentable' => function (MorphTo $morphTo) {\n // $morphTo->morphWith([\n // Video::class => ['tags'],\n // Post::class => ['comments'],\n // ]);\n // }])->get();\n\n // return User::with('phone:id,user_id,number')->get();\n\n // return User::without('phone')->find(1);\n\n // return $users = User::with(['roles' => function ($query) {\n // $query->whereIn('role_name', ['editor', 'content writer']);\n // }])->get();\n\n // $comment = new Comment(['brief' => 'Command is working']);\n // $post = Post::find(4);\n // $post->comments()->save($comment);\n\n // $post = Post::find(2);\n // $post->comments()->saveMany([\n // new Comment(['brief' => 'A new comment.']),\n // new Comment(['brief' => 'Another new comment.']),\n // ]);\n\n\n // $user = User::with('posts')->where('id', 3)->first();\n // $user->posts()->saveMany([\n // new Post(['title' => 'Bird nest', 'discription' => 'Various types of bird nests']),\n // new Post(['title' => 'Authors', 'discription' => 'Authors of Italy']),\n // ]);\n\n // $user->refresh();\n // return $user->posts;\n\n\n // $user = User::find(4);\n // $user->name = \"ALia Bhatt\";\n // $user->posts[0]->title = 'Trump has left whitehouse';\n // $user->posts[0]->comments[0]->brief = 'Biden take charge';\n // $user->push();\n\n // $post = Post::find(4);\n // $post->user()->associate(User::find(4));\n // $post->save();\n\n // $user = User::find(1);\n // $user->roles()->attach(2);\n // $user->roles()->attach(2, ['priority' => 2]);\n\n\n // $user = User::find(1);\n // $user->roles()->detach();\n\n // $user = User::find(1);\n // $user->roles()->attach([\n // 2 => ['priority' => 4],\n // 3 => ['priority' => 5],\n // ]);\n\n // $user = User::find(1);\n // $user->roles()->sync([1, 3]);\n\n // $user = User::find(1);\n // $user->roles()->sync([2 => ['priority' => 5], 1]);\n\n // $user = User::find(1);\n // $user->roles()->syncWithoutDetaching([3]);\n\n // $user = User::find(1);\n // $user->roles()->updateExistingPivot(2, [\n // 'priority' => 2,\n // ]);\n\n\n // $post = Post::find(8);\n // $post->title = \"Ind vs Aus\";\n // $post->save();\n\n // $post = Post::find(8);\n // $post->discription = \"Author of germany\";\n // $post->save();\n\n // return redirect('qbuilder');\n\n\n }", "abstract public function model();", "abstract public function model();", "abstract public function model();", "abstract public function model();", "abstract protected function model();", "abstract protected function model();", "public function modulos()\n {\n return $this->hasMany('App\\Models\\glb\\Modulo');\n }", "public function proyecto()\n {\n return $this->belongsTo('App\\Proyectos', 'proyecto_fk_rp', 'id_proyecto');\n }", "protected abstract function model();", "public abstract function model();", "public function peliculas(){\n // Retornar tipo de relacion\n return $this->hasMany('App\\Pelicula');\n }", "public function produtos() \n \t{\n \t\treturn $this->belongsToMany(Produto::class);\n \t}", "public function productos()\n {\n return $this->belongsTo('App\\Models\\Producto');\n }", "public function model()\n {\n return Pescaria::class;\n }", "public function Mproblema()\n {\n return $this->belongsTo('App\\Models\\poa\\problema\\Mproblema');\n }", "public function permissoes()\n {\n \treturn $this->belongsToMany(Permissao::class);\n }", "public function relasiProdi()\n {\n return $this->belongsTo(\n 'PMW\\Models\\Prodi',\n 'id_prodi');\n }", "public function productos(){\n return $this->hasMany(Producto::class);\n }", "public function model()\n {\n return Movimento::class;\n }", "public function getModo()\n {\n return $this->hasOne(InterModos::className(), ['id' => 'modo_id']);\n }", "public function pais(){\n return $this->belongsTo('App\\Models\\Pais');//relaciona provincia con pais\n }", "public function pronostic() {\n $relation = $this->hasOne(\"Pronostic\");\n return $relation;\n }", "public function getOrm()\n {\n $user= User::first();\n dd($user->NombresCompletos,$user->profile->edad,$user->profile->Biografia);\n }", "public function permisos()\n {\n return $this->belongsToMany(Permiso::class,\n PermisoAttr::PERMISOS_ROLES, 'rol_id', 'permiso_id');\n }", "public function proyecto()\n {\n return $this->belongsTo('App\\Proyecto', 'id_proyecto');\n }", "public function postulanteR()\n {\n \treturn $this->belongsTo('App\\Postulante','postulante'); //Id local\n }", "public function model()\n {\n return Projeto::class;\n }", "public function morph()\n {\n $this->morphTable('rpsa0437', [\n 'columns' => [\n new Column(\n 'recnum',\n [\n 'type' => Column::TYPE_BIGINTEGER,\n 'notNull' => true,\n 'autoIncrement' => true,\n 'size' => 1,\n 'first' => true\n ]\n ),\n new Column(\n 'filial',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 2,\n 'after' => 'recnum'\n ]\n ),\n new Column(\n 'numero',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 8,\n 'after' => 'filial'\n ]\n ),\n new Column(\n 'serie',\n [\n 'type' => Column::TYPE_VARCHAR,\n 'default' => \" \",\n 'notNull' => true,\n 'size' => 5,\n 'after' => 'numero'\n ]\n ),\n new Column(\n 'emissao',\n [\n 'type' => Column::TYPE_DATE,\n 'default' => \"01/01/0001\",\n 'notNull' => true,\n 'size' => 1,\n 'after' => 'serie'\n ]\n ),\n new Column(\n 'situacao',\n [\n 'type' => Column::TYPE_VARCHAR,\n 'default' => \" \",\n 'notNull' => true,\n 'size' => 1,\n 'after' => 'emissao'\n ]\n ),\n new Column(\n 'valor_servicos',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 10,\n 'scale' => 2,\n 'after' => 'situacao'\n ]\n ),\n new Column(\n 'valor_deducoes',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 10,\n 'scale' => 2,\n 'after' => 'valor_servicos'\n ]\n ),\n new Column(\n 'csp',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 8,\n 'after' => 'valor_deducoes'\n ]\n ),\n new Column(\n 'aliquota',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 4,\n 'scale' => 2,\n 'after' => 'csp'\n ]\n ),\n new Column(\n 'iss_retido',\n [\n 'type' => Column::TYPE_VARCHAR,\n 'default' => \" \",\n 'notNull' => true,\n 'size' => 1,\n 'after' => 'aliquota'\n ]\n ),\n new Column(\n 'iss_valor',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 10,\n 'scale' => 2,\n 'after' => 'iss_retido'\n ]\n ),\n new Column(\n 'tomador_emp',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 2,\n 'after' => 'iss_valor'\n ]\n ),\n new Column(\n 'tomador_cod',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 8,\n 'after' => 'tomador_emp'\n ]\n ),\n new Column(\n 'tomador',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 10,\n 'scale' => 2,\n 'after' => 'tomador_cod'\n ]\n ),\n new Column(\n 'valor_cofins',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 10,\n 'scale' => 2,\n 'after' => 'tomador'\n ]\n ),\n new Column(\n 'valor_csll',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 10,\n 'scale' => 2,\n 'after' => 'valor_cofins'\n ]\n ),\n new Column(\n 'valor_inss',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 10,\n 'scale' => 2,\n 'after' => 'valor_csll'\n ]\n ),\n new Column(\n 'valor_irpj',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 10,\n 'scale' => 2,\n 'after' => 'valor_inss'\n ]\n ),\n new Column(\n 'valor_pis',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 10,\n 'scale' => 2,\n 'after' => 'valor_irpj'\n ]\n ),\n new Column(\n 'condicao_pagto',\n [\n 'type' => Column::TYPE_VARCHAR,\n 'default' => \" \",\n 'notNull' => true,\n 'size' => 7,\n 'after' => 'valor_pis'\n ]\n ),\n new Column(\n 'qitens',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 4,\n 'after' => 'condicao_pagto'\n ]\n ),\n new Column(\n 'outras_inf',\n [\n 'type' => Column::TYPE_TEXT,\n 'size' => 1,\n 'after' => 'qitens'\n ]\n ),\n new Column(\n 'msg_corpo_rps',\n [\n 'type' => Column::TYPE_VARCHAR,\n 'default' => \" \",\n 'notNull' => true,\n 'size' => 208,\n 'after' => 'outras_inf'\n ]\n ),\n new Column(\n 'desc_servicos',\n [\n 'type' => Column::TYPE_TEXT,\n 'size' => 1,\n 'after' => 'msg_corpo_rps'\n ]\n ),\n new Column(\n 'status_rps',\n [\n 'type' => Column::TYPE_VARCHAR,\n 'default' => \" \",\n 'notNull' => true,\n 'size' => 1,\n 'after' => 'desc_servicos'\n ]\n ),\n new Column(\n 'num_nfse',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 8,\n 'after' => 'status_rps'\n ]\n ),\n new Column(\n 'emi_nfse',\n [\n 'type' => Column::TYPE_DATE,\n 'default' => \"01/01/0001\",\n 'notNull' => true,\n 'size' => 1,\n 'after' => 'num_nfse'\n ]\n ),\n new Column(\n 'exp_rps_data',\n [\n 'type' => Column::TYPE_DATE,\n 'default' => \"01/01/0001\",\n 'notNull' => true,\n 'size' => 1,\n 'after' => 'emi_nfse'\n ]\n ),\n new Column(\n 'imp_nfse_data',\n [\n 'type' => Column::TYPE_DATE,\n 'default' => \"01/01/0001\",\n 'notNull' => true,\n 'size' => 1,\n 'after' => 'exp_rps_data'\n ]\n ),\n new Column(\n 'log',\n [\n 'type' => Column::TYPE_VARCHAR,\n 'default' => \" \",\n 'notNull' => true,\n 'size' => 10,\n 'after' => 'imp_nfse_data'\n ]\n ),\n new Column(\n 'log_data',\n [\n 'type' => Column::TYPE_DATE,\n 'default' => \"01/01/0001\",\n 'notNull' => true,\n 'size' => 1,\n 'after' => 'log'\n ]\n ),\n new Column(\n 'log_hora',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 4,\n 'scale' => 2,\n 'after' => 'log_data'\n ]\n ),\n new Column(\n 'log_filial',\n [\n 'type' => Column::TYPE_DECIMAL,\n 'default' => \"0\",\n 'notNull' => true,\n 'size' => 2,\n 'after' => 'log_hora'\n ]\n )\n ],\n 'indexes' => [\n new Index('rpsa0437_index00', ['recnum'], null),\n new Index('rpsa0437_index01', ['numero', 'serie', 'filial'], null),\n new Index('rpsa0437_index02', ['emissao', 'filial', 'numero', 'serie'], null)\n ],\n ]\n );\n }", "public function model();", "public function model();", "public function getProducto()\n {\n return $this->belongsTo(Producto::class, 'producto');\n }", "public function ponderacion() {\n\t\treturn $this->belongsTo('App\\Ponderacion');\n\t}", "public function model()\n {\n return Pedidos::class;\n }", "public function palmares() {\n $relation = $this->hasOne(\"Palmares\");\n return $relation;\n }", "public function model()\n {\n //use model\n }", "public function ministerios(){\n \treturn $this->hasMany(Ministerio::class, 'id_ministerio', 'id_ministerio')->where('bo_activo', true)->where('bo_estado', 1);//->orderBy('email');\n }", "function hola(){\n $pruebas = new model_pruebas(\"bd\");\n $pruebas->pruebas();\n }", "public function patrocinadores()\n\t{\n\t\treturn $this->belongsToMany('App\\Models\\Patrocinador', 'proyecto_patrocinador','proyecto_id');\n\t}", "public function peliculas(){\n //retornar tipo de relacion\n return $this->belongsToMany('App\\Pelicula','pelicula_director');\n }", "public function prodi() {\n return $this->belongsTo( 'App\\Prodi', 'kd_prodi', 'kd_prodi' );\n }", "public function productos()\n {\n return $this->hasMany(Producto::class);\n }", "public function pautas()\n {\n return $this->hasMany('App\\Pauta');\n }", "public function tipo_procesos()\n {\n return $this->belongsTo('App\\TipoProceso');\n }", "public function pagos()\n {\n return $this->hasMany('App\\pagos','id_expediente','id_expediente');\n }", "public function profesor(){\r\n return $this->hasMany('profesor','escuela_id');\r\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function producto() {\n return $this->belongsTo(Producto::class);\n }", "public function producto(){\n return $this->belongsTo(Producto::class);\n }", "public function negocio()\n {\n return $this->hasMany('App\\Negocio');\n }", "public function libro(){\n return $this->belongsTo('App\\Models\\Libro');\n }", "public function mots()\n\t{\n\t\t// hasMany(RelatedModel, foreignKeyOnRelatedModel = liste_id, localKey = id)\n\t\treturn $this->belongsToMany('App\\Models\\Mot');\n\t}", "public function producto() {\n return $this\n ->belongsTo('App\\Producto','idProducto');\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function run()\n {\n //PRODUCTO 1\n $producto = new Producto();\n $producto->producto = 'Audífonos'; \n $producto->precio = '4500.00';\n $producto->save();\n\n //PRODUCTO 2\n $producto2 = new Producto();\n $producto2->producto = 'Smartwatch'; \n $producto2->precio = '2000.00';\n $producto2->save();\n\n //PRODUCTO 3\n $producto3 = new Producto();\n $producto3->producto = 'Teatro en Casa'; \n $producto3->precio = '5000.00';\n $producto3->save();\n\n //PRODUCTO 4\n $producto4 = new Producto();\n $producto4->producto = 'Smart TV'; \n $producto4->precio = '1200.00';\n $producto4->save();\n\n //PRODUCTO 5\n $producto5 = new Producto();\n $producto5->producto = 'Smartphone'; \n $producto5->precio = '7500.00';\n $producto5->save();\n }", "public function getProducto(){\n return $this->belongsTo(Producto::class,'id_producto');\n }", "public function libro(){\n return $this->hasMany('App\\Libro');// la tabla OrderDetail\n}", "public function letras(){\n return $this->hasMany('trogue\\Entities\\Letra','prestamo_id','id');\n }", "public function mobiteli()\n {\n return $this->belongsToMany('App\\Mobitel', 'mobitel_trgovina'); //m:n\n }", "public function getOrm()\r\n {\r\n return new R;\r\n }", "public function run()\n {\n $modoPago = new ModoPago();\n\n $modoPago->modoPago = \"efectivo\";\n $modoPago->cantidadPagos = 1;\n $modoPago->descripcion = \"efectivo\";\n $modoPago->created_at = now();\n\n $modoPago->save();\n\n $modoPago = new ModoPago();\n\n $modoPago->modoPago = \"Debito 1 cuota\";\n $modoPago->cantidadPagos = 1;\n $modoPago->descripcion = \"debito a una cuota\";\n $modoPago->created_at = now();\n\n $modoPago->save();\n\n $modoPago = new ModoPago();\n\n $modoPago->modoPago = \"credito a 1 cuota\";\n $modoPago->cantidadPagos = 1;\n $modoPago->descripcion = \"credito a una cuota\";\n $modoPago->created_at = now();\n\n $modoPago->save();\n\n $modoPago = new ModoPago();\n\n $modoPago->modoPago = \"Debito a 3 cuotas\";\n $modoPago->cantidadPagos = 3;\n $modoPago->descripcion = \"credito a tres cuotas\";\n $modoPago->created_at = now();\n\n $modoPago->save();\n }", "public function run()\n {\n\n $producto = new Producto();\n $producto->title = 'Hamaca';\n $producto->description = 'matrimonial color azul';\n $producto->price = 3200;\n $producto->cantidad = 15;\n $producto->image_url = '';\n $producto->save();\n $producto->artesanos()->attach(1, ['precio_fab' => 814, 'fecha_ini' => now(), 'fecha_ter' => now()]);\n\n\n $producto = new Producto();\n $producto->title = 'Perezosa';\n $producto->description = 'mediana color morado';\n $producto->price = 2500;\n $producto->cantidad = 15;\n $producto->image_url = '';\n $producto->save();\n $producto->artesanos()->attach(2, ['precio_fab' => 814, 'fecha_ini' => now(), 'fecha_ter' => now()]);\n\n $producto = new Producto();\n $producto->title = 'Catre';\n $producto->description = 'tejido cerrado';\n $producto->price = 2500;\n $producto->cantidad = 15;\n $producto->image_url = '';\n $producto->save();\n $producto->artesanos()->attach(3, ['precio_fab' => 814, 'fecha_ini' => now(), 'fecha_ter' => now()]);\n\n $producto = new Producto();\n $producto->title = 'Columpio';\n $producto->description = 'hawaiano';\n $producto->price = 2200;\n $producto->cantidad = 15;\n $producto->image_url = '';\n $producto->save();\n $producto->artesanos()->attach(4, ['precio_fab' => 814, 'fecha_ini' => now(), 'fecha_ter' => now()]);\n\n }", "public function proceso()\n {\n return $this->belongsTo(Proceso::class, 'FK_ECT_Proceso', 'PK_PCS_Id');\n }", "public function models();", "public function hijo(){\r\n return $this->hasMany('hijo','escuela_id');\r\n }", "public function provincias()\n {\n return $this->belongsToMany(Provincia::class,'projecto__provincias__distritos');\n }", "public function genero(){\n return $this->belongsTo('App\\Genero','pk_genero');\n }", "public function genero(){\n return $this->belongsTo('App\\Models\\Genero');\n }", "public function provincy(){\n return $this->belongsTo('App\\Provincy', 'provincy_id');\n }", "public function __construct() {\n $this->noticia_modelo = $this->modelo('NoticiaModelo');\n }", "public function pesanan()\n {\n return $this->hasMany('App\\Pesanan', 'id_pengguna');\n }", "public function salidas(){\n return $this->hasMany('App\\Mantenimiento');\n }", "public function periodo(){\n return $this->belongsTo('App\\Periodo', 'codigo_per');\n }", "function contador_proyectoI(){\r\n $contadorProyectoI= new ContadorEstuModel();\r\n return $contadorProyectoI->contadorProyectoI();\r\n }", "public function Renovation(){\n return $this->hasMany('renovacion','membresia_id');\n }", "public function pharmacies(){\n return $this->hasMany('App\\Pharmacie');\n }", "public function products(): MorphToMany;", "public function insumoPlatos(){\n return $this->hasMany('App\\Models\\insumo_plato');\n }", "public function newModelQuery();", "public function restos(){\n return $this->hasMany('App\\Resto');\n }", "public function genero()\n\t{\n return $this->belongsTo(Genero::class);\n\t}", "public function seguimiento()\n {\n return $this->hasMany('TitIntegral\\Seguimiento','metodo_id');\n }", "public function theloai()\n {\n \treturn $this->belongsTo('App\\TheLoai','idTheLoai','id');\n\n }", "public function getModelo(){ return $this->modelo;}", "public function cimeros()\n {\n return $this->belongsTo('App\\Cimero','id','provincia');\n }", "public function curso1()\n{\n return $this->hasOne(Curso::class, 'tipo_curso_id');\n}", "public function Prodotto()\n {\n return $this->belongsToMany('App\\models\\Prodotto',\n 'App\\models\\Lista','id_cliente',\n 'codice_prodotto','id','codice')\n ->withPivot('quantita_prodotto');\n }", "public function planPago() {\r\n\t\treturn $this->belongsTo('App\\PlanPago');\r\n\t}" ]
[ "0.6374884", "0.6348796", "0.6185268", "0.6149543", "0.6149543", "0.6149543", "0.6149543", "0.61379117", "0.61290896", "0.611944", "0.6103264", "0.6101455", "0.6091029", "0.60674584", "0.60611075", "0.60611075", "0.60611075", "0.60611075", "0.6056779", "0.6056779", "0.60261023", "0.6026056", "0.6012197", "0.60046196", "0.6003007", "0.5987372", "0.5978871", "0.597675", "0.5973649", "0.596524", "0.5951731", "0.59489477", "0.5939009", "0.59340686", "0.5918949", "0.5914411", "0.58956367", "0.58850855", "0.58687663", "0.58635503", "0.5852949", "0.5828578", "0.58267426", "0.58267426", "0.5824744", "0.58238477", "0.5818003", "0.5810947", "0.5795313", "0.5793168", "0.5789063", "0.57887083", "0.57828635", "0.578171", "0.57717806", "0.5760624", "0.575937", "0.57479095", "0.5743277", "0.5737468", "0.5735379", "0.5735149", "0.5730994", "0.5715711", "0.57132107", "0.5712035", "0.57060885", "0.5703619", "0.56886363", "0.5684436", "0.5661775", "0.5661589", "0.5661168", "0.5660154", "0.56574804", "0.5657469", "0.56485224", "0.5646633", "0.56463623", "0.5638103", "0.5631386", "0.56302404", "0.56288147", "0.5620143", "0.5611775", "0.5610394", "0.5606027", "0.5603968", "0.5598811", "0.559474", "0.55945414", "0.559403", "0.559369", "0.5592058", "0.5589668", "0.5586989", "0.558652", "0.5584898", "0.5579129", "0.5576426", "0.5569915" ]
0.0
-1
function initializes the board to start playing
public function initGame(){ $this->board = new Board(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function startPlay(){ \r\n\r\n $this->selectPlayer();\r\n $this->board->printBoard();\r\n\r\n while(!$this->gameOver){\r\n\r\n //check if board is full\r\n if($this->reachedMaxMoves() || $this->validateIsFullBoard()){\r\n noWinningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n break;\r\n }\r\n // set board with table\r\n $userMove = $this->selectMove();\r\n \r\n //in case that column is not full \r\n if(!$this->validateIsFullColumn($userMove)){\r\n $this->insertMoveToBoard($userMove);\r\n $this->winCheck($userMove);\r\n $this->switchPlayer();\r\n }\r\n }\r\n }", "function initBoard()\n\t{\n\t\tglobal $board;\n\n\t\t/* clear board */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\tfor ($j = 0; $j < 8; $j++)\n\t\t\t{\n\t\t\t\t$board[$i][$j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/* setup white pieces */\n\t\t$board[0][0] = WHITE | ROOK;\n\t\t$board[0][7] = WHITE | ROOK;\n\t\t$board[0][1] = WHITE | KNIGHT;\n\t\t$board[0][6] = WHITE | KNIGHT;\n\t\t$board[0][2] = WHITE | BISHOP;\n\t\t$board[0][5] = WHITE | BISHOP;\n\t\t$board[0][3] = WHITE | QUEEN;\n\t\t$board[0][4] = WHITE | KING;\n\n\t\t/* setup black pieces */\n\t\t$board[7][0] = BLACK | ROOK;\n\t\t$board[7][7] = BLACK | ROOK;\n\t\t$board[7][1] = BLACK | KNIGHT;\n\t\t$board[7][6] = BLACK | KNIGHT;\n\t\t$board[7][2] = BLACK | BISHOP;\n\t\t$board[7][5] = BLACK | BISHOP;\n\t\t$board[7][3] = BLACK | QUEEN;\n\t\t$board[7][4] = BLACK | KING;\n\n\t\t/* setup pawns */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\t$board[1][$i] = WHITE | PAWN;\n\t\t\t$board[6][$i] = BLACK | PAWN;\n\t\t}\n\t}", "function start()\n\t{\n\t\t$this->score = 0;\n\t\t$this->won = false;\n\t\t$this->over = false;\n\t}", "public function startGame($cell_number)\n\t{\n\n\t}", "public function initGame()\n {\n session_start();\n $this->newGame();\n if (!isset($_SESSION['game']) || $_SESSION['game']['remaining_ships'] < 1) {\n $this->newGame();\n } else {\n $this->loadGame($_SESSION['game']);\n }\n $this->play();\n $this->storeGame();\n $this->show();\n }", "public function play() {\r\n foreach ($this->cells as $cell) {\r\n $alive_neighbours = $this->alive_neighbours_around($cell);\r\n if (!$cell->alive && $alive_neighbours == 3) {\r\n $cell->next_state = 1;\r\n } else if ($alive_neighbours < 2 || $alive_neighbours > 3) {\r\n $cell->next_state = 0;\r\n }\r\n }\r\n\r\n foreach ($this->cells as $cell) {\r\n if ($cell->next_state == 1) {\r\n $cell->alive = true;\r\n } else if ($cell->next_state == 0) {\r\n $cell->alive = false;\r\n }\r\n }\r\n\r\n $this->play += 1;\r\n }", "public function playMoves()\n\t{\n\t\t$this->resetBoard();\n\t\t$moves = unserialize(serialize($this->moves));\n\t\t$this->resetMoves();\n\t\t\n\t\tforeach($moves as $move)\n\t\t{\n\t\t\t$this->move($move[0], $move[1]);\n\t\t}\n\t}", "public function setUp()\n {\n //For this example, the max score MUST be exactly 15\n $this->_maxScore = 15;\n\n $this->_board = [\n [8 => \"\", 1 => \"\", 6 => \"\"],\n [3 => \"\", 5 => \"\", 7 => \"\"],\n [4 => \"\", 9 => \"\", 2 => \"\"]\n ];\n\n /**\n * Winning conditions, based on Magic Square Theory\n */\n $this->_winningConditions = [\n [8, 1, 6],\n [3, 5, 7],\n [4, 9, 2],\n [8, 3, 4],\n [1, 6, 9],\n [6, 7, 2],\n [8, 5, 2],\n [6, 5, 4]\n ];\n\n\n }", "public function __construct() {\n $round = apc_fetch('game_round');\n if ($round === false) {\n $this->start_round();\n }\n\n $board = apc_fetch('game_board');\n if ($board === false) {\n $board = $this->__reload_board($round);\n }\n \n $this->_BOARD = $board;\n $this->_ROUND = $round;\n }", "private function _resetBoard()\n {\n $this->curPos = 0;\n $this->curRow = 0;\n $this->_createBoard();\n }", "public function init()\n {\n $this->_createBoard();\n $this->_createSlots();\n }", "public function startNewGame() {\n\t \t//Set all queued used to playing\n\t \t//Build new map scaled on number of playing users\n\t \t//place users on map\n\t \t//start game\n\t \t//send out alert that game has started\n\t }", "public function start(): void\n {\n $this->startTimer();\n $this->setGameState(SELF::STATE_STARTED);\n }", "public function emptyBoard()\n {\n $this->board = array_fill(0, $this->boardSize, array_fill(0, $this->boardSize, ''));\n }", "private function initPlayer(): void\n {\n $name = $this->getConfig()->getPlayerName();\n $interaction = $this->getConfig()->getInteractionInterface();\n\n $this->player = PlayerFabric::createReal($this->pile, $name, $interaction);\n }", "function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\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$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}", "public function run() {\n $this->init();\n $this->welcome();\n $this->setMark();\n $this->startGame();\n }", "public function play()\n {\n $game = $this->getGame();\n $playerList = $game->getPlayerList();\n /** @var IPlayer $player */\n array_map(function($player){\n $player->removeCards();\n }, $playerList->getPlayers());\n $this->getGame()->setDeck((new \\FiveCardDraw\\Service\\Deck\\StandardDeckBuilder())->build());\n for ($i = 0; $i < 5; ++$i) {\n /** @var IPlayer $player */\n foreach ($playerList->getPlayers() as $player) {\n $player->addCard($game->getDeck()->draw());\n }\n }\n $game->changeState(new TradeState($game));\n }", "function play($game) {\t\n\tif($game[\"gameOver\"] == -1) {\n\t\tif ($game[\"clicked\"] !== 9 )\n\t\t\tupdateBoard(); //print_r($game); \n\t\tdisplayBoard();\t\t\n\t\tupdateSession();\t\t\n\t} \n}", "function board_main(){\n\t\tglobal $x7c, $x7s, $db, $prefix, $x7p, $print;\n\n\n\t\tif($x7c->settings['panic']) {\n\t\t\t$print->board_window(\"\",\"\",\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tudpate_unread();\n\t\t\n\t\tif(isset($_GET['newboard'])){\n\t\t\tcreate_board();\n\t\t}\n\t\telse if(isset($_GET['board'])){\n\t\t\tshow_board($_GET['board']);\n\t\t}\n\t\telse if(isset($_GET['send'])){\n\t\t\tnew_communication($_GET['send']);\n\t\t}\n\t\telse if(isset($_GET['delete'])){\n\t\t\tdelete_message($_GET['delete']);\n\t\t}\n\t\telse if(isset($_GET['delboard'])){\n\t\t\tdelete_board($_GET['delboard']);\n\t\t}\n\t\telse if(isset($_GET['readall'])){\n\t\t\tread_all();\n\t\t}\n\t\telse if(isset($_GET['move'])){\n move_msg();\n\t\t}\n\t\telse \n\t\t\tboard_list();\n\t}", "public function __construct()\n {\n parent::__construct();\n //$this->board = $board;\n }", "public function switchPlayer(){\n\t\tfor($col = 0; $col < 3; $col++){\n\t\t\tfor($row = 0; $row < 3; $row++){\n\t\t\t\tif(isset($_GET[\"cell-\".$col.\"-\".$row])){\n\t\t\t\t\tif($this->player1->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player1;\n\t\t\t\t\t}\n\t\t\t\t\tif($this->player2->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->currentPlayer === $this->player1){\n\t\t\t$this->currentPlayer = $this->player2;\n\t\t} else {\n\t\t\t$this->currentPlayer = $this->player1;\n\t\t}\n\t}", "public function __construct()\n {\n for ($x = -self::BOARD_SIZE; $x <= self::BOARD_SIZE; $x++) {\n for ($y = -self::BOARD_SIZE; $y <= self::BOARD_SIZE; $y++) {\n if (abs($x) >= self::SIDE_SIZE && abs($y) >= self::SIDE_SIZE) {\n continue;\n }\n $this->board[$x][$y] = self::STONE;\n }\n }\n\n $this->board[0][0] = self::EMPTY_SLOT;\n }", "private function _createBoard()\n {\n $board = array();\n for($nr = 1; $nr <= $this->numSlots; $nr++){\n $board[] = array_fill(0, $nr, 0);\n }\n\n $this->board = $board;\n }", "public function resetBoard()\n\t{\n\t\t$this->board = array();\n\t\t\n\t\t// Not available positions in the square.\n\t\t$this->board[3][-3] = false;\n\t\t$this->board[3][-2] = false;\n\t\t$this->board[2][-3] = false;\n\t\t$this->board[2][-2] = false;\n\t\t\n\t\t$this->board[-2][-3] = false;\n\t\t$this->board[-2][-2] = false;\n\t\t$this->board[-3][-3] = false;\n\t\t$this->board[-3][-2] = false;\n\t\t\n\t\t$this->board[3][2] = false;\n\t\t$this->board[3][3] = false;\n\t\t$this->board[2][2] = false;\n\t\t$this->board[2][3] = false;\n\t\t\n\t\t$this->board[-2][2] = false;\n\t\t$this->board[-2][3] = false;\n\t\t$this->board[-3][2] = false;\n\t\t$this->board[-3][3] = false;\n\t\t\n\t\t// Fill the available positions.\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\tif(!isset($this->board[$i][$j]))\n\t\t\t\t{\n\t\t\t\t\tif($i == 0 && $j == 0) // Center position empty\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function startBattle()\n {\n echo \"Starting battle.. <br />\";\n echo \"Type of this battle is: <i>\" . $this->_type . \"</i>.<br />\";\n echo \"\\t\\t<i>\" . $this->getTypeDescription() . \"</i><br/>\";\n \n $round = 0;\n while(!$this->battleFinished())\n {\n // prints information about current round:\n echo \"<br /><br />ROUND \" . $round++ . \" Attacker: <i>\";\n echo $this->getAttacker()->getName();\n echo \"</i>\\tDefender: <i>\";\n echo $this->getDefender()->getName() . \"</i>\";\n $this->status();\n \n $this->getAttacker()->fight($this, $this->getDefender());\n \n $this->changeTurn(); \n }\n \n // battle is over, print status and declare winner (if there is any) \n $this->status(); \n echo \"<br/><br/>The winner is: <b>\";\n echo $this->getWinner() . \"</b>!\" . PHP_EOL;\n }", "function updateBoard() {\n\tglobal $game, $message;\n\t$cellClicked = $game['clicked']; //identify which button was submitted \t\t\t\t\t\n\tif ($cellClicked !== 9 ) {\n\t\t$curPos = $cellClicked; // get the actual button clicked. 0 to 8 correspond to respective cell\n\t\t$game[\"board\"][$curPos] = $game[\"player\"]; // set our game's data with player mark\n\t\t$game[\"player\"] = ($game[\"player\"]+1)%2; // switch the player turn\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t} else {\n\t\t$game[\"player\"] = 0;\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t}\n\t$message = \"Player \".substr($game[\"playToken\"],$game[\"player\"],1).\" go!\";\n}", "public function play() {\n if ($this->getLigado() && !($this->getTocando())) {\n $this->setTocando(true);\n }\n }", "protected function welcome() {\n echo \"*****************\" . PHP_EOL .\n \"*** TicTacToe ***\" . PHP_EOL .\n \"*****************\" . PHP_EOL;\n $this->drawBoard(array(), true);\n echo \"[\" . self::QUIT_BUTTON . \"] - End game\" . PHP_EOL . PHP_EOL;\n }", "public function start(){\n\t\t$gameId = $this->input->post('gameId');\n $utoken = $this->input->post('utoken');\n\t\t$game = $this->setRedis_info($gameId);\n\t\tif($game['admin']==$utoken){\n\t\t\tif(count($game['players']) < 2){\n\t\t\t\t$this->setHeader(['success'=>0, 'msg'=>'Cannot start the game... min. 2 players needed!'], 202);\n\t\t\t}\n\t\t\t$game['status'] = \"inPlay\";\n\t\t\t$this->setRedis_set($gameId, $game);\n\t\t\t$this->setHeader(['success'=>1, 'msg'=>'Game has been started successfully!'], 200);\n\t\t}else{\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'You are not admin of this game!'], 202);\n\t\t}\n }", "private function setUpItemboard()\n\t{\n\t\t$items_number = $this->photos_collection->count();\n\t\t$columns_number = $this->columns_number;\n\t\t\n\t\t$this->itemboard = new Itemboard($items_number, $columns_number);\n\t\t$this->itemboard->process();\n\t}", "public function run()\n {\n Boardroom::factory(30)->create();\n }", "public function start() {\r\n\r\n $this->stepTick = $this->getMain()->getServer()->getTick();\r\n\r\n $count = count($this->players);\r\n\r\n $this->step = self::STEP_HIDE;\r\n\r\n $this->seekersCount = ceil($count * ($this->getSeekersPercentage() / 100)); // Minimum $this->getSeekersPercentage() percents of the players (inimum because if there are less than $this->getSeekersPercentage(), then there could be no seeker)\r\n\r\n $this->hidersLeft = count($this->players) - $this->seekersCount;\r\n\r\n\r\n\r\n shuffle($this->players);\r\n\r\n $i = 0;\r\n\r\n foreach($this->players as $p) {\r\n\r\n if($i < $this->seekersCount) {\r\n\r\n $this->players[$i]->HideAndSeekRole = self::ROLE_SEEK;\r\n\r\n $this->players[$i]->sendTip(\"§4You're a seeker.\");\r\n\r\n } else {\r\n\r\n $this->players[$i]->HideAndSeekRole = self::ROLE_HIDE;\r\n\r\n $this->players[$i]->sendTip(\"§4You're an hider.\");\r\n\r\n }\r\n\r\n $i++;\r\n\r\n }\r\n\r\n }", "public function playLastGame()\n\t{\n\t\t$this->resetBoard();\n\t\t\n\t\tif($this->renderPlay)\n\t\t{\n\t\t\techo $this->renderBoard();\n\t\t}\n\t\t\n\t\t$db = new PegDB();\n\t\t\n\t\t$moves = $db->loadLastGame();\n\t\t\n\t\tforeach($moves as $move)\n\t\t{\n\t\t\t$this->move($move[0], $move[1]);\n\t\t}\n\t}", "function my_magic_cards_grid_setup() {\r\n\r\n\r\n}", "public function stepGameTurn(){\n\n $this->stepBoard = new Board();\n $this->board->showBoard();\n $gridSize = $this->board->getRowCount();\n $cell;\n $stepCell;\n\n if($this->board->isSquareGrid()){\n // for rows\n for($i = 0; $i<$gridSize; $i++){\n //for columns\n for($j = 0; $j<$gridSize; $j++){\n $cell = $this->board->getCell($i,$j);\n $liveNeighbors = $this->analyzeNeighbors($i,$j);\n $stepCell = $this->processRulesOfTheGame($cell, $liveNeighbors);\n // add the result of processRulesOfTheGame to the step board\n $this->stepBoard->addCell($i,$j,$stepCell);\n }\n }\n $this->stepBoard->showBoard();\n }\n }", "function makePlayerMove($x,$y){\n if (!$this->board->isEmpty($x,$y)){\n return False;\n } else {\n $this->board[$x][$y] = 2;\n }\n }", "public function start() {\n $this->setup();\n $this->fight();\n }", "function game_play($link) {\r\n echo '<br />'; \r\n if ($this->grid_size > 3) {\r\n \r\n }\r\n echo '<font face = \"courier\" size = \"5\">';\r\n echo '<table cols = \"' . ($this->debug ? $this->grid_size + 2 : $this->grid_size) . '\" border = \"1\" style = \"font-weight:bold; border-collapse: collapse\">';\r\n if ($this->debug) {\r\n echo '<thead><tr><th></th>';\r\n for ($col = 1; $col <= $this->grid_size; $col++) {\r\n echo '<th style=\"padding: 5px;\"> Column ' . $col . '</th>';\r\n }\r\n echo '<th></th></tr></thead>';\r\n echo '<tfoot><tr><th></th>';\r\n for ($col = 1; $col <= $this->grid_size; $col++) {\r\n echo '<th> Column ' . $col . '</th>';\r\n }\r\n echo '<th></th></tr></tfoot>';\r\n }\r\n echo '<tbody><tr>';\r\n $row = 1; \r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row . '</th>';\r\n }\r\n for ($pos = 0; $pos < pow($this->grid_size, 2); $pos++) {\r\n if ($link) {\r\n echo $this->show_cell($pos);\r\n } else {\r\n\t\t\t\t\r\n\t\t\t\t\t echo '<td style=\"text-align:center;' . (in_array($pos, $this->winning_line[0]) ? ' background-color: #90EE90;' : ' opacity: 0.5;' ) . '\"><div style=\"padding: 1em;\">' . $this->position[$pos] . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $pos . ':(' . $row . ',' . (($pos % $this->grid_size) + 1) . ')</span>') : '') . '</div></td>';\r\n\t\t\t\t\t\r\n\t\t\t}\r\n if (($pos + 1) % $this->grid_size == 0) {\r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row++ . '</th>';\r\n }\r\n if (($pos + 1) != pow($this->grid_size, 2)) {\r\n echo '</tr><tr>';\r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row . '</th>';\r\n }\r\n }\r\n }\r\n }\r\n echo '</tr></tbody>';\r\n echo '</table>';\r\n echo '</font>';\r\n echo '<br /><hr />';\r\n }", "public function startGameSession() {\n if(!isset($_SESSION['wrongGuesses'])) {\n $_SESSION['wrongGuesses'] = 0;\n }\n $_SESSION['activeGame'] = true;\n }", "public function turn()\n {\n }", "abstract public function fillBoard(Board $_board, Console $_console, Getopt $_options);", "function stInterPlayerTurn() {\n \n // Give him extra time for his actions to come\n self::giveExtraTime(self::getActivePlayerId());\n \n // Does he plays again?\n if (self::getGameStateValue('first_player_with_only_one_action')) {\n // First turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('first_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('second_player_with_only_one_action')) {\n // 4 players at least and this is the second turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('second_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('has_second_action')) {\n // The player took his first action and has another one\n $next_player = false;\n self::setGameStateValue('has_second_action', 0);\n }\n else {\n // The player took his second action\n $next_player = true;\n self::setGameStateValue('has_second_action', 1);\n }\n if ($next_player) { // The turn for the current player is over\n // Reset the flags for Monument special achievement\n self::resetFlagsForMonument();\n \n // Activate the next player in turn\n $this->activeNextPlayer();\n $player_id = self::getActivePlayerId();\n self::setGameStateValue('active_player', $player_id);\n }\n self::notifyGeneralInfo('<!--empty-->');\n self::trace('interPlayerTurn->playerTurn');\n $this->gamestate->nextState();\n }", "function start($gameId){\n \n}", "function getInitialBoard() {\n $board=array();\n $boardindex=array(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\");\n\n foreach($boardindex as $i) {\n $board[$i]=array(\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\");\n }\n\n $board['A'][1]=\"WR\";\n $board['B'][1]=\"WN\";\n $board['C'][1]=\"WB\";\n $board['D'][1]=\"WQ\";\n $board['E'][1]=\"WK\";\n $board['F'][1]=\"WB\";\n $board['G'][1]=\"WN\";\n $board['H'][1]=\"WR\";\n\n $board['A'][2]=\"WP\";\n $board['B'][2]=\"WP\";\n $board['C'][2]=\"WP\";\n $board['D'][2]=\"WP\";\n $board['E'][2]=\"WP\";\n $board['F'][2]=\"WP\";\n $board['G'][2]=\"WP\";\n $board['H'][2]=\"WP\";\n\n $board['A'][7]=\"BP\";\n $board['B'][7]=\"BP\";\n $board['C'][7]=\"BP\";\n $board['D'][7]=\"BP\";\n $board['E'][7]=\"BP\";\n $board['F'][7]=\"BP\";\n $board['G'][7]=\"BP\";\n $board['H'][7]=\"BP\";\n\n $board['A'][8]=\"BR\";\n $board['B'][8]=\"BN\";\n $board['C'][8]=\"BB\";\n $board['D'][8]=\"BQ\";\n $board['E'][8]=\"BK\";\n $board['F'][8]=\"BB\";\n $board['G'][8]=\"BN\";\n $board['H'][8]=\"BR\";\n\n return $board;\n }", "abstract protected function play(array $move = array());", "function play() { \n\n\t\tif ($this->XBMCCmd(\"PlayNext\")!=\"OK\") { return false; } \n\t\treturn true;\n\n\t}", "public function run()\n {\n //\n DB::table('states')->insert([\n \t'connected' => false,\n \t'playing' => false,\n \t'volume' => 30\n ]);\n }", "private function playMachine()\n {\n do {\n echo \"Jugador Maquina pide carta.\\n\";\n\n $card = new Card($this->memory);\n $this->machine->receiveCard($card);\n $this->memory->add($card);\n $points = $this->machine->getPoints();\n\n echo \"\\tHa sacado \" . $card . '. LLeva ' . $points . ' punto' . $points > 1 ? 's' : '' . \"\\n\";\n\n } while ($this->machine->willContinue($this->memory) && !$this->machine->isOver());\n\n if (!$this->machine->isOver())\n echo \"Jugador Máquina se planta.\\n\";\n\n }", "public function testGameStart()\n {\n $twitterTopic = 'TestTwitterTopic';\n $twitterOAuth = $this->createTwitterMock($twitterTopic);\n\n $game = new Game($twitterOAuth);\n $game->start();\n\n $this->assertEquals($game->word, 'TESTTWITTERTOPIC');\n $this->assertEquals($game->numberTiles, strlen($twitterTopic));\n }", "function runningPlay() {\n\t\t// request information about the new challenge ...\n\t\t// ... and callback to function newChallenge() ...\n//\t\t$this->addCall('GetCurrentChallengeInfo', array(), '', 'newChallenge');\n\t}", "public function onRun(): void\n {\n foreach (Server::getInstance()->getOnlinePlayers() as $player){\n $session = SessionManager::getSession($player->getXuid());\n if ($session !== null && $session->getTogglesModule()->scoreboards()){\n ScoreboardHandler::sendAppropriateScoreboard($session);\n }\n }\n }", "function gameSetup() {\n\t// create an array for cards\n\t$suits = ['C', 'H', 'S', 'D'];\n\t$cards = ['Ace', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King'];\n\t//take player name\n\t$name = enterName();\n\t//Build the deck of cards\n\t$deck = buildDeck($cards, $suits);\n\t// initialize a dealer and player hand\n\t$dealer = [];\n\t$player = [];\n\t$bankroll = determineBankroll();\n\t$bet = enterBet($bankroll);\n\tdrawHand($deck, $player);\n\tdrawHand($deck, $dealer);\n\techoDealer($dealer, true);\n\techoPlayer($player, $name);\n\tgamePlay($deck, $player, $dealer, $name, $bankroll, $bet);\n}", "public function gameGrid() {\n\n }", "public function __construct(Board $board)\n {\n $this->board = $board;\n }", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "public function run()\n\t{\n\t\t\n\t\t$boards = [\n\t\t\t[\t'id' => 1,\n\t\t\t\t'name' => 'b',\n\t\t\t\t'description' => 'Random',\n\t\t\t\t'header_content' => '<h2><em>Some description or html block about the board.</em></h2><p class=\"board-description small\">Some fine print indicating nothing important which nobody really reads.<br>Also nobody reads this line.</p>',\n\t\t\t\t'is_locked' => 0,\n\t\t\t\t'is_staff_only' => 0,\n\t\t\t\t'is_nsfw' => 0,\n\t\t\t\t'is_forced_anon' => 0,\n\t\t\t\t'pages' => 15,\n\t\t\t\t'section_id' => 2,\n\t\t\t\t'order_id' => 0,\n\t\t\t\t'max_replies' => 250,\n\t\t\t\t'max_upload_size' => 5 * 1024,\n\t\t\t],\n\t\t];\n\n\t\tDB::table('boards')->insert($boards);\n\t\t\n $this->command->info('User table seeded!');\n\n\t}", "function st_setupMinigame()\n {\n self::incGameStateValue('minigame', 1);\n $minigame = self::getGameStateValue('minigame');\n\n self::setGameStateValue('minigame_round', 1);\n self::setStat(1, \"rounds_{$minigame}\");\n self::setGameStateValue('points_winnable', 7);\n self::DbQuery(\"UPDATE `player` SET `player_solved_in_round` = NULL\");\n\n // Get all cards, sort into piles, shuffle piles.\n $this->cards->moveAllCardsInLocation(null, \"offtable\");\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('evidence'), 'id'), 'deck');\n $this->cards->shuffle('deck');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('crime'), 'id'), 'crime_deck');\n $this->cards->shuffle('crime_deck');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('location'), 'id'), 'location_deck');\n $this->cards->shuffle('location_deck');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('suspect'), 'id'), 'suspect_deck');\n $this->cards->shuffle('suspect_deck');\n\n // Get all tiles, shuffle them in two decks, associate them with\n // location slots. Decks are called \"cri_tile_d\" (crime tile deck) and\n // \"sus_tile_d\" (suspect tile deck). VARCHAR(16) ftw!\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('tile_crime'), 'id'), 'cri_tile_d');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('tile_suspect'), 'id'), 'sus_tile_d');\n $this->cards->shuffle('cri_tile_d');\n $this->cards->shuffle('sus_tile_d');\n foreach($this->locations as $loc_id => $loc) {\n $this->cards->pickCardForLocation('cri_tile_d', 'locslot', $loc['slots']['crime']['id']);\n $this->cards->pickCardForLocation('sus_tile_d', 'locslot', $loc['slots']['suspect']['id']);\n\n // Get the specific location tile (also currently 'offboard') and\n // put it into its fixed location slot.\n //\n // (28 + $loc_id) is the \"material id\" aka type_arg of the fake\n // location tile.\n $temp = $this->cards->getCardsOfType('tile_location', 28 + $loc_id); // required, as array_shift does not want a direct reference\n $location_tile = array_shift($temp);\n $this->cards->moveCard($location_tile['id'], 'locslot', $loc['slots']['location']['id']);\n }\n\n // Main display of evidence cards\n $this->cards->pickCardsForLocation($this->constants['EVIDENCE_DISPLAY_SIZE'], 'deck', 'evidence_display');\n\n // Investigators that have been used go back to the box.\n $used_investigators = $this->tokens->getTokensOfTypeInLocation('pi_%', 'agentarea_%');\n if ($used_investigators) {\n $this->tokens->moveTokens(array_pluck($used_investigators, 'key'), 'box');\n }\n\n // Set up a case for every player and distribute the case cards to their\n // right neighbor.\n $players = self::loadPlayersBasicInfos();\n foreach($players as $player_id => $player) {\n $this->cards->pickCard('crime_deck', $player_id);\n $this->cards->pickCard('location_deck', $player_id);\n $this->cards->pickCard('suspect_deck', $player_id);\n\n // Give their tokens\n $color = $this->constants['HEX2COLORNAME'][$player['player_color']];\n $this->tokens->moveTokens(\n array_pluck($this->tokens->getTokensOfTypeInLocation(\"cube_{$color}_%\"), 'key'),\n \"cubes_{$player_id}\");\n $this->tokens->moveTokens(\n array_pluck($this->tokens->getTokensOfTypeInLocation(\"disc_{$color}_%\"), 'key'),\n \"discs_{$player_id}\");\n }\n\n // Trigger clean up in frontend. Sending only tokens that are to be\n // moved away.\n self::notifyAllPlayers(\"cleanBoard\", \"\", array(\n 'tokens' => array_values(array_merge(\n $this->tokens->getTokensInLocation('box'),\n $this->tokens->getTokensInLocation('offtable'),\n $this->tokens->getTokensInLocation('cubes_%'),\n $this->tokens->getTokensInLocation('discs_%')\n ))\n ));\n $this->notifyAnimate();\n\n $this->gamestate->nextState(); // start minigame\n }", "function fillBoard(Board $_board, GetOpt $_options)\n {\n }", "public function __construct()\n\t{\n\t\t$this->game = new BowlingGame;\n\t}", "function score_borad_init()\r\n{\r\n\tregister_setting('score_board_settings','score_board_team1_name');\r\n\tregister_setting('score_board_settings','score_board_team2_name');\r\n\tregister_setting('score_board_settings','score_board_team3_name');\r\n\tregister_setting('score_board_settings','score_board_team4_name');\r\n\tregister_setting('score_board_settings','score_board_team1_score');\r\n\tregister_setting('score_board_settings','score_board_team2_score');\r\n\tregister_setting('score_board_settings','score_board_team3_score');\r\n\tregister_setting('score_board_settings','score_board_team4_score');\r\n}", "public function run()\n {\n $game = new Game([\n 'name' => 'TicTacToe',\n 'description' => 'A funny TicTacToe Game',\n 'rules' => 'Match three Xs or Os in a row in any direction and you win!'\n ]);\n\n $game->save();\n }", "public function start() {\n $cmd = sprintf(\"./control.sh start %s -game %s -ip %s -port %d -maxplayers %d -map %s -rcon %s\", $this->sid, $this->gameId, $this->ip, $this->port, $this->maxplayers, $this->map, $this->rcon);\n ssh($cmd, $this->host);\n DB::get()->query(\"UPDATE `servers` SET `status` = 1 WHERE `serverID` = '\" . $this->serverId . \"'\");\n }", "function runningPlay() {\n\t\t// request information about the new map\n\t\t// ... and callback to function newMap()\n\t}", "public function run()\n {\n DB::table('boards')->insert([\n 'category_id' => 1,\n 'title' => 'General Discussion',\n 'description' => 'This is the place to be.',\n 'position' => 1\n ]);\n }", "public function playRound()\n {\n $this->checkFirstAttack();\n\n // Orderus attacks\n if ($this->orderus_attacks) {\n $attacks = $this->orderus->rapidStrike();\n if ($attacks > 1) {\n $this->ui->display($this->narration->orderusRapidStrike());\n $this->ui->displayBlank();\n }\n while ($attacks > 0) {\n $this->ui->display($this->narration->orderusAttacks());\n if ($this->orderus->attack($this->beast)) {\n $this->ui->display($this->narration->orderusHits());\n } else {\n $this->ui->display($this->narration->orderusMisses());\n }\n $attacks--;\n if ($attacks > 0) {\n $this->displayStats();\n $this->ui->displayBlank();\n }\n }\n\n // the wild beast attacks\n } else {\n $this->ui->display($this->narration->beastAttacks());\n $damage_divider = $this->orderus->magicShield();\n if ($damage_divider > 1) {\n $this->ui->displayBlank();\n $this->ui->display($this->narration->orderusMagicShield());\n $this->ui->displayBlank();\n }\n if ($this->beast->attack($this->orderus, $damage_divider)) {\n $this->ui->display($this->narration->beastHits());\n } else {\n $this->ui->display($this->narration->beastMisses());\n }\n }\n\n // take turns attacking\n $this->orderus_attacks = !$this->orderus_attacks;\n\n // prevent endless battles\n $this->turns--;\n $this->is_running = ($this->turns > 0);\n\n // check health stats\n if (($this->orderus->health() <= 0) || ($this->beast->health() <= 0)) {\n $this->is_running = false;\n }\n\n // Orderus wins\n if ($this->beast->health() <= 0) {\n $this->winner->is_orderus = true;\n }\n\n // the wild beast wins\n if ($this->orderus->health() <= 0) {\n $this->winner->is_beast = true;\n }\n }", "public function start()\n {\n for($nr = 1; $nr <= $this->numBalls; $nr++){\n $slotNr = $this->_addBall($nr);\n $this->_increaseSlot($slotNr);\n }\n }", "public function runGame( )\n {\n\n $MODELS = include(ROOT.'/conf/rooms.php');\n $gameConfig = $MODELS[1];\n\n }", "public function __construct()\n {\n $this->matchFinished = false;\n //$this->player1 = new Player('A');\n //$this->player2 = new Player('B');\n }", "function setPiece($col){\n\t\t$gameId = getCurrentGameIdFromPlayerId();\n\t\tif(!$gameId['currentGameId']){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting currentGameId of player\");\n\t\t}\n\t\n\t\t$gameId = $gameId['currentGameId'];\n\t\t$game = getCurrentGame($gameId);\n\t\tif(!$game){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting current game of player\");\n\t\t}\n\t\t\n\t\t//check if player is on turn\n\t\tif($game['nextTurn'] != $_SESSION['playerId']){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"its not your turn\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\t$board = json_decode($game['board']);\n\t\tfor($i = -1;$i<count($board)-1;$i++){\n\t\t\tif($board[$i+1][$col]!=0){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif($i==-1){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"column is full\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\tif($game['player1']==$_SESSION['playerId']){\n\t\t\t$nextTurnPlayer = $game['player2'];\n\t\t\t$playerNumber = 1;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}else{\n\t\t\t$nextTurnPlayer = $game['player1'];\n\t\t\t$playerNumber = 2;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}\n\t\t\n\t\t//save updated board\n\t\t$my_db = mysqli_connect($GLOBALS['servername'],$GLOBALS['username'],$GLOBALS['password'],$GLOBALS['db_name']) or die(\"db connection konnte nicht hergestellt werden\");\n\t\t$updateGameQuery = \"UPDATE games SET board='\".json_encode($board).\"',nextTurn=\".$nextTurnPlayer.\" WHERE gameId=\".$game['gameId'];\n\t\t$result = $my_db->query($updateGameQuery);\n\t\tif(!$result){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error udpating game in database\");\n\t\t}\t\t\n\t\t\n\t\t$gameOver = checkWin($board,$i,$col,$playerNumber);\n\t\tif($gameOver){\n\t\t\t$gameOverQuery = \"UPDATE games SET gameOver=1,nextTurn=0,winner=\".$_SESSION['playerId'].\" WHERE gameId=\".$game['gameId'];\n\t\t\t$result = $my_db->query($gameOverQuery);\n\t\t\t\n\t\t\tif(!$result){\n\t\t\t\thttp_response_code(500);\n\t\t\t\tdie(\"error updating gameOver field\");\n\t\t\t}\n\t\t}\n\t}", "function boardInitialization(&$comObject, &$exclude, &$row, &$params)\r\n\t{\r\n\r\n\t $josComment_absolute_path = JPATH_SITE . DS . 'components' . DS . 'com_comment' . DS . 'joscomment';\r\n\t $josComment_live_site = JURI::root(). 'components/com_comment/joscomment';\r\n\r\n\t require_once(JPATH_SITE . DS . 'administrator' . DS . 'components' . DS . 'com_comment' . DS . 'class.config.comment.php');\r\n\t require_once($josComment_absolute_path . DS . 'comment.class.php');\r\n\r\n\t $board = new JOSC_board($josComment_absolute_path, $josComment_live_site, $comObject, $exclude, $row, $params);\r\n\r\n\t return $board;\r\n\t}", "function set_up() {\n\t\tglobal $current_screen;\n\t\t$this->current_screen = $current_screen;\n\t\tparent::set_up();\n\t}", "public function initAction()\n {\n // Init the session for the gamestart\n $session = $this->app->session;\n $this->app->session->set(\"who\", true);\n $game = new Gameround(5, 1);\n $player = new Player(\"Player\");\n $computer = new Computer(\"Computer\");\n $computer->addRandomPoints();\n\n $session->set(\"game\", $game);\n $session->set(\"player\", $player);\n $session->set(\"computer\", $computer);\n return $this->app->response->redirect(\"dice2/player\");\n }", "function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}", "public function run()\n {\n // [\"CREATED\" => 0, \"ABORTED\" => 1, \"PLAYING\" => 2, \"WONTEAM1\" => 3, \"WONTEAM2\" => 4];\n\n $g = new Game();\n\n\n $g->player1 = 1;\n $g->player2 = 2;\n $g->player3 = 3;\n $g->player4 = 4;\n\n $g->scorelimit = 1000;\n $gameState = rand(0, 4);\n $g->gamestate = $gameState;\n\n switch ($gameState) {\n case 0:\n $g->scoreteam1 = 0;\n $g->scoreteam2 = 0;\n break;\n case 3:\n $g->scoreteam1 = 1000;\n $g->scoreteam2 = rand(100, 999);\n break;\n case 4:\n $g->scoreteam1 = rand(100, 999);\n $g->scoreteam2 = 1000;\n break;\n \n default: #case ABORTED et PLAYING\n $g->scoreteam1 = rand(100, 999);\n $g->scoreteam2 = rand(100, 999);\n break;\n }\n $g->save();\n }", "public function startGame(){\n\n try {\n $this->openFile($this->filepath);\n $this->loopThroughContents();\n\n } catch(Exception $e) {\n echo \"Could not start game: \" .$e->getMessage();\n }\n\n return true;\n }", "private function __construct($rows, $columns)\r\n {\r\n $this->board = new Board($rows, $columns);\r\n $this->initShips();\r\n }", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function run()\n\t{\n\t\t DB::table('board_swimlines')->truncate();\n\n\t\t$board_swimlines = array(\n ['board_id' => 1,'swimline_id' => 1],\n ['board_id' => 1,'swimline_id' => 2],\n\t\t);\n\n\t\t// Uncomment the below to run the seeder\n\t\t DB::table('board_swimlines')->insert($board_swimlines);\n\t}", "abstract protected function move($board);", "public function view(){\n\t\t\t$this->__switchboard();\n\t\t}", "function start();", "function start();", "function __construct( )\n {\n // Here, you can assign labels to global variables you are using for this game.\n // You can use any number of global variables with IDs between 10 and 99.\n // If your game has options (variants), you also have to associate here a label to\n // the corresponding ID in gameoptions.inc.php.\n // Note: afterwards, you can get/set the global variables with getGameStateValue/setGameStateInitialValue/setGameStateValue\n parent::__construct();\n\n self::initGameStateLabels(array(\n // P.I. is played over 3 \"mini games\". Here we store in which of\n // these games we are. Valid values: 1, 2, 3\n \"minigame\" => 10,\n\n // The inner-minigame round. Required to determine how many points\n // players score when solving. All players that solve in the same\n // round score the same, then the score drops. Also a minigame ends\n // when a new round begins and only 1 player is left with an\n // unsolved case. That player then scores 0 for that minigame and a\n // new one starts (or game end).\n \"minigame_round\" => 11,\n\n // The current value of points a player would get if they would\n // score correctly now. Decreases after rounds in that a player (or\n // multiple) successfully scored.\n \"points_winnable\" => 12,\n\n // \"my_first_game_variant\" => 100,\n // \"my_second_game_variant\" => 101,\n ));\n\n $this->cards = self::getNew(\"module.common.deck\");\n $this->cards->init(\"card\");\n $this->tokens = new Tokens();\n }", "protected function setUp() {\r\n\t\t$this->board = $this->getMock('Board');\r\n\t\t$this->playerName = 'Test';\r\n\t\t$this->player = new Player($this->playerName, $this->board);\r\n\t}", "public function gamed(){\n\t\t$this->data['game_content'] = \"we are always playing\" ;\n\t\t//$this->viewpage($this->data, null) ;\n\t\t$this->route();\n\t}", "function quick_init()\n \t{\n \t\t$this->load_skin();\n \t \n\t //-----------------------------------------\n\t // Grab session cookie\n\t //-----------------------------------------\n\t\t\t \n\t $this->session_id = $this->sess->session_id ? $this->sess->session_id : $this->my_getcookie('session_id');\n\t \n\t //-----------------------------------------\n\t // Organize default info\n\t //-----------------------------------------\n\t \n\t $this->base_url \t= $this->vars['board_url'].'/index.'.$this->vars['php_ext'].'?s='.$this->session_id;\n\t $this->js_base_url \t= $this->vars['board_url'].'/index.'.$this->vars['php_ext'].'?s='.$this->session_id;\n\t $this->skin_rid \t= $this->skin['set_id'];\n\t $this->skin_id \t= 's'.$this->skin['set_id'];\n\t \n\t if ($this->vars['default_language'] == \"\")\n\t {\n\t\t $this->vars['default_language'] = 'en';\n\t }\n\t \n\t $this->lang_id = $this->member['language'] ? $this->member['language'] : $this->vars['default_language'];\n\t \n\t if ( ($this->lang_id != $this->vars['default_language']) and (! is_dir( CACHE_PATH.\"cache/lang_cache/\".$this->lang_id ) ) )\n\t {\n\t\t $this->lang_id = $this->vars['default_language'];\n\t }\n\t \n\t //-----------------------------------------\n\t // Get words & skin\n\t //-----------------------------------------\n\t \n\t $this->load_language(\"lang_global\");\n\t \n\t $this->vars['img_url'] = 'style_images/' . $this->skin['_imagedir'];\n\t \n\t if ( ! $this->compiled_templates['skin_global'] )\n\t {\n\t\t $this->load_template('skin_global');\n\t }\n \t}", "function OnLoad()\n\t\t{\n\t\t\tfor ($j = 0; $j < $this->grid_h; $j++)\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < $this->grid_w; $i++)\n\t\t\t\t{\n\t\t\t\t\t$btn = new TButton();\n\t\t\t\t\t//$btn->Theme = $this->Theme;\n\t\t\t\t\t$btn->Name = 'btn_'.$i.'_'.$j;\n\t\t\t\t\t$btn->Left = 128 + $i * 32;\n\t\t\t\t\t$btn->Top = 16 + $j * 32;\n\t\t\t\t\t$btn->Width = 32;\n\t\t\t\t\t$btn->Height = 32;\n\t\t\t\t\t$btn->OnClick = 'MineButtonClick';\n\t\t\t\t\t$btn->Parent = $this;\n\t\t\t\t\t\n\t\t\t\t\t$shp = new TShape();\n\t\t\t\t\t$shp->Name = 'shp_'.$i.'_'.$j;\n\t\t\t\t\t$shp->Left = 128 + $i * 32;\n\t\t\t\t\t$shp->Top = 16 + $j * 32;\n\t\t\t\t\t$shp->Width = 32;\n\t\t\t\t\t$shp->Height = 32;\n\t\t\t\t\t$shp->BrushColor = 'silver';\n\t\t\t\t\t$shp->PenColor = 'gray';\n\t\t\t\t\t$shp->Shape = 'stRoundRect';\n\t\t\t\t\t$shp->Parent = $this;\n\t\t\t\t\t$shp->Style = 'font-weight: bold; font-size: 16px; padding-top: 8px; max-height: 24px;';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$this->Controls[$shp->Name] = $shp;\n\t\t\t\t\t$this->Controls[$btn->Name] = $btn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->NewGame();\n\t\t}", "public function testStartNextTurn()\n {\n $this->game->startNextTurn();\n $gamestate = $this->game->getGamestate();\n\n $exp = 1;\n $res = $gamestate[\"turnCounter\"];\n $this->assertEquals($exp, $res);\n\n $exp = 0;\n $res = $gamestate[\"currentPoints\"];\n $this->assertEquals($exp, $res);\n\n $exp = false;\n $res = $gamestate[\"turnIsOver\"];\n $this->assertEquals($exp, $res);\n\n $exp = $this->game->getPlayer($gamestate[\"turnCounter\"]);\n $res = $gamestate[\"active\"];\n $this->assertEquals($exp, $res);\n\n $this->game->startNextTurn();\n $gamestate = $this->game->getGamestate();\n\n $exp = 0;\n $res = $gamestate[\"turnCounter\"];\n $this->assertEquals($exp, $res);\n }" ]
[ "0.77953655", "0.73100907", "0.6662601", "0.6630795", "0.645974", "0.6459133", "0.6432256", "0.6353283", "0.63438475", "0.62641424", "0.6111711", "0.5969623", "0.59474504", "0.59130836", "0.58800733", "0.5851251", "0.58486897", "0.58331823", "0.58294845", "0.5801565", "0.5786008", "0.5773761", "0.5752969", "0.5750565", "0.57335556", "0.57228166", "0.56489563", "0.5620803", "0.56060225", "0.5605675", "0.56039095", "0.5588406", "0.5560306", "0.55406827", "0.5534298", "0.5484129", "0.5453007", "0.54357654", "0.5426107", "0.54049534", "0.5388377", "0.538617", "0.53856087", "0.53718454", "0.5356196", "0.5350033", "0.5340687", "0.5332909", "0.53229105", "0.5305078", "0.53046274", "0.5302744", "0.52915317", "0.52872264", "0.5284365", "0.52658355", "0.52621186", "0.5261627", "0.52601075", "0.52535886", "0.5235613", "0.52226806", "0.52119297", "0.5204364", "0.52036774", "0.520265", "0.5197091", "0.5161303", "0.51396877", "0.5138556", "0.51299685", "0.51269007", "0.5114104", "0.51011676", "0.50930136", "0.50740546", "0.5054796", "0.50489825", "0.50489825", "0.50489825", "0.50489825", "0.50489825", "0.50489825", "0.50489825", "0.50489825", "0.50489825", "0.50489825", "0.50489825", "0.50489825", "0.50385", "0.50262326", "0.5025492", "0.5019599", "0.5019599", "0.501273", "0.5006714", "0.5006199", "0.50020385", "0.5000245", "0.4985195" ]
0.7266772
2
Main Function set the hole game as long as the game status is true keep playing function validate max moves on board , user selection , full column.... in case of a winning players will recive a win message that print in the console
public function startPlay(){ $this->selectPlayer(); $this->board->printBoard(); while(!$this->gameOver){ //check if board is full if($this->reachedMaxMoves() || $this->validateIsFullBoard()){ noWinningMsg($this->currentPlayer); $this->gameOver = true; break; } // set board with table $userMove = $this->selectMove(); //in case that column is not full if(!$this->validateIsFullColumn($userMove)){ $this->insertMoveToBoard($userMove); $this->winCheck($userMove); $this->switchPlayer(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}", "function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\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$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}", "function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}", "function setPiece($col){\n\t\t$gameId = getCurrentGameIdFromPlayerId();\n\t\tif(!$gameId['currentGameId']){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting currentGameId of player\");\n\t\t}\n\t\n\t\t$gameId = $gameId['currentGameId'];\n\t\t$game = getCurrentGame($gameId);\n\t\tif(!$game){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting current game of player\");\n\t\t}\n\t\t\n\t\t//check if player is on turn\n\t\tif($game['nextTurn'] != $_SESSION['playerId']){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"its not your turn\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\t$board = json_decode($game['board']);\n\t\tfor($i = -1;$i<count($board)-1;$i++){\n\t\t\tif($board[$i+1][$col]!=0){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif($i==-1){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"column is full\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\tif($game['player1']==$_SESSION['playerId']){\n\t\t\t$nextTurnPlayer = $game['player2'];\n\t\t\t$playerNumber = 1;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}else{\n\t\t\t$nextTurnPlayer = $game['player1'];\n\t\t\t$playerNumber = 2;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}\n\t\t\n\t\t//save updated board\n\t\t$my_db = mysqli_connect($GLOBALS['servername'],$GLOBALS['username'],$GLOBALS['password'],$GLOBALS['db_name']) or die(\"db connection konnte nicht hergestellt werden\");\n\t\t$updateGameQuery = \"UPDATE games SET board='\".json_encode($board).\"',nextTurn=\".$nextTurnPlayer.\" WHERE gameId=\".$game['gameId'];\n\t\t$result = $my_db->query($updateGameQuery);\n\t\tif(!$result){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error udpating game in database\");\n\t\t}\t\t\n\t\t\n\t\t$gameOver = checkWin($board,$i,$col,$playerNumber);\n\t\tif($gameOver){\n\t\t\t$gameOverQuery = \"UPDATE games SET gameOver=1,nextTurn=0,winner=\".$_SESSION['playerId'].\" WHERE gameId=\".$game['gameId'];\n\t\t\t$result = $my_db->query($gameOverQuery);\n\t\t\t\n\t\t\tif(!$result){\n\t\t\t\thttp_response_code(500);\n\t\t\t\tdie(\"error updating gameOver field\");\n\t\t\t}\n\t\t}\n\t}", "function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}", "public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }", "function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}", "function updateBoard() {\n\tglobal $game, $message;\n\t$cellClicked = $game['clicked']; //identify which button was submitted \t\t\t\t\t\n\tif ($cellClicked !== 9 ) {\n\t\t$curPos = $cellClicked; // get the actual button clicked. 0 to 8 correspond to respective cell\n\t\t$game[\"board\"][$curPos] = $game[\"player\"]; // set our game's data with player mark\n\t\t$game[\"player\"] = ($game[\"player\"]+1)%2; // switch the player turn\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t} else {\n\t\t$game[\"player\"] = 0;\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t}\n\t$message = \"Player \".substr($game[\"playToken\"],$game[\"player\"],1).\" go!\";\n}", "function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }", "public function stepGameTurn(){\n\n $this->stepBoard = new Board();\n $this->board->showBoard();\n $gridSize = $this->board->getRowCount();\n $cell;\n $stepCell;\n\n if($this->board->isSquareGrid()){\n // for rows\n for($i = 0; $i<$gridSize; $i++){\n //for columns\n for($j = 0; $j<$gridSize; $j++){\n $cell = $this->board->getCell($i,$j);\n $liveNeighbors = $this->analyzeNeighbors($i,$j);\n $stepCell = $this->processRulesOfTheGame($cell, $liveNeighbors);\n // add the result of processRulesOfTheGame to the step board\n $this->stepBoard->addCell($i,$j,$stepCell);\n }\n }\n $this->stepBoard->showBoard();\n }\n }", "public function openValve(){\n if ($this->game->get_current_turn()->WinStatus($this->game->getSize())){\n $this->game->set_winner();\n }else{\n $this->game->update_turn();\n $this->game->set_winner();\n }\n }", "function board_main(){\n\t\tglobal $x7c, $x7s, $db, $prefix, $x7p, $print;\n\n\n\t\tif($x7c->settings['panic']) {\n\t\t\t$print->board_window(\"\",\"\",\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tudpate_unread();\n\t\t\n\t\tif(isset($_GET['newboard'])){\n\t\t\tcreate_board();\n\t\t}\n\t\telse if(isset($_GET['board'])){\n\t\t\tshow_board($_GET['board']);\n\t\t}\n\t\telse if(isset($_GET['send'])){\n\t\t\tnew_communication($_GET['send']);\n\t\t}\n\t\telse if(isset($_GET['delete'])){\n\t\t\tdelete_message($_GET['delete']);\n\t\t}\n\t\telse if(isset($_GET['delboard'])){\n\t\t\tdelete_board($_GET['delboard']);\n\t\t}\n\t\telse if(isset($_GET['readall'])){\n\t\t\tread_all();\n\t\t}\n\t\telse if(isset($_GET['move'])){\n move_msg();\n\t\t}\n\t\telse \n\t\t\tboard_list();\n\t}", "function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}", "public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }", "function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}", "protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }", "function play($game) {\t\n\tif($game[\"gameOver\"] == -1) {\n\t\tif ($game[\"clicked\"] !== 9 )\n\t\t\tupdateBoard(); //print_r($game); \n\t\tdisplayBoard();\t\t\n\t\tupdateSession();\t\t\n\t} \n}", "public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }", "function initBoard()\n\t{\n\t\tglobal $board;\n\n\t\t/* clear board */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\tfor ($j = 0; $j < 8; $j++)\n\t\t\t{\n\t\t\t\t$board[$i][$j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/* setup white pieces */\n\t\t$board[0][0] = WHITE | ROOK;\n\t\t$board[0][7] = WHITE | ROOK;\n\t\t$board[0][1] = WHITE | KNIGHT;\n\t\t$board[0][6] = WHITE | KNIGHT;\n\t\t$board[0][2] = WHITE | BISHOP;\n\t\t$board[0][5] = WHITE | BISHOP;\n\t\t$board[0][3] = WHITE | QUEEN;\n\t\t$board[0][4] = WHITE | KING;\n\n\t\t/* setup black pieces */\n\t\t$board[7][0] = BLACK | ROOK;\n\t\t$board[7][7] = BLACK | ROOK;\n\t\t$board[7][1] = BLACK | KNIGHT;\n\t\t$board[7][6] = BLACK | KNIGHT;\n\t\t$board[7][2] = BLACK | BISHOP;\n\t\t$board[7][5] = BLACK | BISHOP;\n\t\t$board[7][3] = BLACK | QUEEN;\n\t\t$board[7][4] = BLACK | KING;\n\n\t\t/* setup pawns */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\t$board[1][$i] = WHITE | PAWN;\n\t\t\t$board[6][$i] = BLACK | PAWN;\n\t\t}\n\t}", "public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChecker = [4, 3];\n $game->gameState->possibleGoChoices = [array(\"row\"=>2, \"col\"=>5), array(\"row\"=>4, \"col\"=>3)];\n $game->gameState->boardState = $this->getMultipleBeat();\n\n $gm->userMove(2, 5, 1, $game );\n $gm->userMove(0, 3, 1, $game );\n $gm->userMove(3, 0, 1, $game );\n $result = $gm->userMove(7, 4, 1, $game );\n\n\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][3]);//initial\n $this->assertEquals(0, $result[\"gameState\"]->boardState[3][4]);//beaten\n $this->assertEquals(-1, $result[\"gameState\"]->boardState[1][6]);//still there due to turkish turn rule\n $this->assertEquals(0, $result[\"gameState\"]->boardState[1][4]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[2][1]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][1]);//beaten\n $this->assertEquals(2, $result[\"gameState\"]->boardState[7][4]);//end position of the hero checker\n\n }", "function _checkGame($game, $team) {\n global $_SYS;\n\n $game = intval($game);\n $team = intval($team);\n\n /* fetch game from db */\n\n $query = 'SELECT g.away AS away,\n na.team AS away_team,\n na.nick AS away_nick,\n na.acro AS away_acro,\n ta.user AS away_hc,\n g.away_sub AS away_sub,\n ta.conference AS away_conference,\n ta.division AS away_division,\n g.home AS home,\n nh.team AS home_team,\n nh.nick AS home_nick,\n nh.acro AS home_acro,\n th.user AS home_hc,\n g.home_sub AS home_sub,\n th.conference AS home_conference,\n th.division AS home_division,\n g.site AS site,\n g.week AS week,\n g.season AS season,\n s.name AS season_name\n FROM '.$_SYS['table']['game'].' AS g\n LEFT JOIN '.$_SYS['table']['team'].' AS ta ON g.away = ta.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS na ON ta.team = na.id\n LEFT JOIN '.$_SYS['table']['team'].' AS th ON g.home = th.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS nh ON th.team = nh.id\n LEFT JOIN '.$_SYS['table']['season'].' AS s ON g.season = s.id\n WHERE g.id = '.$game;\n\n $result = $_SYS['dbh']->query($query) or die($_SYS['dbh']->error());\n\n /* check if game exists */\n\n if ($result->rows() == 0) {\n return $_SYS['html']->fehler('1', 'Game does not exist.');\n }\n\n /* check if game was already played */\n\n $row = $result->fetch_assoc();\n\n if ($row['site'] != 0) {\n return $_SYS['html']->fehler('2', 'Game was already played.');\n }\n\n /* allow if user is admin OR user is hc or sub of the team */\n\n if (!(($team == 0 && $_SYS['user']['admin'])\n || ($team == $row['away'] && ($_SYS['user']['id'] == $row['away_hc'] || $_SYS['user']['id'] == $row['away_sub']))\n || ($team == $row['home'] && ($_SYS['user']['id'] == $row['home_hc'] || $_SYS['user']['id'] == $row['home_sub'])))) {\n return $_SYS['html']->fehler('3', 'You cannot upload a log for this game.');\n }\n\n $this->_game = $row;\n\n return '';\n }", "protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }", "public function makeMove($boardState, $playerUnit = 'X')\n {\n $opponentUnit = ($playerUnit == 'X' ? 'O' : 'X');\n $playerWinCases = array();\n $opponentWinCases = array();\n $choosePlayerWinCase = -1;\n $chooseOpponentWinCase = -1;\n foreach (self::$winningCases as $key => &$winCase) {\n\n $playerWinCase = new WinningCase($boardState, $winCase, $playerUnit);\n if (!$playerWinCase->isBlocked()) {\n if ($playerWinCase->countRemainingMoves() == 0) {\n $this->winner = $playerUnit;\n $this->winningCase = $winCase;\n return;\n } else if (!$choosePlayerWinCase instanceof WinningCase\n || (\n $choosePlayerWinCase instanceof WinningCase\n && $playerWinCase->countRemainingMoves() < $choosePlayerWinCase->countRemainingMoves()\n )\n ) {\n $choosePlayerWinCase = $playerWinCase;\n }\n }\n if ($playerWinCase->countRemainingMoves() > 0) {\n $playerWinCases[$playerWinCase->countRemainingMoves()] = $playerWinCase;\n// array_push($playerWinCases, $playerWinCase);\n }\n\n $opponentWinCase = new WinningCase($boardState, $winCase, $opponentUnit);\n if (!$opponentWinCase->isBlocked()) {\n if ($opponentWinCase->countRemainingMoves() == 0) {\n $this->winner = $opponentUnit;\n $this->winningCase = $winCase;\n return;\n } else if ($opponentWinCase->countRemainingMoves() == 1) {\n $chooseOpponentWinCase = $opponentWinCase;\n }\n }\n if ($opponentWinCase->countRemainingMoves() > 0) {\n $opponentWinCases[$opponentWinCase->countRemainingMoves()] = $opponentWinCase;\n// array_push($opponentWinCases, $opponentWinCase);\n }\n }\n\n // Winning case\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() == 1) {\n #if (DEBUG) echo 'Winning case:' . \"\\r\\n\";\n $this->winner = $playerUnit;\n $this->winningCase = $choosePlayerWinCase->winCase;\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n // Block opponent winning case (to avoid loss)\n if ($chooseOpponentWinCase instanceof WinningCase && $chooseOpponentWinCase->countRemainingMoves() > 0) {\n #if (DEBUG) echo 'Block opponent winning case -> Avoid loss:' . \"\\r\\n\";\n return array_merge($chooseOpponentWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n #if (DEBUG) echo 'No immediate winnning move found -> Best move:' . \"\\r\\n\";\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() > 0) {\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n $this->winner = 'Draw';\n return;\n }", "function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }", "protected function isBoardFull() {\n if ((count($this->_markers[self::X_MARK]) + count($this->_markers[self::O_MARK])) == 9) {\n echo $this->promptMessage('board_full') . PHP_EOL;\n return TRUE;\n }\n return FALSE;\n }", "public function resetBoard()\n\t{\n\t\t$this->board = array();\n\t\t\n\t\t// Not available positions in the square.\n\t\t$this->board[3][-3] = false;\n\t\t$this->board[3][-2] = false;\n\t\t$this->board[2][-3] = false;\n\t\t$this->board[2][-2] = false;\n\t\t\n\t\t$this->board[-2][-3] = false;\n\t\t$this->board[-2][-2] = false;\n\t\t$this->board[-3][-3] = false;\n\t\t$this->board[-3][-2] = false;\n\t\t\n\t\t$this->board[3][2] = false;\n\t\t$this->board[3][3] = false;\n\t\t$this->board[2][2] = false;\n\t\t$this->board[2][3] = false;\n\t\t\n\t\t$this->board[-2][2] = false;\n\t\t$this->board[-2][3] = false;\n\t\t$this->board[-3][2] = false;\n\t\t$this->board[-3][3] = false;\n\t\t\n\t\t// Fill the available positions.\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\tif(!isset($this->board[$i][$j]))\n\t\t\t\t{\n\t\t\t\t\tif($i == 0 && $j == 0) // Center position empty\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }", "public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }", "public function rejectIfWrongMove(Board $board, User $player, $row, $col);", "function game_play($link) {\r\n echo '<br />'; \r\n if ($this->grid_size > 3) {\r\n \r\n }\r\n echo '<font face = \"courier\" size = \"5\">';\r\n echo '<table cols = \"' . ($this->debug ? $this->grid_size + 2 : $this->grid_size) . '\" border = \"1\" style = \"font-weight:bold; border-collapse: collapse\">';\r\n if ($this->debug) {\r\n echo '<thead><tr><th></th>';\r\n for ($col = 1; $col <= $this->grid_size; $col++) {\r\n echo '<th style=\"padding: 5px;\"> Column ' . $col . '</th>';\r\n }\r\n echo '<th></th></tr></thead>';\r\n echo '<tfoot><tr><th></th>';\r\n for ($col = 1; $col <= $this->grid_size; $col++) {\r\n echo '<th> Column ' . $col . '</th>';\r\n }\r\n echo '<th></th></tr></tfoot>';\r\n }\r\n echo '<tbody><tr>';\r\n $row = 1; \r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row . '</th>';\r\n }\r\n for ($pos = 0; $pos < pow($this->grid_size, 2); $pos++) {\r\n if ($link) {\r\n echo $this->show_cell($pos);\r\n } else {\r\n\t\t\t\t\r\n\t\t\t\t\t echo '<td style=\"text-align:center;' . (in_array($pos, $this->winning_line[0]) ? ' background-color: #90EE90;' : ' opacity: 0.5;' ) . '\"><div style=\"padding: 1em;\">' . $this->position[$pos] . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $pos . ':(' . $row . ',' . (($pos % $this->grid_size) + 1) . ')</span>') : '') . '</div></td>';\r\n\t\t\t\t\t\r\n\t\t\t}\r\n if (($pos + 1) % $this->grid_size == 0) {\r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row++ . '</th>';\r\n }\r\n if (($pos + 1) != pow($this->grid_size, 2)) {\r\n echo '</tr><tr>';\r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row . '</th>';\r\n }\r\n }\r\n }\r\n }\r\n echo '</tr></tbody>';\r\n echo '</table>';\r\n echo '</font>';\r\n echo '<br /><hr />';\r\n }", "protected function changeStateCheck()\n {\n if (empty($this->boardNewMoves)) {\n throw new BoardException(Yii::t('app', 'No move detected.'));\n }\n // Make sure 1 move has been made.\n if (count($this->boardNewMoves) > 1) {\n throw new BoardException(Yii::t('app', 'Only one move per request allowed.'));\n }\n\n // Make sure proper character used.\n $allowedCharacter = $this->moveCharacterMap[($this->getTotalMoves() + 1) % 2];\n if (($moveCharacter = $this->getNewMoveCharacter()) != $allowedCharacter) {\n throw new BoardException(Yii::t('app', 'You have to use character \"{allowedCharacter}\" instead of \"{moveCharacter}\"', [\n 'allowedCharacter' => $allowedCharacter,\n 'moveCharacter' => $moveCharacter,\n ]));\n }\n\n // Make sure that character has been placed into the proper position (not overriding existing).\n if (in_array($this->boardArr[$this->getNewMovePosition()], $this->moveCharacterMap)) {\n throw new BoardException(Yii::t('app', 'You are not allowed to override existing moves.'));\n }\n }", "function st_setupMinigame()\n {\n self::incGameStateValue('minigame', 1);\n $minigame = self::getGameStateValue('minigame');\n\n self::setGameStateValue('minigame_round', 1);\n self::setStat(1, \"rounds_{$minigame}\");\n self::setGameStateValue('points_winnable', 7);\n self::DbQuery(\"UPDATE `player` SET `player_solved_in_round` = NULL\");\n\n // Get all cards, sort into piles, shuffle piles.\n $this->cards->moveAllCardsInLocation(null, \"offtable\");\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('evidence'), 'id'), 'deck');\n $this->cards->shuffle('deck');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('crime'), 'id'), 'crime_deck');\n $this->cards->shuffle('crime_deck');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('location'), 'id'), 'location_deck');\n $this->cards->shuffle('location_deck');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('suspect'), 'id'), 'suspect_deck');\n $this->cards->shuffle('suspect_deck');\n\n // Get all tiles, shuffle them in two decks, associate them with\n // location slots. Decks are called \"cri_tile_d\" (crime tile deck) and\n // \"sus_tile_d\" (suspect tile deck). VARCHAR(16) ftw!\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('tile_crime'), 'id'), 'cri_tile_d');\n $this->cards->moveCards(array_pluck($this->cards->getCardsOfType('tile_suspect'), 'id'), 'sus_tile_d');\n $this->cards->shuffle('cri_tile_d');\n $this->cards->shuffle('sus_tile_d');\n foreach($this->locations as $loc_id => $loc) {\n $this->cards->pickCardForLocation('cri_tile_d', 'locslot', $loc['slots']['crime']['id']);\n $this->cards->pickCardForLocation('sus_tile_d', 'locslot', $loc['slots']['suspect']['id']);\n\n // Get the specific location tile (also currently 'offboard') and\n // put it into its fixed location slot.\n //\n // (28 + $loc_id) is the \"material id\" aka type_arg of the fake\n // location tile.\n $temp = $this->cards->getCardsOfType('tile_location', 28 + $loc_id); // required, as array_shift does not want a direct reference\n $location_tile = array_shift($temp);\n $this->cards->moveCard($location_tile['id'], 'locslot', $loc['slots']['location']['id']);\n }\n\n // Main display of evidence cards\n $this->cards->pickCardsForLocation($this->constants['EVIDENCE_DISPLAY_SIZE'], 'deck', 'evidence_display');\n\n // Investigators that have been used go back to the box.\n $used_investigators = $this->tokens->getTokensOfTypeInLocation('pi_%', 'agentarea_%');\n if ($used_investigators) {\n $this->tokens->moveTokens(array_pluck($used_investigators, 'key'), 'box');\n }\n\n // Set up a case for every player and distribute the case cards to their\n // right neighbor.\n $players = self::loadPlayersBasicInfos();\n foreach($players as $player_id => $player) {\n $this->cards->pickCard('crime_deck', $player_id);\n $this->cards->pickCard('location_deck', $player_id);\n $this->cards->pickCard('suspect_deck', $player_id);\n\n // Give their tokens\n $color = $this->constants['HEX2COLORNAME'][$player['player_color']];\n $this->tokens->moveTokens(\n array_pluck($this->tokens->getTokensOfTypeInLocation(\"cube_{$color}_%\"), 'key'),\n \"cubes_{$player_id}\");\n $this->tokens->moveTokens(\n array_pluck($this->tokens->getTokensOfTypeInLocation(\"disc_{$color}_%\"), 'key'),\n \"discs_{$player_id}\");\n }\n\n // Trigger clean up in frontend. Sending only tokens that are to be\n // moved away.\n self::notifyAllPlayers(\"cleanBoard\", \"\", array(\n 'tokens' => array_values(array_merge(\n $this->tokens->getTokensInLocation('box'),\n $this->tokens->getTokensInLocation('offtable'),\n $this->tokens->getTokensInLocation('cubes_%'),\n $this->tokens->getTokensInLocation('discs_%')\n ))\n ));\n $this->notifyAnimate();\n\n $this->gamestate->nextState(); // start minigame\n }", "public function GenerateLegalPawnMoves($chesspiece, $x, $y){\n\t\t$from = array($x, $y);\n\t\t\n\t if ($chesspiece > 0){ // $chesspiece is a white pawn.\n\t \t$to = array($x, $y+1);\n\t \t\n\t \tif ($this->chessposition[$x][$y+1] == 0){\n\t \t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 1){\n \t$to = array($x, $y+2);\n \tif ($this->chessposition[$x][$y+2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \t}\n }\n \n if ($this->IsEnemyPiece(1, $x+1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x+1, $y+1));\n }\n if ($this->IsEnemyPiece(1, $x-1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x-1, $y+1));\n }\n }\n\n if ($chesspiece < 0){ // $chesspiece is a black pawn\n \t$to = array($x, $y-1);\n\t \t\n\t if($this->chessposition[$x][$y-1] == 0){\n\t \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 6){\n \t$to = array($x, $y-2);\n \tif ($this->chessposition[$x][$y-2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t }\n }\n \n if ($this->IsEnemyPiece(-1, $x+1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x+1, $y-1));\n if ($this->IsEnemyPiece(-1, $x-1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x-1, $y-1)); \n }\n \n //now do en-passant\n /***\n if ($LastMovePlayed[0] == ){ //if it is a pawn\n \t$fromsquare = $this->NumToCoordinate($LastMovePlayed[0]);\n \t$tosquare = $this->NumToCoordinate($LastMovePlayed[1]);\n \t\n \t$a = $tosquare[0] + 1;\n \tif ($this->IsEnemyPiece($this->chessposition[$tosquare[0]][$tosquare[1]]))\n }\n ***/\n \n return true;\n\t}", "abstract protected function isGameOver();", "public function setUp()\n {\n //For this example, the max score MUST be exactly 15\n $this->_maxScore = 15;\n\n $this->_board = [\n [8 => \"\", 1 => \"\", 6 => \"\"],\n [3 => \"\", 5 => \"\", 7 => \"\"],\n [4 => \"\", 9 => \"\", 2 => \"\"]\n ];\n\n /**\n * Winning conditions, based on Magic Square Theory\n */\n $this->_winningConditions = [\n [8, 1, 6],\n [3, 5, 7],\n [4, 9, 2],\n [8, 3, 4],\n [1, 6, 9],\n [6, 7, 2],\n [8, 5, 2],\n [6, 5, 4]\n ];\n\n\n }", "function makePlayerMove($x,$y){\n if (!$this->board->isEmpty($x,$y)){\n return False;\n } else {\n $this->board[$x][$y] = 2;\n }\n }", "protected function thinkBot() {\n $cellReturn = '';\n $markers = array($this->_botMark, $this->_userMark); //offense first, then defense\n while ($this->isValidMove($cellReturn) === FALSE) {\n //defense and offense\n foreach ($markers AS $marker) {\n foreach ($this->_winningCombination AS $cells) {\n $lineCells = explode(\",\", $cells); //separate the winning combination to 3\n $marked = 0;\n $noMark = 0;\n for ($x = 0; $x < 3; $x++) {\n if (in_array($lineCells[$x], $this->_markers[$marker]))\n $marked++;\n else\n $noMark = $lineCells[$x];\n }\n if ($marked == 2 && $this->isValidMove($noMark)) {\n $cellReturn = $noMark;\n break;\n }\n }\n if ($cellReturn != '')\n break;\n }\n //plan\n if ($cellReturn == '') {\n while (!$this->isValidMove($cellReturn)) {\n $combinationRandKey = rand(0, 7);\n //separate the winning combination to 3 elements\n $lineCells = explode(\",\", $this->_winningCombination[$combinationRandKey]);\n if ($this->isValidMove($lineCells[0]))\n $cellReturn = $lineCells[0];\n elseif ($this->isValidMove($lineCells[1]))\n $cellReturn = $lineCells[1];\n else\n $cellReturn = $lineCells[2];\n }\n }\n }\n return $cellReturn;\n }", "public function run()\n {\n // [\"CREATED\" => 0, \"ABORTED\" => 1, \"PLAYING\" => 2, \"WONTEAM1\" => 3, \"WONTEAM2\" => 4];\n\n $g = new Game();\n\n\n $g->player1 = 1;\n $g->player2 = 2;\n $g->player3 = 3;\n $g->player4 = 4;\n\n $g->scorelimit = 1000;\n $gameState = rand(0, 4);\n $g->gamestate = $gameState;\n\n switch ($gameState) {\n case 0:\n $g->scoreteam1 = 0;\n $g->scoreteam2 = 0;\n break;\n case 3:\n $g->scoreteam1 = 1000;\n $g->scoreteam2 = rand(100, 999);\n break;\n case 4:\n $g->scoreteam1 = rand(100, 999);\n $g->scoreteam2 = 1000;\n break;\n \n default: #case ABORTED et PLAYING\n $g->scoreteam1 = rand(100, 999);\n $g->scoreteam2 = rand(100, 999);\n break;\n }\n $g->save();\n }", "function getMovesForMatch ()\r\n{\r\n\t//array of chess moves assuming a few things:\r\n\t/* \t- light/dark take turns \r\n\t\t- the moves are set up to take a piece and move it to another,\r\n\t\t\tso moving pawn e2 -> e4 would be stored as the first 2 elements in a multidimensional array.\r\n\t\t- there are many things that would need to be done to support algebraic chess notation, \r\n\t\t\tI didn't go into that here.\t\t\r\n\t\t\r\n\t*/\r\n\t$matchMoves = array();\r\n\t\r\n\t/*\r\n\t$matchMoves [0]['from'] = \"e2\";\r\n\t$matchMoves [0]['to'] \t= \"e4\";\r\n\t$matchMoves [1]['from'] = \"c7\";\r\n\t$matchMoves [1]['to']\t= \"c5\";\r\n\t\r\n\t$matchMoves [2]['from'] = \"g1\";\r\n\t$matchMoves\t[2]['to']\t= \"f3\";\r\n\t$matchMoves [3]['from'] = \"b8\";\r\n\t$matchMoves [3]['to']\t= \"c6\";\r\n\t\r\n\t//begin invalid off board examples\r\n\t$matchMoves [4]['from'] = \"c6\";\r\n\t$matchMoves [4]['to'] \t= \"c9\";\r\n\t\r\n\t$matchMoves [5]['from'] = \"c6\";\r\n\t$matchMoves [5]['to'] \t= \"c0\";\r\n\t\r\n\t$matchMoves [6]['from'] = \"c6\";\r\n\t$matchMoves [6]['to'] \t= \"z9\";\r\n\t*/\r\n\t//begin invalid examples for particular pieces\r\n\t\r\n\t//king =======================\r\n\t//bad move\r\n\t$matchMoves [7]['from'] = \"e8\";\r\n\t$matchMoves [7]['to'] \t= \"g7\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [8]['from'] = \"e8\";\r\n\t$matchMoves [8]['to'] \t= \"f7\";\r\n\t\r\n\t//rook =========================\r\n\t//bad move\r\n\t$matchMoves [9]['from'] = \"h8\";\r\n\t$matchMoves [9]['to'] \t= \"h5\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [10]['from'] = \"h7\";\r\n\t$matchMoves [10]['to'] \t = \"h6\";\t\r\n\t$matchMoves [11]['from'] = \"h6\";\r\n\t$matchMoves [11]['to'] \t = \"h5\";\r\n\t$matchMoves [12]['from'] = \"h5\";\r\n\t$matchMoves [12]['to'] \t = \"h4\";\r\n\t$matchMoves [13]['from'] = \"h8\";\r\n\t$matchMoves [13]['to'] \t = \"h5\";\r\n\t\r\n\t//bishop ========================\r\n\t//bad move\r\n\t$matchMoves [14]['from'] \t= \"c8\";\r\n\t$matchMoves [14]['to'] \t\t= \"b8\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [15]['from'] \t= \"c8\";\r\n\t$matchMoves [15]['to'] \t\t= \"c7\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [16]['from'] \t= \"b7\";\r\n\t$matchMoves [16]['to'] \t\t= \"b6\";\r\n\t$matchMoves [17]['from'] \t= \"c8\";\r\n\t$matchMoves [17]['to'] \t\t= \"a6\";\r\n\t\r\n\t//queen ==========================\r\n\t$matchMoves [18]['from'] \t= \"d8\";\r\n\t$matchMoves [18]['to'] \t\t= \"c8\";\r\n\t\r\n\t\t\r\n\t//setting up a check for between functions - rook\r\n\t$matchMoves [19]['from'] \t= \"f2\";\r\n\t$matchMoves [19]['to'] \t\t= \"f3\";\r\n\t$matchMoves [20]['from'] \t= \"f3\";\r\n\t$matchMoves [20]['to'] \t\t= \"f4\";\r\n\t$matchMoves [21]['from'] \t= \"f4\";\r\n\t$matchMoves [21]['to'] \t\t= \"f5\";\r\n\t\r\n\t$matchMoves [22]['from'] \t= \"h5\";\r\n\t$matchMoves [22]['to'] \t\t= \"e5\";\r\n\t\r\n\t//demonstrating capture move a pawn to capture\r\n\t$matchMoves [23]['from'] \t= \"f7\";\r\n\t$matchMoves [23]['to'] \t\t= \"f6\";\r\n\t$matchMoves [24]['from'] \t= \"g7\";\r\n\t$matchMoves [24]['to'] \t\t= \"g6\";\r\n\t$matchMoves [25]['from'] \t= \"f5\";\r\n\t$matchMoves [25]['to'] \t\t= \"g6\";\r\n\t\r\n\r\n\treturn ($matchMoves);\r\n}", "function spar() {\r\n\tglobal $system;\r\n\r\n\tglobal $player;\r\n\r\n\tglobal $self_link;\r\n\r\n\tif($player->battle_id) {\r\n\t\ttry {\r\n $battle = new Battle($system, $player, $player->battle_id);\r\n\r\n $battle->checkTurn();\r\n\r\n $battle->renderBattle();\r\n\r\n if($battle->isComplete()) {\r\n echo \"<table class='table'><tr><th>Battle complete</th></tr>\r\n\t\t\t <tr><td style='text-align:center;'>\";\r\n if($battle->isPlayerWinner()) {\r\n echo \"You win!<br />\";\r\n }\r\n else if($battle->isOpponentWinner()) {\r\n echo \"You lose.<br />\";\r\n $player->health = 5;\r\n }\r\n else if($battle->isDraw()) {\r\n echo \"You both knocked each other out.<br />\";\r\n $player->health = 5;\r\n }\r\n echo \"</td></tr></table>\";\r\n\r\n $player->battle_id = 0;\r\n }\r\n }\r\n catch (Exception $e) {\r\n $system->printMessage($e->getMessage());\r\n $player->battle_id = 0;\r\n return false;\r\n }\r\n\t}\r\n\telse if(isset($_GET['challenge'])) {\r\n\t\ttry {\r\n\t\t\t$challenge = (int)$system->clean($_GET['challenge']);\r\n\t\t\t$result = $system->query(\"SELECT `user_id`, `user_name`, `village`, `location`, `challenge`, `battle_id`, `last_active`\r\n\t\t\t\tFROM `users` WHERE `user_id`='$challenge' LIMIT 1\");\r\n\t\t\tif($system->db_last_num_rows == 0) {\r\n\t\t\t\tthrow new Exception(\"Invalid user!\");\r\n\t\t\t}\r\n\t\t\t$user = $system->db_fetch($result);\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\tif($user['village'] != $player->village) {\r\n\t\t\t\tthrow new Exception(\"You cannot spar ninja from enemy villages!\");\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t\tif($user['location'] != $player->location) {\r\n\t\t\t\tthrow new Exception(\"Target is not at your location!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($user['challenge']) {\r\n\t\t\t\tthrow new Exception(\"Target has already been challenged!\");\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif($user['battle_id']) {\r\n\t\t\t\tthrow new Exception(\"Target is in battle!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($user['last_active'] < time() - 120) {\r\n\t\t\t\tthrow new Exception(\"Target is inactive/offline!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$system->query(\"UPDATE `users` SET `challenge`='$player->user_id' WHERE `user_id`='$challenge' LIMIT 1\");\r\n\t\t\t$system->message(\"Challenge sent!\");\r\n\t\t\t$system->printMessage();\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$system->message($e->getMessage());\r\n\t\t\t$system->printMessage();\r\n\t\t\trequire(\"scoutArea.php\");\r\n\t\t\tscoutArea();\r\n\t\t}\r\n\t}\r\n\telse if(isset($_GET['accept_challenge'])) {\r\n\t\ttry {\r\n\t\t\t$challenge = (int)$system->clean($_GET['accept_challenge']);\r\n\t\t\t\r\n\t\t\tif($challenge != $player->challenge) {\r\n\t\t\t\tthrow new Exception(\"Invalid challenge!\");\r\n\t\t\t}\r\n\r\n try {\r\n $user = new User($challenge);\r\n $user->loadData(User::UPDATE_NOTHING, true);\r\n } catch(Exception $e) {\r\n throw new Exception(\"Invalid user! \" . $e->getMessage());\r\n }\r\n\t\t\t\r\n\t\t\tif($user->location != $player->location) {\r\n\t\t\t\tthrow new Exception(\"Target is not at your location!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($user->battle_id) {\r\n\t\t\t\tthrow new Exception(\"User is in battle!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($user->last_active < time() - 120) {\r\n\t\t\t\tthrow new Exception(\"Target is inactive/offline!\");\r\n\t\t\t}\r\n\r\n $player->challenge = 0;\r\n Battle::start($system, $player, $user, Battle::TYPE_SPAR);\r\n\r\n\t\t\t$system->message(\"You have accepted the challenge!<br />\r\n\t\t\t\t<a class='link' href='$self_link'>To Battle</a>\");\r\n\t\t\t$system->printMessage();\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$player->challenge = 0;\r\n\t\t\t\r\n\t\t\t$system->message($e->getMessage());\r\n\t\t\t$system->printMessage();\r\n\t\t\trequire(\"scoutArea.php\");\r\n\t\t\tscoutArea();\r\n\t\t}\r\n\t}\r\n\telse if(isset($_GET['decline_challenge'])) {\r\n\t\t$player->challenge = 0;\r\n\t\t$system->message(\"Challenge declined.\");\r\n\t\t$system->printMessage();\r\n\t\t\r\n\t\trequire(\"scoutArea.php\");\r\n\t\tscoutArea();\r\n\t}\r\n\telse if(isset($_GET['cancel_challenge'])) {\r\n\t\t$challenge = $system->clean($_GET['cancel_challenge']);\r\n\t\t// Load user challenges sent\r\n\t\t$result = $system->query(\"UPDATE `users` SET `challenge`=0 WHERE `user_id`='$challenge' AND `challenge`='$player->user_id' LIMIT 1\");\r\n\t\t$system->message(\"Challenge cancelled!\");\r\n\t\t$system->printMessage();\r\n\t\t\t\r\n\t\trequire(\"scoutArea.php\");\r\n\t\tscoutArea();\r\n\t}\r\n\telse {\r\n\t\t// Load user challenges sent\r\n\t\t$result = $system->query(\"SELECT `user_id`, `user_name` FROM `users` WHERE `challenge`='$player->user_id'\");\r\n\t\tif($system->db_last_num_rows > 0) {\r\n\t\t\t$user_challenges = array();\r\n\t\t\twhile($row = $system->db_fetch($result)) {\r\n\t\t\t\t$user_challenges[$row['user_id']] = $row['user_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($player->challenge or isset($user_challenges)) {\r\n\t\t\techo \"<table class='table'><tr><th>Challenges</th></tr>\";\r\n\t\t\t\t\r\n\t\t\t// Challenge received\r\n\t\t\tif($player->challenge) {\r\n\t\t\t\t$result = $system->query(\"SELECT `user_name` FROM `users` WHERE `user_id`='$player->challenge' LIMIT 1\");\r\n\t\t\t\tif($system->db_last_num_rows == 0) {\r\n\t\t\t\t\t$player->challenge = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$challenger_data = $system->db_fetch($result);\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"<tr><td>\r\n\t\t\t\t\t<p style='display:inline-block;margin:0px;margin-left:20px;'>\r\n\t\t\t\t\t\tChallenged by <span style='font-weight:bold;'>\" . $challenger_data['user_name'] . \"</span></p>\r\n\t\t\t\t\t<p style='display:inline-block;margin:0px;margin-right:40px;float:right;'>\r\n\t\t\t\t\t\t<a href='$self_link&accept_challenge=$player->challenge'>Accept</a> | \r\n\t\t\t\t\t\t<a href='$self_link&decline_challenge=$player->challenge'>Decline</a>\r\n\t\t\t\t\t</p></td></tr>\";\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($user_challenges) {\r\n\t\t\t\tforeach($user_challenges as $id=>$name) {\r\n\t\t\t\t\techo \"<tr><td>\r\n\t\t\t\t\t<p style='display:inline-block;margin:0px;margin-left:20px;'>\r\n\t\t\t\t\t\tChallenge sent to <span style='font-weight:bold;'>\" . $name . \"</span></p>\r\n\t\t\t\t\t<p style='display:inline-block;margin:0px;margin-right:40px;float:right;'>\r\n\t\t\t\t\t\t<a href='$self_link&cancel_challenge=$id'>Cancel</a></p>\r\n\t\t\t\t\t</td></tr>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"</table>\";\r\n\t\t}\r\n\t\t\r\n\t\trequire(\"scoutArea.php\");\r\n\t\tscoutArea();\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "private function exit_user_from_game() {\n //increments the user account_balance, since the amount was already deducted at game start\n $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) + {$this->amount} WHERE user_id = '{$this->userID}'\");\n\n /*This gets the user current game details*/\n $this->userCurrentGameDetail = $this->fetch_data_from_table($this->games_table_name, 'game_id', $this->user_details[\"game_id_about_to_play\"])[0];\n\n /* Gets the number of players in the game */\n $number_of_players = (int)$this->userCurrentGameDetail[\"number_of_players\"];\n\n /* the new number of players will now be the previous number of players - 1*/\n $new_number_of_players = $number_of_players - 1;\n /* if the new number of players is equal to 0; meaning that he is the only one about to play; the entire game details will be deleted from the database*/\n if($new_number_of_players == 0){ $this->delete_record($this->games_table_name , \"game_id\" , $this->user_details[\"game_id_about_to_play\"] ); return true;}\n /* else set the new number of players to the one above */\n $this->update_record($this->games_table_name , \"number_of_players\" , $new_number_of_players , 'game_id' , $this->userCurrentGameDetail[\"game_id\"]);\n /* delete the game id from the user detail to avoid deduction from the when the game starts */\n $this->update_record($this->users_table_name , \"game_id_about_to_play\" , \"0\" , 'user_id' , $this->userID);\n /* finally return true */\n return true;\n }", "public function validateIsFullBoard(){\r\n //in case of a full Column\r\n for($index=0; $index < Board::COLUMNS; $index++){\r\n //if there is an empty cell\r\n if($this->board->gameBoard[0][$index] == Board::CELL){\r\n //board is not full\r\n return false;\r\n }\r\n }///board is full\r\n return true;\r\n }", "public function winRound() {\n\n\t\t$this->points++;\n\n\t\t$this->output($this->name.' has won this round');\n\t}", "function drawChessBoard($x, $y){\n $flag = true; \n if($x <= 10 && $y <= 10 && $x >= 2 && $y >= 2){\n $sizeDiv = 80;\n $widthBlock = $x * $sizeDiv; \n $heightBlock = $y * $sizeDiv; \n $chessBoard = '<div class=\"displayChessBord\" style=\"height:' . $heightBlock . 'px; \n width:' . $widthBlock . 'px\">';\n for ($i = 0; $i < $y; $i++) { \n for ($r = 0; $r < $x; $r++) {\n if($flag){\n $chessBoard .= '<div class=\"black\"></div>';\n }else{\n $chessBoard .= '<div class=\"white\"></div>';\n }\n $flag = !$flag;\n }\n \n if($x % 2 == 0){\n $flag = !$flag;\n }\n }\n $chessBoard .= '</div>';\n }else{\n $chessBoard = '<span class=\"alertInfo\">Enter data according to the rules and format.</span';\n } \n\n return $chessBoard;\n }", "public function runGame()\n {\n $currentGame = $this->find('all')->where([\n 'complete' => false\n ])->contain(['Users'])->first();\n\n //get all the plays counts\n $gamesUsersTable = TableRegistry::get('GamesUsers');\n $currentGameCheckedCount = $gamesUsersTable->find();\n $currentGameCheckedCount = $currentGameCheckedCount->select([\n 'count' => $currentGameCheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->first()->count;\n\n $currentGameUncheckedCount = $gamesUsersTable->find();\n $currentGameUncheckedCount = $currentGameUncheckedCount->select([\n 'count' => $currentGameUncheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->first()->count;\n\n $totalPlays = $currentGameCheckedCount + $currentGameUncheckedCount;\n\n //If not enough players, extend the end time and bail;\n if ($totalPlays < 2) {\n $currentGame->end_time = Time::now()->addHour(1);\n $this->save($currentGame);\n return false;\n }\n\n //update current game fields\n $currentGame->total_checked = $currentGameCheckedCount;\n $currentGame->total_plays = $totalPlays;\n $currentGame->ratio = round((float)$currentGameCheckedCount / (float)$totalPlays, 2);\n\n //save game as 'complete'\n $currentGame->complete = true;\n $this->save($currentGame);\n\n //get all the users that played this round\n $usersTable = TableRegistry::get('Users');\n $usersWhoCheckedThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->toArray();\n $currentGameCheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoCheckedThisGameIdArray) ? $usersWhoCheckedThisGameIdArray : [0])\n ]);\n\n $usersWhoDidntCheckThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->toArray();\n $currentGameUncheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoDidntCheckThisGameIdArray) ? $usersWhoDidntCheckThisGameIdArray : [0])\n ]);\n\n\n //update users scores\n foreach ($currentGameCheckedUsers as $user) {\n if ($currentGame->ratio > 0.5) {\n if ($user->score != 0) {\n $user->score = (int)$user->score - 10;\n }\n } else {\n $user->score = (int)$user->score + 10;\n }\n $usersTable->save($user);\n }\n\n //create next incomplete game & save\n $this->createNewGame();\n\n //send notification emails to everybody that gained/lost points\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => true,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameCheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n\n //send email to everybody who played but didn't check\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => false,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameUncheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n }", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }", "public function onRun(): void\n {\n foreach (Server::getInstance()->getOnlinePlayers() as $player){\n $session = SessionManager::getSession($player->getXuid());\n if ($session !== null && $session->getTogglesModule()->scoreboards()){\n ScoreboardHandler::sendAppropriateScoreboard($session);\n }\n }\n }", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "abstract public function winner();", "public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }", "function paperSiccorsRockChooseWinner($gameList){\n\t\t$movesArray = explode(\",\",$gameList);\n\t\t//printf(\"El gamelist es: \" . $gameList . \"<br>\");\n\t\t//printf(\"La jugada1 es: \" . substr($movesArray[1],1,1) . \"<br>\");\n\t\t$player1move = substr($movesArray[1],1,1);\n\t\t$player2move = substr($movesArray[3],1,1);\n\t\t$gameResult = \"\";\n\n\t\t//console.log(\" \");\n\t\t//console.log(\" \");\n\t\t\n\n\t\t//Se pregunta si la cantidad de jugadores es valida\n\t\tif(validateQuantityOfPlayers($movesArray) == false){\n\t\t\t//console.log(\"Error Cantidad de jugadores\");\n\t\t\t//throw \"Error with number of players\"; \n\t\t}\n\n\t\t//Se preguntan si las jugadas son validas\n\t\tif(validateMove($player1move) == false || validateMove($player2move) == false){\n\t\t\t//console.log(\"Error Jugada no valida\");\n\t\t\t//throw \"Error not valid move\";\n\t\t}\n\n\t\t//Se averigua cual jugador gano\n\t\t$winner = paperSiccorsRockRules($player2move, $player1move);\n\t\tif($winner == true){\n\t\t\t////printf(\"1 El gamelist es: \" .$movesArray[2] . ',' . substr($movesArray[3],0,-1). \"<br>\");\n\t\t\t$gameResult = $movesArray[2] . ',' . substr($movesArray[3],0,-1);\n\t\t}else{\n\t\t\t////printf(\"2 El gamelist es: \" . substr($movesArray[0],1). ',' .$movesArray[1] . \"<br>\");\n\t\t\t$gameResult = substr($movesArray[0],1). ',' .$movesArray[1]; //Se puede caer\n\t\t}\n\n\t\t//printf(\"El juego es \" . $gameList . \"<br>\");\n\t\t//printf(\"Jugada player 1 \" . $player1move .\"<br>\");\n\t\t//printf(\"Jugada player 2 \" . $player2move .\"<br>\");\n\t\t//printf(\"El ganadore es player2 \" . $winner .\"<br>\");\n\n\t\t//console.log(\" \");\n\t\t//console.log(\" \");\n\t\treturn $gameResult;\n\t}", "public function winGame(array $winner){\r\n\t\tFreedomDive::getInstance()->notifyGameEnded($this->serverId, $winner);\r\n\r\n\t\t$this->finishGame();\r\n\t}", "protected static function isBoardFull(array $gameBoard){\r\n\t\tforeach($gameBoard as $pos1=>$columns){\r\n\t\t\tforeach($columns as $pos2=>$player){\r\n\t\t\t\tif (false !== $player){\r\n\t\t\t\t\tcontinue ; \t\r\n\t\t\t\t}\r\n\t\t\t\t$blankPositions[] = array($pos1,$pos2);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn (!empty($blankPositions))? $blankPositions:true;\r\n\t}", "function is_attacked($i, $opponent_color = null, $try_move = array()) {\n\n if ($opponent_color != null) {\n $opponent_color = 1 - $this->to_move;\n }\n \n # check pawns\n # _debug(\"... checking opponent pawns\");\n if ($opponent_color) {\n if ($this->_test_attack('p', $i - 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i - 11, $opponent_color, $try_move) === -1) return TRUE;\n } \n else {\n if ($this->_test_attack('p', $i + 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i + 11, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check knights\n # _debug(\"... checking opponent knights\");\n foreach (array(19, 21, 8, 12, -19, -21, -8, -12) as $step) {\n if ($this->_test_attack('n', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check bishops or queens\n # _debug(\"... checking opponent bishops\");\n foreach (array(11, 9, -11, -9) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('bq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n # check rooks or queens\n # _debug(\"... checking opponent rooks or queens\");\n foreach (array(1, 10, -1, -10) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('rq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n foreach (array(9, 10, 11, -1, 1, -9, -10, -11) as $step) {\n if ($this->_test_attack('k', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n return FALSE;\n }", "public function startGame($cell_number)\n\t{\n\n\t}", "public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }", "public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function ship_pick()\n{\n\t//[02:14] <Exekutor4> Well if you punish the times stgc'ler want then you can tap the source type^^\n\t//[02:17] <Karnickl> @sci. no wonder that nothing is done *g* tap+source=makes+w.bush\n\tglobal $db;\n\tglobal $game,$ACTUAL_TICK;\n\n\t$game->out('<center><span class=\"sub_caption\">'.constant($game->sprache(\"TEXT247\")).' '.HelpPopup('ship_avis').' :</span></center><br>');\n\n\t$ships=isset($_POST['ship_auswahl'])?$_POST['ship_auswahl']:null;\n\n\tif(isset($_POST['plani_ziel'])) $_POST['plani_ziel']=(int)$_POST['plani_ziel'];\n\n\tif(isset($_REQUEST['handel']) && $_REQUEST['handel']=='ship_send' && $_POST['plani_ziel']!=null && $_REQUEST['step']=='2' && $ships[0]!=null)\n\t{\n\t\t$plani_id_a=$db->queryrow('SELECT planet_id,planet_name FROM `planets` WHERE planet_id='.$_POST['plani_ziel'].' AND planet_owner='.$game->player['user_id'].'');\n\t\tif($plani_id_a['planet_id']!=$_POST['plani_ziel'])\n\t\t{\n\t\t\t$game->out(constant($game->sprache(\"TEXT146\")));\n\t\t}else\n\t\t{\n\t\t\t$where_frage=\"\";\n\t\t\t$zaehler=0;\n\t\t\tfor($i=0; $i < count($ships); $i++) {\n\t\t\t\tif($i==0)\n\t\t\t\t{\n\t\t\t\t\t$where_frage.=\"( w.ship_id=\".$ships[$i].\" \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$where_frage.=\" OR w.ship_id=\".$ships[$i].\" \";\n\t\t\t\t}\n\t\t\t\t$zaehler++;\n\t\t\t}\n\n\t\t\tif($_POST['transportsart']!=1 && $_POST['transportsart']!=2 && $_POST['transportsart']!=3) {$game->out('Cheat'); exit;}\n\t\t\tif($_POST['transportsart']==1) {$transportsatz=0.30;$tickzeit=20*6;}\n\t\t\tif($_POST['transportsart']==2) {$transportsatz=0.15;$tickzeit=20*12;}\n\t\t\tif($_POST['transportsart']==3) {$transportsatz=0;$tickzeit=20*36;}\n\t\t\t$Bot = $db->queryrow('SELECT planet_id FROM FHB_Bot');\n\t\t\t$db->lock('ships','ship_fleets','FHB_warteschlange w','FHB_logging_ship','scheduler_shipmovement','schulden_table s','FHB_warteschlange');\n\t\t\tif(($npc_ships_wait=$db->query('SELECT w.* FROM (FHB_warteschlange w) LEFT JOIN schulden_table s on s.ship_id=w.ship_id WHERE (s.status=1 OR s.status IS NULL) AND user_id='.$game->player['user_id'].' AND '.$where_frage.')'))==true)\n\t\t\t{\n\t\t\t\tif($db->query('INSERT INTO ship_fleets (fleet_name, user_id, owner_id, planet_id, move_id, n_ships)\n\t\t\t\t\tVALUES (\"'.constant($game->sprache(\"TEXT274\")).' '.((int)($ACTUAL_TICK/2)).'\", '.$game->player['user_id'].', '.$game->player['user_id'].', '.$Bot['planet_id'].', 0, '.$zaehler.')'))\n\t\t\t\t{\n\n\t\t\t\t\t$fleet_id=$db->insert_id();\n\t\t\t\t\t$xxx=0;\n\t\t\t\t\twhile($npc_ships_wait_t=$db->fetchrow($npc_ships_wait))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!$db->query('UPDATE ships SET fleet_id='.$fleet_id.',ship_untouchable=0,user_id='.$game->player['user_id'].' WHERE ship_id='.$npc_ships_wait_t['ship_id'].''))\n\t\t\t\t\t\t\tmessage(DATABASE_ERROR, 'Could not insert new movement data');\n\t\t\t\t\t\t$xxx++;\n\t\t\t\t\t}\n\t\t\t\t\tif($xxx!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!$db->query('INSERT INTO scheduler_shipmovement (user_id, move_status, move_exec_started, start, dest, total_distance, remaining_distance, tick_speed, move_begin, move_finish, n_ships, action_code, action_data)\n\t\t\t\t\t\t\tVALUES ('.$game->player['user_id'].', 0, 0, '.$Bot['planet_id'].', '.$_POST['plani_ziel'].', 0, 0, 0, '.$ACTUAL_TICK.', '.($ACTUAL_TICK + $tickzeit).', '.$zaehler.', 11, \"\")'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmessage(DATABASE_ERROR, 'Could not insert new movement data');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$new_move_id = $db->insert_id();\n\t\t\t\t\t\t\tif(!$db->query('UPDATE ship_fleets\n\t\t\t\t\t\t\t\tSET planet_id = 0,\n\t\t\t\t\t\t\t\tmove_id = '.$new_move_id.'\n\t\t\t\t\t\t\t\tWHERE fleet_id='.$fleet_id.''))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmessage(DATABASE_ERROR, 'Could not update fleets position data');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/* 06/03/08 - AC: No taxes on the ship shipping */\n\t\t\t\t\t\t\t$steuern = 0;\n\n\t\t\t\t\t\t\t$game->out('<table>\n\t\t\t\t\t\t\t\t<tr><td>'.constant($game->sprache(\"TEXT248\")).'</td></tr>\n\t\t\t\t\t\t\t\t<tr><td>'.constant($game->sprache(\"TEXT148\")).$plani_id_a['planet_name'].'</td></tr>\n\t\t\t\t\t\t\t\t<tr><td><!--'.constant($game->sprache(\"TEXT149\")).$steuern.'--></td></tr>\n\t\t\t\t\t\t\t\t<tr><td><form action=\"'.parse_link('a=trade&view='.$_REQUEST['view'].'&handel=kaufen_truppen').'\" method=\"post\">\n\t\t\t\t\t\t\t\t<input type=\"submit\" value=\"'.constant($game->sprache(\"TEXT152\")).'\" name=\"submit\" class=\"Button_nosize\"></td></tr></table>');\n\t\t\t\t\t\t\tif(($npc_ships_wait=$db->query('SELECT w.* FROM (FHB_warteschlange w) LEFT JOIN schulden_table s on s.ship_id=w.ship_id WHERE (s.status=1 OR s.status IS NULL) AND user_id='.$game->player['user_id'].' AND '.$where_frage.')'))==false)\n\t\t\t\t\t\t\t\tmessage(DATABASE_ERROR, 'Could select ships from Bot');\n\t\t\t\t\t\t\twhile($npc_ships_wait_t=$db->fetchrow($npc_ships_wait))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!$db->query('DELETE FROM FHB_warteschlange WHERE id='.$npc_ships_wait_t['id'].''))\n\t\t\t\t\t\t\t\t\tmessage(DATABASE_ERROR, 'Could not Delete from Bot');\n\t\t\t\t\t\t\t\tif(!$db->query('INSERT INTO `FHB_logging_ship` (`tick` , `user_id` , `ship_id` ) VALUES ('.$ACTUAL_TICK.','.$game->player['user_id'].','.$npc_ships_wait_t['ship_id'].')'))\n\t\t\t\t\t\t\t\t\tmessage(DATABASE_ERROR, 'Could not logging');\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{\n\t\t\t\t\t\t$game->out(constant($game->sprache(\"TEXT249\")));\n\t\t\t\t\t\t$db->unlock('ships','ship_fleets','FHB_warteschlange w','FHB_logging_ship','scheduler_shipmovement','schulden_table s','FHB_warteschlange');\n\t\t\t\t\t\t$game->out('<table><form action=\"'.parse_link('a=trade&view='.$_REQUEST['view'].'&handel=ship_send').'\" method=\"post\"><tr><td>');\n\t\t\t\t\t\t$game->out('<input type=\"submit\" value=\"'.constant($game->sprache(\"TEXT152\")).'\" name=\"submit\" class=\"Button_nosize\"></td></tr></form></table>');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{message(DATABASE_ERROR, 'Internal database error');}\n\t\t\t}\n\t\t\telse{message(DATABASE_ERROR, 'Internal database error');}\n\t\t\t$db->unlock('ships','ship_fleets','FHB_warteschlange w','FHB_logging_ship','scheduler_shipmovement','schulden_table s','FHB_warteschlange');\n\t\t}\n\t}\n\telse\n\t{ \n\t\tif(($npc_ships_wait=$db->query('SELECT w.* FROM (FHB_warteschlange w) LEFT JOIN schulden_table s on s.ship_id=w.ship_id WHERE (s.status=1 OR s.status IS NULL) AND user_id='.$game->player['user_id'].''))==false)\n\t\t{\n\t\t\tmessage(DATABASE_ERROR, 'Could not open ship wait list');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($db->num_rows()<=0)\n\t\t\t{\n\t\t\t\t$game->out(constant($game->sprache(\"TEXT250\")));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$game->out('<table>');\n\n\t\t\t\t$game->out('<form action=\"'.parse_link('a=trade&view='.$_REQUEST['view'].'&handel=ship_send&step=2').'\" method=\"post\">');\n\n\t\t\t\t$game->out('<tr><td>'.constant($game->sprache(\"TEXT173\")).'</td><td><select size=\"1\" name=\"transportsart\">\n\t\t\t\t<option value=\"1\">'.constant($game->sprache(\"TEXT266\")).'</option>\n\t\t\t\t<!-- <option value=\"1\">'.constant($game->sprache(\"TEXT174\")).'</option>-->\n\t\t\t\t<!--<option value=\"2\">'.constant($game->sprache(\"TEXT175\")).'</option>-->\n\t\t\t\t<!--<option value=\"3\">'.constant($game->sprache(\"TEXT176\")).'</option>-->\n\t\t\t\t</select></td></tr><tr><td colspan=2><br>'.constant($game->sprache(\"TEXT177\")).'</td></tr>');\n\t\t\t\t$sql='SELECT planet_id,planet_name,building_11 FROM `planets` WHERE planet_owner='.$game->player['user_id'].' ORDER BY planet_name ASC';\n\t\t\t\tif(($planis=$db->query($sql))==false)\n\t\t\t\t{\n\t\t\t\t\t$game->out(constant($game->sprache(\"TEXT178\")));\n\t\t\t\t}else{\n\t\t\t\t\t$game->out('<tr><td>'.constant($game->sprache(\"TEXT251\")).'</td><td><select size=\"1\" name=\"plani_ziel\">');\n\t\t\t\t\twhile($planeten=$db->fetchrow($planis))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($planeten['building_11']>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($game->planet['planet_id'] == $planeten['planet_id'])\n\t\t\t\t\t\t\t\t$game->out('<option value=\"'.$planeten['planet_id'].'\" selected=\"selected\">'.$planeten['planet_name'].'</option>');\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$game->out('<option value=\"'.$planeten['planet_id'].'\">'.$planeten['planet_name'].'</option>');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$game->out('</select></td></tr>');\n\t\t\t\t}\n\t\t\t\t$game->out('<tr><td colspan=2><br>');\n\t\t\t\twhile($npc_ships_wait_t=$db->fetchrow($npc_ships_wait))\n\t\t\t\t{\n\t\t\t\t\t$sql = 'SELECT s.ship_id, s.hitpoints, \n\t\t\t\t\t\t\t\t s.unit_1, s.unit_2,\n\t\t\t\t\t\t\t\t s.unit_3,s.unit_4,\n\t\t\t\t\t\t\t\t st.max_unit_1,st.max_unit_2,\n\t\t\t\t\t\t\t\t st.max_unit_3,st.max_unit_4,\n\t\t\t\t\t\t\t\t st.name AS template_name,\n\t\t\t\t\t\t\t\t st.value_5 AS max_hitpoints\n\t\t\t\t\t\tFROM (ships s) INNER JOIN (ship_templates st) ON st.id = s.template_id\n\t\t\t\t\t\tWHERE s.ship_id='.$npc_ships_wait_t['ship_id'];\n\n\t\t\t\t\tif(($ship = $db->queryrow($sql)) === false) {\n\t\t\t\t\t\tmessage(DATABASE_ERROR, 'Cannot retrieve delivery ship data!');\n\t\t\t\t\t}\n\n\t\t\t\t\t$crew_perc = 100 / ($ship['max_unit_1'] + $ship['max_unit_2'] +\n\t\t\t\t\t\t\t\t\t\t$ship['max_unit_3'] + $ship['max_unit_4']) *\n\t\t\t\t\t\t\t\t\t ($ship['unit_1'] + $ship['unit_2'] + \n\t\t\t\t\t\t\t\t\t $ship['unit_3'] + $ship['unit_4']);\n\n\t\t\t\t\t$crew_title = $crew_perc!=100 ? ' B='.round($crew_perc,0).'%': '';\n\n\t\t\t\t\t$game->out('<input name=\"ship_auswahl[]\" type=\"checkbox\" id=\"ship_auswahl[]\" value=\"'.$npc_ships_wait_t['ship_id'].'\"> '.$ship['template_name'].' ('.$ship['hitpoints'].'/'.$ship['max_hitpoints'].')'.$crew_title.'<br>');\n\t\t\t\t}\n\t\t\t\t$game->out('<br><br><input type=\"submit\" value=\"'.constant($game->sprache(\"TEXT252\")).'\" name=\"submit\" class=\"Button_nosize\"></td></tr></form></table>');\n\t\t\t}\n\t\t}\n\t}\n}", "public function playRound()\n {\n $this->checkFirstAttack();\n\n // Orderus attacks\n if ($this->orderus_attacks) {\n $attacks = $this->orderus->rapidStrike();\n if ($attacks > 1) {\n $this->ui->display($this->narration->orderusRapidStrike());\n $this->ui->displayBlank();\n }\n while ($attacks > 0) {\n $this->ui->display($this->narration->orderusAttacks());\n if ($this->orderus->attack($this->beast)) {\n $this->ui->display($this->narration->orderusHits());\n } else {\n $this->ui->display($this->narration->orderusMisses());\n }\n $attacks--;\n if ($attacks > 0) {\n $this->displayStats();\n $this->ui->displayBlank();\n }\n }\n\n // the wild beast attacks\n } else {\n $this->ui->display($this->narration->beastAttacks());\n $damage_divider = $this->orderus->magicShield();\n if ($damage_divider > 1) {\n $this->ui->displayBlank();\n $this->ui->display($this->narration->orderusMagicShield());\n $this->ui->displayBlank();\n }\n if ($this->beast->attack($this->orderus, $damage_divider)) {\n $this->ui->display($this->narration->beastHits());\n } else {\n $this->ui->display($this->narration->beastMisses());\n }\n }\n\n // take turns attacking\n $this->orderus_attacks = !$this->orderus_attacks;\n\n // prevent endless battles\n $this->turns--;\n $this->is_running = ($this->turns > 0);\n\n // check health stats\n if (($this->orderus->health() <= 0) || ($this->beast->health() <= 0)) {\n $this->is_running = false;\n }\n\n // Orderus wins\n if ($this->beast->health() <= 0) {\n $this->winner->is_orderus = true;\n }\n\n // the wild beast wins\n if ($this->orderus->health() <= 0) {\n $this->winner->is_beast = true;\n }\n }", "public function startGameSession() {\n if(!isset($_SESSION['wrongGuesses'])) {\n $_SESSION['wrongGuesses'] = 0;\n }\n $_SESSION['activeGame'] = true;\n }", "private function _resetBoard()\n {\n $this->curPos = 0;\n $this->curRow = 0;\n $this->_createBoard();\n }", "public function GenerateLegalMoves($chessposition){\n\t\t$this->SetAsPosition($chessposition);\n\t\t$this->ResetLegalMovesArr();\n\t\n\t\t//loop through the entire board\n\t\t//possible candidates are (x,y)\n\t\tfor ($x=0; $x<8; $x++){\n for ($y=0; $y<8; $y++){\n $chesspiece = $this->chessposition[$x][$y];\n \n //if nothing is there\n if ($chesspiece == 0){\n continue;\n }\n \n if (($this->IsWhiteToMove && ($chesspiece < 0)) ||\n \t\t(!$this->IsWhiteToMove && ($chesspiece > 0))){\n \t\tcontinue;\n \t\t}\n \n //if chesspiece is a pawn\n if (($chesspiece == 1) || ($chesspiece == -1)){ // chesspiece = pawn\n $this->GenerateLegalPawnMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n \n //if $chesspiece is a knight\n if (($chesspiece == 2) || ($chesspiece == -2)){\n $this->GenerateLegalKnightMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }//end of examining legal moves for knight\n \n //if $chesspiece is a bishop\n if (($chesspiece == 3) || ($chesspiece == -3)){ //$chesspiece is a bishop\n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for bishop\n \n //if $chesspiece is a rook\n if (($chesspiece == 4) || ($chesspiece == -4)){\n $this->GenerateLegalRookMoves($chesspiece, $x, $y); \n \n continue; //move on to the next iteration\n }//end of generating legal moves for the rook\n \n //if $chesspiece is a queen\n if (($chesspiece == 5) || ($chesspiece == -5)){\n \n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n $this->GenerateLegalRookMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for the queen\n \n //if chesspiece is a king\n if (($chesspiece == 6) || ($chesspiece == -6)){\n $this->GenerateLegalKingMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n }\n }\n\t}", "function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}", "function fillBoard(Board $_board, GetOpt $_options)\n {\n }", "public function rejectIfInvalidRowAndColumn(Board $board, User $player, $row, $col);", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n if ($rightDiagonalSum == $this->boardSize || $leftDiagonalSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n if ($rightDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $column = array_column($this->board, $i);\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n if ($columnSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($columnSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($rowSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->secondMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "function show_round()\n{\n $bdd = DB_connect();\n\n // On récupère de la table matches les informations sur la partie\n $req_match = $bdd->query('SELECT * FROM matches WHERE id = \\''.$_SESSION['match']['id'].'\\'');\n $data_match = $req_match->fetch();\n\n // On récupère de la table rounds tous les rounds de la partie\n $req_round = $bdd->query('SELECT * FROM rounds WHERE match_id = \\''.$_SESSION['match']['id'].'\\'');\n while($data_round = $req_round->fetch())\n $tab[$data_round['id']] = $data_round;\n // On sélectionne le dernier round en mémoire du match\n $round = $tab[max(array_keys($tab))];\n\n $_SESSION['match']['previous_user'] = $round['actual_user'];\n\n // On détermine si l'on est le user1 ou le user2 dans la partie\n if ($data_match['user1_id'] == $_SESSION['user']['id'])\n {\n $_SESSION['match']['user_me'] = 1;\n $_SESSION['match']['user_me_id'] = $data_match['user1_id'];\n $_SESSION['match']['user_me_score'] = $round['user1_score'];\n $_SESSION['match']['user_enemy'] = 2;\n $_SESSION['match']['user_enemy_id'] = $data_match['user2_id'];\n $_SESSION['match']['user_enemy_score'] = $round['user2_score'];\n }\n else\n {\n $_SESSION['match']['user_me'] = 2;\n $_SESSION['match']['user_me_id'] = $data_match['user2_id'];\n $_SESSION['match']['user_me_score'] = $round['user2_score'];\n $_SESSION['match']['user_enemy'] = 1;\n $_SESSION['match']['user_enemy_id'] = $data_match['user1_id'];\n $_SESSION['match']['user_enemy_score'] = $round['user1_score'];\n }\n\n // Si la partie est finie, on n'affiche pas la map\n if ($data_match['end'])\n {\n echo '<h3>La partie est finie !</h3>';\n if ($_SESSION['match']['user_me_score'] > $_SESSION['match']['user_enemy_score'])\n {\n echo '<h3>Bravo ! Tu as GAGNÉ.</h3>';\n }\n else if ($_SESSION['match']['user_me_score'] < $_SESSION['match']['user_enemy_score'])\n {\n echo '<h3>Dommage ! Tu as PERDU.</h3>';\n }\n else\n {\n echo '<h3>Bravo ! Vous êtes arrivés EX AEQUO.</h3>';\n }\n return (0);\n }\n\n // On enregistre la map dans le $_SESSION\n $map = string_to_map($round['map']);\n $_SESSION['match']['map'] = $map;\n\n // On affiche la map à jour\n echo '<table id=\"map\">';\n echo '<tr>';\n for ($j = 0; $j <= 6; $j++)\n {\n if ($j == 0)\n echo '<td></td>';\n else\n echo '<td>'.$j.'</td>';\n }\n echo '</tr>';\n for ($i = 'A'; isset($map[$i]); $i++)\n {\n echo '<tr>';\n for ($j = 0; $j <= 6; $j++)\n {\n if ($j == 0)\n echo '<td>'.$i.'</td>';\n else\n {\n if ($map[$i][$j] == 3)\n $background_color = 'red';\n else if ($map[$i][$j] == 4)\n $background_color = 'green';\n else\n $background_color = 'white';\n echo \"<td style='background-color:$background_color'></td>\";\n }\n }\n echo '</tr>';\n }\n echo '</table>';\n\n if ($round['actual_user'] == $_SESSION['match']['user_me'] ||\n ($round['actual_user'] == 0 && $_SESSION['match']['user_me'] != 1))\n {\n // On récupère le nom de l'ennemi dans la table users\n $req_enemy_login = $bdd->query('SELECT login FROM users WHERE id = \\''.$_SESSION['match']['user_enemy_id'].'\\'');\n $data_enemy_login = $req_enemy_login->fetch();\n\n echo '<h3>C\\'est au tour de '.$data_enemy_login['login'].'</h3>';\n echo '<form method=\"POST\" action=\"game.php\">\n <input type=\"submit\" name=\"reload_submit\" value=\"↻ Rafraîchir\">\n </form>';\n return (1);\n }\n else\n {\n echo '<h3>C\\'est à ton tour !</h3>\n <form method=\"POST\" action=\"#\">\n <br>\n <input type=\"text\" name=\"coord\" placeholder=\"Case\" required><br><br>\n <input type=\"submit\" value=\"Jouer\">\n </form>';\n return (0);\n }\n}", "public function runGame( )\n {\n\n $MODELS = include(ROOT.'/conf/rooms.php');\n $gameConfig = $MODELS[1];\n\n }", "private function fight() {\n while(!$this->winner) {\n // Check current field conditions\n // Check abilities\n $this->playTurn();\n // End turn\n if($this->getNextFighter()->health <= 0) {\n $this->winner_fighter = $this->fighter_current;\n $this->winner = true;\n break;\n }\n $this->nextFighter();\n\n // $this->winner_fighter = $this->fighter_current;\n // $this->winner = true;\n }\n }", "public function GenerateLegalRookMoves($chesspiece, $x, $y){\n\t //examine forward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n \tbreak; //stop examining this file.\n }\n }\n\n //examine backward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this file.\n }\n }\n\n //examine right-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this rank.\n }\n }\n\n //examine left-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this rank.\n }\n }\n \n return true;\n\t}", "function stInterPlayerTurn() {\n \n // Give him extra time for his actions to come\n self::giveExtraTime(self::getActivePlayerId());\n \n // Does he plays again?\n if (self::getGameStateValue('first_player_with_only_one_action')) {\n // First turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('first_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('second_player_with_only_one_action')) {\n // 4 players at least and this is the second turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('second_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('has_second_action')) {\n // The player took his first action and has another one\n $next_player = false;\n self::setGameStateValue('has_second_action', 0);\n }\n else {\n // The player took his second action\n $next_player = true;\n self::setGameStateValue('has_second_action', 1);\n }\n if ($next_player) { // The turn for the current player is over\n // Reset the flags for Monument special achievement\n self::resetFlagsForMonument();\n \n // Activate the next player in turn\n $this->activeNextPlayer();\n $player_id = self::getActivePlayerId();\n self::setGameStateValue('active_player', $player_id);\n }\n self::notifyGeneralInfo('<!--empty-->');\n self::trace('interPlayerTurn->playerTurn');\n $this->gamestate->nextState();\n }", "private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function indexAction() {\n if($_POST) {\n $this->board = [\n [0,0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0,0]\n ];\n \n foreach ($this->board as $row => $cols) {\n foreach ($cols as $col => $cellValue) {\n $this->board[$row][$col] = Input::getInt('t'.($row+1).($col+1));\n }\n }\n\n if(!$this->isFilled()) {\n Router::redirect('board/result/notfilled');\n return;\n }\n\n if(!$this->isValidRowColumn()) {\n Router::redirect('board/result/repeatedRowOrCol');\n return;\n }\n\n if(!$this->isValidBox()) {\n Router::redirect('board/result/boxrepeated');\n return;\n }\n\n Router::redirect('board/result/success');\n }\n $this->view->render('board/index'); \n }", "private function decideVictory()\n {\n echo 'Jugador ';\n if (!$this->human->isOver() &&\n (\n ($this->human->getPoints() == $this->machine->getPoints() && $this->human->getPoints() != PLAYER_WIN_POINTS)\n || $this->human->getPoints() > $this->machine->getPoints()\n || $this->machine->isOver()\n )\n ) echo 'Humano';\n else echo 'Máquina';\n echo ' gana la partida. ';\n }", "private function add_user_to_existing_game()\n {\n\n $number_of_existing_players = intval($this->gameUserCanPlay[\"number_of_players\"]) + 1;\n $this->number_of_players_in_current_user_game = $number_of_existing_players;\n $this->update_multiple_fields($this->games_table_name, [\"number_of_players\" => $number_of_existing_players], \"game_id ='{$this->gameIDUserCanPlay}'\");\n $this->update_multiple_fields($this->users_table_name, [\"game_id_about_to_play\" => $this->gameIDUserCanPlay], \"user_id='{$this->userID}'\");\n $this->game_10_words = $this->fetch_data_from_table($this->games_table_name , 'game_id' , $this->gameIDUserCanPlay)[0][\"words\"];\n $this->game_10_words = json_decode($this->game_10_words);\n\n /* if players are complete game should start */\n if ($number_of_existing_players == $this->config->MaximumNumberOfPlayers) {\n /* tell javascript that the game has started */\n $this->update_record($this->games_table_name, 'started', '1', 'game_id', $this->gameIDUserCanPlay);\n /* update current_game_id for all users in game */\n $this->update_record($this->users_table_name , 'current_game_id' , $this->gameIDUserCanPlay , 'game_id_about_to_play' , $this->gameIDUserCanPlay );\n /* Subtract the amount for all players */\n //$this->update_multiple_fields($this->users_table_name , ['account_balance' => \" account_balance - {$this->amount}\"] , \"game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n /* Make sure all users point is set to 0 immediately game starts and ends*/\n // $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) - {$this->amount} WHERE game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n $this->update_record($this->users_table_name , 'current_point' , 0 , 'game_id_about_to_play' , $this->gameIDUserCanPlay);\n $this->start_time = time() * 1000;\n $this->update_record($this->games_table_name , 'start_time' , $this->start_time , 'game_id' , $this->gameIDUserCanPlay);\n\n $this->showGameChat = true;\n\n }\n\n return true;\n }", "function playGame($config)\n{\n showWelcome();\n $userName = getUserName();\n showRules($config[\"ruleGame\"]);\n\n for ($countRightRounds = 0; $countRightRounds < $config[\"countRounds\"]; $countRightRounds++) {\n [$Question, $rightAnswer] = $config[\"getRound\"]();\n $userAnswer = showQuestion($Question);\n\n if (!checkAnswer($userAnswer, $config[\"checkAnswer\"])) {\n err('Error answer format!');\n exit;\n }\n if (!checkResult($userAnswer, $rightAnswer)) {\n showResult($userAnswer, $userName, $rightAnswer, 'WrongAnswer');\n exit;\n }\n showResult($userAnswer, $userName, $rightAnswer, 'RightAnswer');\n if ($countRightRounds === $config[\"countRounds\"]) {\n showResult($userAnswer, $userName, $rightAnswer, 'EndGame');\n }\n }\n}", "protected function welcome() {\n echo \"*****************\" . PHP_EOL .\n \"*** TicTacToe ***\" . PHP_EOL .\n \"*****************\" . PHP_EOL;\n $this->drawBoard(array(), true);\n echo \"[\" . self::QUIT_BUTTON . \"] - End game\" . PHP_EOL . PHP_EOL;\n }", "public function run()\n {\n $game = new Game([\n 'name' => 'TicTacToe',\n 'description' => 'A funny TicTacToe Game',\n 'rules' => 'Match three Xs or Os in a row in any direction and you win!'\n ]);\n\n $game->save();\n }", "public function checkHorizontalWin($userMove){\r\n $HorizontalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $row = $this->lastRowInsert;\r\n $current_player = \"[$this->currentPlayer]\";\r\n\r\n for($col = $userMove-1; $col > -1 ; $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break; \r\n }\r\n $HorizontalCounter++;\r\n }\r\n for($col= $userMove; $col < Board::COLUMNS ; $col++){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $HorizontalCounter++; \r\n }\r\n return $HorizontalCounter >= self::WIN ? true : false;\r\n \r\n }", "public function checkIfPlayersConflictsTeam(OnWayPointEventStructure $structure) {\n\t\t$login = trim($structure->getLogin());\n\n\t\t// If there's login of player in blueTeam but he finished as redTeam make swap\n\t\tif (array_key_exists($login, $this->matchScore->blueTeamPlayers)) {\n\t\t\tif ($structure->getPlayer()->teamId != $this->matchScore->blueTeamPlayers[$login]->teamId) {\n\t\t\t\t$this->matchScore->redTeamPlayers[$login] = $this->matchScore->blueTeamPlayers[$login];\n\t\t\t\t$this->matchScore->redTeamPlayers[$login]->teamId = self::RED_TEAM;\n\t\t\t\tunset($this->matchScore->blueTeamPlayers[$login]);\n\t\t\t}\n\n\t\t} // If there's login of player in redTeam but he finished as blueTeam make swap\n\t\telse if (array_key_exists($login, $this->matchScore->redTeamPlayers)) {\n\t\t\tif ($structure->getPlayer()->teamId != $this->matchScore->redTeamPlayers[$login]->teamId) {\n\t\t\t\t$this->matchScore->blueTeamPlayers[$login] = $this->matchScore->redTeamPlayers[$login];\n\t\t\t\t$this->matchScore->blueTeamPlayers[$login]->teamId = self::BLUE_TEAM;\n\t\t\t\tunset($this->matchScore->redTeamPlayers[$login]);\n\t\t\t}\n\t\t}\n\t}", "function _test_attack($type, $i, $opponent_color, $try_move) {\n/*\nprintf(\"try_move['from']: %s\\n\", $try_move['from']);\nprintf(\"try_move['to']: %s\\n\", $try_move['to']);\nprintf(\"try_move['piece']: %s\\n\", $try_move['piece']);\nprintf(\"this->enpa: %s\\n\", $this->enpa);\n*/\n $p = null;\n if ($try_move) {\n\n if ($i === $try_move['from']) {\n $p = 0;\n } \n elseif ($i === $try_move['to']) {\n // The trial move takes the piece being considered\n $p = $try_move['piece'];\n } \n elseif ( $try_move['piece'] === 'p' \n && intval($this->enpa) === intval($try_move['to'])\n && intval($i) === intval($this->enpa) + 10\n ) {\n $p = 0;\n }\n elseif ( $try_move['piece'] === 'P' \n && intval($this->enpa) === intval($try_move['to'])\n && intval($i) === intval($this->enpa) - 10\n ) {\n $p = 0;\n }\n else {\n $p = $this->pos[$i];\n }\n } \n else {\n $p = $this->pos[$i];\n }\n \n if ($p === null) {\n//print(\"A\\n\");\n return 1;\n }\n\n if ($p && $this->piece_color($p) === $opponent_color && strpos($type, strtolower($p)) !== FALSE) {\n//printf(\"p:%s\\n\", $p);\n//print(\"B\\n\");\n return -1;\n }\n//print(\"C\\n\");\n return $p;\n }", "private function findBigLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\t// Top\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[3][-1]->hasMarble &&\n\t\t\t\t$this->board[3][0]->hasMarble &&\n\t\t\t\t$this->board[3][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Left\n\t\t\t\tif(\t$this->board[2][-1]->hasMarble &&\n\t\t\t\t\t$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[0][-1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[1][-2]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -2);\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$moves[0][] = array('left', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t$moves[0][] = array('left', 3, 1);\n\t\t\t\t\t$moves[0][] = array('up', 0, -1);\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -2);\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$moves[0][] = array('left', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Right\n\t\t\t\tif(\t$this->board[2][1]->hasMarble &&\n\t\t\t\t\t$this->board[1][1]->hasMarble &&\n\t\t\t\t\t$this->board[0][1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[1][2]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 2);\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$moves[1][] = array('right', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t$moves[1][] = array('right', 3, -1);\n\t\t\t\t\t$moves[1][] = array('up', 0, 1);\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 2);\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$moves[1][] = array('right', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Down\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[-3][-1]->hasMarble &&\n\t\t\t\t$this->board[-3][0]->hasMarble &&\n\t\t\t\t$this->board[-3][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Left\n\t\t\t\tif(\t$this->board[-2][-1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[0][-1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-1][-2]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('right', -1, -2);\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$moves[2][] = array('left', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[2][] = array('up', -3, -1);\n\t\t\t\t\t$moves[2][] = array('left', -3, 1);\n\t\t\t\t\t$moves[2][] = array('down', 0, -1);\n\t\t\t\t\t$moves[2][] = array('up', -3, -1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('right', -1, -2);\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$moves[2][] = array('left', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Right\n\t\t\t\tif(\t$this->board[-2][1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t$this->board[0][1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-1][2]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('left', -1, 2);\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$moves[3][] = array('right', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[3][] = array('up', -3, 1);\n\t\t\t\t\t$moves[3][] = array('right', -3, -1);\n\t\t\t\t\t$moves[3][] = array('down', 0, 1);\n\t\t\t\t\t$moves[3][] = array('up', -3, 1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('left', -1, 2);\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$moves[3][] = array('right', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Left\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][-3]->hasMarble &&\n\t\t\t\t$this->board[0][-3]->hasMarble &&\n\t\t\t\t$this->board[-1][-3]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Up\n\t\t\t\tif(\t$this->board[1][-2]->hasMarble &&\n\t\t\t\t\t$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[2][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('up', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[4][] = array('right', 1, -3);\n\t\t\t\t\t$moves[4][] = array('up', -1, -3);\n\t\t\t\t\t$moves[4][] = array('left', 1, 0);\n\t\t\t\t\t$moves[4][] = array('right', 1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('up', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Down\n\t\t\t\tif(\t$this->board[-1][-2]->hasMarble &&\n\t\t\t\t\t$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-2][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('up', -2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('down', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[5][] = array('right', -1, -3);\n\t\t\t\t\t$moves[5][] = array('down', 1, -3);\n\t\t\t\t\t$moves[5][] = array('left', 1, 0);\n\t\t\t\t\t$moves[5][] = array('right', -1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('up', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('down', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Right\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][3]->hasMarble &&\n\t\t\t\t$this->board[0][3]->hasMarble &&\n\t\t\t\t$this->board[-1][3]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Up\n\t\t\t\tif(\t$this->board[1][2]->hasMarble &&\n\t\t\t\t\t$this->board[1][1]->hasMarble &&\n\t\t\t\t\t$this->board[1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[2][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[6][] = array('left', 1, 3);\n\t\t\t\t\t$moves[6][] = array('up', -1, 3);\n\t\t\t\t\t$moves[6][] = array('right', 1, 0);\n\t\t\t\t\t$moves[6][] = array('left', 1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Down\n\t\t\t\tif(\t$this->board[-1][2]->hasMarble &&\n\t\t\t\t\t$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-2][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('down', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[7][] = array('left', -1, 3);\n\t\t\t\t\t$moves[7][] = array('down', 1, 3);\n\t\t\t\t\t$moves[7][] = array('right', -1, 0);\n\t\t\t\t\t$moves[7][] = array('left', -1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('down', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\treturn $moves;\n\t}", "public function isWin() {\n\t\tif ($_SESSION['game']->getState()==\"correct\") {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function initGame()\n {\n session_start();\n $this->newGame();\n if (!isset($_SESSION['game']) || $_SESSION['game']['remaining_ships'] < 1) {\n $this->newGame();\n } else {\n $this->loadGame($_SESSION['game']);\n }\n $this->play();\n $this->storeGame();\n $this->show();\n }", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "public function testCheckWinner()\n {\n $gamestate = $this->game->getGamestate();\n $this->game->holdHand();\n $this->assertNull($gamestate[\"hasWon\"]);\n\n $gamestate[\"active\"]->addPoints(100);\n $exp = $gamestate[\"active\"];\n $this->game->holdHand();\n\n $gamestate = $this->game->getGamestate();\n $this->assertEquals($exp, $gamestate[\"hasWon\"]);\n }", "private function endGame()\n {\n $this->hasWon = true;\n $this->calculatePoints();\n $this->setMessageToPlayer();\n }", "function _checkSetupPossibility($scenario_id, $player_id){ \r\n \r\n // this array is filled by the checks below!\r\n // it is returned to the calling function playScenario which evaluates what to do next! \r\n $returnData = array(\r\n 'Systemaccount' => array(\r\n 'user'=>null,\r\n 'passwd'=>null,\r\n 'id'=>false\r\n ),\r\n 'envSetupNeeded' => false,\r\n 'error' => null,\r\n 'scripts'=>array() //this will be filled with scenario data\r\n );\r\n \r\n // each player can only setup and play one scenario at a time!\r\n $other = $this->Scenariosetup->find('Scenariosetup.player_id='.$player_id, false);\r\n if(!empty($other)){\r\n $this->redirect('/game/evaluateScenario/'.$other['Scenario']['id'].'/'.$player_id);\r\n exit;\r\n }\r\n \r\n $scenario = $this->Scenario->read(null, $scenario_id);\r\n $player = $this->Player->read(null, $player_id);\r\n \r\n // check scenario/player data ---------------------------------------\r\n if (empty($scenario) || empty($player)){\r\n $returnData['error'] = 'scenario/player not found.';\r\n return $returnData;\r\n }\r\n \r\n // check if player is active ---------------------------------------\r\n if ($player['Player']['active']!=1){\r\n $returnData['error'] = 'Not allowed, Player is disabled!';\r\n return $returnData;\r\n }\r\n \r\n // check if player meets the required skills ---------------------------\r\n if (!$this->_playerHasRequiredSkills($scenario['Skill'], $player['Skill'])){\r\n $returnData['error'] = 'You do not have enough skills!';\r\n return $returnData;\r\n }\r\n \r\n // do the most important scenario checks here: (IF-Monster) ===============================================\r\n $singleScenario = $this->_isSingleScenarioRunning();\r\n if (!empty($singleScenario)){ // a single scenario is running:\r\n if ($singleScenario['id'] == $scenario_id){ // running same as requested? -----------\r\n if ($singleScenario['is_multiplayer_scenario']==1){\r\n // OKAY up to here, continue below this IF-Monster\r\n } else { // the running single scenario is not multiplayer: ------------------------------------------\r\n $returnData['error'] = 'Not allowed!<br />Someone else is doing this scenario already.';\r\n }\r\n } else { // running single scenario is not the same as requested: ---------------------------------\r\n $returnData['error'] = 'Not allowed!<br />A different single scenario is running.';\r\n }\r\n \r\n } else { // =================== NO single scenario is running: ======================================\r\n \r\n if ($scenario['Scenario']['is_multiplayer_scenario']){ // requested scenario is multi-player:\r\n $running = $this->Scenariosetup->find('scenario_id='.$scenario_id);\r\n if (!empty($running)){ // same multiplayer scenario is already running: --------------------\r\n // envSetupNeeded = false; //this is default already!\r\n } else { // the same multiplayer scenario is NOT running: -------------------------------------\r\n $returnData['envSetupNeeded'] = true; // IMPORTANT!\r\n $availableResources = $this->_getAvailableResources($scenario_id);\r\n if (!$availableResources){\r\n $returnData['error'] = 'Not allowed!<br />The resources are not available.';\r\n }\r\n }\r\n // OKAY!\r\n \r\n } else { // requested scenario is a single player scenario: ----------------------------------------\r\n \r\n $running = $this->Scenariosetup->find('scenario_id='.$scenario_id);\r\n if (empty($running)){ // single player is possible, because scenario is not running: ------------\r\n $returnData['envSetupNeeded'] = true; // IMPORTANT!\r\n $availableResources = $this->_getAvailableResources($scenario_id);\r\n if (!$availableResources){\r\n $returnData['error'] = 'All resources are in use, scenario setup impossible.';\r\n }\r\n // OKAY!\r\n } else { // single player is not possible somebody else has set it up already -----\r\n $returnData['error'] = 'Scenario setup not possible.<br />Somebody else plays this scenario already.';\r\n } \r\n }\r\n } // end of IF-Monster: ======================================================\r\n \r\n \r\n // When you get HERE, all checks have been successful until now.\r\n // now check for precompiled/player Systemaccount:\r\n if ($scenario['Scenario']['use_player']==0){ // the requested scenario uses system accounts: -------\r\n $possibleAccounts = $this->_getAvailableSystemaccounts($scenario_id);\r\n if (!empty($possibleAccounts)){ // player max is not reached (not all systemaccounts are in use):-------\r\n $rand = rand(0,(sizeof($possibleAccounts)-1)); // get a random id between 0 and size-1\r\n $returnData['Systemaccount'] = $possibleAccounts[$rand];\r\n // OKAY\r\n } else { // all Systemaccounts are in use! ---------------------------------------\r\n $returnData['error'] = 'Not allowed!<br />Someone else is playing this scenario already.';\r\n }\r\n } else {// the player user/password is used for scenario: --------------------------\r\n $returnData['Systemaccount']['user'] = $player['Player']['nick'];\r\n $returnData['Systemaccount']['passwd'] = $this->Session->read('Player.passwd_clear');\r\n }\r\n \r\n $returnData['Script'] = $scenario['Script'];\r\n return $returnData;\r\n }", "public function index()\r\n\t{\r\n\r\n\t\t$this->FarmGameModel->InitGame();\r\n\r\n\t\t$game_array = $this->FarmGameModel->GetGameInfo(true);\r\n\r\n\t\t// Check after init, turns are 0\t\t\t\t\t\t\r\n\t\t$expected_result = 0;\r\n\t\t$test = $game_array['turns'];\r\n\t\t$this->unit->run($test, $expected_result, 'init turns test');\r\n\r\n\t\t// Check after init, game over is 0\t\t\t\t\t\t\r\n\t\t$expected_result = 0;\r\n\t\t$test = $game_array['gameOver'];\r\n\t\t$this->unit->run($test, $expected_result, 'gameOver test');\r\n\r\n\t\t// Check after init, winStatus is 0\t\t\t\t\t\t\r\n\t\t$expected_result = 0;\r\n\t\t$test = $game_array['winStatus'];\r\n\t\t$this->unit->run($test, $expected_result, 'win test');\r\n\r\n\t\techo $this->unit->report();\r\n\t}", "public function gameGrid() {\n\n }", "public function rewardWinners(& $wins,& $table){\n\t\t$pots=& $table->game_pots;\n\t\t$leftOvers=$pots[\"left_overs\"]->amount;\n\t\t$x.=print_r($wins,true);\n\t\t$x.=\"\\n\\n\";\n\t\tforeach ($wins as $points=>$winners){// loop through winners by highest points , search for elegible pot then add that pot to the users'amount'\n\t\t\t$pot_on=count($winners); // how many winners for single pot ?\n\t\t\t$x.= \"got $pot_on winners with score of $points\\n\";\n\t\t\tif ($pon_on=='1'){\n\t\t\t\t$table->dealerChat($pot_on.' winner .');\n\t\t\t}elseif($pon_on>'1'){\n\t\t\t\t$table->dealerChat($pot_on.' winners .');\n\t\t\t}\n\t\t\t$winName=$this->getWinName($points);\n\t\t\t//generate win text\n\t\t\t$winText=' With <label class=\"hand_name\">'.$winName->handName.'</label>' ;\n\t\t\tif ($winName->handName=='High Card'){\n\t\t\t\t$winText.=' '.$winName->normalKicker ;\n\t\t\t}else{\n\t\t\t\tif (isset($winName->doubleKicker)){\n\t\t\t\t\t$winText.=' of '.$winName->doubleKicker ;\n\t\t\t\t}\n\t\t\t\tif ((isset($winName->normalKicker) && !isset($winName->doubleKicker)) || isset($winName->normalKicker) && isset($winName->doubleKicker) && $winName->doubleKicker!=$winName->normalKicker){\n\t\t\t\t\t$winText.=' and '.$winName->normalKicker.' kicker' ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($winners as $winnerId){\n\t\t\t\t$x.= \" - checking winner $winnerId :\\n\";\n\t\t\t\t//search for pots who has this player id\n\t\t\t\t$winPlayer=new Player($winnerId);\n\t\t\t\t\t$x.= \" - Winner is $winPlayer->display_name $winPlayer->seat_id has $ $winPlayer->amount :\\n\";\n\t\t\t\t\tforeach ($pots as $id=>$pot){\n\t\t\t\t\t\tif ($pot->amount>0 && $id!=='left_overs'){\n\t\t\t\t\t\t\t$pot->amount+=$leftOvers;\n\t\t\t\t\t\t\t$leftOvers=0;\n\t\t\t\t\t\t\tif (!isset($pot->original_amount)){$pot->original_amount=$pot->amount;}\n\t\t\t\t\t\t\t$winAmount=round($pot->original_amount/$pot_on);\n\t\t\t\t\t\t\tif (in_array($winnerId,$pot->eligible)!==false){\n\t\t\t\t\t\t\t\t$pots[$id]->amount-=$winAmount;\n\t\t\t\t\t\t\t\t$winPlayer->amount+=$winAmount;\n\t\t\t\t\t\t\t\t$table->dealerChat($winPlayer->profile_link.' has won the pot <label class=\"cash_win\">($'.$winAmount.')</label> '.$winText.' .');\n\t\t\t\t\t\t\t\tif ($winAmount>0){$winPlayer->won=5;}else{$winPlayer->won=0;}\n\t\t\t\t\t\t\t\tif (substr($winPlayer->bet_name,0,6)=='<label'){\n\t\t\t\t\t\t\t\t\t$oldAmount=substr($winPlayer->bet_name,26,strpos($winPlayer->bet_name,'</label>')-26);\n\t\t\t\t\t\t\t\t\t$oldAmount+=$winAmount;\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$oldAmount.'</label>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$winAmount.'</label>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$winPlayer->saveBetData();\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\n\t\t\t}//\n\t\t\t\n\t\t}//\n\t\tfile_put_contents('wins.txt',$x);\n\t\n\t}", "public function playLastGame()\n\t{\n\t\t$this->resetBoard();\n\t\t\n\t\tif($this->renderPlay)\n\t\t{\n\t\t\techo $this->renderBoard();\n\t\t}\n\t\t\n\t\t$db = new PegDB();\n\t\t\n\t\t$moves = $db->loadLastGame();\n\t\t\n\t\tforeach($moves as $move)\n\t\t{\n\t\t\t$this->move($move[0], $move[1]);\n\t\t}\n\t}", "function _assignMatchesDo() {\n\t\tdefined('_JEXEC') or die( 'Invalid Token' );\n\n\t\t// Turnierdaten!\n\t\t$tournament = new CLMTournament($this->id, true);\n\t\t// $tournament->data->typ\n\n\t\tif (($tournament->data->tl != clm_core::$access->getJid() AND $clmAccess->access('BE_tournament_edit_round') !== true) OR $clmAccess->access('BE_tournament_edit_round') === false) {\n\t\t\t$this->app->enqueueMessage( JText::_('TOURNAMENT_NO_ACCESS'),'warning' );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($tournament->data->typ == 2) {\n\t\t\t// Vollturnier nur via Rundenerstellung!\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'IMPOSSIBLE' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t} elseif ($tournament->data->typ == 3) { // KO\n\t\t\t// maximal bestätige Runde holen - ist hier MIN(nr)\n\t\t\t$query = 'SELECT MIN(nr) FROM #__clm_turniere_rnd_termine'\n\t\t\t\t. ' WHERE turnier = '.$this->id.' AND tl_ok = 1';\n\t\t\t$this->_db->setQuery( $query );\n\t\t\tif ($tlokMin = $this->_db->loadResult()) {\n\t \t\t\t$roundToDraw = $tlokMin-1;\n\t \t\t} else {\n\t \t\t\t$roundToDraw = $tournament->data->runden;\n\t\t\t}\n\t\t\t// nächste zu vervollständigende Runde ermittelt\n\t\t\tif ($roundToDraw == 0) { // dann gibt es nichts mehr zu tun\n\t\t\t\t$this->app->enqueueMessage( JText::_('NO_ROUND_LEFT'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Frage: sind in dieser Runde schon Partien angesetzt?\n\t\t\t$query = 'SELECT COUNT(*)'\n\t\t\t\t\t. ' FROM #__clm_turniere_rnd_spl'\n\t\t\t\t\t. ' WHERE turnier = '.$this->id.' AND runde = '.$roundToDraw.' AND ((spieler >= 1 AND gegner >= 1) OR ergebnis = 8)';\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$matchesAssigned = $this->_db->loadResult();\n\t\t\t\n\t\t\tif ($matchesAssigned > 0) { // bereits Matches angelegt\n\t\t\t\t$this->app->enqueueMessage( JText::_('MATCHES_ASSIGNED_ALREADY'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// OKay, jetzt kann angesetzt werden\n\t\t\t// alle Spieler, die 'in' sind holen\n\t\t\t$query = \"SELECT snr \"\n\t\t\t\t\t. \" FROM #__clm_turniere_tlnr\"\n\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND koStatus = '1'\";\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$playersIn = $this->_db->loadAssocList('snr');\n\t\t\t\n\t\t\t// wieviele Matches werden benötigt? \n\t\t\t// Spielerzahl - (maximale Matches der Runde / 2)\n\t\t\t// maximale Matches der Runde: 2^Runde\n\t\t\t$neededMatches = (count($playersIn) - pow(2, $roundToDraw)/2);\n\t\t\t\n\t\t\t// TODO: Sicherheitscheck, ob diese Boards wirklich vorhanden!\n\t\t\t\n\t\t\t// jetzt setzen wir an jedes Board eine Zufallspaarung\n\t\t\t\n\t\t\t// Matches zusammenstellen\n\t\t\t$sid = $tournament->data->sid;\n\t\t\tfor ($m=1; $m<=$neededMatches; $m++) {\n\t\t\t\t// Spieler 1\n\t\t\t\t$player1 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player1]);\n\t\t\t\t// Spieler 2\n\t\t\t\t$player2 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player2]);\n\t\t\t\t// SQL\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player1.\", spieler = \".$player1.\", gegner = \".$player2\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '1'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player2.\", spieler = \".$player2.\", gegner = \".$player1\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '0'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$this->app->enqueueMessage( JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED') );\n\t\n\t\t\t// Log\n\t\t\t$clmLog = new CLMLog();\n\t\t\t$clmLog->aktion = JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED');\n\t\t\t$clmLog->params = array('sid' => $tournament->data->sid, 'tid' => $this->id, 'rnd' => $roundToDraw); // TurnierID wird als LigaID gespeichert\n\t\t\t$clmLog->write();\n\t\n\t\n\t\t} elseif ($tournament->data->typ == 1) { // CH\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'NOTIMPLEMENTED' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\n\t}", "public function GenerateLegalBishopMoves($chesspiece, $x, $y){\n\t\t//examine top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine top left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n \n return true;\n\t}", "public function checkValidMove($userMove){\r\n if(!is_numeric($userMove) ||$userMove < 1 || $userMove > Board::COLUMNS){ \r\n invalidInputMsg($this->currentPlayer);\r\n return false;\r\n }\r\n return true;;\r\n }", "function game_is_broken($game) {\n\tif ($game->is_tie()) {\n\t\techo \"\\n\\n****ERROR: Broken Game. Tie! in game_is_broken()\";\n\t\tpause(\"\");\n\t\treturn true;\n\t}\n\treturn false;\n}" ]
[ "0.7445252", "0.6682662", "0.66092634", "0.64298415", "0.6396222", "0.6342407", "0.63309914", "0.63021696", "0.62961656", "0.62457556", "0.6189297", "0.616316", "0.6143622", "0.6142093", "0.6102478", "0.6064995", "0.60588455", "0.6046753", "0.60364634", "0.6004795", "0.5947546", "0.5917081", "0.5861418", "0.58612424", "0.5847238", "0.58133495", "0.57826734", "0.57781225", "0.57665473", "0.5750737", "0.5718349", "0.57156664", "0.57060385", "0.56660265", "0.5633748", "0.56278557", "0.55934393", "0.55654275", "0.5562924", "0.55405587", "0.553212", "0.55033916", "0.54892284", "0.5485676", "0.5467947", "0.5467583", "0.54316795", "0.54268086", "0.54200006", "0.54080325", "0.5407341", "0.5396945", "0.53940237", "0.5375987", "0.53711766", "0.5361765", "0.5355176", "0.5338575", "0.5331191", "0.5330101", "0.5324948", "0.53215015", "0.530148", "0.5287498", "0.52861494", "0.5271962", "0.52687734", "0.52598906", "0.52589154", "0.52536535", "0.52478826", "0.52470994", "0.52288324", "0.5218676", "0.5210606", "0.5207933", "0.5207896", "0.52034926", "0.51831585", "0.5180913", "0.5171673", "0.5171079", "0.5166567", "0.51652", "0.5163812", "0.51605344", "0.51570517", "0.5148616", "0.5143682", "0.5143403", "0.5123881", "0.51035357", "0.51033854", "0.51013905", "0.5092791", "0.5087987", "0.5079633", "0.5056836", "0.5048554", "0.5042458" ]
0.68577087
1
Function select random player and print message to inform
protected function selectPlayer(){ $this->currentPlayer = rand(1,2); selectRandPlayerMsg($this->currentPlayer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function onPlayerSelect();", "public function play($choice){\n $yourChoice = trim(strtoupper($choice));\n if($yourChoice == 'ROCK'){\n $playerOne = 1;\n $playerTwo = rand(1,3);\n $this->checkForWinner($playerOne,$playerTwo);\n }elseif($yourChoice == 'PAPER'){\n $playerOne = 2;\n $playerTwo = rand(1,3);\n $this->checkForWinner($playerOne,$playerTwo);\n }elseif($yourChoice == 'SCISSOR'){\n $playerOne = 3;\n $playerTwo = rand(1,3);\n $this->checkForWinner($playerOne,$playerTwo);\n }else{\n throw new Exception(\"You need to make right choice!\");\n }\n }", "public function putOnRandomGameKit(Player $p) {\n\t\t$kittype = array_rand ( $this->kits );\n\t\t$selectedKit = $this->kits [$kittype];\n\t\t$this->putOnGameKit ( $p, $selectedKit );\n\t}", "public function random();", "function displayPoints($randomVal1,$randomVal2,$randomVal3)\n {\n \n echo \"<div id='output'>\";\n if(($randomVal1 == $randomVal2) && ($randomVal3 == $randomVal2)){\n switch($randomVal1) //Any at this point to figure out the suit\n {\n case 0:\n $totalPoints = 1000 ;\n echo \"<h1>Jackpot</h1>\";\n $soundfile = \"./inc/JackPot.mp3\";\n break;\n case 1:\n $totalPoints = 500 ;\n $soundfile = \"./inc/WonSomething.mp3\";\n break;\n case 2:\n $totalPoints = 250 ;\n $soundfile = \"./inc/WonSomething.mp3\";\n break;\n case 3:\n /* case 4:\n case 5:\n case 6:*/\n $totalPoints = 900 ;\n $soundfile = \"./inc/WonSomething.mp3\";\n break;\n }\n echo \"<h2>You Won $totalPoints points!</h2>\";\n \n }\n else\n {\n echo \"<h3> Try Again </h3>\";\n //$soundfile = \"./inc/FailEffect.mp3\";\n }\n echo \"<audio autoplay='autoplay'>\";\n echo \"<source src='$soundfile'/>\";\n echo \"</audio>\";\n echo \"</div>\";\n }", "private function generatePlayers() : void\n {\n $indexes = array_rand($this->availablePlayerNames, $this->numOfPlayers);\n \n $firstIndex = $indexes[0];\n $firstName = $this->availablePlayerNames[$firstIndex];\n\n $firstPlayer = new Player();\n $firstPlayer->setName($firstName);\n\n $this->firstPlayer = $firstPlayer;\n $this->curPlayer = $this->firstPlayer;\n\n for ($i=1; $i < count($indexes); $i++) {\n $curIndex = $indexes[$i];\n $curName = $this->availablePlayerNames[$curIndex];\n\n $curPlayer = new Player();\n $curPlayer->setName($curName);\n \n $this->curPlayer->setNext($curPlayer);\n\n $this->curPlayer = $this->curPlayer->getNext();\n }\n }", "function challangeRandom() {\r\n // random number between 10 and 99\r\n $random = rand(10,99);\r\n $say = \"<Say voice='gcloud.en-GB-Standard-F' loop='2'>Please type the following number, $random, then press pound.</Say>\";\r\n return [$random, $say];\r\n}", "private function pickWinner(OutputInterface $output)\n {\n $winner = $this->entries[rand(0, count($this->entries) - 1)];\n\n $text = '';\n $text .= $winner->user_display_name . ' - ' . substr(str_replace(PHP_EOL, ' ', $winner->comment ?: '<< no comment >>'), 0, 200) . PHP_EOL;\n $text .= ' - ' . isset($winner->uri) ? $winner->uri : $winner->event_uri;\n\n $this->io->success($text);\n }", "public function getPlayer();", "public function findRandom();", "private function setMessageToPlayer()\n {\n if ($this->isUserMode()) {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng. Vill du vara med i tävlingen, spara poängen med den gröna knappen!\";\n } else {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng!\";\n }\n }", "function zuus_player() {\n\t$directory = get_template_directory() . '/images/zuus_player/';\n\t$files = glob($directory . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);\n\n\t$image = '';\n\tif($files !== false) { \n\t\t$file = array_rand($files);\n\t\t$image = basename($files[$file]);\n\t}\n\t\n\tif($image != '') {\n\t\techo '<div class=\"zuus_player\">';\n\t\t\techo '<img class=\"img-responsive\" alt=\"zuus_player\" src=\"' . THEME_DIR . '/images/zuus_player/' . $image .'\" />';\n\t\techo '</div>';\n\t}\n\t\n}", "private function getRandomSayText()\n {\n $texts = [\n 'They see me rollin\\'',\n '*whistle*',\n 'I\\'m walking on sunshine',\n ];\n $rand = mt_rand(0, count($texts) - 1);\n\n return $texts[$rand];\n }", "function playerSentToPenaltyBox($currentPlayer) {\n\t}", "public function randomItem();", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "function checkPlayPos($given_pos){\n $player_ID = $_SESSION['login_user'];\n $play_pos = mysql_fetch_array(mysql_query(\"select * from Player where ID = '$player_ID';\"))['PlayPos'];\n if(!strcmp($play_pos,$given_pos))\n echo \"selected=\\\"selected\\\"\";\n }", "public function genius(){\n $aNames = array('name-1', 'name-2', 'name-3');\n\n // Pick random index number from array aNames\n $iKey = array_rand($aNames);\n\n // Return the name using the random index\n return $aNames[$iKey];\n\n }", "public function onRun($currentTick) {\n\t\t$onlinePlayers = \\pocketmine\\Server::getInstance()->getOnlinePlayers();\n// \t\tforeach ($onlinePlayers as $player) {\n// \t\t\tif (self::needPetMessage($player)) {\n// \t\t\t\tPets::sendPetMessage($player, Pets::PET_LOBBY_RANDOM);\n// \t\t\t}\n// \t\t}\n\t}", "private function decideVictory()\n {\n echo 'Jugador ';\n if (!$this->human->isOver() &&\n (\n ($this->human->getPoints() == $this->machine->getPoints() && $this->human->getPoints() != PLAYER_WIN_POINTS)\n || $this->human->getPoints() > $this->machine->getPoints()\n || $this->machine->isOver()\n )\n ) echo 'Humano';\n else echo 'Máquina';\n echo ' gana la partida. ';\n }", "public function randomFunc() {\n return \"RANDOM\";\n }", "public function PracticeLobbySelector(Player $player){\n $form = new SimpleForm(function (Player $player, ?int $data){\n if (!is_null($data)){\n $prefix = \"§l§a» §fConnecting to the server...\";\n switch ($data){\n\n case 0:\n $player->sendMessage($prefix);\n $this->plugin->getScheduler()->scheduleRepeatingTask(new LP1($this->plugin, $player), 20);\n break;\n case 1:\n $player->sendMessage($prefix);\n $this->plugin->getScheduler()->scheduleRepeatingTask(new LP2($this->plugin, $player), 20);\n break;\n case 2:\n self::navigatorForm($player);\n break;\n default:\n return;\n }\n }\n });\n $form->setTitle(\"§l§cEndGames §7| §fPractice\");\n $images = [\n \"return\" => \"textures/ui/refresh_light\",\n \"lobby\" => \"textures/gui/newgui/mob_effects/strength_effect\"\n ];\n try {\n $lobby1 = PMQuery::query(\"207.244.228.121\", 19122);\n $lobby2 = PMQuery::query(\"207.244.228.121\", 19123);\n $lp1 = (int)$lobby1['Players'].\"§7/§a60\";\n $lp2 = (int)$lobby2['Players'].\"§7/§a60\";\n } catch (PmQueryException $e){\n $lp1 = \"§cOFFLINE\";\n $lp2 = \"§cOFFLINE\";\n }\n $form->addButton(\"§l§6LOBBY 1\\n§r§7Players Connected: §a\".$lp1, 0, $images[\"lobby\"]);\n $form->addButton(\"§l§6LOBBY 2\\n§r§7Players Connected: §a\".$lp2, 0, $images[\"lobby\"]);\n $form->addButton(\"§cReturn\", 0, $images[\"return\"]);\n\n $player->sendForm($form);\n\n }", "function random(){\n $randomnummer = rand(1,6);\n return $randomnummer;\n}", "function play_song($array){\n\tglobal $searchquery;\n\tglobal $song_returned_id, $number_of_moods;\n\tif ($array != NULL) {\n\t$randomnumber = rand(0, count($array)-1);\n\t//echo $randomnumber;\n\t//echo count($array);\n\tforeach ($array as $key => & $sub_array) {\n\t\tif ($key == $randomnumber) {\n\t\t\techo \"you are listening to {$sub_array[\"name\"]} by {$sub_array[\"artist\"]} tagged \" . $GLOBALS['searchquery'] .\"<br />\";\n\t\t\techo \"<audio controls id=\\\"player\\\" src=\" . $sub_array[\"path\"] .\">\n\t\t\tYour browser does not support the audio element.\n\t\t\t</audio>\"; \n\t\t\t$song_returned_id = $sub_array[\"songid\"];\n\t\t\t//echo \"song\".$song_returned_id;\n\t\t}\n\t}\n\t\techo \"tags: \";\n\t\t// echo the tags for the song\n\tforeach ($array as $key => & $sub_array) {\n\t\tif ($sub_array['songid'] == $song_returned_id) {\n\t\t\techo $sub_array['mood'] . \" \";\n\t\t}\n\n\t}\n\t} else { \n\t\tif ($searchquery != \"random\"){\n\t\t\techo \"Sorry we don't have \" . $searchquery . \" in our database. \";\n\t\t\techo \"To see all the tagged moods, please check out <a href=\\\"sensation2.php\\\"> All the moods </a><br />\";\n\t\t}\n\t\t// free mysqli result\n\t\tmysqli_free_result($GLOBALS['dbresult']);\n\t\t// make a new query to get all the songs in the database, and then to play a random one from that selection\n\t\t$sqlquery = \"SELECT * FROM moods\";\n\t\t$sqlquery .= \" INNER JOIN map\";\n \t$sqlquery .= \" ON moods.tagid = map.tagid\";\n \t$sqlquery .= \" INNER JOIN songs\";\n \t$sqlquery .= \" ON songs.songid = map.songid\";\n\n\t\t$dbresult = mysqli_query($GLOBALS['connection'], $sqlquery);\n\t// test if query succeeded./ if there was a query error\n\tif (!$dbresult){\n\t\tdie(\"Database query failed.\");\n\t}\n\n\t\t// get the first row from that result set and asign it to row, store all of those rows in an array of arrays called $dbarray, which can be used to compare to the original one\n\t$db_rand_song = array();\n\twhile($row = mysqli_fetch_assoc($dbresult)){\n \t\t$db_rand_song[] = $row;\n\t\t}\n\n\t\t// play a random song from the database\n\t\tif ($db_rand_song != NULL) {\n\t$randomnumber = rand(0, count($db_rand_song)-1);\n\t//echo $randomnumber;\n\t//echo count($array);\n\t//print_r($db_rand_song);\n\tforeach ($db_rand_song as $key => & $sub_array) {\n\t\tif ($key == $randomnumber) {\n\n\t\t\techo \"Now playing a random mood from our database: {$sub_array['name']} by {$sub_array['artist']} <audio controls id=\\\"player\\\" src=\" . $sub_array[\"path\"] .\">\n\t\t\tYour browser does not support the audio element.\n\t\t\t</audio>\";\n\t\t\t$song_returned_id = $sub_array[\"songid\"];\n\t}}}}\n\t//mysqli_free_result($dbresult);\n}", "public function generateUsername()\n {\n $dir = \"@Give2PeerBundle/Resources/config/\";\n $path = $this->get('kernel')->locateResource($dir . 'game.yml');\n\n $words = Yaml::parse(file_get_contents($path));\n\n $adjectives = array_merge(\n $words['quantity']\n ,$words['quality']\n ,$words['size']\n ,$words['age']\n ,$words['shape']\n ,$words['color']\n ,$words['origin']\n ,$words['material']\n ,$words['qualifier']\n );\n \n $beings = $words['being'];\n\n $a1 = $a2 = '';\n $i = 0; // BAD. pop out of $adjectives instead ?\n while ($a1 == $a2 && $i < 42) {\n $i1 = array_rand($adjectives);\n $i2 = array_rand($adjectives);\n $a1 = $adjectives[min($i1, $i2)];\n $a2 = $adjectives[max($i1, $i2)];\n $i++;\n }\n\n if ($a1 == $a2) { // we have a lottery winner\n $a1 = \"Incredibly\";\n $a2 = \"Unlucky\";\n }\n\n $b = $beings[array_rand($beings)];\n\n $x = random_int(0, 9);\n $y = random_int(0, 9);\n $z = random_int(0, 9);\n \n // About 406 billion right now\n // $nb = count($beings) * (count($adjectives) ** 2) * 1000;\n // print(\"Possibilities : $nb\\n\");\n\n return \"${a1} ${a2} ${b} ${x}${y}${z}\";\n }", "function displaySymbol($randomValue){\n //using conditions\n //$randomValue = rand(0,4);\n echo $randomValue;\n \n /*\n if($randomValue == 0){\n $symbol =\"cherry\";\n }\n else if($randomValue == 1){\n $symbol =\"grapes\";\n }\n else if($randomValue == 2){\n $symbol =\"lemon\";\n }\n else if($randomValue == 3){\n $symbol =\"orange\";\n }\n else {\n $symbol =\"seven\";\n }\n */\n \n //trhee or more if statements\n switch ($randomValue){\n case 0 :\n $symbol =\"cherry\";\n break;\n case 1 :\n $symbol =\"grapes\";\n break;\n case 2 :\n $symbol =\"lemon\";\n break;\n case 3 :\n $symbol =\"orange\";\n break;\n case 4 :\n $symbol =\"seven\";\n break;\n }\n echo \"<img src='img/$symbol.png' alt='$symbol' title='\". ucfirst($symbol) .\"' width='70' >\";\n }", "function getRandomGames() {\n return DBcommand(\"SELECT * FROM games WHERE suggestion = 0 ORDER BY RAND() LIMIT 5\", [])['output'];\n}", "function scrapbots_choose_fighter ($army){\n\tdebug(\"Choosing fighter, here is the army:\");\n\tdebug($army);\n\t//get a fighter at random\n\t$fighter = \"none\";\n\twhile ($fighter == \"none\"){\n\t\t$bot = e_rand(0,(count($army)-2));\n\t\tif (e_rand(1,100) < ($army[$bot]['briskness'] * 10)){\n\t\t\tdebug (\"Fighter Chosen:\");\n\t\t\t$fighter = $army[$bot];\n\t\t\tdebug ($fighter);\n\t\t} else {\n\t\tdebug(\"Fighter failed Briskness check. Choosing again.\");\n\t\t}\n\t}\n\treturn $fighter;\n}", "function greeting()\r\n\t{\r\n\t\t$greeting = array(\r\n\t\t\t'Hi!', 'Hello,', 'Hello there,', 'Hi there,',\r\n\t\t\t'Hey yo!', 'Zzup!', 'Yo, man!', 'Sup?!',\r\n\t\t\t'Holla!', 'Hallo,', 'Bonos díes!', 'Saluton!',\r\n\t\t\t'Bonjour!', 'Salut!', 'Aloha!', 'Salute,',\r\n\t\t\t'¡Hola!', 'Ciao!',\r\n\t\t);\r\n\t\treturn $greeting[array_rand($greeting)];\r\n\t}", "function compete($a,$b){\n $p = intval(100 * getWinProb($a['elo']-$b['elo']));\n $expected = ($a['elo']>=$b['elo']) ? $a['name'] : $b['name'];\n $percent = ($a['elo']>=$b['elo']) ? $p.'%' : (100-$p).'%';\n $n = mt_rand(1,100);\n $winner = ($n<=$p) ? $a['name'] : $b['name'];\n \n //echo sprintf(\"Now Playing: %s (%s) vs. %s (%s) \\n\", $a['name'], $a['elo'], $b['name'], $b['elo']);\n //echo sprintf(\"Expected winner: %s (%s)\\n\", $expected, $percent);\n //echo sprintf(\"Actual winner: %s\\n\\n\", $winner);\n return ($n<=$p) ? $a : $b;\n}", "function stat_player(){\n // richiamo la funzione per generare il codice giocatore\n $codice_giocatore = genera_codice();\n // genero le statistiche giocatore\n $punti_fatti= rand(0, 100);\n $rimbalzi = rand(30, 200);\n $falli = rand(0, 100);\n\n // mi genero le percentuali\n $perc2= rand(0,1000)/10;\n $perc3= (100 - $perc2);\n\n $giocatore =[\n [\n 'id'=>$codice_giocatore,\n 'punti fatti'=> $punti_fatti,\n 'rimbalzi'=>$rimbalzi,\n 'falli'=>$falli,\n 'perc. tiri da 2'=>$perc2,\n 'perc. tiri da 3'=>$perc3\n ]\n ];\n return $giocatore ;\n}", "private function playHuman()\n {\n do {\n echo \"Jugador Humano pide carta.\\n\";\n\n $card = new Card($this->memory);\n $this->human->receiveCard($card);\n $this->memory->add($card);\n $points = $this->human->getPoints();\n\n echo \"\\tHas sacado \" . $card . '. LLevas ' . $points . ' punto' . ($points > 1 ? 's' : '') . '.';\n\n if ($this->human->isOver())\n echo \"\\n\";\n else {\n do {\n echo 'Plantarse (p) o Continuar (c) ';\n fscanf(STDIN, \"%s\\n\", $response);\n\n if ($response === \"p\") {\n echo \"Jugador Humano se planta.\\n\";\n return;\n }\n } while ($response != 'p' && $response != 'c');\n }\n } while (!$this->human->isOver());\n }", "public function _random() {\n\t\tif( $this->type == 'image' ) {\n\t\t\t$files = PSUFiles::getImageArray($this->base_dir.$this->dir, 0, $this->depth);\n\t\t} else {\n\t\t\t$files = PSUFiles::getImageArray($this->base_dir.$this->dir, 0, $this->depth, array('txt', 'html'));\n\t\t}//end if\n\n\t\t$this->set( PSUFiles::chooseRandomElement($files) );\n\t}", "function playLottery($fname, $email, $number, $code, $mailing, $playerChoise, $conn)\n{\n $prizesAmount = amountOfAvailablePrizesToday($conn);\n $result = array();\n if ($prizesAmount > 0) {\n $lastWin = whenWasTheLastWin($conn);\n $chance = chanceToWin($lastWin);\n //decide if used wins\n if ($chance != 0 && rand(1, 100) < $chance) {\n // changing the code status and full fill the user data to it\n updateCode($fname, $email, $number, $code, $mailing, 'won', $conn);\n $result[9] = \"true\";\n // take all the available prizes (not given to other users)\n $list = getAvailablePrizes($conn);\n // take one prize\n $prizeOpt = $list[rand(0, count($list) - 1)];\n $prizeName = $prizeOpt[0];\n $prizeValue = $prizeOpt[1];\n $prizeVoucher = getRandomVoucher($prizeName, $prizeValue, $conn);\n $price = $prizeOpt[1];\n $result[$playerChoise - 1] = [$prizeName, $price];\n // change prize's status as given\n updatePrize($prizeName, $prizeValue, $prizeVoucher, $email, $conn);\n // HERE YOU CONNECT SEDNING EMAILS\n sendEmail($email, $code, $fname, $prizeName, $prizeValue);\n } else {\n // changing the code status and full fill the user data to it\n updateCode($fname, $email, $number, $code, $mailing, 'loose', $conn);\n $result[9] = \"false\";\n $result[$playerChoise - 1] = ['loose'];\n }\n } else {\n $result[9] = \"false\";\n $result[$playerChoise - 1] = ['loose'];\n }\n if ($result[9] == \"false\") {\n }\n\n $result = generateOthersPrizes($result, $playerChoise);\n for ($i = 0; $i < 9; $i++) {\n if (is_null($result[$i])) {\n $result[$i] = ['loose'];\n }\n }\n $conn->close();\n echo json_encode($result);\n}", "function Start_Again() {\n\t//choose new number\n $number = rand(1,100);\n //print text guess a number\n print(\"Guess a number between 1 and 100\");\n Display_Form($number);\n}", "public function randomName() {}", "public function setRandomTypeOfBattle()\n {\n switch(rand(0, 9)) {\n case 0: return 'Mountain';\n case 1: return 'Water';\n case 2: return 'Open land';\n case 3: return 'Water';\n case 4: return 'Open land';\n case 5: return 'Woods';\n case 6: return 'Woods';\n case 7: return 'Water';\n case 8: return 'Open land';\n case 9: return 'Open land';\n }\n }", "function random(int $min, int $max){\n\treturn \"Random entre \".$min.\" et \".$max;\n}", "function recruitPlayer($cxn,$player,$request)\r\n {\r\n \r\n }", "function rewards(){\r\n $rand = rand(1, 5);\r\n return \"rewards\" . $rand;\r\n}", "public function picked(){\n }", "private function welcome_players()\n\t{\n\t\t$players = $this->players->all(); \n\n\t\t\n\t\t$players_array = array ();\n\t\tforeach ($players as $player)\n\t\t{\n\t\t\t$player['equity'] = $this->players->equity($player['player']);\n\t\t\t$players_array[] = (array) $player;\n\t\t}\n\t\t$this->data['test'] = $players_array; \n\t}", "static function getDesktopRand();", "function newPlayer($player) {\n\n\t\t// creates player object ...\n\t\t$player_item = new Player($player);\n\t\tif ($player_item->login == \"\")\n\t\t\t{\n\t\t\t//$this->console(\"New broken Player entered - ignored.\");\n\t\t\treturn;\n\t\t\t}\n\t\t\n\t\tif ($player_item->id == $this->lastloginid)\n\t\t\t{\n\t\t\t//$this->console(\"Dublicated join event - ignored.\");\n\t\t\treturn;\n\t\t\t}\n\t\t$this->lastloginid = $player_item->id;\n\n\t\t// adds a new player to the intern player list ...\n\t\t$this->server->players->addPlayer($player_item);\n\n\t\t// display console message ...\n\t\t$this->console('<< player {1} joined the game [{2}]',\n\t\t\t$player_item->id,\n\t\t\t$player_item->login);\n\n\t\t// send chat message to player ...\n\t\t// format message parameters ...\n\t\t$message = myWelcomeMessage($this, $player_item);\n\n\t\t// replace colors ...\n\t\t$message = $this->formatColors($message);\n\n\t\t// send the message ...\n\t\t$message = str_replace('{br}', \"\\n\", $message);\n\t\tif ($this->settings['welcome_msg_window']) {\n\t\t \tif ($player_item->login)\n\t\t\t\tpopup_msg($player_item->login, $message, 10000);\n\t\t} else {\n\t\t\t$this->client->addCall('ChatSendServerMessageToLogin', array(str_replace(\"\\n\\n\", \"\\n\", $message), $player_item->login));\n\t\t\t$this->client->multiquery();\n\t\t}\n\n\t\t// release a new player connect event ...\n\t\t$this->releaseEvent('onPlayerConnect', $player_item);\n\t}", "function newGameID()\n{\n return randomString();\n}", "function aurora_borealis() {\n\t$chosen = steamed_hams_get_lyric();\n\techo \"<p id='seymour'>$chosen</p>\";\n}", "function w18ol_ajax_get_oneliner() {\n\tglobal $oneliners;\n\t$oneliner_index = array_rand($oneliners);\n\t$oneliner = $oneliners[$oneliner_index];\n\techo $oneliner;\n\t// echo $oneliners[array_rand($oneliners)];\n\twp_die();\n}", "public static function random(){\n $conexion = StorianDB::connectDB();\n $query = $conexion->query(\"SELECT * FROM cuento ORDER BY RAND() LIMIT 1\");\n return $tabla = $query->fetchObject();\n }", "function display_player_name($id) {\n\t\n\tglobal $zurich;\n\t\n\t/* softbot's ids are preceded by * in the log; remove this */\n\tif ($id{0} == '*') {\n\t\t$robot = true;\n\t\t$id = substr($id, 1);\n\t}\n\telse $robot = false;\n\t\n\tswitch($id) {\n\t\tcase 'water_utility': $colour = \"#0000ff\"; break; /* blueberry */\n\t\tcase 'waste_water_utility': $colour = \"#804000\"; break; /* mocha */\n\t\tcase 'housing_assoc_1': $colour = \"#ff6666\"; break; /* salmon */\n\t\tcase 'housing_assoc_2': $colour = \"#800040\"; break; /* maroon */\n\t\tcase 'manufacturer_1': $colour = \"#808000\"; break; /* asparagus */\n\t\tcase 'manufacturer_2': $colour = \"#008040\"; break; /* moss */\n\t\tcase 'politician': $colour = \"#ff8000\"; break; /* tangerine */\n\t\tcase 'bank': $colour = \"#ff66cc\"; break; /* carnation */\n\t\tdefault: $colour = \"#000000\"; break; /* black */\n\t}\n\t\n\t/* translate between id and name for player ids */\n\tforeach ($zurich->players as $p) {\n\t\tif ($id == $p->id) {\n\t\t\t$name = $p->name;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!isset($name)) $name = $id;\n\tif ($robot) $name = strtolower($name);\n\t\t\n\treturn \"<font color=$colour>$name</font>\";\n}", "abstract public function winner();", "public function SkywarsLobbySelector(Player $player){\n try {\n $sw1 = PMQuery::query(\"sw1\", 19135);\n $sw2 = PMQuery::query(\"sw2\", 19135);\n $sw3 = PMQuery::query(\"sw2\", 19135);\n $plsw1 = (int)$sw1['Players'].\"§7/§a50\";\n $plsw2 = (int)$sw2['Players'].\"§7/§a50\";\n $plsw3 = (int)$sw3['Players'].\"§7/§a50\";\n } catch (PmQueryException $e){\n $plsw1 = \"§cOFFLINE\";\n $plsw2 = \"§cOFFLINE\";\n $plsw3 = \"§cOFFLINE\";\n }\n $form = new SimpleForm(function (Player $player, ?int $data){\n if (!is_null($data)){\n switch ($data){\n\n case 0:\n $player->sendMessage(self::EXEPCION);\n //$this->plugin->getScheduler()->scheduleRepeatingTask(new LP1($this->plugin, $player), 20);\n break;\n case 1:\n $player->sendMessage(self::EXEPCION);\n break;\n case 2:\n $player->sendMessage(self::EXEPCION);\n break;\n case 3:\n self::navigatorForm($player);\n break;\n default:\n return;\n }\n }\n });\n $form->setTitle(\"§l§cEndGames §7| §6SkyWars\");\n $images = [\n \"return\" => \"textures/ui/refresh_light\",\n \"sw\" => \"textures/items/bow_pulling_0\"\n ];\n $form->addButton(\"§l§6LOBBY 1\\n§r§7Players Connected: §a\".$plsw1, 0, $images[\"sw\"]);\n $form->addButton(\"§l§6LOBBY 2\\n§r§7Players Connected: §a\".$plsw2, 0, $images[\"sw\"]);\n $form->addButton(\"§l§6LOBBY 3\\n§r§7Players Connected: §a\".$plsw3, 0, $images[\"sw\"]);\n $form->addButton(\"§cReturn\", 0, $images[\"return\"]);\n\n $player->sendForm($form);\n\n }", "function getPlayerArray(){\n $players = array(\"Chang\", \"Heath\", \"Jeff\", \"Tupac\");\n shuffle($players);\n return $players;\n}", "public function orderRandom();", "public function actionRandomSongView()\n {\n $song = Song::getRandomSong();\n\n if ($song) {\n $song->hit = $song->hit + 1;\n\n if (Yii::$app->session->get('last_page') != Yii::$app->request->getReferrer()) {\n Song::plusHit($song->id);\n Singer::plusHit($song->singer->id);\n }\n\n return $this->render('song-view', [\n 'song' => $song\n ]);\n } else {\n Yii::$app->response->statusCode = 404;\n\n return $this->render('error', ['name' => 'Not Found']);\n }\n }", "public function start() {\r\n\r\n $this->stepTick = $this->getMain()->getServer()->getTick();\r\n\r\n $count = count($this->players);\r\n\r\n $this->step = self::STEP_HIDE;\r\n\r\n $this->seekersCount = ceil($count * ($this->getSeekersPercentage() / 100)); // Minimum $this->getSeekersPercentage() percents of the players (inimum because if there are less than $this->getSeekersPercentage(), then there could be no seeker)\r\n\r\n $this->hidersLeft = count($this->players) - $this->seekersCount;\r\n\r\n\r\n\r\n shuffle($this->players);\r\n\r\n $i = 0;\r\n\r\n foreach($this->players as $p) {\r\n\r\n if($i < $this->seekersCount) {\r\n\r\n $this->players[$i]->HideAndSeekRole = self::ROLE_SEEK;\r\n\r\n $this->players[$i]->sendTip(\"§4You're a seeker.\");\r\n\r\n } else {\r\n\r\n $this->players[$i]->HideAndSeekRole = self::ROLE_HIDE;\r\n\r\n $this->players[$i]->sendTip(\"§4You're an hider.\");\r\n\r\n }\r\n\r\n $i++;\r\n\r\n }\r\n\r\n }", "public function switchPick($randomNumber)\n{\n\tswitch ($randomNumber)\n\t{\n\t\tcase 1: $wordOne = $this->pickOne();\n\t\tbreak;\n\t\tcase 2: $wordOne = $this->pickTwo();\n\t\tbreak;\n\t\tcase 3: $wordOne = $this->pickThree();\n\t\tbreak;\n\t}\n}", "function chooseSpecialOption($choice) {\n self::checkAction('choose');\n $player_id = self::getActivePlayerId();\n \n $special_type_of_choice = self::getGameStateValue('special_type_of_choice');\n \n if ($special_type_of_choice == 0) { // This is not a special choice\n // The player is cheating...\n throw new BgaUserException(self::_(\"You cannot choose a special option; you have to choose a card [Press F5 in case of troubles]\"));\n }\n \n switch(self::decodeSpecialTypeOfChoice($special_type_of_choice)) {\n case 'choose_opponent':\n case 'choose_opponent_with_fewer_points':\n // Player choice\n // Check if the choice is a opponent\n if ($choice == $player_id) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You cannot choose yourself [Press F5 in case of troubles]\"));\n }\n else if ($choice == self::getPlayerTeammate($player_id)) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You cannot choose your teammate [Press F5 in case of troubles]\"));\n }\n $players = self::loadPlayersBasicInfos();\n if (!array_key_exists($choice, $players)) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You must choose an opponent [Press F5 in case of troubles]\"));\n }\n if ($choice == 'choose_opponent_with_fewer_points' && self::getPlayerScore($choice) >= self::getPlayerScore($player_id)) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You must choose an opponent with fewer points than you [Press F5 in case of troubles]\"));\n }\n break;\n case 'choose_value':\n // Values choice\n if (!ctype_digit($choice) || $choice < 1 || $choice > 10) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"Your choice must be a value from 1 to 10 [Press F5 in case of troubles]\"));\n }\n break;\n case 'choose_color':\n // Color choice\n if (!ctype_digit($choice) || $choice < 0 || $choice > 4) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"Your choice must be a color [Press F5 in case of troubles]\"));\n }\n break;\n case 'choose_two_colors':\n // Two color choice\n if (!ctype_digit($choice) || $choice < 0) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"Your choice must be two colors [Press F5 in case of troubles]\"));\n }\n $colors = self::getValueAsArray($choice);\n if (count($colors) <> 2 || $colors[0] == $colors[1] || $colors[0] < 0 || $colors[0] > 4 || $colors[1] < 0 || $colors[1] > 4) {\n // The player is cheating... \n throw new BgaUserException(self::_(\"Your choice must be two colors [Press F5 in case of troubles]\"));\n }\n break;\n case 'choose_rearrange':\n $exception = self::_(\"Ill formated permutation info [Press F5 in case of troubles]\");\n // Choice contains the color and the permutations made\n if (!is_array($choice) || !array_key_exists('color', $choice)) {\n throw new BgaUserException($exception);\n }\n $color = $choice['color'];\n if (!ctype_digit($color) || $color < 0 || $color > 4) {\n // The player is cheating...\n throw new BgaUserException($exception);\n }\n if (!array_key_exists('permutations_done', $choice)) {\n throw new BgaUserException($exception);\n }\n $permutations_done = $choice['permutations_done'];\n if (!is_array($permutations_done) || count($permutations_done) == 0) {\n throw new BgaUserException($exception);\n }\n $n = self::countCardsInLocation($player_id, 'board', false, true);\n $n = $n[$color];\n \n foreach($permutations_done as $permutation) {\n if (!array_key_exists('position', $permutation)) {\n throw new BgaUserException($exception);\n }\n $position = $permutation['position'];\n if (!array_key_exists('delta', $permutation)) {\n throw new BgaUserException($exception);\n }\n $delta = $permutation['delta'];\n if ($delta <> 1 && $delta <> -1) {\n throw new BgaUserException($exception);\n }\n if (!ctype_digit($position) || $position >= $n || $position + $delta >= $n) {\n throw new BgaUserException($exception);\n }\n }\n \n // Do the rearrangement now\n $actual_change = self::rearrange($player_id, $color, $permutations_done);\n \n if (!$actual_change) {\n throw new BgaUserException(self::_(\"Your choice does not make any change in the rearrangement [Press F5 in case of troubles]\"));\n }\n \n // This move was legal\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} rearrange your ${color} pile.'), array('i18n' => array('color'), 'You' => 'You', 'color' => self::getColorInClear($color)));\n self::notifyAllPlayersBut($player_id, 'rearrangedPile', clienttranslate('${player_name} rearranges his ${color} pile.'), array('i18n' => array('color'), 'player_id' => $player_id, 'rearrangement' => $choice, 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'color' => self::getColorInClear($color)));\n try {\n self::checkForSpecialAchievements($player_id, false); // Check all except Wonder\n }\n catch (EndOfGame $e) {\n // End of the game: the exception has reached the highest level of code\n self::trace('EOG bubbled from self::chooseSpecialOption');\n self::trace('selectionMove->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n \n $choice = 1;\n break;\n case 'choose_yes_or_no':\n // Yes/no choice\n if ($choice != 0 && $choice != 1) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You have to choose between yes or no [Press F5 in case of troubles]\"));\n }\n break;\n default:\n break;\n }\n // No cheating here\n self::setGameStateValue('choice', $choice);\n \n // Return to the resolution of the effect\n self::trace('selectionMove->interSelectionMove (chooseSpecialOption)');\n $this->gamestate->nextState('interSelectionMove');\n }", "private function initPlayer(): void\n {\n $name = $this->getConfig()->getPlayerName();\n $interaction = $this->getConfig()->getInteractionInterface();\n\n $this->player = PlayerFabric::createReal($this->pile, $name, $interaction);\n }", "function welcomeBanner()\r\n{\r\n\t$welcomeWords = array(\"Welcome\", \"Salutations\", \"Bonjour\", \"Hello\", \"G'Day\", \"Guten Tag\", \"Buona Giornata\", \"Yoi Tsuitachi\", \"M'athcho maroon\", \"Hey\", \"Good to see you\", \"Hi\", \"Howdy\",\"Sup\", \"Hiya\");\r\n\treturn $welcomeWords[rand(0,sizeof($welcomeWords)-1)];\r\n}", "function pick_random($array){\n return $array[array_rand($array)];\n}", "public function selectGoat($choice)\n {\n $remaining = array_diff_key($this->doors,array($choice => ''));\n $goats = array_keys($remaining,'goat');\n //in the event the user chooses the car, we'll just return one goat\n return $goats[array_rand($goats)];\n }", "function playerConnect($player) {\n\n\t\t// request information about the new player\n\t\t// (removed callback mechanism here, as GetPlayerInfo occasionally\n\t\t// returns no data and then the connecting login would be lost)\n\t\t$login = $player[0];\n\t\t$this->client->query('GetDetailedPlayerInfo', $login);\n\t\t$playerd = $this->client->getResponse();\n\t\t$this->client->query('GetPlayerInfo', $login, 1);\n\t\t$player = $this->client->getResponse();\n\n\t\t// check for server\n\t\tif (isset($player['Flags']) && floor($player['Flags'] / 100000) % 10 != 0) {\n\t\t\t// register relay server\n\t\t\tif (!$this->server->isrelay && $player['Login'] != $this->server->serverlogin) {\n\t\t\t\t$this->server->relayslist[$player['Login']] = $player;\n\n\t\t\t\t// log console message\n\t\t\t\t$this->console('<<< relay server {1} ({2}) connected', $player['Login'],\n\t\t\t\t stripColors($player['NickName'], false));\n\t\t\t}\n\n\t\t// on relay, check for player from master server\n\t\t} elseif ($this->server->isrelay && floor($player['Flags'] / 10000) % 10 != 0) {\n\t\t\t; // ignore\n\t\t} else {\n\t\t\t$ipaddr = isset($playerd['IPAddress']) ? preg_replace('/:\\d+/', '', $playerd['IPAddress']) : ''; // strip port\n\n\t\t\t// if no data fetched, notify & kick the player\n\t\t\tif (!isset($player['Login']) || $player['Login'] == '') {\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('CONNECT_ERROR'));\n\t\t\t\t$message = $this->formatColors($message);\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $login);\n\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CONNECT_DIALOG'))));\n\t\t\t\t// log console message\n\t\t\t\t$this->console('GetPlayerInfo failed for ' . $login . ' -- notified & kicked');\n\t\t\t\treturn;\n\n\t\t\t// if player IP in ban list, notify & kick the player\n\t\t\t} elseif (!empty($this->bannedips) && in_array($ipaddr, $this->bannedips)) {\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('BANIP_ERROR'));\n\t\t\t\t$message = $this->formatColors($message);\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $login);\n\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t$this->client->addCall('Ban', array($login, $this->formatColors($this->getChatMessage('BANIP_DIALOG'))));\n\t\t\t\t// log console message\n\t\t\t\t$this->console('Player ' . $login . ' banned from ' . $ipaddr . ' -- notified & kicked');\n\t\t\t\treturn;\n\n\t\t\t// client version checking\n\t\t\t} else {\n\t\t\t\t// extract version number\n\t\t\t\t$version = str_replace(')', '', preg_replace('/.*\\(/', '', $playerd['ClientVersion']));\n\t\t\t\tif ($version == '') $version = '2.11.11';\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('CLIENT_ERROR'));\n\n\t\t\t\t// if invalid version, notify & kick the player\n\t\t\t\tif ($this->settings['player_client'] != '' &&\n\t\t\t\t strcmp($version, $this->settings['player_client']) < 0) {\n\t\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $login);\n\t\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CLIENT_DIALOG'))));\n\t\t\t\t\t// log console message\n\t\t\t\t\t$this->console('Obsolete player client version ' . $version . ' for ' . $login . ' -- notified & kicked');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// if invalid version, notify & kick the admin\n\t\t\t\tif ($this->settings['admin_client'] != '' && $this->isAnyAdminL($player['Login']) &&\n\t\t\t\t strcmp($version, $this->settings['admin_client']) < 0) {\n\t\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $login);\n\t\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CLIENT_DIALOG'))));\n\t\t\t\t\t// log console message\n\t\t\t\t\t$this->console('Obsolete admin client version ' . $version . ' for ' . $login . ' -- notified & kicked');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// create player object\n\t\t\t$player_item = new Player($playerd);\n\t\t\t// set default window style, panels & background\n\t\t\t$player_item->style = $this->style;\n\t\t\t$player_item->panels['admin'] = set_panel_bg($this->panels['admin'], $this->panelbg);\n\t\t\t$player_item->panels['donate'] = set_panel_bg($this->panels['donate'], $this->panelbg);\n\t\t\t$player_item->panels['records'] = set_panel_bg($this->panels['records'], $this->panelbg);\n\t\t\t$player_item->panels['vote'] = set_panel_bg($this->panels['vote'], $this->panelbg);\n\t\t\t$player_item->panelbg = $this->panelbg;\n\n\t\t\t// adds a new player to the internal player list\n\t\t\t$this->server->players->addPlayer($player_item);\n\n\t\t\t// log console message\n\t\t\t$this->console('<< player {1} joined the game [{2} : {3} : {4} : {5} : {6}]',\n\t\t\t $player_item->pid,\n\t\t\t $player_item->login,\n\t\t\t $player_item->nickname,\n\t\t\t $player_item->nation,\n\t\t\t $player_item->ladderrank,\n\t\t\t $player_item->ip);\n\n\t\t\t// replace parameters\n\t\t\t$message = formatText($this->getChatMessage('WELCOME'),\n\t\t\t stripColors($player_item->nickname),\n\t\t\t $this->server->name, XASECO2_VERSION);\n\t\t\t// hyperlink package name & version number\n\t\t\t$message = preg_replace('/XASECO2.+' . XASECO2_VERSION . '/', '$l[' . XASECO_ORG . ']$0$l', $message);\n\n\t\t\t// send welcome popup or chat message\n\t\t\tif ($this->settings['welcome_msg_window']) {\n\t\t\t\t$message = str_replace('{#highlite}', '{#message}', $message);\n\t\t\t\t$message = preg_split('/{br}/', $this->formatColors($message));\n\t\t\t\t// repack all lines\n\t\t\t\tforeach ($message as &$line)\n\t\t\t\t\t$line = array($line);\n\t\t\t\tdisplay_manialink($player_item->login, '',\n\t\t\t\t array('Icons64x64_1', 'Inbox'), $message,\n\t\t\t\t array(1.2), 'OK');\n\t\t\t} else {\n\t\t\t\t$message = str_replace('{br}', LF, $this->formatColors($message));\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $player_item->login);\n\t\t\t}\n\n\t\t\t// if there's a record on current map\n\t\t\t$cur_record = $this->server->records->getRecord(0);\n\t\t\tif ($cur_record !== false && $cur_record->score > 0) {\n\t\t\t\t// set message to the current record\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_CURRENT'),\n\t\t\t\t stripColors($this->server->map->name),\n\t\t\t\t ($this->server->gameinfo->mode == Gameinfo::STNT ?\n\t\t\t\t $cur_record->score : formatTime($cur_record->score)),\n\t\t\t\t stripColors($cur_record->player->nickname));\n\t\t\t} else { // if there should be no record to display\n\t\t\t\t// display a no-record message\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_NONE'),\n\t\t\t\t stripColors($this->server->map->name));\n\t\t\t}\n\n\t\t\t// show top-8 & records of all online players before map\n\t\t\tif (($this->settings['show_recs_before'] & 2) == 2 && function_exists('show_maprecs')) {\n\t\t\t\tshow_maprecs($this, $player_item->login, 1, 0); // from chat.records2.php\n\t\t\t} elseif (($this->settings['show_recs_before'] & 1) == 1) {\n\t\t\t\t// or show original record message\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $player_item->login);\n\t\t\t}\n\n\t\t\t// throw main 'player connects' event\n\t\t\t$this->releaseEvent('onPlayerConnect', $player_item);\n\t\t\t// throw postfix 'player connects' event (access control)\n\t\t\t$this->releaseEvent('onPlayerConnect2', $player_item);\n\t\t}\n\t}", "function playerConnect(){\n\t return true;\n\t}", "function game_ai_create_new_player() {\n global $game, $base_url, $ai_output;\n\n while (TRUE) {\n $num = mt_rand(0, 99999);\n $id_to_check = 'ai-' . $num;\n zg_ai_out(\"checking for existing player $id_to_check\");\n\n $sql = 'select id from users\n where phone_id = \"%s\";';\n $result = db_query($sql, $id_to_check);\n $item = db_fetch_object($result);\n\n if (empty($item)) {\n break;\n }\n }\n\n $uri = $base_url . \"/$game/home/$id_to_check\";\n zg_ai_out(\"phone_id $id_to_check not in use; URI is $uri\");\n $response = zg_ai_web_request($id_to_check, 'home');\n zg_ai_out($response);\n\n zg_ai_out('updating record to make this a ToxiCorp Employee');\n $sql = 'update users set username = \"%s\", fkey_neighborhoods_id = 75,\n fkey_values_id = 9, `values` = \"Goo\", meta = \"ai_minion\"\n where phone_id = \"%s\";';\n db_query($sql, \"TC Emp $num\", $id_to_check);\n $ai_bot = zg_fetch_user_by_id($id_to_check);\n // mail('[email protected]', 'ai trying to create a new player AGAIN', $ai_output);.\n zg_slack($ai_bot, 'bots', 'new bot creation', $ai_output);\n}", "function ran()\r\n\t{\r\n\t\tsrand((double)microtime()*1000000^getmypid());\r\n\t}", "public function show_randomMember($random_type = '', $output_method = 'echo')\n {\n return $this->call_method(\"show/randomMember\",\n array('random_type' => $random_type,\n 'output_method' => $output_method,\n )\n );\n }", "public static function getRandomMove()\n {\n return array_rand(Game::$moves);\n }", "function random($students)\n {\n $a = rand(0,7);\n print $students[$a]['name'];\n }", "function playerConnect($player) {\n\n\t\t// request information about the new player ...\n\t\t// ... and callback to function newPlayer() ...\n\t\t$this->addCall('GetPlayerInfo', array($player[0]), 0, 'newPlayer');\n\t}", "public function makeSound()\n {\n echo 'Maw Maw....<br>';\n }", "function rollDie() {\r\n\t$roll = rand(1,6);\r\n\techo $roll . ' ';\r\n}", "function rand_warrior(){\n\t\t$list = array ('adversary', 'advocate', 'ally', 'antagonist', 'apache', 'assailant', 'attacker', 'backer', 'barbarian', 'battler', 'belligerent', 'centurion', 'challenger', 'champ', 'combatant', 'commando', 'conqueror', 'contender', 'contester', 'corsair', 'crusader', 'defender', 'disputant', 'enemy', 'entrant', 'expounder', 'foe', 'gladiator', 'goliath', 'guardian', 'gurkha', 'hero', 'horseman', 'immortal', 'knight', 'legionairre', 'marshall', 'medalist', 'mongol', 'musketeer', 'ninja', 'partisan', 'patron', 'pirate', 'player', 'proponent', 'protector', 'ranger', 'rifler', 'rival', 'rover', 'samurai', 'scrapper', 'serviceman', 'soldier', 'spartan', 'spoiler', 'upholder', 'vanquisher', 'victor', 'viking', 'vindicator', 'warrior', 'winner');\n\t\t$i = count($list);\n\t\treturn $list[mt_rand(0,$i-1)];\n\t}", "public function onRun($currentTick) {\n\t\tforeach ($this->plugin->getServer()->getOnlinePlayers() as $player) {\n\t\t\tif ($player->spawned && $player instanceof CustomPlayer) {\n\t\t\t\tif ($player->hasNotification !== false) {\n\t\t\t\t\t$player->sendTip($player->hasNotification);\n\t\t\t\t\tif ($player->notificationTime >= 0) {\n\t\t\t\t\t\t$player->notificationTime--;\n\n\t\t\t\t\t\tif ($player->notificationTime === 0) {\n\t\t\t\t\t\t\t$player->showNotification(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if ($player->currentGame === null) {\n\t\t\t\t\t//send welcome message\n\t\t\t\t\t$welcome = $player->getTranslatedString(\"WELCOME_TO_AVERSIONPE\", \"\", array($this->plugin->serverGameType));\n\t\t\t\t\t$account_status = \"\";\n\t\t\t\t\t//send popup with player's coin balance or message need registration\n\t\t\t\t\tif ($player->isAuthorized()) {\n\t\t\t\t\t\t$account_status = TextFormat::YELLOW . $player->getDisplayName() \n\t\t\t\t\t\t\t\t. TextFormat::GRAY . \" | \" \n\t\t\t\t\t\t\t\t. TextFormat::GOLD . number_format($player->coinsNum) . $player->getTranslatedString(\"JUST_COINS\");\n\t\t\t\t\t} else if (!$player->isRegistered()) {\n\t\t\t\t\t\t$account_status = $player->getTranslatedString(\"ACC_NOT_REGISTERED\");\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t$player->sendTip($welcome . \"\\n\" . $account_status);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function random_victory_quote(){\n $temp_text_options = array('Awesome work!', 'Nice work!', 'Fantastic work!', 'Great work!', 'Super work!', 'Amazing work!', 'Fabulous work!');\n $temp_text = $temp_text_options[array_rand($temp_text_options)];\n return $temp_text;\n }", "public function randomKey();", "function pickRandom($tablename) {\n\t$result=mysql_query(\"SELECT pkey FROM $tablename\"); //Select all pkeys\n\t$resultCount=mysql_num_rows($result);\n\t$randPkey=mt_rand(0,$resultCount-1);\n\t$result=mysql_query(\"SELECT firstname,surname FROM $tablename WHERE pkey='$randPkey'\"); //select the chosen pkey\n return mysql_fetch_array($result);\n}", "public function onPlayerInteract(Player $player) : void {\n\t}", "public function pickOne()\n{\n\t$random = rand(0,$this->lengthOne);\n\t$word = $this->oneArray[$random];\n\treturn $word;\n}", "public function playerActionGet()\n {\n // Play the game\n $title = \"Play the game 2\";\n $session = $this->app->session;\n $game = $session->get(\"game\");\n $player = $session->get(\"player\");\n $computer = $session->get(\"computer\");\n $who = $session->get(\"who\");\n\n $data = [\n \"diceValues\" => $game->rollDices(),\n \"gameState\" => $game->getState(),\n \"player\" => $player,\n \"computer\" => $computer\n ];\n $player->addDicesToHistogram($game->getDices());\n $this->app->page->add(\"dice2/player\", $data);\n //$this->app->page->add(\"dice2/debug\");\n $session->set(\"game\", $game);\n $session->set(\"player\", $player);\n $session->set(\"computer\", $computer);\n $session->set(\"who\", $who);\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "function mark_human($socket, $data) {\r\n\tif($socket->process == true) {\r\n\t\t$ip = $data;\r\n\t\tglobal $player_array;\r\n\t\tforeach( $player_array as $player ) {\r\n\t\t\tif($player->ip == $ip && $player->human == false) {\r\n\t\t\t\t$player->human = true;\r\n\t\t\t\t$exp_gain = $player->hostage_exp_points + 250;\r\n\t\t\t\t$player->inc_exp($exp_gain);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function helloMessage($time) {\n\t\t\n\t\t\t$langs[1] = \"English in case you weren't sure ;)\";\n\t\t\t$langs[2] = \"German\";\n\t\t\t$langs[3] = \"French\";\n\t\t\t$langs[4] = \"Italian\";\n\t\t\t$langs[5] = \"Portuguese\";\n\t\t\t$langs[6] = \"Russian\";\n\t\t\t$langs[7] = \"Spanish\";\n\t\t\t$langs[8] = \"Greek\";\n\t\t\t$langs[9] = \"Chinese\";\n\t\t\t$langs[10] = \"Dutch\";\n\t\t\t$langs[11] = \"Lithuanian\";\n\t\t\t\n\t\t\t$pickLang = rand(1, count($langs));\n\t\t\t\n\t\t\t// Populate Languages\n\t\t\t// Good Morning\n\t\t\t$languages[1][1] = \"Good Morning\";\n\t\t\t$languages[1][2] = \"Guten Morgen\";\n\t\t\t$languages[1][3] = \"Bonjour\";\n\t\t\t$languages[1][4] = \"Buongiorno\";\n\t\t\t$languages[1][5] = \"Bom dia\";\n\t\t\t$languages[1][6] = \"Доброе утро\";\n\t\t\t$languages[1][7] = \"Buenos días\";\n\t\t\t$languages[1][8] = \"Καλημέρα\";\n\t\t\t$languages[1][9] = \"早晨好\";\n\t\t\t$languages[1][10] = \"Goedemorgen\";\n\t\t\t$languages[1][11] = \"Labas Rytas\";\n\t\t\n\t\t\t// Good Afternoon\n\t\t\t$languages[2][1] = \"Good Afternoon\";\n\t\t\t$languages[2][2] = \"Guten Tag\";\n\t\t\t$languages[2][3] = \"Bonjour\";\n\t\t\t$languages[2][4] = \"Buon pomeriggio\";\n\t\t\t$languages[2][5] = \"Boa tarde\";\n\t\t\t$languages[2][6] = \"Добрый день\";\n\t\t\t$languages[2][7] = \"Buonas tardes\";\n\t\t\t$languages[2][8] = \"Καλό απόγευμα\";\n\t\t\t$languages[2][9] = \"你好\";\n\t\t\t$languages[2][10] = \"Goede Middag\";\n\t\t\t$languages[2][11] = \"Labą Dieną\";\n\n\t\t\t// Good Evening\n\t\t\t$languages[3][1] = \"Good Evening\";\n\t\t\t$languages[3][2] = \"Guten Abend\";\n\t\t\t$languages[3][3] = \"Bonsoir\";\n\t\t\t$languages[3][4] = \"Buona sera\";\n\t\t\t$languages[3][5] = \"Boa noite\";\n\t\t\t$languages[3][6] = \"Добрый вечер\";\n\t\t\t$languages[3][7] = \"Buonas noches\";\n\t\t\t$languages[3][8] = \"Καλό βράδυ\";\n\t\t\t$languages[3][9] = \"晚上好\";\n\t\t\t$languages[3][10] = \"Goede Avond\";\n\t\t\t$languages[3][11] = \"Labas Vakaras\";\n\t\t\n\t\t\t$chosen['greeting'] = $languages[$time][$pickLang];\n\t\t\t$chosen['language'] = $langs[$pickLang];\n\t\t\t$chosen['eng'] = $languages[$time][1];\n\t\t\t\n\t\t\treturn $chosen;\n\t\t}", "public function randomize()\n {\n return mt_rand(1, $this->maxnumber());\n }", "public function displayWinner()\n {\n // Search in array scores, for the username with the highest score.\n $nameWinner = array_search(max($this->scores), $this->scores);\n $scoreWinner = max($this->scores);\n\n $this->console->stdInput(1);\n $this->console->getInpunt(\"De winnaar met \" . $scoreWinner[\"scoreTotal\"] . \" punten is: \" . $nameWinner . \"\\nPress enter to end the game!\");\n $this->console->stdInput(1);\n }", "private function sendSavedMessage(Player $player) : void{\n $player->sendMessage(TextFormat::GOLD . \"You were teleported to safety while a mine was being reset :)\");\n }", "function hello_dollynho() {\n\t$chosen = hello_dolly_get_lyric();\n\techo \"<p id='dolly'>$chosen</p>\";\n}", "function initPlayer($player) {\n\t\t// creates player object ...\n\t\t$player_item = new Player($player);\n\n\t\tldb_playerConnect($this, $player_item);\n\n\t\t// adds a new player to the intern player list ...\n\t\t$this->server->players->addPlayer($player_item);\n\n\t\t// display console message ...\n\t\t$this->console('<< player {1} online [{2}] {3} wins',\n\t\t\t$player_item->id,\n\t\t\t$player_item->login,\n\t\t\t$player_item->getWins());\n\t}", "public function play()\n {\n $this->app->validate([\n 'choice'=>'required'\n ]);\n\n # Get player selection from radio button\n $playerMove = $this->app->input('choice');\n\n # Call RPS method to generate random move\n $computerMove = RPS::getMove();\n\n #Get player name from form, or use default value\n $playerName = $this->app->input('playerName');\n\n # Create instance of RPS class for game logic\n $game = new RPS($playerMove, $computerMove);\n\n # Call RPS method playGame to get win, loss, or tie\n $result = $game->playGame();\n\n # Save results to the database and set up a round\n $round = [\n 'player_move' => $playerMove,\n 'computer_move' => $computerMove,\n 'result' => $result,\n 'time' =>date('Y-m-d H:i:s'),\n 'name' => $playerName\n ];\n\n # Insert the round\n $this->app->db()->insert('rounds', $round);\n\n # Redirect the user back to the home page with the form to play again\n $this->app->redirect('/', [\n 'results' =>[\n 'player_move'=>$playerMove,\n 'computer_move' => $computerMove,\n 'result' => $result,\n 'name' => $playerName\n ]\n ]);\n }", "function recruitTeam($cxn,$player,$request)\r\n {\r\n \r\n }", "private function random_peer_id()\n {\n $identifier = '-SP0054-';\n $chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n\n return $identifier . substr(str_shuffle($chars), 0, 12);\n }", "public function selectRandomMovie($max) {\n\t\t$this->dbAdapter->dbOpen();\n\t\t$result = $this->dbAdapter->movieSelectRandom($max);\n\t\t$this->dbAdapter->dbClose();\n\t\t$this->error = $this->dbAdapter->lastError();\n\t\t\n\t\treturn $result;\n\t}", "function selectRandomCandidate($arrayList)\n{\n\t$arrayValue = array();\n\t$listCount = count($arrayList);\n\t$randomNum = 0;\n\t\n\t$randomNum = rand(0, $listCount-1);\n\t\n\t$arrayValue = $arrayList[$randomNum];\n\t\n\treturn $arrayValue;\n}", "public function chooseMove()\n {\n return $this->getMoveFactory()->getMove(array_rand($this->getMoveFactory()->getAvailableMoves()));\n }", "function tep_random_select($query) {\n $random_product = '';\n $random_query = tep_db_query($query);\n $num_rows = tep_db_num_rows($random_query);\n if ($num_rows > 0) {\n $random_row = tep_rand(0, ($num_rows - 1));\n tep_db_data_seek($random_query, $random_row);\n $random_product = tep_db_fetch_array($random_query);\n }\n\n return $random_product;\n }", "public function chooseOption($gameId, $playerId, $options);", "function get_random_song($param)\n{\n\t$connection = db_connect_select();\n\t$tagCount = substr_count($param, ',')+1;\n\t$query = \"SELECT tracks.artist_name, tracks.track_name\n FROM tracks\n INNER JOIN track_tag ON tracks.id = track_tag.track_id\n INNER JOIN tags ON tags.id = track_tag.tag_id\n WHERE track_tag.tag_id IN ($param)\n GROUP BY tracks.id\n HAVING COUNT(tracks.id)=$tagCount\n ORDER BY RAND( )\n LIMIT 1\";\n\t\t\t\n\t\t$result = mysql_fetch_array(mysql_query($query));\n\t\tif(!$result)\n\t\t{\n\t\t\techo mysql_error();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t\tif(mysql_ping($connection))\n\t\t{\n\t\t\tmysql_close($connection); \n\t\t}\n\t\t\n}", "public function registerPlayer(Player $player) {\r\n\r\n if($player->isSpectator() || \r\n\r\n (!is_null($this->getMain()->getServer()->getPluginManager()->getPlugin(\"SpectatorPlus\")) &&\r\n\r\n $this->getMain()->getServer()->getPluginManager()->getPlugin(\"SpectatorPlus\")->isSpectator($player))) { // Support for spectator Plus\r\n\r\n $this->spectators[$player->getName()] = $player;\r\n\r\n $player->HideAndSeekRole = self::ROLE_SPECTATE;\r\n\r\n } elseif($this->step == self::STEP_WAIT || $this->step == self::STEP_START) {$player->hideAndSeekGame = $this;\r\n\r\n // API inside player's class (easilier to get data)\r\n\r\n $player->HideAndSeekRole = self::ROLE_WAIT;\r\n\r\n $player->playsHideAndSeek = true;\r\n\r\n $this->players[$player->getName()] = $player;\r\n\r\n $player->setGamemode(2); // Set it to adventure so player cannot break blocks.\r\n\r\n $this->sendMessage(\"§a\" . $player->getName() . \" joined (\" . count($this->players) . \"/\" . $this->getMaxPlayers() . \"). \" . (round($this->getMaxPlayers() * 0.75) - count($this->players)) . \" players left before starting\");\r\n\r\n } else {\r\n\r\n $this->spectators[$player->getName()] = $player;\r\n\r\n $player->HideAndSeekRole = self::ROLE_SPECTATE;\r\n\r\n $player->setGamemode(3);\r\n\r\n }\r\n\r\n }", "private function select_random() {\n $ad = $this->db_wrapper->select_data($this->table_name, '*', null, 1, 'RAND()');\n if($ad) {\n $ad = array_flat($ad);\n \n $this->ad_code = $ad['adcode'];\n $this->ad_id = $ad['ad_id'];\n $this->ad_title = $ad['ad_title'];\n }\n }", "public function select(CustomPlayer $player) {\n\t\t$player->particleEffectExtra[\"i\"] = 0;\n\t}", "public function switchPlayer(){\n\t\tfor($col = 0; $col < 3; $col++){\n\t\t\tfor($row = 0; $row < 3; $row++){\n\t\t\t\tif(isset($_GET[\"cell-\".$col.\"-\".$row])){\n\t\t\t\t\tif($this->player1->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player1;\n\t\t\t\t\t}\n\t\t\t\t\tif($this->player2->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->currentPlayer === $this->player1){\n\t\t\t$this->currentPlayer = $this->player2;\n\t\t} else {\n\t\t\t$this->currentPlayer = $this->player1;\n\t\t}\n\t}", "public function random(): GifData;" ]
[ "0.6402196", "0.62477463", "0.61383677", "0.6131086", "0.6088489", "0.6057457", "0.60531896", "0.580598", "0.58006644", "0.57715154", "0.57694703", "0.5689289", "0.56084937", "0.55991423", "0.5590919", "0.54940724", "0.5458018", "0.5455137", "0.5443015", "0.54023033", "0.5392875", "0.53710634", "0.53582954", "0.53517413", "0.53511846", "0.5342914", "0.5318881", "0.5314585", "0.53119284", "0.5303274", "0.5290402", "0.5286027", "0.52847666", "0.5277117", "0.5276695", "0.5273555", "0.5262804", "0.5249599", "0.5235986", "0.5231449", "0.5223407", "0.5216735", "0.52136576", "0.52050614", "0.5204744", "0.5196994", "0.5192203", "0.5175734", "0.5171574", "0.517098", "0.516417", "0.5160281", "0.51547605", "0.5152493", "0.51521754", "0.5144221", "0.5143838", "0.5115264", "0.5109728", "0.5105345", "0.51042116", "0.5087183", "0.50757104", "0.50652677", "0.50578266", "0.50446916", "0.5036756", "0.50310856", "0.5028965", "0.50200593", "0.49961945", "0.49897936", "0.49897802", "0.49859613", "0.49859002", "0.49788848", "0.49786478", "0.49782702", "0.49713865", "0.4968668", "0.49652058", "0.4964258", "0.4961631", "0.49608257", "0.49517694", "0.49363852", "0.49356374", "0.49308157", "0.4928537", "0.4925537", "0.49250725", "0.49249834", "0.4920172", "0.49197862", "0.4913915", "0.49119338", "0.49001822", "0.4898796", "0.48937646", "0.48928013" ]
0.8639816
0
Function asked the player to enter a column that he would like to place his discs after selection set validation to the selection, in case of a bad validation user will notify and asked to selecet again
public function selectMove(){ do { $userMsg = readlineUserInputMsg($this->currentPlayer); $userMove = readline($userMsg); } while (!$this->checkValidMove($userMove)); return $userMove; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "function validate() {\n\t\t// execute the column validation \n\t\tparent::validate();\n\t\t\n\t\t// connection\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM company WHERE name = '\".$this->getName().\"' AND id <> '\".$this->getID().\"'\";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage(\"result is \".$result);\n\t\tif(!isEmptyString($result)){ \n\t\t\t$this->getErrorStack()->add(\"unique.name\", \"The name \".$this->getName().\" already exists. Please specify another.\");\n\t\t}\n\t}", "public function validate_column($column)\n {\n }", "function select_validate($select){\n // 'none' is the first option that is default \"-------Choose Country-------\"\n if($select==\"none\"){\n $this->form_validation->set_message('select_validate', 'Please Select Your Country.');\n return false;\n } else{\n // User picked something.\n return true;\n }\n }", "function ValidateEdit()\n\t{\n\t}", "public function getValidationScript($colName) { \r\n //it's possible to modify the attribute leftQuantity if the leaveEarned is the last one with the same leaveType and resource\r\n //TO DO: take into account the profil Admin\r\n $old=$this->getOld();\r\n if($this->id!=NULL){\r\n $clauseWhere=\"idLeaveType=\".$this->idLeaveType.\" and idEmployee=\".$this->idEmployee.\" AND idle=0\";\r\n $clauseOrderBy=\"startDate DESC\";\r\n $lvEarnedList = $this->getSqlElementsFromCriteria(null,false,$clauseWhere, $clauseOrderBy);\r\n if($this->quantity!=null && $lvEarnedList){\r\n //going with the principle that there cannot be at the same time a leaveEarned with a quantity null and another with a quantity set\r\n if($lvEarnedList[0]->startDate==$this->startDate && $lvEarnedList[0]->endDate==$this->endDate){\r\n self::$_fieldsAttributes['leftQuantity']='';\r\n self::$_fieldsAttributes['quantity']='';\r\n }\r\n }\r\n }\r\n \r\n $colScript = parent::getValidationScript($colName);\r\n \r\n \r\n if($colName==\"quantity\"){\r\n if($this->quantity!=null && $lvEarnedList){\r\n //going with the principle that there cannot be at the same time a leaveEarned with a quantity null and another with a quantity set\r\n if($lvEarnedList[0]->startDate==$this->startDate && $lvEarnedList[0]->endDate==$this->endDate){\r\n $colScript.='<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript.='if(this.value=='.$old->quantity.'){';\r\n $colScript.=' dijit.byId(\"leftQuantity\").set(\"readOnly\", null);';\r\n $colScript.='}else{';\r\n $colScript .= ' dijit.byId(\"leftQuantity\").set(\"readOnly\", true);';\r\n $colScript.='}';\r\n $colScript .= '</script>';\r\n }\r\n }\r\n \r\n }\r\n \r\n if($colName==\"leftQuantity\"){\r\n if($this->quantity!=null && $lvEarnedList){\r\n //going with the principle that there cannot be at the same time a leaveEarned with a quantity null and another with a quantity set\r\n if($lvEarnedList[0]->startDate==$this->startDate && $lvEarnedList[0]->endDate==$this->endDate){\r\n $colScript.='<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript.='if(this.value=='.$old->leftQuantity.'){';\r\n $colScript.=' dijit.byId(\"quantity\").set(\"readOnly\", null);';\r\n $colScript.='}else{';\r\n $colScript .= ' dijit.byId(\"quantity\").set(\"readOnly\", true);';\r\n $colScript.='}';\r\n $colScript .= '</script>';\r\n }\r\n }\r\n \r\n }\r\n \r\n return $colScript;\r\n }", "function validate() {\n\t\t\t$this->field['msg'] = ( isset( $this->field['msg'] ) ) ? $this->field['msg'] : esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );\n\n\t\t\tif ( ! is_numeric( str_replace( ',', '', $this->value ) ) || strpos( $this->value, ',' ) == false ) {\n\t\t\t\t$this->value = ( isset( $this->current ) ) ? $this->current : '';\n\t\t\t\t$this->field['current'] = $this->value;\n\n\t\t\t\t$this->error = $this->field;\n\t\t\t}\n\t\t}", "function m_verifyEdit()\n\t{\n\t\t$this->errMsg=\"\";\n\t\tif(empty($this->request['subject']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg=MSG_SUBJECT_EMPTY.\"<br>\";\n\t\t}\n\t\tif(!empty($this->request['sid']))\n\t\t{\n\t\t\t#VALIDATING EXISTING OPTION TITLE\n\t\t\t$this->obDb->query = \"SELECT iMailid_PK FROM \".EMAILS.\" where vSid = '\".$this->request['sid'].\"'\";\n\t\t\t$row_code = $this->obDb->fetchQuery();\n\t\t\tif($this->obDb->record_count != 0)\n\t\t\t{\n\t\t\t\tif($row_code[0]->iMailid_PK !=$this->request['id'])\n\t\t\t\t{\n\t\t\t\t\t$this->err=1;\n\t\t\t\t\t$this->errMsg.=MSG_SID_EXIST.\"<br>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->err;\n\t}", "function validateData($tID, $sID){\r\n\t\t\t\tglobal $error;\r\n\t\t\t\tglobal $count;\r\n\t\t\t\t\r\n\t\t\t\tif($tID==0 || $tID== null){\r\n\t\t\t\t\t$error.= \"<br/> You must select a tutor.\"; \r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($sID)==0){\r\n\t\t\t\t\t$error.= \"<br/> You must select a student to assign.\"; \r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "public function collectData() {\n $dialog = new Application_Model_DbTable_Dialog();\n\n $this->getDialogLines();\n $ignore_list = array('',''\n /*,\n 'submit_button'*/\n );\n $this->error = array();\n $this->error[] = \"<table><tr><th colspan='2'>Fix the following errors and retry</td></tr>\";\n $errorct = 0;\n $this->data = array();\n $formData = $this->getRequest();\n foreach($this->drows as $row) {\n if ($row['position'] == 0)\n continue;\n $type = $row['field_type'];\n $varname = $row['field_name'];\n $field_label = $row['field_label'];\n $validate = $row['validate'];\n if (in_array($type, $ignore_list)) {\n continue;\n }\n // logit('IN: '. $formData->getPost($varname,''));\n $this->data[$varname] = $formData->getPost($varname, '');\n // VALIDATION HERE\n if ($validate) {\n $msg = call_user_func($validate, $this->data[$varname]);\n logit(\"VAL: {$varname} {$validate} {$this->data[$varname]} -- {$msg}\");\n\n if ($msg) {\n // Enter into error array\n $errorct ++;\n $this->error[] = \"<tr><td class=\\\"rpad\\\"><b>{$field_label}:</b></td>\" .\n \"<td> <Span class=\\\"error\\\">{$msg}</span></td></tr>\";\n }\n }\n }\n $this->error[] = \"</table>\";\n if ($errorct == 0)\n $this->error = array();\n $this->handleCancel();\n // logit(\"ECT: \" . count($this->error));\n if (count($this->error) > 0) {\n $this->echecklistNamespace->flash = 'Correct errors and retry';\n $this->makeDialog($this->data);\n return true;\n }\n }", "function schedule_table_entry ($key)\n{\n // echo \" <TD><INPUT TYPE=TEXT NAME=$key SIZE=1 MAXLENGTH=1 VALUE=\\\"$_POST[$key]\\\"></TD>\\n\";\n\n $mykey = str_replace ( ' ' , '_' , $key );\n\n if (! isset ($_POST[$mykey]))\n $value = '';\n else\n {\n $value = trim ($_POST[$mykey]);\n if (1 == get_magic_quotes_gpc())\n $value = stripslashes ($value);\n }\n\n $dont_care = '';\n $one = '';\n $two = '';\n $three = '';\n $no = '';\n\n switch ($value)\n {\n case '': $dont_care = 'selected'; break;\n case '1': $one = 'selected'; break;\n case '2': $two = 'selected'; break;\n case '3': $three = 'selected'; break;\n case 'X': $no = 'selected'; break;\n }\n\n echo \" <TD>\\n\";\n echo \" <SELECT NAME=$mykey SIZE=1>\\n\";\n echo \" <option value=\\\"\\\" $dont_care>Don't Care&nbsp;</option>\\n\";\n echo \" <option value=1 $one>1st Choice&nbsp;</option>\\n\";\n echo \" <option value=2 $two>2nd Choice&nbsp;</option>\\n\";\n echo \" <option value=3 $three>3rd Choice&nbsp;</option>\\n\";\n echo \" <option value=X $no>Prefer Not&nbsp;</option>\\n\";\n echo \" </SELECT>\\n\";\n echo \" </TD>\\n\";\n}", "function BeforeEdit(&$values, $where, &$oldvalues, &$keys, &$message, $inline, &$pageObject)\n{\n\n\t\t\n\n$fh=$values[\"FirstHalf\"];\n$sh=$values[\"SecondHalf\"];\n$fd=$values[\"FromDate\"];\n$td=$values[\"ToDate\"];\n\n$fd1=strtotime($fd);\n$td1= strtotime($td);\n\nif ($fd1>$td1) {\n\n$message = \"FromDate should be equal less than ToDate.\";\n\n$message;\n\nreturn false;\n\n\n}\n\n\nelseif ($fh!=1 and $sh!=1) {\n\n$message = \"Please select one or both FirstHalf or SecondHalf\";\n\n$message;\n\nreturn false;\n\n}\n\nelse\n{\nreturn True;\n};\n\n\n\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n\n;\t\t\n}", "private function writeDataValidity(): void\n {\n // Datavalidation collection\n $dataValidationCollection = $this->phpSheet->getDataValidationCollection();\n\n // Write data validations?\n if (!empty($dataValidationCollection)) {\n // DATAVALIDATIONS record\n $record = 0x01B2; // Record identifier\n $length = 0x0012; // Bytes to follow\n\n $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records\n $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position\n $verPos = 0x00000000; // Vertical position of prompt box, if fixed position\n $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible\n\n $header = pack('vv', $record, $length);\n $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection));\n $this->append($header . $data);\n\n // DATAVALIDATION records\n $record = 0x01BE; // Record identifier\n\n foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) {\n // options\n $options = 0x00000000;\n\n // data type\n $type = CellDataValidation::type($dataValidation);\n\n $options |= $type << 0;\n\n // error style\n $errorStyle = CellDataValidation::errorStyle($dataValidation);\n\n $options |= $errorStyle << 4;\n\n // explicit formula?\n if ($type == 0x03 && preg_match('/^\\\".*\\\"$/', $dataValidation->getFormula1())) {\n $options |= 0x01 << 7;\n }\n\n // empty cells allowed\n $options |= $dataValidation->getAllowBlank() << 8;\n\n // show drop down\n $options |= (!$dataValidation->getShowDropDown()) << 9;\n\n // show input message\n $options |= $dataValidation->getShowInputMessage() << 18;\n\n // show error message\n $options |= $dataValidation->getShowErrorMessage() << 19;\n\n // condition operator\n $operator = CellDataValidation::operator($dataValidation);\n\n $options |= $operator << 20;\n\n $data = pack('V', $options);\n\n // prompt title\n $promptTitle = $dataValidation->getPromptTitle() !== '' ?\n $dataValidation->getPromptTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($promptTitle);\n\n // error title\n $errorTitle = $dataValidation->getErrorTitle() !== '' ?\n $dataValidation->getErrorTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($errorTitle);\n\n // prompt text\n $prompt = $dataValidation->getPrompt() !== '' ?\n $dataValidation->getPrompt() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($prompt);\n\n // error text\n $error = $dataValidation->getError() !== '' ?\n $dataValidation->getError() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($error);\n\n // formula 1\n try {\n $formula1 = $dataValidation->getFormula1();\n if ($type == 0x03) { // list type\n $formula1 = str_replace(',', chr(0), $formula1);\n }\n $this->parser->parse($formula1);\n $formula1 = $this->parser->toReversePolish();\n $sz1 = strlen($formula1);\n } catch (PhpSpreadsheetException $e) {\n $sz1 = 0;\n $formula1 = '';\n }\n $data .= pack('vv', $sz1, 0x0000);\n $data .= $formula1;\n\n // formula 2\n try {\n $formula2 = $dataValidation->getFormula2();\n if ($formula2 === '') {\n throw new WriterException('No formula2');\n }\n $this->parser->parse($formula2);\n $formula2 = $this->parser->toReversePolish();\n $sz2 = strlen($formula2);\n } catch (PhpSpreadsheetException $e) {\n $sz2 = 0;\n $formula2 = '';\n }\n $data .= pack('vv', $sz2, 0x0000);\n $data .= $formula2;\n\n // cell range address list\n $data .= pack('v', 0x0001);\n $data .= $this->writeBIFF8CellRangeAddressFixed($cellCoordinate);\n\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n $this->append($header . $data);\n }\n }\n }", "private function choixEffectuer()\n {\n $valider = false;//on mets le forrmulaire a faux\n $valeur = $this->recupValeur($this->position['valeur']);//on recupêre la valeur a comparer\n\n if($this->position['egal'])\n {\n \n if($this->choix == $valeur)\n {\n $valider = true;\n }\n }\n else if($this->position['different'])\n {\n \n if($this->choix != $valeur)\n {\n $valider = true;\n }\n }\n else\n {\n Erreur::declarer_dev(27);\n }\n\n return $valider;\n\n }", "public function validation();", "function checks($tbl, $col1, $col2, $title, $crit){\n\t\t\n\t\t$sq_more = \"\";\n\t\t//if($tbl == 'mrfc_reg_cats') { $sq_more = \" and system_cat = '0' \"; }\n\t\t\n\t\t$result=$this->dbQuery(\"SELECT $col1, $col2 FROM $tbl where cat_id > 3 $sq_more order by $col2\"); // //seq,\n\t\t$records = $this->recordCount($result);\n\t\tif($records >=1 )\t\n\t\t{\n\t\t\t\n\t\t\t$i=0;\n\t\t\t//echo \"<input type=\\\"checkbox\\\" class=\\\"hidden required\\\" name=\\\"\".$title.\"[]\\\" id=\\\"\".$title.\"\\\" title=\\\"Please select option(s)!\\\" validate=\\\"required:true\\\" >\";\n\t\t\t//echo '<label class=\"error hidden\" for=\"'.$title.'[]\">Please select option(s)!</label>';\n\t\t\twhile($qry_data = $this->fetchRow($result))\n\t\t\t{\n\t\t\t\tif($crit == $qry_data[0]) { $isOn = \" checked \"; } else { $isOn = \"\"; }\n\t\t\t\t$rec_id = $qry_data[0];\n\t\t\t\t$labelid = $title.\"_\".$qry_data[0];\n\t\t\t\tif($i==0) { $validate = \" validate=\\\"required:true\\\" class=\\\"required\\\" \"; } else { $validate = \"\"; }\n\t\t\t\t//\n\t\t\t\techo \"<label for=\\\"$labelid\\\" class=\\\"labelradio col-md-6\\\"><input type=\\\"checkbox\\\" name=\\\"\".$title.\"[]\\\" id=\\\"$labelid\\\" value='$qry_data[0]' $isOn $validate > $qry_data[1] &nbsp; </label>\";\n\t\t\t$i += 1;\n\t\t\t}\n\t\t\t\n\t\t\t/*echo \"<label for=\\\"\".$title.\"_other\\\" class=\\\"labelradio\\\"><input type=\\\"checkbox\\\" name=\\\"\".$title.\"_other\\\" id=\\\"\".$title.\"_other\\\" > Other <em>(key-in below)</em></label>\";*/\n\t\t\t//\n\t\t}\t\n\t}", "public function dispense()\n {\n $this->addValidator('model', new Validator_HasValue());\n }", "protected function afterInsertAccepting()\n {\n }", "protected function prepareForValidation()\n {\n \n //Filling uncaught parameters to blank default value\n foreach($this->columns_rules as $column => $rules){\n if(empty($this->get($column))) {\n $this->request->add([$column => '']); \n }\n }\n\n }", "function showroweditor($row, $iseditmode)\r\n{\r\n global $conn;\r\n global $categoryList;\r\n global $catId;\r\n global $unitId;\r\n \r\n if($catId==0){\r\n \t$catId = $row[\"cat_code\"];\r\n }\r\n $categoryList = buildCategoryOptions($catId);\r\n if($unitId==0){\r\n \t$unitId = $row[\"unit_code\"];\r\n }\r\n $unitList = buildUnitOptions($unitId);\r\n?>\r\n\t<table class=\"tbl\" border=\"0\" cellspacing=\"1\" cellpadding=\"5\" width=\"75%\">\r\n \t<tr> \r\n \t\t\t<td width=\"150\" class=\"hr\" align=\"left\">Category</td>\r\n \t\t\t\t<td align=\"left\"> \r\n \t<select name=\"cboCategory\" id=\"cboCategory\" class=\"box\">\r\n \t\t\t\t\t<option value=\"\" selected>-- Choose Category --</option>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\techo $categoryList;\r\n\t\t\t\t\t\t?>\t \r\n \t\t\t\t</select>\r\n <?php echo htmlspecialchars(\"*\").\"&nbsp;\" ?>\r\n </td>\r\n \t\t</tr>\r\n <tr>\r\n\t\t\t<td class=\"hr\" align=\"left\"><?php echo htmlspecialchars(\"Part Number\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t\t<td class=\"dr\" align=\"left\"><input type=\"text\" class=\"uppercase\" name=\"part_code\" size=\"30\" maxlength=\"30\" value=\"<?php echo str_replace('\"', '&quot;', trim($row[\"part_code\"])) ?>\">\r\n <?php echo htmlspecialchars(\"*\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td class=\"hr\" align=\"left\"><?php echo htmlspecialchars(\"Product Name\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t\t<td class=\"dr\" align=\"left\"><input type=\"text\" class=\"uppercase\" name=\"prod_name\" size=\"30\" maxlength=\"30\" value=\"<?php echo str_replace('\"', '&quot;', trim($row[\"prod_name\"])) ?>\">\r\n <?php echo htmlspecialchars(\"*\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t</tr>\r\n <tr>\r\n\t\t\t<td class=\"hr\" align=\"left\"><?php echo htmlspecialchars(\"Product Short Name\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t\t<td class=\"dr\" align=\"left\"><input type=\"text\" class=\"uppercase\" name=\"prod_sname\" size=\"30\" maxlength=\"30\" value=\"<?php echo str_replace('\"', '&quot;', trim($row[\"prod_sname\"])) ?>\">\r\n <?php echo htmlspecialchars(\"*\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td class=\"hr\" align=\"left\"><?php echo htmlspecialchars(\"Product Description\").\"&nbsp;\" ?></td>\r\n <td class=\"dr\" align=\"left\">\r\n <?php if($row[\"prod_description\"] !=\"\"){ ?>\r\n <textarea name=\"prod_description\" cols=\"45\" rows=\"5\"><?=$row[\"prod_description\"]?></textarea>\r\n <?php }else{ ?>\r\n <textarea name=\"prod_description\" cols=\"45\" rows=\"5\"></textarea>\r\n <?php } ?>\r\n <?php echo htmlspecialchars(\"(optional)\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t</tr>\r\n <tr> \r\n \t\t\t<td width=\"150\" class=\"hr\" align=\"left\">Unit</td>\r\n \t\t\t\t<td align=\"left\"> \r\n \t<select name=\"cboUnit\" id=\"cboUnit\" class=\"box\">\r\n \t\t\t\t\t<option value=\"\" selected>-- Choose Unit --</option>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\techo $unitList;\r\n\t\t\t\t\t\t?>\t \r\n \t\t\t\t</select>\r\n <?php echo htmlspecialchars(\"*\").\"&nbsp;\" ?>\r\n </td>\r\n \t\t</tr>\r\n <tr>\r\n\t\t\t<td class=\"hr\" align=\"left\"><?php echo htmlspecialchars(\"Product Opening Balance\").\"&nbsp;\" ?>\r\n </td>\r\n <?php if($row[\"prod_obal_qty\"] == \"0\" or $row[\"prod_obal_qty\"] == \"\"){ ?>\r\n \r\n\t\t\t<td class=\"dr\" align=\"left\"><input type=\"text\" name=\"prod_obal_qty\" maxlength=\"10\" value=\"<?php echo $row[\"prod_obal_qty\"] ?>\" onKeyUp=\"this.value=this.value.replace(/[^\\d\\.*]+/g, '')\">\r\n \r\n <?php }else{ ?>\r\n \t<td class=\"dr\" align=\"left\"><input type=\"text\" name=\"prod_obal_qty\" maxlength=\"10\" value=\"<?php echo $row[\"prod_obal_qty\"] ?>\" onKeyUp=\"this.value=this.value.replace(/[^\\d\\.*]+/g, '')\" readonly>\r\n <?php } ?>\r\n \t<?php echo htmlspecialchars(\"*\").\"&nbsp;\" ?>\r\n </td>\r\n </tr>\r\n <tr>\r\n\t\t\t<td class=\"hr\" align=\"left\"><?php echo htmlspecialchars(\"Purchase Price\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t\t<td class=\"dr\" align=\"left\"><input type=\"text\" name=\"prod_price\" maxlength=\"10\" value=\"<?php echo $row[\"prod_price\"] ?>\" onKeyUp=\"this.value=this.value.replace(/[^\\d\\.*]+/g, '')\">\r\n <?php echo htmlspecialchars(\"*\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t</tr>\r\n <tr>\r\n\t\t\t<td class=\"hr\" align=\"left\"><?php echo htmlspecialchars(\"Selling Price\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t\t<td class=\"dr\" align=\"left\"><input type=\"text\" name=\"prod_price1\" maxlength=\"10\" value=\"<?php echo $row[\"prod_price1\"] ?>\" onKeyUp=\"this.value=this.value.replace(/[^\\d\\.*]+/g, '')\">\r\n <?php echo htmlspecialchars(\"*\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t</tr>\r\n \r\n <tr>\r\n\t\t\t<td class=\"hr\" align=\"left\"><?php echo htmlspecialchars(\"Product Tax\").\"&nbsp;\" ?></td>\r\n\t\t\t<td class=\"dr\" align=\"left\"><input type=\"text\" name=\"prod_tax\" maxlength=\"10\" value=\"<?php echo $row[\"prod_tax\"] ?>\" onKeyUp=\"this.value=this.value.replace(/[^\\d\\.*]+/g, '')\">\r\n <?php echo htmlspecialchars(\"(optional)\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td class=\"hr\" align=\"left\"><?php echo htmlspecialchars(\"Product Discount\").\"&nbsp;\" ?></td>\r\n\t\t\t<td class=\"dr\" align=\"left\"><input type=\"text\" name=\"prod_discount\" maxlength=\"10\" value=\"<?php echo $row[\"prod_discount\"] ?>\" onKeyUp=\"this.value=this.value.replace(/[^\\d\\.*]+/g, '')\">\r\n <?php echo htmlspecialchars(\"(optional)\").\"&nbsp;\" ?>\r\n </td>\r\n\t\t</tr>\r\n\t</table>\r\n<?php \r\n}", "public function validateBody()\n {\n\n if (v::identical($this->col)->validate(1)) {\n\n /** Cidade ou Região **/\n\n $regiao = Tools::clean($this->cell);\n\n if (!v::stringType()->notBlank()->validate($regiao)) {\n throw new \\InvalidArgumentException(\"Atenção: Informe na tabela a Cidade ou Região corretamente.\", E_USER_WARNING);\n }\n\n $this->array[$this->row]['regiao'] = $regiao;\n\n }\n\n if (v::identical($this->col)->validate(2)) {\n\n /** Faixa CEP Inicial **/\n\n $cep_inicio = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_inicio)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Inicial \\\"{$cep_inicio}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_inicio'] = $cep_inicio;\n\n }\n\n if (v::identical($this->col)->validate(3)) {\n\n /** Faixa CEP Final **/\n\n $cep_fim = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_fim)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Final \\\"{$cep_fim}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_fim'] = $cep_fim;\n\n }\n\n if (v::identical($this->col)->validate(4)) {\n\n /** Peso Inicial **/\n\n $peso_inicial = Tools::clean($this->cell);\n\n if (v::numeric()->negative()->validate(Tools::convertToDecimal($peso_inicial))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Inicial não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$peso_inicial}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_inicial'] = $peso_inicial;\n\n }\n\n if (v::identical($this->col)->validate(5)) {\n\n /** Peso Final **/\n\n $peso_final = Tools::clean($this->cell);\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($peso_final))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Final não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$peso_final}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_final'] = $peso_final;\n\n }\n\n if (v::identical($this->col)->validate(6)) {\n\n /** Valor **/\n\n $valor = Tools::clean($this->cell);\n\n if (!v::notEmpty()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALOR do frete não pode ser vazio.\n\n Por favor, corrija o valor e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do frete não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$valor}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['valor'] = $valor;\n\n }\n\n if (v::identical($this->col)->validate(7)) {\n\n /** Prazo de Entrega **/\n\n $prazo_entrega = (int)Tools::clean($this->cell);\n\n /**\n * Verifica o prazo de entrega\n */\n if (!v::numeric()->positive()->validate($prazo_entrega)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Atenção: Informe na tabela os Prazos de Entrega corretamente.\n\n Exemplo: 7 para sete dias.\n\n Por favor, corrija o Prazo de Entrega \\\"{$prazo_entrega}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate($prazo_entrega)) {\n $prazo_entrega = null;\n }\n\n $this->array[$this->row]['prazo_entrega'] = $prazo_entrega;\n\n }\n\n if (v::identical($this->col)->validate(8)) {\n\n /** AD VALOREM **/\n\n $ad_valorem = Tools::clean($this->cell);\n\n if (!empty($ad_valorem) && !v::numeric()->positive()->validate(Tools::convertToDecimal($ad_valorem))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do AD VALOREM não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$this->cell}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($ad_valorem))) {\n $ad_valorem = null;\n }\n\n $this->array[$this->row]['ad_valorem'] = $ad_valorem;\n\n }\n\n if (v::identical($this->col)->validate(9)) {\n\n /** KG Adicional **/\n\n $kg_adicional = Tools::clean($this->cell);\n\n if (!empty($kg_adicional) && v::numeric()->negative()->validate(Tools::convertToDecimal($kg_adicional))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do KG Adicional não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$kg_adicional}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($kg_adicional))) {\n $kg_adicional = null;\n }\n\n $this->array[$this->row]['kg_adicional'] = $kg_adicional;\n\n }\n\n return $this->array;\n\n }", "function select_type($who){\t\n\t$textareas = array('note'); \n\t$select = array('centro_di_ricavo','proprietario','anno_di_interesse','interessato_a','campagna_id',\"source_potential\",'vettura_posseduta_alimentazione','pagamento_vettura','experience_level',\"mansione\",\"paese\",\"proprietario\",\"status_pagamento\",\"causale\",\"metodo_di_pagamento\");\n\t$select_text = array(\"provincia\",\"citta\");\n\t$disabled = array(\"messaggio\",\"data_creazione\",\"visite\");\n\t$hidden = array('industry',\"paese\",'marchio',\"data_assegnazione\",\"data_scadenza\",\"data_scadenza_venditore\",'venditore',\"company\",\"job_title\",\"data_creazione\",\"sent_mail\",\"in_use\",'is_customer',\"data_aggiornamento\",\"ip\",\"operatore\");\n\t$radio = array('rito_civile');\n\t$text = array();\n\t$selectbtn = array('location_evento',\"status_potential\",'attivo');\t\n\t$calendario = array('data_visita');\t\n\t$file = array();\n\t$invisible = array('priorita_contatto');\n\t$datePicker = array();\n\t$checkbox = array('tipo_interesse');\n\t$multi_selection = array(\"ambienti\",\"mesi_di_interesse\",\"giorni_di_interesse\");\n\t$ifYesText = array();\t\t\n\tif(defined('tab_prefix') && @tab_prefix == 'hrc') $hidden = array(\"indirizzo\",\"ragione_sociale\",\"partita_iva\",\"paese\",\"\",\"\",\"data_assegnazione\",\"data_scadenza\",\"data_scadenza_venditore\",'venditore',\"website\",\"fatturato_annuo\",\"mansione\",\"company\",\"job_title\",\"numero_dipendenti\",\"data_creazione\",\"sent_mail\",\"in_use\",\"status_potential\",'is_customer',\"data_aggiornamento\",\"marchio\",\"ip\",\"operatore\");\n\t\n\tif(isset($_GET['id'])) { \n\tif(check($_GET['id']) == 1) { \n\t\tarray_push($invisible,'anno_di_interesse','ambienti','mesi_di_interesse','tipo_interesse','periodo_interesse','preferenze_menu','prezzo_preventivato'); \n\t\tarray_push($hidden,'cap','proprietario','messaggio','rito_civile'); \n\t\tif(check($_GET['status_potential']) != 1) array_push($hidden,'source_potential'); \n\t}}\n\n\t$type = 1;\n\t\n\tif(in_array($who,$select)) { $type = 2; }\n\tif(in_array($who,$select_text)) { $type = 12; }\t\n\tif(in_array($who,$textareas)){ $type = 3; }\n\tif(in_array($who,$disabled)){ $type = 4; }\n\tif(in_array($who,$radio)){ $type = 8; }\n\tif(in_array($who,$calendario)){ $type = 20; }\n\tif(in_array($who,$file)){ $type = 18; }\n\tif(in_array($who,$text)){ $type = 24; }\n\tif(in_array($who,$checkbox)){ $type = 19; }\n\tif(in_array($who,$selectbtn)){ $type = 9; }\n\tif(in_array($who,$multi_selection)){ $type = 23; }\n\tif(in_array($who,$checkbox)){ $type = 19; }\n\tif(in_array($who,$datePicker)){ $type = 11; }\n\tif(in_array($who,$ifYesText)){ $type = 13; }\n\tif(in_array($who,$hidden)){ $type = 5; }\n\tif(in_array($who,$invisible)){ $type = 7; }\n\n\treturn $type;\n\t}", "function combo_check($str)\r\n\t{\r\n\t\tif ($str == '-SELECT-')\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('combo_check', 'Valid %s Name is required');\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t}", "private function input(){\n if($this->option('s')){\n $this->params['exceptions'] = '';\n return false;\n }\n $this->info('Set table names, that be excluded from CRUD generation');\n $this->params['exceptions'] = $this->ask('Excluded table names');\n }", "function ValidaCampos(){\n\t\t\n\t\t $this->form_validation->set_rules(\"id_clase\", \"Id_clase\", \"callback_select_clase\");\n\t\t $this->form_validation->set_rules(\"ofrenda_clase\", \"Ofrenda_clase\", \"trim|required\");\n\t\t $this->form_validation->set_rules(\"fecha_ofrenda\", \"Fecha_ofrenda\", \"trim|required\");\n\t\t \n\t}", "public function getValidationScript($colName) {\r\n $colScript = parent::getValidationScript($colName);\r\n if ($colName==\"idCriticality\" or $colName==\"idUrgency\") {\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >'; \r\n $colScript .= htmlGetJsTable('Urgency', 'value');\r\n $colScript .= htmlGetJsTable('Criticality', 'value');\r\n $colScript .= htmlGetJsTable('Priority', 'value');\r\n $colScript .= ' var urgencyValue=0; var criticalityValue=0; var priorityValue=0;';\r\n $colScript .= ' var filterUrgency=dojo.filter(tabUrgency, function(item){return item.id==dijit.byId(\"idUrgency\").value;});';\r\n $colScript .= ' var filterCriticality=dojo.filter(tabCriticality, function(item){return item.id==dijit.byId(\"idCriticality\").value;});';\r\n $colScript .= ' dojo.forEach(filterUrgency, function(item, i) {urgencyValue=item.value;});';\r\n $colScript .= ' dojo.forEach(filterCriticality, function(item, i) {criticalityValue=item.value;});';\r\n $colScript .= ' calculatedValue = Math.round(urgencyValue*criticalityValue/2);';\r\n $colScript .= ' var filterPriority=dojo.filter(tabPriority, function(item){return item.value==calculatedValue;});';\r\n $colScript .= ' if ( filterPriority.length==0) {';\r\n $colScript .= ' calculatedValue = Math.round(calculatedValue/2);';\r\n $colScript .= ' var filterPriority=dojo.filter(tabPriority, function(item){varChanged=true; return item.value==calculatedValue;});';\r\n $colScript .= ' }';\r\n $colScript .= ' var setVar=\"\";';\r\n $colScript .= ' dojo.forEach(filterPriority, function(item, i) {if (setVar==\"\") dijit.byId(\"idPriority\").set(\"value\",item.id);});';\r\n $colScript .= ' formChanged();';\r\n $colScript .= '</script>';\r\n } else if ($colName==\"actualDueDateTime\") {\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .= ' var upd=dijit.byId(\"initialDueDateTime\");';\r\n $colScript .= ' if (upd && upd.get(\"value\")==null) { ';\r\n $colScript .= ' upd.set(\"value\", this.value); ';\r\n $colScript .= ' } ';\r\n $colScript .= ' formChanged();'; \r\n $colScript .= '</script>'; \r\n } else if ($colName==\"actualDueDateTimeBis\") {\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .= ' var upd=dijit.byId(\"initialDueDateTimeBis\");';\r\n $colScript .= ' if (upd && upd.get(\"value\")==null) { ';\r\n $colScript .= ' upd.set(\"value\", this.value); ';\r\n $colScript .= ' } ';\r\n $colScript .= ' formChanged();';\r\n $colScript .= '</script>'; \r\n } else if ($colName==\"initialDueDateTime\") {\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .= ' var upd=dijit.byId(\"actualDueDateTime\");';\r\n $colScript .= ' if (upd && upd.get(\"value\")==null) { ';\r\n $colScript .= ' upd.set(\"value\", this.value); ';\r\n $colScript .= ' } ';\r\n $colScript .= ' formChanged();';\r\n $colScript .= '</script>'; \r\n } else if ($colName==\"initialDueDateTimeBis\") {\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .= ' var upd=dijit.byId(\"actualDueDateTimeBis\");';\r\n $colScript .= ' if (upd && upd.get(\"value\")==null) { ';\r\n $colScript .= ' upd.set(\"value\", this.value); ';\r\n $colScript .= ' } ';\r\n $colScript .= ' formChanged();';\r\n $colScript .= '</script>'; \r\n } else if ($colName==\"idProduct\" or $colName==\"idComponent\") {\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .= ' if (this.value) {';\r\n $colScript .= ' var idP=dijit.byId(\"idProduct\").get(\"value\");';\r\n $colScript .= ' var idC=dijit.byId(\"idComponent\").get(\"value\");';\r\n $colScript .= ' var idR=dijit.byId(\"idResource\").get(\"value\");';\r\n $colScript .= ' dojo.xhrGet({';\r\n $colScript .= ' url: \"../tool/getSingleData.php?dataType=responsible&idProduct=\"+idP+\"&idComponent=\"+idC+\"&idResource=\"+idR,';\r\n $colScript .= ' handleAs: \"text\",';\r\n $colScript .= ' load: function (data) {';\r\n $colScript .= ' if (data) {';\r\n $colScript .= ' refreshList(\"idResource\", \"idProject\", dijit.byId(\"idProject\").get(\"value\"), data, null, dijit.byId(\"idResource\").get(\"required\"));';\r\n $colScript .= ' dijit.byId(\"idResource\").set(\"value\",data);';\r\n $colScript .= ' }';\r\n $colScript .= ' }';\r\n $colScript .= ' });';\r\n $colScript .= ' };';\r\n \r\n //ADD by qCazelles - Business features\r\n if ($colName==\"idProduct\") $colScript .= 'dijit.byId(\"idBusinessfeature\").set(\"value\", \"\");refreshList(\"idBusinessfeature\", \"idProduct\", dijit.byId(\"idProduct\").get(\"value\"));';\r\n //END ADD\r\n \r\n $colScript .= '</script>';\r\n }\r\n if ($colName==\"done\") {\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .= ' var done=dijit.byId(\"done\").get(\"checked\");';\r\n $colScript .= ' var real=dijit.byId(\"WorkElement_realWork\").get(\"value\");';\r\n $colScript .= ' var planned=dijit.byId(\"WorkElement_plannedWork\").get(\"value\");';\r\n $colScript .= ' if (done) {';\r\n $colScript .= ' dijit.byId(\"WorkElement_leftWork\").set(\"value\", 0);';\r\n $colScript .= ' } else {';\r\n $colScript .= ' var left=planned-real;';\r\n $colScript .= ' if (left<0) left=0;';\r\n $colScript .= ' dijit.byId(\"WorkElement_leftWork\").set(\"value\", left);';\r\n $colScript .= ' } ';\r\n $colScript .= ' formChanged();';\r\n $colScript .= '</script>';\r\n }\r\n return $colScript;\r\n }", "function thumbwhere_contentcollection_edit_form_validate(&$form, &$form_state) {\n \n //if (twCanDebug()) debug($form); \n //if (twCanDebug()) debug($form_state);\n\n\n // No validation for pk\n\n\n // Convert fk autocomplete for fk_actor\n $value = $form['fk_actor']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_actor'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_actor']);\n if (twCanDebug()) debug('fk_actor = ' . $value);\n // Validate fk fk_actor\n if (empty($value)) {\n form_set_error('fk_actor', t('Validation error, \\'fk_actor\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_actor\\' in is mandatory');\n }\n\n // Validate normaltitle\n $value = $form['title']['#value'];\n // If we have no default value then we don't care much for checking for emptyness.\n\n\n \n\n //form_set_value( array('#parents' => array('array_key_parent', 'array_key_to_replace')) , $value, $form_state);\n\n \n \n $thumbwhere_contentcollection = $form_state['thumbwhere_contentcollection'];\n\n // Notify field widgets to validate their data.\n field_attach_form_validate('thumbwhere_contentcollection', $thumbwhere_contentcollection, $form, $form_state);\n \n \n \n}", "public function checkEnableColumnEdit()\n\t{\n\t\treturn false;\n\t}", "function doEdit()\n {\n global $_POST;\n$regs=explode(\":::\",$_POST[\"DROWS\"]);\n$id= $regs[0];\n if (strlen($id) <= 0)\n {\n echo \"Nao existe valores a serem editados\";\n echo \"<a href=./cadastra.php>Voltar</a> \";\n exit();\n }\n$result = lookup($id);\n\n presentInputForm(\n mysql_result($result, 0, \"id\"),\n mysql_result($result, 0, 1),\n mysql_result($result, 0, 2),\n mysql_result($result, 0, 3),\n mysql_result($result, 0, 4),\n mysql_result($result, 0, 5),\n mysql_result($result, 0, 6),\n mysql_result($result, 0, 7),\n mysql_result($result, 0, 8),\n mysql_result($result, 0, 9),\n mysql_result($result, 0, 10),\n mysql_result($result, 0, 11),\n\"E\");\n }", "function cvpapgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 194) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(2964);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('cvpapgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('cvpapgr_school_check_2964', 'Select a VCCS College/Agency', 2964);\n }\n /* Confirms Discipline is selected */\n $dis_check = $ninja_forms_processing->get_field_value(2960);\n if ($dis_check == 1 ) {\n $ninja_forms_processing->add_error('cvpapgr_dis_check', 'Please select a Discipline');\n $ninja_forms_processing->add_error('cvpapgr_dis_check_2960', 'Select a Discipline', 2960);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(2962);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('cvpapgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('cvpapgr_job_check_2962', 'Select a Job Type', 2962);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(2966);\n $email_check = $ninja_forms_processing->get_field_value(2967);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('cvpapgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('cvpapgr_email_check_2966', 'Email addresses must match', 2966);\n $ninja_forms_processing->add_error('cvpapgr_email_check_2967', 'Email addresses must match', 2967);\n }\n }\n}", "public function setInvalid();", "function validate_on_update() {}", "public function getValidationScript($colName) {\r\n $colScript = parent::getValidationScript($colName);\r\n if ($colName=='startDate') {\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .=\" var end=dijit.byId('endDate');\";\r\n $colScript .=\" end.set('dropDownDefaultValue',startDate);\";\r\n $colScript .=\" end.constraints.min=startDate; \";\r\n $colScript .=\" setDatesContract('startDate');\";\r\n $colScript .= '</script>';\r\n }else if($colName=='idUnitContract'){\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .=\" setDatesContract('idUnitContract');\";\r\n $colScript .= '</script>';\r\n }else if($colName=='initialContractTerm'){\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .=\" if(isNaN(this.value))dijit.byId('initialContractTerm').set('value',0);\";\r\n $colScript .=\" setDatesContract('initialContractTerm');\";\r\n $colScript .= '</script>';\r\n }else if($colName=='endDate'){\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .=\" var start=dijit.byId('startDate');\";\r\n $colScript .=\" start.set('dropDownDefaultValue',this.value);\";\r\n $colScript .=\" start.constraints.max=this.value; \";\r\n $colScript .=\" setDatesContract('endDate');\";\r\n $colScript .= '</script>';\r\n }else if($colName=='noticeDate') {\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .=\" setDatesContract('noticeDate');\";\r\n $colScript .= '</script>';\r\n }else if($colName=='idUnitNotice'){\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .=\" setDatesContract('idUnitNotice');\";\r\n $colScript .= '</script>';\r\n }else if($colName=='noticePeriod'){\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .=\" if(isNaN(this.value))dijit.byId('noticePeriod').set('value',0);\";\r\n $colScript .=\" setDatesContract('noticePeriod');\";\r\n $colScript .= '</script>';\r\n }else if($colName=='periodicityContract'){\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .=\" if(isNaN(this.value))dijit.byId('periodicityContract').set('value',0);\";\r\n $colScript .= '</script>';\r\n }else if($colName=='periodicityBill'){\r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .=\" if(isNaN(this.value))dijit.byId('periodicityBill').set('value',0);\";\r\n $colScript .= '</script>';\r\n }else if ($colName==\"idClient\") {\r\n\t\t\t$colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n\t\t\t$colScript .= ' refreshList(\"idContact\", \"idClient\", this.value, null, null, false);';\r\n\t\t\t$colScript .= ' formChanged();';\r\n\t\t\t$colScript .= '</script>';\r\n\t } else if ($colName==\"idContact\") { \r\n $colScript .= '<script type=\"dojo/connect\" event=\"onChange\" >';\r\n $colScript .= ' if (this.value && ! dijit.byId(\"phoneNumber\").get(\"value\")) {';\r\n $colScript .= ' dojo.xhrGet({';\r\n $colScript .= ' url: \"../tool/getSingleData.php?dataType=contactPhone&idContact=\" + this.value,';\r\n $colScript .= ' handleAs: \"text\",';\r\n $colScript .= ' load: function (data) {dijit.byId(\"phoneNumber\").set(\"value\",data);}';\r\n $colScript .= ' });';\r\n $colScript .= ' };';\r\n $colScript .= ' formChanged();';\r\n $colScript .= '</script>';\r\n }\r\n return $colScript;\r\n }", "abstract public function runValidation();", "function checkValues($row,&$data,$insert,$from_update=false) {\n global $Language;\n $hp = Codendi_HTMLPurifier::instance();\n for ($c=0; $c < count($this->parsed_labels); $c++) {\n $label = $this->parsed_labels[$c];\n $val = $data[$c];\n $field = $this->used_fields[$label];\n if ($field) $field_name = $field->getName();\n \n // check if val in predefined vals (if applicable)\n unset($predef_vals);\n if (isset($this->predefined_values[$c])) {$predef_vals = $this->predefined_values[$c];}\n if (isset($predef_vals)) {\n\tif (!$this->checkPredefinedValues($field,$field_name,$label,$val,$predef_vals,$row,$data)) {\n\t return false;\n\t}\n }\n \n // check whether we specify None for a field which is mandatory\n if ($field && !$field->isEmptyOk() &&\n\t $field_name != \"artifact_id\") {\n\tif ($field_name == \"submitted_by\" ||\n\t $field_name == \"open_date\") {\n\t //submitted on and submitted by are accepted as \"\" on inserts and\n\t //we put time() importing user as default\n\t} else {\n\t \n\t $is_empty = ( ($field->isSelectBox() || $field->isMultiSelectBox()) ? ($val==$Language->getText('global','none')) : ($val==''));\n\n\t if ($is_empty) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_current',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML),\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t}\n }\n \n // for date fields: check format\n if ($field && $field->isDateField()) {\n\tif ($field_name == \"open_date\" && $val == \"\") {\n\t //is ok.\n\t} else {\n\t \n\t if ($val == \"-\" || $val == \"\") {\n\t //ok. transform it by hand into 0 before updating db\n\t $data[$c] = \"\";\n\t } else {\n\t list($unix_time,$ok) = util_importdatefmt_to_unixtime($val);\n\t if (!$ok) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','incorrect_date',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t $date = format_date(\"Y-m-d\",$unix_time);\n\t $data[$c] = $date;\n\t }\n\t}\n }\n } // end of for parsed_labels\n\n\n if (!$insert && $label == $this->lbl_list['follow_ups']) {\n /* check whether we need to remove known follow-ups */\n \n }\n \n // if we come from update case ( column tracker_id is specified but for this concrete artifact no aid is given)\n // we have to check whether all mandatory fields are specified and not empty\n if ($from_update) {\n\n \n while (list($label,$field) = each($this->used_fields)) {\n\tif ($field) $field_name = $field->getName();\n\t\n\tif ($field) {\n if ($field_name != \"artifact_id\" &&\n $field_name != \"open_date\" &&\n $field_name != \"submitted_by\" &&\n $label != $this->lbl_list['follow_ups'] &&\n $label != $this->lbl_list['is_dependent_on'] &&\n $label != $this->lbl_list['add_cc'] &&\n $label != $this->lbl_list['cc_comment'] &&\n !$field->isEmptyOk() && !in_array($label,$this->parsed_labels)) {\n\t \n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_line',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n }\n\t}\n }\n \n \n }//end from_update\n \n return true;\n }", "function form_dropdown_position($name = '', $selected = array(), $extra = '', $type = 'all', $display = 'y', $dept_type = '')\n {\n $ci =& get_instance();\n\n /* load the resources */\n $ci->load->model('depts_model', 'dept');\n $ci->load->model('positions_model', 'pos');\n $ci->load->library('session');\n\n /* set and load the language file needed */\n $ci->lang->load('app', $ci->session->userdata('language'));\n\n /* grab the positions */\n if ($type == 'open') {\n $positions = $ci->pos->get_open_positions($display);\n } elseif (is_numeric($type)) {\n $positions = $ci->pos->get_dept_positions($type, $display);\n } else {\n $positions = $ci->pos->get_all_positions('asc', $display);\n }\n\n if ($positions->num_rows() > 0) {\n $options[0] = ucwords($ci->lang->line('labels_please') .' '. $ci->lang->line('actions_choose')\n .' '. $ci->lang->line('order_one'));\n\n $valid = false;\n\n foreach ($positions->result() as $pos) {\n $dept = $ci->dept->get_dept($pos->pos_dept, array('dept_name', 'dept_type', 'dept_display', 'dept_manifest'));\n\n $manifestname = $ci->dept->get_manifest($dept['dept_manifest'], 'manifest_name');\n $manifest = ($manifestname == '') ? false : ' ('.$manifestname.')';\n $fullname = $dept['dept_name'].$manifest;\n\n if (($dept_type == 'playing' && $dept['dept_type'] == 'playing') ||\n ($dept_type == 'nonplaying' && $dept['dept_type'] == 'nonplaying') ||\n $dept['dept_display'] == 'y') {\n if ($type == 'all' || $type == 'open') {\n $options[$fullname][$pos->pos_id] = $pos->pos_name;\n } else {\n $options[$pos->pos_id] = $pos->pos_name;\n }\n }\n }\n\n return form_dropdown($name, $options, $selected, $extra);\n }\n\n return false;\n }", "function edit_field_confirm()\n\t{\n\t\tif ( empty($_POST['type']) ) return FALSE;\n\n\t\t// -------------------------------------\n\t\t//\tField id\n\t\t// -------------------------------------\n\n\t\t$field_id\t= ee()->input->get_post('field_id');\n\n\t\t// -------------------------------------\n\t\t//\tField length tests\n\t\t// -------------------------------------\n\n\t\t$error\t= array();\n\t\t$sql\t= \"\";\n\n\t\tswitch ( $_POST['type'] )\n\t\t{\n\t\t\tcase 'character':\n\n\t\t\t\tif ( empty( $_POST['length'] ) OR ! is_numeric($_POST['length']) )\n\t\t\t\t{\n\t\t\t\t\t$error[]\t= lang('field_length_required');\n\t\t\t\t}\n\t\t\t\telseif ( $_POST['length'] < 1 OR $_POST['length'] > 255 )\n\t\t\t\t{\n\t\t\t\t\t$error[]\t= lang('char_length_incorrect');\n\t\t\t\t}\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" CHAR(\".round(ee()->db->escape_str($_POST['length'])).\") NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'varchar':\n\n\t\t\t\tif ( empty( $_POST['length'] ) OR ! is_numeric($_POST['length']) )\n\t\t\t\t{\n\t\t\t\t\t$error[]\t= lang('field_length_required');\n\t\t\t\t}\n\t\t\t\telseif ( $_POST['length'] < 1 OR $_POST['length'] > 255 )\n\t\t\t\t{\n\t\t\t\t\t$error[]\t= lang('varchar_length_incorrect');\n\t\t\t\t}\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" VARCHAR(\".round(ee()->db->escape_str($_POST['length'])).\") NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'decimal':\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$parens\t= ( is_numeric($_POST['length']) === TRUE AND is_numeric($_POST['precision']) === TRUE ) ? \"(\".round(ee()->db->escape_str($_POST['length'])).\",\".round(ee()->db->escape_str($_POST['precision'])).\")\": '';\n\t\t\t\t$sql\t.= \" DECIMAL\" . $parens . \" NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'float':\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$parens\t= ( is_numeric($_POST['length']) === TRUE AND is_numeric($_POST['precision']) === TRUE ) ? \"(\".round(ee()->db->escape_str($_POST['length'])).\",\".round(ee()->db->escape_str($_POST['precision'])).\")\": '';\n\t\t\t\t$sql\t.= \" FLOAT\" . $parens . \" NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'integer':\n\n\t\t\t\t$_POST['length']\t= 10;\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" INT(\".round(ee()->db->escape_str($_POST['length'])).\") unsigned NOT NULL\";\n\t\t\tbreak;\n\t\t\tcase 'small integer':\n\n\t\t\t\t$_POST['length']\t= 5;\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" SMALLINT(\".round(ee()->db->escape_str($_POST['length'])).\") unsigned NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'tiny integer':\n\n\t\t\t\t$_POST['length']\t= 3;\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" TINYINT(\".round(ee()->db->escape_str($_POST['length'])).\") unsigned NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$sql\t.= \" TEXT NOT NULL\";\n\t\t\tbreak;\n\t\t}\n\n\t\t$sql\t= \"ALTER TABLE `%table%` CHANGE `%field%` `%field%`\".$sql;\n\n\t\t$sql\t= str_replace( array( '%table%', '%field%' ), array( 'exp_channel_data', 'field_id_'.$field_id ), $sql );\n\n\t\t// -------------------------------------\n\t\t//\tAny errors?\n\t\t// -------------------------------------\n\n\t\tif ( count( $error ) > 0 )\n\t\t{\n\t\t\treturn $this->show_error($error);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tPrep vars\n\t\t// -------------------------------------\n\n\t\t$this->cached_vars['field_id']\t= $field_id;\n\t\t$this->cached_vars['sql']\t\t= base64_encode( $sql );\n\t\t$this->cached_vars['method']\t= 'edit_field';\n\n\t\t// -------------------------------------\n\t\t//\tWill this change truncate data?\n\t\t// -------------------------------------\n\n\t\t$this->cached_vars['question']\t= lang('edit_field_question');\n\n\t\tif ( isset( $check_truncation ) === TRUE )\n\t\t{\n\t\t\t$this->cached_vars['question']\t= lang('edit_field_question_truncate');\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tPrep message\n\t\t// -------------------------------------\n\n\t\t$this->_prep_message();\n\n\t\t// -------------------------------------\n\t\t//\tTitle and Crumbs\n\t\t// -------------------------------------\n\n\t\t$this->add_crumb( lang( 'edit_field' ) );\n\t\t$this->cached_vars['module_menu_highlight'] = 'module_fields';\n\n\t\t// -------------------------------------\n\t\t//\tLoad Homepage\n\t\t// -------------------------------------\n\n\t\treturn $this->ee_cp_view('edit_field_confirm.html');\n\t}", "public static function userBadChoice()\n {\n say('Invalid entry, please try again');\n }", "function show_or_hide($table, $column, $radio_option){\n\t\tif(isset($_POST[$column])){\n\t\t\t$show_column_name = $_POST[$column];\n\t\t\t$show_hide = $_POST[$radio_option];\n\t\t\t$result = $table::insert_info_about_page($table, $show_column_name,$show_hide);\n\t\t}\t\n\t}", "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "function validate()\n\t{\n\t}", "public function validarCedula() {\n if (!$this->hasErrors()) {\n// $usuario = Usuario::model()->findByPk($this->cedula);\n// if ($usuario !== null) {\n// $this->addError('cedula', 'Cédula ya registrada');\n// }\n \t\n }\n }", "public abstract function validation();", "public function Validate_Data($sorce){\r\n\r\n // Create connection with database\r\n $this->_db = DB::get_Instance();\r\n\r\n // Set validation flag as true\r\n $this->_flag = true;\r\n\r\n ### Nick Validation ###\r\n\r\n self::Nick_Register_Validation($sorce);\r\n\r\n ### E-mail Validation ###\r\n\r\n self::Email_Register_Validation($sorce);\r\n\r\n ### Password Validation ###\r\n\r\n self::Password_Register_Validation($sorce);\r\n\r\n ### Check checkbox ###\r\n\r\n self::check_Check_Box($sorce);\r\n\r\n ### Check reCAPTCHA ###\r\n\r\n self::check_ReCAPTCHA($sorce);\r\n\r\n ### Check first name ###\r\n self::FName_Register_Validation($sorce);\r\n\r\n ### Check last name ###\r\n self::LName_Register_Validation($sorce);\r\n }", "function thumbwhere_contentcollectionitem_edit_form_validate(&$form, &$form_state) {\n \n //if (twCanDebug()) debug($form); \n //if (twCanDebug()) debug($form_state);\n\n\n // No validation for pk\n\n\n // Convert fk autocomplete for fk_contentcollection\n $value = $form['fk_contentcollection']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_contentcollection'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_contentcollection']);\n if (twCanDebug()) debug('fk_contentcollection = ' . $value);\n // Validate fk fk_contentcollection\n if (empty($value)) {\n form_set_error('fk_contentcollection', t('Validation error, \\'fk_contentcollection\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_contentcollection\\' in is mandatory');\n }\n\n // Convert fk autocomplete for fk_content\n $value = $form['fk_content']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_content'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_content']);\n if (twCanDebug()) debug('fk_content = ' . $value);\n // Validate fk fk_content\n if (empty($value)) {\n form_set_error('fk_content', t('Validation error, \\'fk_content\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_content\\' in is mandatory');\n }\n\n // Validate normalweight\n $value = $form['weight']['#value'];\n // If we have no default value then we don't care much for checking for emptyness.\n\n\n \n\n //form_set_value( array('#parents' => array('array_key_parent', 'array_key_to_replace')) , $value, $form_state);\n\n \n \n $thumbwhere_contentcollectionitem = $form_state['thumbwhere_contentcollectionitem'];\n\n // Notify field widgets to validate their data.\n field_attach_form_validate('thumbwhere_contentcollectionitem', $thumbwhere_contentcollectionitem, $form, $form_state);\n \n \n \n}", "private function check_column($column, $column_value)\n {\n $column_errors = [];\n\n check_empty($column_value, $column->title, $column_errors);\n\n if( empty( $column_errors ) )\n {\n $rules = $this->rules[$column->rules];\n if (isset($rules['regex']) && !preg_match($rules['regex'], $column_value)) {\n array_push($column_errors, $column->title . '格式錯誤');\n }\n if (isset($rules['validator'])) {\n $validator = \\Validator::make([$column->id => $column_value], [$column->id => $rules['validator']]);\n $validator->fails() && array_push($column_errors, $column->title . '格式錯誤');\n }\n if (isset($rules['function'])) {\n call_user_func_array($this->checker($rules['function']), array($column_value, $column, &$column_errors));\n }\n\n if (!$column->unique && isset($rules['menu'])) {\n if (!in_array($column_value, $column->answers->lists('value'), true)) {\n array_push($column_errors, $column->title . '未在選單中');\n }\n }\n }\n\n return $column_errors;\n }", "function EDIT()\n{ //COMPROBAR SI EXISTEN TODOS MEDIANTE EL SELECT\n\t//si se cumple la condicion\n\tif ($this->Comprobar_atributos() === true){\n\t $sql = \"SELECT *\n\t\t\tFROM PROF_ESPACIO\n\t\t\tWHERE (\n\t\t\t\t(DNI = '$this->DNI' AND CODESPACIO = '\".$this->CODESPACIO.\"') \n\t\t\t)\";\n\t//si no guardamos un mensaje de error en la variable resultado\n\t\t\tif($result = $this->mysqli->query($sql)){\t\n\t//si se cumple la condicion\n\tif ($result->num_rows == 0){ // existe el usuario\n\t\t$sql = \"UPDATE PROF_ESPACIO SET DNI = '$this->DNI',CODESPACIO = '$this->CODESPACIO' WHERE DNI= '$this->DNI' AND CODESPACIO = '\".$this->CODESPACIO.\"'\";\n\t//si se cumple la condicion\n\t\tif ($this->mysqli->query($sql))\n\t{\n\t\t$resultado = 'Actualización realizada con éxito';\n\t}\n\t//si no\n\telse\n\t{\n\t\t$resultado = 'Error de gestor de base de datos';//guarda mensaje de error en la variable resultado\n\t}\n\treturn $resultado;\n\t}\n\t//si no\n\telse\n\t{\n\t\treturn 'El elemento no existe en la BD';//devuelve el mensaje\n\t}\n\t}//si no\n\telse{\n\t\treturn 'Error de gestor de base de datos';//devuelve el mensaje\n}\n\t}//si no\n\telse{\n\t\treturn $this->erroresdatos;\n\t}\n}", "public function Do_select_Example1(){\n\n\t}", "function save_user_management_validation() {\n global $pesan_error; //memanggil global variabel 2 ini\n global $conn;\n //mengecek jika datanya tidak sama dengan datanya yang lama alias diubah\n if ($_POST['nama-pengguna']!=pengguna()['nama_pengguna']) {\n //melakukan select pada pengguna dengan where kondisi data baru\n $q = $conn->prepare(\"SELECT * FROM pengguna WHERE nama_pengguna='{$_POST['nama-pengguna']}' AND aktif='1'\");\n $q->execute();\n //jika method fetchAll ini menghasilkan setidaknya 1 (tidak bernilai false) maka dianggap sudah ada yang menggunakan data itu\n if (@$q->fetchAll()) $pesan_error['nama-pengguna'] = 'Nama pengguna sudah digunakan';\n }\n validasi_masukan_alfanumerik($pesan_error, 'nama-pengguna'); //menvalidasi nama pengguna untuk alfanumerik\n validasi_masukan_wajib($pesan_error, 'nama-pengguna'); //masukan wajib juga\n if ($_POST['sandi']!='') { //jika kolom sandi diisi, dianggap melakukan perubahan pada kata sandi, dan akan divalidasi\n validasi_masukan_minimal($pesan_error, 'sandi', 4); //setidaknya terdapat 4 huruf\n validasi_masukan_sama($pesan_error, 'konfirmasi-sandi', 'sandi', 'Sandi'); //divalidasi juga dengan kolom konfirmasi, harus sama\n }\n validasi_masukan_alfabet($pesan_error, 'nama'); //validasi alfabet untuk nama\n validasi_masukan_wajib($pesan_error, 'nama'); //wajib juga\n if ($_POST['nomor-hp']!=pengguna()['nomor_hp']) { //jika ada perbedaan dengan nomor hp yang lama, maka dianggap diubah dan divalidasi\n //melakukan select pada database dengan data hp\n $q = $conn->prepare(\"SELECT * FROM pengguna WHERE nomor_hp='{$_POST['nomor-hp']}'\");\n $q->execute();\n //jika true (ada datanya) dianggap sudah ada yang menggunakan data tsb\n if (@$q->fetchAll()) $pesan_error['nomor-hp'] = 'Nomor HP sudah digunakan';\n }\n validasi_masukan_panjang($pesan_error, 'nomor-hp', 10, 15); //validasi panjang untuk hp min 10 dan max 15 karakter\n validasi_masukan_numerik($pesan_error, 'nomor-hp'); //harus angka\n validasi_masukan_wajib($pesan_error, 'nomor-hp'); //dan masukan wajib\n if ($_POST['email']!=pengguna()['email']) { //email juga demikian, jika beda dianggap melakukan perubahan dan divalidasi\n $q = $conn->prepare(\"SELECT * FROM pengguna WHERE email='{$_POST['email']}'\"); //select berdasarkan email\n $q->execute();\n if (@$q->fetchAll()) $pesan_error['email'] = 'E-mail sudah digunakan'; //jika data ada maka dianggap sudah ada yang menggunakan\n }\n validasi_masukan_email($pesan_error, 'email'); //validasi format email untuk kolom email\n validasi_masukan_wajib($pesan_error, 'email'); //validasi wajib juga\n if (!empty($pesan_error)) return; //jika ada pesan kesalahan, maka sampai disini (return, kebawahnya tidak akan diproses)\n $nama_pengguna = pengguna()['nama_pengguna']; //mengambil data nama pengguna yang lama dari fungsi pengguna()\n if ($_POST['sandi']!='') { //jika kolom sandi diisi, maka otomatis sandi akan diubah\n //mengupdate database berdasarkan nama pengguna saat ini\n $q = $conn->prepare(\"UPDATE pengguna SET sandi=SHA2('{$_POST['sandi']}', 0) WHERE nama_pengguna='$nama_pengguna' AND aktif='1'\");\n $q->execute();\n }\n //mengupdate data lainnya, meskipun data sama tetap akan melakukan ini\n $q = $conn->prepare(\"UPDATE pengguna SET nama_pengguna='{$_POST['nama-pengguna']}', nama='{$_POST['nama']}', alamat='{$_POST['alamat']}', nomor_hp='{$_POST['nomor-hp']}', email='{$_POST['email']}' WHERE nama_pengguna='$nama_pengguna' AND aktif='1'\");\n $q->execute();\n //mengubah data pada session, karena data nama-pengguna dianggap sudah berbeda, sehingga user tetap tercatat sudah login\n $_SESSION['nama-pengguna'] = $_POST['nama-pengguna'];\n}", "function select_option()\r\n{}", "function errorInput(){\r\n\t\tinclude 'define.php';\r\n\t\tif($_POST['hairstyle'] == \"\" and $_POST['maxprice'] == \"\" and $_POST['location'] == \"\" and $_POST['minprice'] == \"\"){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct one of the option\");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t}\r\n\t\telseif(isset($_POST['minprice']) and $_POST['hairstyle'] == \"\" and $_POST['location'] == \"\"and $_POST['maxprice'] == \"\"){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle or the combination of hairstyle and the minimum price you want to spend \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t}//end of if statement\r\n\t\telseif(isset($_POST['maxprice'])and $_POST['hairstyle'] == \"\" and $_POST['location'] == \"\" and $_POST['minprice'] == \"\"){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle or the combination of hairstyle and the maximum price you are willing to spend\");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t}\r\n\t\telseif(isset($_POST['minprice']) and isset($_POST['maxprice']) and $_POST['hairstyle'] == \"\" and $_POST['location'] == \"\" ){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t}\r\n\t\telseif(isset($_POST['minprice']) and isset($_POST['location']) and $_POST['hairstyle'] == \"\" and $_POST['maxprice'] == \"\" ){\r\n\t\t\t\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\telseif(isset($_POST['location']) and isset($_POST['maxprice']) and $_POST['hairstyle'] == \"\" and $_POST['minprice'] == \"\" ){\r\n\t\t\t\r\n\t\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t}\r\n\t\telseif(isset($_POST['minprice']) and isset($_POST['maxprice']) and isset($_POST['location']) and $_POST['hairstyle'] == \"\"){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t}\r\n\t}", "protected function _validate() {\n\t}", "public function validate()\r\n {\r\n foreach ($this->_data as $data) {\r\n if (!in_array($data, $this->_validateAgainst)) $this->addError('Value is not a valid selection.');\r\n }\r\n \r\n return !sizeof($this->_errors);\r\n }", "function ctr_validateDetails(&$ctx)\n{\n $reservation = $ctx['reservation'];\n\n // tables exist *AND* are not empty\n if (!empty($_POST['fullnames']) AND !empty($_POST['ages']))\n {\n $ages = $_POST['ages'];\n $fullnames = $_POST['fullnames'];\n $persons = array();\n\n for ($i = 0; $i < count($fullnames); $i++)\n {\n // age in [1;120] and fullname is set\n if (1 <= $ages[$i] AND $ages[$i] <= 120 AND $fullnames[$i])\n {\n array_push($persons, new Person($fullnames[$i], $ages[$i]));\n }\n else\n {\n $ctx['warning'] .= \"Veuillez remplir le(s) \".\n \"participant(s) correctement.\\n\";\n return false;\n }\n }\n\n $reservation->persons = $persons;\n $reservation->save();\n \n return true;\n }\n\n // Bypass checks if datas were already filled\n if ($reservation->persons)\n return true;\n\n $ctx['warning'] .= \"Veuillez remplir tous les champs correctement.\\n\";\n\n return false;\n}", "public function editCandidates($applicantID,$vacancy2){\n\t\t$vacancy = str_replace(\"%20\", \" \", $vacancy2);\n\t\t//$vacancy=$_POST['vacancy'];\n\t\t$final=$_POST['result'];\n\t\t//echo $vacancy;\n\n\t//\techo $final;\n\t\t//$aplicantID=$_POST['index'];\n\t\t//echo $applicantID;\n\t\tif ($vacancy==\"Senior Lecturer Grade I selected\" ||$vacancy==\"Senior Lecturer Grade I not selected\") {\n\t\t\t\n\n\t\t\t$this->load->model('SAR/ApplicantsModel');\n\t\t\t$this->ApplicantsModel->updateSLi($applicantID,$final);\n\n\t\t\t$this->load->model('SAR/CandidatesModel');\n\t\t\t$data['array']=$this->CandidatesModel->getAll($vacancy);\n\t\t\t$data['position']=$vacancy;\n\t\t\t$this->load->view('includes/header');\n\t\t\t$this->load->view('users/SAR/viewcategorized',$data);\n\t\t\t$this->load->view('includes/footer');\n\t\t}\n\t\tif ($vacancy==\"Senior Lecturer Grade II selected\" ||$vacancy==\"Senior Lecturer Grade II not selected\") {\n\t\t\t# code...\n\t\t\t$this->load->model('SAR/ApplicantsModel');\n\t\t\t$this->ApplicantsModel->updateSLii($applicantID,$final);\n\n\t\t\t$this->load->model('SAR/CandidatesModel');\n\t\t\t$data['array']=$this->CandidatesModel->getAll($vacancy);\n\t\t\t$data['position']=$vacancy;\n\t\t\t$this->load->view('includes/header');\n\t\t\t$this->load->view('users/SAR/viewcategorized',$data);\n\t\t\t$this->load->view('includes/footer');\n\t\t}else{\n\t\t\t$this->load->model('SAR/ApplicantsModel');\n\t\t\t$this->ApplicantsModel->updateLP($applicantID,$final);\n\t\t\n\t\t\t$this->load->model('SAR/CandidatesModel');\n\t\t\t$data['array']=$this->CandidatesModel->getAll($vacancy);\n\t\t\t$data['position']=$vacancy;\n\t\t\t$this->load->view('includes/header');\n\t\t\t$this->load->view('users/SAR/viewcategorized',$data);\n\t\t\t$this->load->view('includes/footer');\n\t\t}\n\n\t}", "function m_verifyInsert()\n\t{\n\t\t$this->errMsg=\"\";\n\n\t\tif(empty($this->request['subject']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg=MSG_SUBJECT_EMPTY.\"<br>\";\n\t\t}\n\t\t\n\t\tif(!empty($this->request['sid']))\n\t\t{\n\t\t\t#VALIDATING EXISTING OPTION TITLE\n\t\t\t$this->obDb->query = \"SELECT iMailid_PK FROM \".EMAILS.\" where vSid = '\".$this->request['sid'].\"'\";\n\t\t\t$row_code = $this->obDb->fetchQuery();\n\t\t\tif($this->obDb->record_count != 0)\n\t\t\t{\n\t\t\t\t$this->err=1;\n\t\t\t\t$this->errMsg.=MSG_SID_EXIST.\"<br>\";\n\t\t\t}\n\t\t}\n\t\treturn $this->err;\n\t}", "function listaProblemasCompetencia($competencia){\n \n include(\"../modelo/cnx.php\");\n $cnx = pg_connect($entrada) or die (\"Error de conexion. \". pg_last_error());\n session_start();\n $seleccionar=\"SELECT id_competencia_problema, problema.id_problema, id_competencia, nombre_problema\n FROM competencia_problema, problema\n where competencia_problema.id_problema=problema.id_problema and\n id_competencia=\".$competencia;\n \n $result = pg_query($seleccionar) or die('ERROR AL INSERTAR DATOS: ' . pg_last_error());\n $columnas = pg_numrows($result);\n $this->formu.='<table><tr><td>Identificador</td>';\n $this->formu.='<td>Nombre Problema</td>';\n for($i=0;$i<=$columnas-1; $i++){\n $line = pg_fetch_array($result, null, PGSQL_ASSOC);\n $this->formu.='<tr> \n <td>'.$line['id_problema'].'</td> \n <td>'.$line['nombre_problema'].'</td>\n <td><input type=\"CHECKBOX\" name=\"problemasCompetencia[]\" value='.$line['id_problema'].'></td>\n </tr>';\n }\n $this->formu.='</table>';\n\n return $this->formu; \n }", "function select_clase($campo)\n\t{\n\t\tif($campo==\"0\"){\n\t\t\t$this->form_validation->set_message('select_clase', 'El campo Nombre Clase es Obligatorio.');\n\t\t\treturn false;\n\t\t} else{\n\t\t// Retornamos\n\t\treturn true;\n\t\t}\n\t}", "function checkRangedQuestions($currentCell,$lineCount,$cellNumber)\n{\n\t$a = array('1 - Strongly Disagree','2 - Disagree','3 - Neither Disagree nor Agree','4 - Agree','5 - Strongly Agree'); \n\t$InformationVerified=in_array($currentCell, $a); // perform a check to ensure x or not, this will need to use the isX method to convert to bool after\n\t\tif ($InformationVerified==false){// the data has failed verification, there is no point in checking anything else... so break and throw an exception\n\t\t\t\t\t\t\t\t\t//throwError(new Exception(\"Data failed verification at cell \" .$cellNumber.\" . In row \" . $lineCount.\".\")); // going to avoid exceptions, maybe a better way is to make an array of error locations for fixing\n\t\techo \"<p style='font-family:arial;color:red;font-size:14px;'> Error parsing value :<b> \" .$currentCell . \"</b> in cell number \" .$cellNumber .\" in row number \" . $lineCount .\" . Please correct the value in the csv file and resubmit!</p>\";\n\t\t}else{\n\t\techo \" <br/><B>Row \".$lineCount.\" / Cell \".$cellNumber.\" has passed verification!</B><br/>\";\n\t\t}\n}", "protected function performValidation()\n {\n // no required arguments\n }", "public function validate()\n {\n if ($this->ingredient() || $this->upc()) {\n return;\n }\n\n throw new \\Exception('You must enter either an ingredient or UPC code to search for');\n }", "public function commandeEnAttenteDeValidation()\n {\n //$demandes est utilisee a la page d'accueil apres l'authentification\n //donc necessaires pour toutes les fonction qui utilse cette page\n\n $demandes = nonConsult();\n\n $commandes=DB::table('fournisseurs')\n ->join('commandes','fournisseurs.id','=','commandes.fournisseurs_id')\n ->select('fournisseurs.nomSociete','fournisseurs.nomDuContact','fournisseurs.prenomDuContact','fournisseurs.telephoneDuContact', 'commandes.*')\n ->where('commandes.etat',0)\n ->get();\n return view('commandes.cmdEnAttenteDeValidation',compact('commandes', 'demandes'));\n }", "function insert_screen() {\n\n $arr = setup_db_columns();\n\n # Compose the sprintf format for the universal SELECT menu.\n # Each of the identical menus is numbered (see the 'sel_%d' below)\n $select = \"\\n\\t<select name='sel_%d'>\";\n $select .= \"\\n\\t<option selected label='None' name='none' value=''>None</option>\";\n\n foreach (array_keys($arr) as $table) {\n $select .= \"\\n\\t<optgroup label='\" . label($table) . \"'>\";\n\n foreach ($arr[$table] as $v) {\n $select .= \"\\n\\t\\t<option label='$v' name='opt_$v' value='$v'>\" . label($v) . \"</option>\";\n }\n $select .= \"\\n\\t</optgroup>\";\n }\n $select .= \"\\n\\t</select>\";\n\n $bg1 = GRAY;\n $bg2 = LGRAY;\n\n # Compose HTML table that will render the query screen\n $table = \"\\n<table width='40%' align='center' border='1' cellspacing='1'>\" .\n \"\\n<th colspan='2' bgcolor='$bg1'>MTT Failure Tracking\";\n\n $sp = '&nbsp;';\n $rows = 10;\n for ($i = 0; $i < $rows; $i++) {\n $table .= \"\\n\\t<tr>\" .\n \"\\n\\t<td bgcolor='$bg2'>\" .\n \"\\n\\t${sp}Field:\" . sprintf($select, $i) .\n \"\\n\\t<td bgcolor='$bg2'>\" .\n \"\\n\\t${sp}Value: <input type='text' name='text_$i' value=''>\";\n }\n\n $href = link_to_screen(\"Delete\");\n\n # Add submit button\n $table .= \"\\n<tr><th colspan='2' bgcolor='$bg1'>\" .\n \"\\n<input type='submit' id='go' name='go' value='Insert'>\" .\n \"\\n$href\" .\n \"\\n</table>\";\n\n $help .= \"\\n<p>Specify the parameter/value pairs of the failure for insertion.</p>\";\n\n print \"\\n $table\" .\n \"\\n $help\";\n}", "function validaSelect($selectDestino)\r\n{\r\n\tglobal $listadoSelects;\r\n\tif(isset($listadoSelects[$selectDestino])) return true;\r\n\telse return false;\r\n}", "function validateOnAdd( $entity ){\t\t\t\n\t\t//TODO unicidad (cliente )\n\t\t\n\t}", "public function validate_user_input_outcome()\n {\n $passed_validation_tests = true;\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n $check_ap = has_presence($this->ap);\n $check_ap_numeric = has_number($this->ap);\n if (!$check_ap or !$check_ap_numeric) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"AP: \";\n $msg .= h($this->ap);\n $msg .= \" cannot be blank and must be a number.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_provider_id = has_presence($this->provider_id);\n $allowed_provider_ids = Provider::find_array_of_providers_ids();\n $check_provider_id_inclusion = has_inclusion_in($this->provider_id, $allowed_provider_ids);\n if (!$check_provider_id or !$check_provider_id_inclusion) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Provider: \";\n $msg .= h($this->provider_id);\n $msg .= \" cannot be blank and must be a valid choice: \";\n $msg .= \"</li>\";\n }\n $check_shift_id = has_presence($this->shift_id);\n $check_shift_id_inclusion = has_inclusion_in($this->shift_id, [1, 2]);\n if (!$check_shift_id or !$check_shift_id_inclusion) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Shift: \";\n $msg .= h($this->shift_id);\n $msg .= \" cannot be blank and must be a valid choice.\";\n $msg .= \"</li>\";\n }\n $check_outcome_id = has_presence($this->outcome_id);\n $allowed_outcome_ids = Outcome::find_array_of_outcome_ids();\n $check_outcome_id_inclusion = has_inclusion_in($this->outcome_id, $allowed_outcome_ids);\n if (!$check_outcome_id or !$check_outcome_id_inclusion) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Outcome: \";\n $msg .= h($this->outcome_id);\n $msg .= \" cannot be blank and must be a valid choice.\";\n $msg .= \"</li>\";\n }\n $check_price_paied = has_presence($this->price_paied);\n $check_price_paied_numeric = has_number($this->price_paied);\n if ($check_price_paied and !$check_price_paied_numeric) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Price paied: \";\n $msg .= h($this->price_paied);\n $msg .= \" by provider must be a number.\";\n $msg .= \"</li>\";\n } elseif (!$check_price_paied) {\n $price_paied = 0;\n }\n $check_reason_outcome_id = has_presence($this->reason_outcome_id);\n $check_reason_outcome_id_inclusion = has_inclusion_in($this->reason_outcome_id, [1, 2]);\n if (!$check_reason_outcome_id or !$check_reason_outcome_id_inclusion) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Reason for outcome: \";\n $msg .= h($this->reason_outcome_id);\n $msg .= \" cannot be blank and must be a valid choice.\";\n $msg .= \"</li>\";\n }\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "public function insertStatAndRoyalitiesAction(){\n \n }", "function after_validation() {}", "function depgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 216) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(3180);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('depgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('depgr_school_check_3180', 'Select a VCCS College/Agency', 3180);\n }\n /* Confirms Discipline is selected */\n $dis_check = $ninja_forms_processing->get_field_value(3176);\n if ($dis_check == 1 ) {\n $ninja_forms_processing->add_error('depgr_dis_check', 'Please select a Discipline');\n $ninja_forms_processing->add_error('depgr_dis_check_3176', 'Select a Discipline', 3176);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(3178);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('depgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('depgr_job_check_3178', 'Select a Job Type', 3178);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(3182);\n $email_check = $ninja_forms_processing->get_field_value(3183);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('depgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('depgr_email_check_3182', 'Email addresses must match', 3182);\n $ninja_forms_processing->add_error('depgr_email_check_3183', 'Email addresses must match', 3183);\n }\n }\n}", "function procEdit($ar){\n $p = new XParam($ar, array());\n $ftable = $p->get('ftable');\n $fname = $p->get('fname');\n $fgcaddr = $p->get('fgcaddr');\n $fgccntr = $p->get('fgccntr');\n $fgctown = $p->get('fgctown');\n $fgcauto_HID = $p->get('fgcauto_HID');\n // si module, trouver la table \n\n // verifier que fname, fgcaddr (liste), fgccntr et fgctown existent bien pour la table\n // mettre a jour les informations dans le champs ftable fname (si il est du bon type)\n $xset = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.$ftable);\n $fd = $xset->getField($fname);\n if ($fd->ftype != 'XGeodesicCoordinatesDef'){\n XLogs::critical(get_class($this), get_class($this).\"procEdit error $fname not XGeodesic type\");\n return; // message etc ...\n }\n // vérifier les champs passes\n\n if (!$xset->fieldExists($fname)){\n XLogs::critical(get_class($this), get_class($this).\"procEdit error $fname not exists\");\n return; // message etc ...\n }\n if (isset($fgcauto_HID['val'])){\n if((!empty($fgccntr) && !$xset->fieldExists($fgccntr))||\n\t (!empty($fgctown) && !$xset->fieldExists($fgctown))){\n\tXLogs::critical(get_class($this), get_class($this).\"procEdit error some fields do not exists in table\");\n\treturn; // message etc\n }\n // les champs addresse\n $fsaddr = explode(' ', $fgcaddr);\n foreach($fsaddr as $foo=>$faddr){\n\tif (!empty($faddr)){\n\t if (!$xset->fieldExists($faddr)){\n\t XLogs::critical(get_class($this), get_class($this).\"procEdit error \");\n\t return; // message etc ...\n\t }\n\t}\n }\n }\n // procEdit\n parent::procEdit($ar);\n // mettre a jour les options du champ avec l'oid de ce module map\n $xseta=XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.$ftable);\n $xseta->procEditField(array('field'=>$fname, 'tplentry'=>TZR_RETURN_DATA, '_todo'=>'save', 'options'=>array('gmoid'=>$this->_moid)));\n }", "public function validateSelection($attribute, $params)\n\t{\n\t\tif ($this->type === \"email\")\n\t\t{\n\t\t\tif (empty($this->emailContent))\n\t\t\t\t$this->addError('emailContent', \"An email message must be specified for the email\");\n\t\t\tif (empty($this->emailSubject))\n\t\t\t\t$this->addError('emailSubject', \"A subject must be specified for the email\");\n\t\t}\n\t}", "protected function columnType()\n {\n $table = $this->ask('Enter the name of desired table');\n $this->checkInput($table);\n $column = $this->ask('Enter the desired column');\n $this->checkInput($column);\n $this->service->columnType($table, $column);\n }", "public function change(): void\n {\n if(!$this->hasTable(\"expostion\")){\n\n $this->table(\"expostion\", [\"id\"=>\"id_expos\"])\n ->addColumn(\"code_expos\", \"string\", [\"limit\"=>225, \"null\"=>true, \"comment\"=>\"Code de l'exposition\"])\n ->addColumn(\"image_expos\", \"string\", [\"limit\"=>225, \"null\"=>true, \"comment\"=>\"Image de l'exposition\"])\n ->addColumn(\"titre_expos\", \"string\", [\"limit\"=>225, \"null\"=>true, \"comment\"=>\"Titre de l'exposition\"])\n ->addColumn(\"soustitre_expos\", \"string\", [\"limit\"=>225, \"null\"=>true, \"comment\"=>\"Sous-titre de l'exposition\"])\n ->addColumn(\"prix_expos\", \"float\", [\"limit\"=>10, \"null\"=>true, \"comment\"=>\"prix article de l'exposition\"])\n ->addColumn(\"details_expos\", \"text\", [\"limit\"=>MysqlAdapter::TEXT_MEDIUM, \"comment\"=>\"Details de l'article de l'exposition\"])\n\n ->addIndex(\"code_expos\", [\"unique\"=>true, \"name\"=>\"indexExposition\"])\n\n ->create();\n }\n }", "function InsertDogFieldsCombobox($mysqli) {\n if ($result = $mysqli->query(\"SELECT id, title, subject FROM dogs WHERE persons_id = \" . $_SESSION['PersonID'] . ' AND id = ' . $_SESSION['DogID'])) {\n $row = $result->fetch_row();\n echo '<tr><td>' . \"Select Lesson: \" . ': </td><td> <input type=\"edit\" name=\"quiz_title\" value= \"'\n . $row[0] . \" - \" . $row[1] . \" - \" . $row[2] . '\" size=\"49\" readonly></td></tr>';\n }\n}", "abstract protected function afterSuccessValidation();", "function validMet($selectedMet){\n// $validMetOptions = array(\"1\", \"2\", \"3\", \"4\");\n//\n// //Check each topping and return false if its not valid\n// foreach($validMetOptions as $validMetOption){\n// if(!in_array($validMetOption, $selectedMet)){\n// return false;\n// }\n// }\n//\n// //Option is valid\n// return true;\n if($selectedMet != \"choose\"){\n return true;\n }\n}", "function fncValidaDI_69($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_68 = \"(69)Licencia sin Goce de Sueldo / CLUES\";\n\t$DI_68_ErrTam = \"Licencia sin Goce de Sueldo / CLUES ser de 11 caracteres\";\n\t$DI_68_DC = \"Licencia sin Goce de Sueldo / CLUES No coincide con la Directiva de Calidad definida por la DGRH\";\n\t$DI_68_Catalogo = \"Licencia sin Goce de Sueldo / CLUES No coincide el catalogo definido por la DGRH\";\n\n\n//Condicion de estado-clues\nif($IdEstado == \"01\"){\n\t$Clues = array(\"ASSSA000013\",\"ASSSA000025\",\"ASSSA000030\",\"ASSSA000042\",\"ASSSA000054\",\"ASSSA000066\",\"ASSSA000071\",\"ASSSA000083\",\"ASSSA000095\",\"ASSSA000100\",\"ASSSA000112\",\"ASSSA000124\",\"ASSSA000136\",\"ASSSA000141\",\"ASSSA000153\",\"ASSSA000165\",\"ASSSA000170\",\"ASSSA000182\",\"ASSSA000194\",\"ASSSA000206\",\"ASSSA000211\",\"ASSSA000223\",\"ASSSA000235\",\"ASSSA000240\",\"ASSSA000252\",\"ASSSA000264\",\"ASSSA000276\",\"ASSSA000281\",\"ASSSA000293\",\"ASSSA000305\",\"ASSSA000310\",\"ASSSA000322\",\"ASSSA000334\",\"ASSSA000346\",\"ASSSA000351\",\"ASSSA000363\",\"ASSSA000375\",\"ASSSA000380\",\"ASSSA000392\",\"ASSSA000404\",\"ASSSA000416\",\"ASSSA000421\",\"ASSSA000433\",\"ASSSA000445\",\"ASSSA000450\",\"ASSSA000462\",\"ASSSA000474\",\"ASSSA000491\",\"ASSSA000503\",\"ASSSA000515\",\"ASSSA000520\",\"ASSSA000532\",\"ASSSA000544\",\"ASSSA000556\",\"ASSSA000561\",\"ASSSA000573\",\"ASSSA000585\",\"ASSSA000590\",\"ASSSA000602\",\"ASSSA000614\",\"ASSSA000626\",\"ASSSA000631\",\"ASSSA000643\",\"ASSSA000655\",\"ASSSA000660\",\"ASSSA000672\",\"ASSSA000684\",\"ASSSA000696\",\"ASSSA000701\",\"ASSSA000713\",\"ASSSA000725\",\"ASSSA000730\",\"ASSSA000742\",\"ASSSA000754\",\"ASSSA000766\",\"ASSSA000771\",\"ASSSA000783\",\"ASSSA000795\",\"ASSSA000800\",\"ASSSA000812\",\"ASSSA000824\",\"ASSSA000836\",\"ASSSA000841\",\"ASSSA000853\",\"ASSSA000865\",\"ASSSA000870\",\"ASSSA000894\",\"ASSSA000906\",\"ASSSA000911\",\"ASSSA000923\",\"ASSSA000931\",\"ASSSA000943\",\"ASSSA000955\",\"ASSSA000960\",\"ASSSA000984\",\"ASSSA000996\",\"ASSSA001001\",\"ASSSA001013\",\"ASSSA001025\",\"ASSSA001030\",\"ASSSA001046\",\"ASSSA001051\",\"ASSSA001063\",\"ASSSA001075\",\"ASSSA001080\",\"ASSSA001092\",\"ASSSA001104\",\"ASSSA001116\",\"ASSSA001121\",\"ASSSA001133\",\"ASSSA001145\",\"ASSSA001150\",\"ASSSA001162\",\"ASSSA001174\",\"ASSSA001186\",\"ASSSA001191\",\"ASSSA001203\",\"ASSSA001215\",\"ASSSA001220\",\"ASSSA001232\",\"ASSSA001244\");\n} //fin de if($IdEstado == \"01\")\n\n//Condicion de estado-clues\nif($IdEstado == \"02\"){\n\t$Clues = array(\"BCSSA000015\",\"BCSSA000020\",\"BCSSA000032\",\"BCSSA000044\",\"BCSSA000061\",\"BCSSA000073\",\"BCSSA000085\",\"BCSSA000090\",\"BCSSA000102\",\"BCSSA000114\",\"BCSSA000126\",\"BCSSA000131\",\"BCSSA000143\",\"BCSSA000160\",\"BCSSA000172\",\"BCSSA000184\",\"BCSSA000196\",\"BCSSA000201\",\"BCSSA000213\",\"BCSSA000225\",\"BCSSA000230\",\"BCSSA000242\",\"BCSSA000254\",\"BCSSA000266\",\"BCSSA000271\",\"BCSSA000283\",\"BCSSA000295\",\"BCSSA000300\",\"BCSSA000312\",\"BCSSA000324\",\"BCSSA000341\",\"BCSSA000353\",\"BCSSA000370\",\"BCSSA000382\",\"BCSSA000406\",\"BCSSA000411\",\"BCSSA000423\",\"BCSSA000440\",\"BCSSA000452\",\"BCSSA000464\",\"BCSSA000476\",\"BCSSA000481\",\"BCSSA000493\",\"BCSSA000505\",\"BCSSA000510\",\"BCSSA000522\",\"BCSSA000534\",\"BCSSA000546\",\"BCSSA000551\",\"BCSSA000563\",\"BCSSA000575\",\"BCSSA000580\",\"BCSSA000592\",\"BCSSA000604\",\"BCSSA000616\",\"BCSSA000621\",\"BCSSA000633\",\"BCSSA000645\",\"BCSSA000650\",\"BCSSA000662\",\"BCSSA000674\",\"BCSSA000686\",\"BCSSA000691\",\"BCSSA000703\",\"BCSSA000715\",\"BCSSA000720\",\"BCSSA000732\",\"BCSSA000744\",\"BCSSA000756\",\"BCSSA000761\",\"BCSSA000773\",\"BCSSA000785\",\"BCSSA000790\",\"BCSSA000814\",\"BCSSA000831\",\"BCSSA000843\",\"BCSSA000855\",\"BCSSA000860\",\"BCSSA000872\",\"BCSSA000884\",\"BCSSA000896\",\"BCSSA000901\",\"BCSSA000913\",\"BCSSA000925\",\"BCSSA000930\",\"BCSSA000942\",\"BCSSA000954\",\"BCSSA000966\",\"BCSSA000971\",\"BCSSA000983\",\"BCSSA000995\",\"BCSSA001000\",\"BCSSA001012\",\"BCSSA001041\",\"BCSSA001053\",\"BCSSA001065\",\"BCSSA001070\",\"BCSSA001082\",\"BCSSA001094\",\"BCSSA001106\",\"BCSSA001111\",\"BCSSA001123\",\"BCSSA001135\",\"BCSSA001140\",\"BCSSA001152\",\"BCSSA001164\",\"BCSSA001176\",\"BCSSA001181\",\"BCSSA001193\",\"BCSSA001205\",\"BCSSA001210\",\"BCSSA001222\",\"BCSSA001234\",\"BCSSA001246\",\"BCSSA001251\",\"BCSSA001263\",\"BCSSA001275\",\"BCSSA001280\",\"BCSSA001292\",\"BCSSA001316\",\"BCSSA001321\",\"BCSSA001333\",\"BCSSA001345\",\"BCSSA001350\",\"BCSSA001362\",\"BCSSA001374\",\"BCSSA001386\",\"BCSSA001403\",\"BCSSA001415\",\"BCSSA001420\",\"BCSSA001444\",\"BCSSA001456\",\"BCSSA001461\",\"BCSSA001473\",\"BCSSA001485\",\"BCSSA001490\",\"BCSSA001502\",\"BCSSA001514\",\"BCSSA001526\",\"BCSSA001531\",\"BCSSA001543\",\"BCSSA001555\",\"BCSSA001560\",\"BCSSA001572\",\"BCSSA001584\",\"BCSSA001630\",\"BCSSA001666\",\"BCSSA017462\",\"BCSSA017504\",\"BCSSA017521\",\"BCSSA017533\",\"BCSSA017545\",\"BCSSA017550\",\"BCSSA017574\",\"BCSSA017585\",\"BCSSA017590\",\"BCSSA017602\",\"BCSSA017614\",\"BCSSA017626\",\"BCSSA017631\",\"BCSSA017643\",\"BCSSA017660\",\"BCSSA017672\",\"BCSSA017684\",\"BCSSA017696\",\"BCSSA017701\",\"BCSSA017713\",\"BCSSA017725\",\"BCSSA017730\",\"BCSSA017742\",\"BCSSA017754\",\"BCSSA017766\",\"BCSSA017771\",\"BCSSA017783\",\"BCSSA017795\",\"BCSSA017800\",\"BCSSA017812\",\"BCSSA017824\",\"BCSSA017836\",\"BCSSA017841\",\"BCSSA017853\",\"BCSSA017865\",\"BCSSA017870\",\"BCSSA017882\",\"BCSSA017894\",\"BCSSA017906\",\"BCSSA017911\",\"BCSSA017923\",\"BCSSA017935\",\"BCSSA017940\",\"BCSSA017952\",\"BCSSA017964\",\"BCSSA017976\",\"BCSSA017981\",\"BCSSA017993\",\"BCSSA018005\",\"BCSSA018010\",\"BCSSA018022\",\"BCSSA018034\",\"BCSSA018046\",\"BCSSA018051\",\"BCSSA018063\",\"BCSSA018075\",\"BCSSA018080\",\"BCSSA018092\",\"BCSSA018104\",\"BCSSA018116\",\"BCSSA018121\",\"BCSSA018133\",\"BCSSA018145\",\"BCSSA018150\",\"BCSSA018162\",\"BCSSA018174\",\"BCSSA018186\",\"BCSSA018191\",\"BCSSA018203\",\"BCSSA018215\",\"BCSSA018220\",\"BCSSA018232\",\"BCSSA018244\",\"BCSSA018256\",\"BCSSA018261\",\"BCSSA018273\",\"BCSSA018285\",\"BCSSA018290\",\"BCSSA018302\",\"BCSSA018314\");\n} //fin de if($IdEstado == \"02\")\n\n//Condicion de estado-clues\nif($IdEstado == \"03\"){\n\t$Clues = array(\"BSSSA000011\",\"BSSSA000035\",\"BSSSA000040\",\"BSSSA000052\",\"BSSSA000064\",\"BSSSA000076\",\"BSSSA000081\",\"BSSSA000093\",\"BSSSA000105\",\"BSSSA000110\",\"BSSSA000134\",\"BSSSA000146\",\"BSSSA000151\",\"BSSSA000192\",\"BSSSA000204\",\"BSSSA000216\",\"BSSSA000221\",\"BSSSA000233\",\"BSSSA000245\",\"BSSSA000274\",\"BSSSA000286\",\"BSSSA000315\",\"BSSSA000320\",\"BSSSA000344\",\"BSSSA000356\",\"BSSSA000361\",\"BSSSA000373\",\"BSSSA000385\",\"BSSSA000390\",\"BSSSA000402\",\"BSSSA000414\",\"BSSSA000431\",\"BSSSA000443\",\"BSSSA000455\",\"BSSSA000460\",\"BSSSA000472\",\"BSSSA000501\",\"BSSSA000530\",\"BSSSA000542\",\"BSSSA000554\",\"BSSSA000566\",\"BSSSA000571\",\"BSSSA000583\",\"BSSSA000595\",\"BSSSA000612\",\"BSSSA000624\",\"BSSSA000636\",\"BSSSA000641\",\"BSSSA000653\",\"BSSSA000665\",\"BSSSA000682\",\"BSSSA000694\",\"BSSSA000706\",\"BSSSA000711\",\"BSSSA000723\",\"BSSSA000735\",\"BSSSA000740\",\"BSSSA000764\",\"BSSSA000776\",\"BSSSA000781\",\"BSSSA000793\",\"BSSSA000806\",\"BSSSA000811\",\"BSSSA000835\",\"BSSSA000840\",\"BSSSA000852\",\"BSSSA000864\",\"BSSSA000876\",\"BSSSA000881\",\"BSSSA000893\",\"BSSSA000905\",\"BSSSA000910\",\"BSSSA000922\",\"BSSSA000933\",\"BSSSA000945\",\"BSSSA000950\",\"BSSSA000962\",\"BSSSA000974\",\"BSSSA001003\",\"BSSSA001020\",\"BSSSA001032\",\"BSSSA001044\",\"BSSSA001056\",\"BSSSA001061\",\"BSSSA001073\",\"BSSSA001085\",\"BSSSA001090\",\"BSSSA001102\",\"BSSSA001114\",\"BSSSA001126\",\"BSSSA001131\",\"BSSSA001143\",\"BSSSA001155\",\"BSSSA001160\",\"BSSSA001172\",\"BSSSA001184\",\"BSSSA001196\",\"BSSSA001201\",\"BSSSA001213\",\"BSSSA001225\",\"BSSSA001230\",\"BSSSA001242\",\"BSSSA001254\",\"BSSSA001266\",\"BSSSA001271\",\"BSSSA001283\",\"BSSSA001295\",\"BSSSA001300\",\"BSSSA001312\");\n} //fin de if($IdEstado == \"03\")\n\n//Condicion de estado-clues\nif($IdEstado == \"04\"){\n\t$Clues = array(\"CCSSA000025\",\"CCSSA000030\",\"CCSSA000054\",\"CCSSA000066\",\"CCSSA000071\",\"CCSSA000083\",\"CCSSA000095\",\"CCSSA000100\",\"CCSSA000124\",\"CCSSA000141\",\"CCSSA000264\",\"CCSSA000276\",\"CCSSA000281\",\"CCSSA000293\",\"CCSSA000305\",\"CCSSA000310\",\"CCSSA000322\",\"CCSSA000334\",\"CCSSA000346\",\"CCSSA000363\",\"CCSSA000375\",\"CCSSA000380\",\"CCSSA000392\",\"CCSSA000404\",\"CCSSA000416\",\"CCSSA000421\",\"CCSSA000433\",\"CCSSA000445\",\"CCSSA000450\",\"CCSSA000462\",\"CCSSA000474\",\"CCSSA000486\",\"CCSSA000491\",\"CCSSA000503\",\"CCSSA000515\",\"CCSSA000532\",\"CCSSA000544\",\"CCSSA000556\",\"CCSSA000561\",\"CCSSA000573\",\"CCSSA000585\",\"CCSSA000590\",\"CCSSA000602\",\"CCSSA000614\",\"CCSSA000626\",\"CCSSA000631\",\"CCSSA000643\",\"CCSSA000655\",\"CCSSA000660\",\"CCSSA000672\",\"CCSSA000684\",\"CCSSA000696\",\"CCSSA000701\",\"CCSSA000713\",\"CCSSA000725\",\"CCSSA000730\",\"CCSSA000742\",\"CCSSA000754\",\"CCSSA000766\",\"CCSSA000771\",\"CCSSA000783\",\"CCSSA000795\",\"CCSSA000800\",\"CCSSA000812\",\"CCSSA000824\",\"CCSSA000865\",\"CCSSA000870\",\"CCSSA000882\",\"CCSSA000894\",\"CCSSA000906\",\"CCSSA000911\",\"CCSSA000923\",\"CCSSA000940\",\"CCSSA000952\",\"CCSSA000976\",\"CCSSA000981\",\"CCSSA000993\",\"CCSSA001005\",\"CCSSA001010\",\"CCSSA001022\",\"CCSSA001034\",\"CCSSA001051\",\"CCSSA001063\",\"CCSSA001075\",\"CCSSA001080\",\"CCSSA001092\",\"CCSSA001104\",\"CCSSA001203\",\"CCSSA001220\",\"CCSSA001232\",\"CCSSA001244\",\"CCSSA001256\",\"CCSSA001261\",\"CCSSA001273\",\"CCSSA001285\",\"CCSSA001290\",\"CCSSA001302\",\"CCSSA001314\",\"CCSSA001326\",\"CCSSA001331\",\"CCSSA001343\",\"CCSSA001360\",\"CCSSA001372\",\"CCSSA001384\",\"CCSSA001396\",\"CCSSA001401\",\"CCSSA001413\",\"CCSSA001425\",\"CCSSA001430\",\"CCSSA001454\",\"CCSSA001466\",\"CCSSA001471\",\"CCSSA001483\",\"CCSSA001495\",\"CCSSA001500\",\"CCSSA001512\",\"CCSSA001524\",\"CCSSA001536\",\"CCSSA001541\",\"CCSSA001553\",\"CCSSA017280\",\"CCSSA017292\",\"CCSSA017304\",\"CCSSA017316\",\"CCSSA017321\",\"CCSSA017333\",\"CCSSA017345\",\"CCSSA017350\",\"CCSSA017362\",\"CCSSA017374\",\"CCSSA017386\",\"CCSSA017391\",\"CCSSA017403\",\"CCSSA017426\",\"CCSSA017431\",\"CCSSA017443\",\"CCSSA017455\",\"CCSSA017460\",\"CCSSA017472\",\"CCSSA017496\",\"CCSSA017501\",\"CCSSA017513\",\"CCSSA017525\",\"CCSSA017530\",\"CCSSA017554\",\"CCSSA017566\",\"CCSSA017571\",\"CCSSA017583\",\"CCSSA017595\",\"CCSSA017600\",\"CCSSA017624\",\"CCSSA017636\",\"CCSSA017641\",\"CCSSA017653\",\"CCSSA017665\",\"CCSSA017670\",\"CCSSA017682\",\"CCSSA017694\",\"CCSSA017706\");\n} //fin de if($IdEstado == \"04\")\n\n//Condicion de estado-clues\nif($IdEstado == \"05\"){\n\t$Clues = array(\"CLSSA000016\",\"CLSSA000021\",\"CLSSA000033\",\"CLSSA000045\",\"CLSSA000050\",\"CLSSA000062\",\"CLSSA000074\",\"CLSSA000086\",\"CLSSA000091\",\"CLSSA000103\",\"CLSSA000115\",\"CLSSA000120\",\"CLSSA000132\",\"CLSSA000144\",\"CLSSA000156\",\"CLSSA000161\",\"CLSSA000173\",\"CLSSA000185\",\"CLSSA000190\",\"CLSSA000202\",\"CLSSA000214\",\"CLSSA000226\",\"CLSSA000231\",\"CLSSA000243\",\"CLSSA000255\",\"CLSSA000260\",\"CLSSA000272\",\"CLSSA000284\",\"CLSSA000296\",\"CLSSA000301\",\"CLSSA000313\",\"CLSSA000325\",\"CLSSA000330\",\"CLSSA000342\",\"CLSSA000354\",\"CLSSA000366\",\"CLSSA000371\",\"CLSSA000383\",\"CLSSA000395\",\"CLSSA000400\",\"CLSSA000412\",\"CLSSA000424\",\"CLSSA000436\",\"CLSSA000441\",\"CLSSA000453\",\"CLSSA000465\",\"CLSSA000470\",\"CLSSA000482\",\"CLSSA000494\",\"CLSSA000506\",\"CLSSA000511\",\"CLSSA000523\",\"CLSSA000535\",\"CLSSA000540\",\"CLSSA000552\",\"CLSSA000564\",\"CLSSA000576\",\"CLSSA000581\",\"CLSSA000593\",\"CLSSA000605\",\"CLSSA000610\",\"CLSSA000622\",\"CLSSA000634\",\"CLSSA000646\",\"CLSSA000651\",\"CLSSA000663\",\"CLSSA000675\",\"CLSSA000680\",\"CLSSA000692\",\"CLSSA000704\",\"CLSSA000716\",\"CLSSA000721\",\"CLSSA000733\",\"CLSSA000745\",\"CLSSA000750\",\"CLSSA000762\",\"CLSSA000774\",\"CLSSA000786\",\"CLSSA000803\",\"CLSSA000815\",\"CLSSA000820\",\"CLSSA000844\",\"CLSSA000856\",\"CLSSA000861\",\"CLSSA000873\",\"CLSSA000885\",\"CLSSA000890\",\"CLSSA000902\",\"CLSSA000914\",\"CLSSA000926\",\"CLSSA000931\",\"CLSSA000960\",\"CLSSA000972\",\"CLSSA000984\",\"CLSSA000996\",\"CLSSA001001\",\"CLSSA001013\",\"CLSSA001025\",\"CLSSA001030\",\"CLSSA001042\",\"CLSSA001054\",\"CLSSA001066\",\"CLSSA001071\",\"CLSSA001100\",\"CLSSA001112\",\"CLSSA001124\",\"CLSSA001136\",\"CLSSA001141\",\"CLSSA001153\",\"CLSSA001170\",\"CLSSA001182\",\"CLSSA001206\",\"CLSSA001211\",\"CLSSA001223\",\"CLSSA001235\",\"CLSSA001240\",\"CLSSA001252\",\"CLSSA001264\",\"CLSSA001276\",\"CLSSA001281\",\"CLSSA001293\",\"CLSSA001305\",\"CLSSA001310\",\"CLSSA001322\",\"CLSSA001334\",\"CLSSA001346\",\"CLSSA001351\",\"CLSSA001363\",\"CLSSA001375\",\"CLSSA001380\",\"CLSSA001392\",\"CLSSA001404\",\"CLSSA001416\",\"CLSSA001421\",\"CLSSA001433\",\"CLSSA001445\",\"CLSSA001450\",\"CLSSA001462\",\"CLSSA001474\",\"CLSSA001486\",\"CLSSA001491\",\"CLSSA001503\",\"CLSSA001515\",\"CLSSA001520\",\"CLSSA001532\",\"CLSSA001544\",\"CLSSA001556\",\"CLSSA001561\",\"CLSSA001573\",\"CLSSA001585\",\"CLSSA001590\",\"CLSSA001602\",\"CLSSA001614\",\"CLSSA001626\",\"CLSSA001631\",\"CLSSA001643\",\"CLSSA001655\",\"CLSSA001660\",\"CLSSA001672\",\"CLSSA001684\",\"CLSSA001696\",\"CLSSA001701\",\"CLSSA001713\",\"CLSSA001725\",\"CLSSA001730\",\"CLSSA001742\",\"CLSSA001754\",\"CLSSA001766\",\"CLSSA001771\",\"CLSSA001795\",\"CLSSA001800\",\"CLSSA001812\",\"CLSSA001824\",\"CLSSA001836\",\"CLSSA001841\",\"CLSSA001853\",\"CLSSA001865\",\"CLSSA001882\",\"CLSSA001894\",\"CLSSA001906\",\"CLSSA001923\",\"CLSSA001935\",\"CLSSA001940\",\"CLSSA001952\",\"CLSSA001964\",\"CLSSA001970\",\"CLSSA001982\",\"CLSSA001994\",\"CLSSA002006\",\"CLSSA002011\",\"CLSSA002023\",\"CLSSA002035\",\"CLSSA002040\",\"CLSSA002064\",\"CLSSA002076\",\"CLSSA002093\",\"CLSSA002105\",\"CLSSA002122\",\"CLSSA002134\",\"CLSSA002146\",\"CLSSA002175\",\"CLSSA002180\",\"CLSSA002192\",\"CLSSA002203\",\"CLSSA002215\",\"CLSSA002220\",\"CLSSA002232\",\"CLSSA002244\",\"CLSSA002256\",\"CLSSA002261\",\"CLSSA002273\",\"CLSSA002285\",\"CLSSA002290\",\"CLSSA002302\",\"CLSSA002314\",\"CLSSA002331\",\"CLSSA002343\",\"CLSSA002355\",\"CLSSA002360\",\"CLSSA002401\",\"CLSSA002413\",\"CLSSA002425\",\"CLSSA002430\",\"CLSSA002442\",\"CLSSA002454\",\"CLSSA002466\",\"CLSSA002471\",\"CLSSA002483\",\"CLSSA002495\",\"CLSSA002500\",\"CLSSA002512\",\"CLSSA002524\",\"CLSSA002536\",\"CLSSA002553\",\"CLSSA002570\",\"CLSSA002582\",\"CLSSA002594\",\"CLSSA002606\",\"CLSSA002611\",\"CLSSA002640\",\"CLSSA002710\",\"CLSSA002722\",\"CLSSA002734\",\"CLSSA002746\",\"CLSSA002751\",\"CLSSA002763\",\"CLSSA002780\",\"CLSSA002804\",\"CLSSA002816\",\"CLSSA002821\",\"CLSSA002833\",\"CLSSA002845\",\"CLSSA002850\");\n} //fin de if($IdEstado == \"05\")\n\n//Condicion de estado-clues\nif($IdEstado == \"06\"){\n\t$Clues = array(\"CMSSA000014\",\"CMSSA000026\",\"CMSSA000031\",\"CMSSA000043\",\"CMSSA000055\",\"CMSSA000060\",\"CMSSA000072\",\"CMSSA000084\",\"CMSSA000096\",\"CMSSA000101\",\"CMSSA000113\",\"CMSSA000125\",\"CMSSA000142\",\"CMSSA000154\",\"CMSSA000166\",\"CMSSA000171\",\"CMSSA000183\",\"CMSSA000195\",\"CMSSA000212\",\"CMSSA000224\",\"CMSSA000236\",\"CMSSA000241\",\"CMSSA000253\",\"CMSSA000265\",\"CMSSA000270\",\"CMSSA000282\",\"CMSSA000294\",\"CMSSA000306\",\"CMSSA000311\",\"CMSSA000323\",\"CMSSA000335\",\"CMSSA000340\",\"CMSSA000352\",\"CMSSA000364\",\"CMSSA000376\",\"CMSSA000381\",\"CMSSA000393\",\"CMSSA000410\",\"CMSSA000422\",\"CMSSA000434\",\"CMSSA000446\",\"CMSSA000451\",\"CMSSA000463\",\"CMSSA000475\",\"CMSSA000480\",\"CMSSA000492\",\"CMSSA000504\",\"CMSSA000516\",\"CMSSA000521\",\"CMSSA000533\",\"CMSSA000545\",\"CMSSA000550\",\"CMSSA000562\",\"CMSSA000574\",\"CMSSA000586\",\"CMSSA000591\",\"CMSSA000603\",\"CMSSA000615\",\"CMSSA000620\",\"CMSSA000632\",\"CMSSA000656\",\"CMSSA000661\",\"CMSSA000673\",\"CMSSA000685\",\"CMSSA000690\",\"CMSSA000702\",\"CMSSA000714\",\"CMSSA000726\",\"CMSSA000743\",\"CMSSA000755\",\"CMSSA000760\",\"CMSSA000772\",\"CMSSA000784\",\"CMSSA000796\",\"CMSSA000801\",\"CMSSA000813\",\"CMSSA000825\",\"CMSSA000830\",\"CMSSA000842\",\"CMSSA000854\",\"CMSSA000866\",\"CMSSA000871\",\"CMSSA000883\",\"CMSSA000895\",\"CMSSA000900\",\"CMSSA000912\",\"CMSSA000924\",\"CMSSA000936\",\"CMSSA000941\",\"CMSSA000953\",\"CMSSA000965\",\"CMSSA000970\",\"CMSSA000982\",\"CMSSA000994\",\"CMSSA001006\",\"CMSSA001011\",\"CMSSA001023\",\"CMSSA001035\",\"CMSSA001040\",\"CMSSA001052\",\"CMSSA001064\",\"CMSSA001076\",\"CMSSA001081\",\"CMSSA001093\",\"CMSSA001105\",\"CMSSA001110\",\"CMSSA001122\",\"CMSSA001134\",\"CMSSA001146\",\"CMSSA001151\",\"CMSSA001163\",\"CMSSA001175\",\"CMSSA001180\",\"CMSSA001192\",\"CMSSA001204\",\"CMSSA001216\",\"CMSSA001221\",\"CMSSA001233\",\"CMSSA001245\",\"CMSSA001250\",\"CMSSA001262\",\"CMSSA001274\",\"CMSSA001286\",\"CMSSA001291\",\"CMSSA001303\",\"CMSSA001315\",\"CMSSA001320\",\"CMSSA001344\",\"CMSSA001356\",\"CMSSA010433\",\"CMSSA010445\",\"CMSSA010450\",\"CMSSA010462\",\"CMSSA010474\",\"CMSSA010486\",\"CMSSA010491\",\"CMSSA010503\",\"CMSSA010515\",\"CMSSA010520\",\"CMSSA010532\",\"CMSSA010543\",\"CMSSA010555\",\"CMSSA010712\",\"CMSSA010724\",\"CMSSA010736\",\"CMSSA010741\",\"CMSSA010753\",\"CMSSA010765\",\"CMSSA010770\",\"CMSSA010782\",\"CMSSA010794\",\"CMSSA010806\",\"CMSSA010811\",\"CMSSA010823\",\"CMSSA010835\",\"CMSSA010840\",\"CMSSA010852\",\"CMSSA010864\",\"CMSSA010876\",\"CMSSA010881\",\"CMSSA010893\",\"CMSSA010905\",\"CMSSA010910\",\"CMSSA010922\",\"CMSSA010934\",\"CMSSA010946\",\"CMSSA010951\",\"CMSSA010963\",\"CMSSA010975\",\"CMSSA010980\",\"CMSSA010992\",\"CMSSA011004\",\"CMSSA011016\",\"CMSSA011021\");\n} //fin de if($IdEstado == \"06\")\n\n//Condicion de estado-clues\nif($IdEstado == \"07\"){\n\t$Clues = array(\"CSSSA000016\",\"CSSSA000021\",\"CSSSA000033\",\"CSSSA000045\",\"CSSSA000050\",\"CSSSA000062\",\"CSSSA000074\",\"CSSSA000086\",\"CSSSA000091\",\"CSSSA000103\",\"CSSSA000120\",\"CSSSA000132\",\"CSSSA000144\",\"CSSSA000156\",\"CSSSA000161\",\"CSSSA000173\",\"CSSSA000185\",\"CSSSA000190\",\"CSSSA000202\",\"CSSSA000214\",\"CSSSA000226\",\"CSSSA000243\",\"CSSSA000255\",\"CSSSA000260\",\"CSSSA000272\",\"CSSSA000284\",\"CSSSA000301\",\"CSSSA000313\",\"CSSSA000325\",\"CSSSA000342\",\"CSSSA000354\",\"CSSSA000366\",\"CSSSA000371\",\"CSSSA000383\",\"CSSSA000395\",\"CSSSA000400\",\"CSSSA000412\",\"CSSSA000424\",\"CSSSA000436\",\"CSSSA000441\",\"CSSSA000453\",\"CSSSA000465\",\"CSSSA000470\",\"CSSSA000482\",\"CSSSA000494\",\"CSSSA000506\",\"CSSSA000511\",\"CSSSA000523\",\"CSSSA000535\",\"CSSSA000540\",\"CSSSA000552\",\"CSSSA000564\",\"CSSSA000576\",\"CSSSA000581\",\"CSSSA000593\",\"CSSSA000605\",\"CSSSA000610\",\"CSSSA000622\",\"CSSSA000634\",\"CSSSA000646\",\"CSSSA000651\",\"CSSSA000663\",\"CSSSA000675\",\"CSSSA000680\",\"CSSSA000692\",\"CSSSA000704\",\"CSSSA000716\",\"CSSSA000733\",\"CSSSA000745\",\"CSSSA000750\",\"CSSSA000762\",\"CSSSA000774\",\"CSSSA000786\",\"CSSSA000791\",\"CSSSA000803\",\"CSSSA000815\",\"CSSSA000820\",\"CSSSA000832\",\"CSSSA000844\",\"CSSSA000856\",\"CSSSA000861\",\"CSSSA000885\",\"CSSSA000890\",\"CSSSA000902\",\"CSSSA000914\",\"CSSSA000926\",\"CSSSA000931\",\"CSSSA000943\",\"CSSSA000955\",\"CSSSA000972\",\"CSSSA000996\",\"CSSSA001001\",\"CSSSA001013\",\"CSSSA001025\",\"CSSSA001030\",\"CSSSA001042\",\"CSSSA001054\",\"CSSSA001066\",\"CSSSA001071\",\"CSSSA001083\",\"CSSSA001095\",\"CSSSA001100\",\"CSSSA001112\",\"CSSSA001124\",\"CSSSA001136\",\"CSSSA001141\",\"CSSSA001165\",\"CSSSA001170\",\"CSSSA001182\",\"CSSSA001194\",\"CSSSA001206\",\"CSSSA001211\",\"CSSSA001223\",\"CSSSA001235\",\"CSSSA001240\",\"CSSSA001252\",\"CSSSA001264\",\"CSSSA001276\",\"CSSSA001281\",\"CSSSA001293\",\"CSSSA001305\",\"CSSSA001322\",\"CSSSA001334\",\"CSSSA001346\",\"CSSSA001351\",\"CSSSA001363\",\"CSSSA001375\",\"CSSSA001380\",\"CSSSA001392\",\"CSSSA001404\",\"CSSSA001421\",\"CSSSA001433\",\"CSSSA001445\",\"CSSSA001450\",\"CSSSA001462\",\"CSSSA001474\",\"CSSSA001491\",\"CSSSA001503\",\"CSSSA001515\",\"CSSSA001520\",\"CSSSA001532\",\"CSSSA001556\",\"CSSSA001561\",\"CSSSA001573\",\"CSSSA001585\",\"CSSSA001602\",\"CSSSA001614\",\"CSSSA001626\",\"CSSSA001631\",\"CSSSA001643\",\"CSSSA001655\",\"CSSSA001660\",\"CSSSA001672\",\"CSSSA001684\",\"CSSSA001696\",\"CSSSA001701\",\"CSSSA001725\",\"CSSSA001730\",\"CSSSA001742\",\"CSSSA001754\",\"CSSSA001766\",\"CSSSA001771\",\"CSSSA001783\",\"CSSSA001795\",\"CSSSA001800\",\"CSSSA001812\",\"CSSSA001824\",\"CSSSA001836\",\"CSSSA001841\",\"CSSSA001894\",\"CSSSA001906\",\"CSSSA001911\",\"CSSSA001923\",\"CSSSA001940\",\"CSSSA001952\",\"CSSSA001976\",\"CSSSA002005\",\"CSSSA002010\",\"CSSSA002080\",\"CSSSA002104\",\"CSSSA002121\",\"CSSSA002145\",\"CSSSA002162\",\"CSSSA002203\",\"CSSSA002215\",\"CSSSA002220\",\"CSSSA002232\",\"CSSSA002244\",\"CSSSA002256\",\"CSSSA002261\",\"CSSSA002273\",\"CSSSA002290\",\"CSSSA002314\",\"CSSSA002326\",\"CSSSA002331\",\"CSSSA002343\",\"CSSSA002355\",\"CSSSA002360\",\"CSSSA002372\",\"CSSSA002384\",\"CSSSA002396\",\"CSSSA002401\",\"CSSSA002413\",\"CSSSA002425\",\"CSSSA002430\",\"CSSSA002442\",\"CSSSA002454\",\"CSSSA002466\",\"CSSSA002483\",\"CSSSA002495\",\"CSSSA002500\",\"CSSSA002512\",\"CSSSA002524\",\"CSSSA002541\",\"CSSSA002553\",\"CSSSA002565\",\"CSSSA002570\",\"CSSSA002582\",\"CSSSA002594\",\"CSSSA002611\",\"CSSSA002623\",\"CSSSA002635\",\"CSSSA002640\",\"CSSSA002652\",\"CSSSA002664\",\"CSSSA002676\",\"CSSSA002681\",\"CSSSA002693\",\"CSSSA002705\",\"CSSSA002710\",\"CSSSA002722\",\"CSSSA002734\",\"CSSSA002746\",\"CSSSA002763\",\"CSSSA002775\",\"CSSSA002780\",\"CSSSA002792\",\"CSSSA002816\",\"CSSSA002821\",\"CSSSA002833\",\"CSSSA002845\",\"CSSSA002850\",\"CSSSA002862\",\"CSSSA002874\",\"CSSSA002886\",\"CSSSA002891\",\"CSSSA002903\",\"CSSSA002920\",\"CSSSA002932\",\"CSSSA002944\",\"CSSSA002956\",\"CSSSA002961\",\"CSSSA002973\",\"CSSSA002985\",\"CSSSA002990\",\"CSSSA003002\",\"CSSSA003026\",\"CSSSA003031\",\"CSSSA003043\",\"CSSSA003055\",\"CSSSA003060\",\"CSSSA003084\",\"CSSSA003096\",\"CSSSA003101\",\"CSSSA003113\",\"CSSSA003125\",\"CSSSA003130\",\"CSSSA003142\",\"CSSSA003166\",\"CSSSA003171\",\"CSSSA003183\",\"CSSSA003195\",\"CSSSA003200\",\"CSSSA003212\",\"CSSSA003224\",\"CSSSA003236\",\"CSSSA003241\",\"CSSSA003253\",\"CSSSA003265\",\"CSSSA003270\",\"CSSSA003294\",\"CSSSA003306\",\"CSSSA003311\",\"CSSSA003323\",\"CSSSA003340\",\"CSSSA003352\",\"CSSSA003364\",\"CSSSA003376\",\"CSSSA003381\",\"CSSSA003393\",\"CSSSA003405\",\"CSSSA003410\",\"CSSSA003422\",\"CSSSA003434\",\"CSSSA003451\",\"CSSSA003475\",\"CSSSA003480\",\"CSSSA003492\",\"CSSSA003504\",\"CSSSA003516\",\"CSSSA003521\",\"CSSSA003533\",\"CSSSA003545\",\"CSSSA003550\",\"CSSSA003562\",\"CSSSA003574\",\"CSSSA003586\",\"CSSSA003591\",\"CSSSA003603\",\"CSSSA003615\",\"CSSSA003620\",\"CSSSA003644\",\"CSSSA003656\",\"CSSSA003661\",\"CSSSA003673\",\"CSSSA003685\",\"CSSSA003690\",\"CSSSA003702\",\"CSSSA003714\",\"CSSSA003726\",\"CSSSA003731\",\"CSSSA003743\",\"CSSSA003755\",\"CSSSA003760\",\"CSSSA003772\",\"CSSSA003784\",\"CSSSA003796\",\"CSSSA003801\",\"CSSSA003813\",\"CSSSA003825\",\"CSSSA003830\",\"CSSSA003842\",\"CSSSA003854\",\"CSSSA003866\",\"CSSSA003883\",\"CSSSA003895\",\"CSSSA003900\",\"CSSSA003912\",\"CSSSA003936\",\"CSSSA003941\",\"CSSSA003953\",\"CSSSA003965\",\"CSSSA003970\",\"CSSSA003982\",\"CSSSA003994\",\"CSSSA004006\",\"CSSSA004011\",\"CSSSA004023\",\"CSSSA004035\",\"CSSSA004040\",\"CSSSA004052\",\"CSSSA004064\",\"CSSSA004076\",\"CSSSA004081\",\"CSSSA004093\",\"CSSSA004105\",\"CSSSA004110\",\"CSSSA004122\",\"CSSSA004134\",\"CSSSA004146\",\"CSSSA004151\",\"CSSSA004163\",\"CSSSA004175\",\"CSSSA004180\",\"CSSSA004192\",\"CSSSA004204\",\"CSSSA004216\",\"CSSSA004221\",\"CSSSA004233\",\"CSSSA004245\",\"CSSSA004250\",\"CSSSA004262\",\"CSSSA004274\",\"CSSSA004286\",\"CSSSA004291\",\"CSSSA004303\",\"CSSSA004320\",\"CSSSA004332\",\"CSSSA004344\",\"CSSSA004356\",\"CSSSA004361\",\"CSSSA004373\",\"CSSSA004385\",\"CSSSA004390\",\"CSSSA004402\",\"CSSSA004426\",\"CSSSA004431\",\"CSSSA004443\",\"CSSSA004455\",\"CSSSA004460\",\"CSSSA004472\",\"CSSSA004484\",\"CSSSA004496\",\"CSSSA004501\",\"CSSSA004513\",\"CSSSA004525\",\"CSSSA004530\",\"CSSSA004542\",\"CSSSA004566\",\"CSSSA004571\",\"CSSSA004583\",\"CSSSA004595\",\"CSSSA004600\",\"CSSSA004612\",\"CSSSA004624\",\"CSSSA004636\",\"CSSSA004641\",\"CSSSA004653\",\"CSSSA004665\",\"CSSSA004670\",\"CSSSA004682\",\"CSSSA004694\",\"CSSSA004711\",\"CSSSA004723\",\"CSSSA004735\",\"CSSSA004740\",\"CSSSA004764\",\"CSSSA004776\",\"CSSSA004781\",\"CSSSA004793\",\"CSSSA004805\",\"CSSSA004810\",\"CSSSA004822\",\"CSSSA004834\",\"CSSSA004846\",\"CSSSA004851\",\"CSSSA004863\",\"CSSSA004875\",\"CSSSA004880\",\"CSSSA004904\",\"CSSSA004916\",\"CSSSA004945\",\"CSSSA004950\",\"CSSSA004962\",\"CSSSA004986\",\"CSSSA004991\",\"CSSSA005003\",\"CSSSA005015\",\"CSSSA005020\",\"CSSSA005032\",\"CSSSA005044\",\"CSSSA005056\",\"CSSSA005061\",\"CSSSA005073\",\"CSSSA005085\",\"CSSSA005090\",\"CSSSA005102\",\"CSSSA005114\",\"CSSSA005126\",\"CSSSA005131\",\"CSSSA005143\",\"CSSSA005155\",\"CSSSA005160\",\"CSSSA005172\",\"CSSSA005184\",\"CSSSA005196\",\"CSSSA005201\",\"CSSSA005213\",\"CSSSA005225\",\"CSSSA005230\",\"CSSSA005242\",\"CSSSA005254\",\"CSSSA005266\",\"CSSSA005271\",\"CSSSA005283\",\"CSSSA005295\",\"CSSSA005300\",\"CSSSA005312\",\"CSSSA005324\",\"CSSSA005336\",\"CSSSA005341\",\"CSSSA005353\",\"CSSSA005370\",\"CSSSA005382\",\"CSSSA005394\",\"CSSSA005406\",\"CSSSA005411\",\"CSSSA005423\",\"CSSSA005435\",\"CSSSA005440\",\"CSSSA005452\",\"CSSSA005464\",\"CSSSA005481\",\"CSSSA005493\",\"CSSSA005505\",\"CSSSA005510\",\"CSSSA005522\",\"CSSSA005534\",\"CSSSA005546\",\"CSSSA005551\",\"CSSSA005563\",\"CSSSA005575\",\"CSSSA005580\",\"CSSSA005592\",\"CSSSA005604\",\"CSSSA005616\",\"CSSSA005621\",\"CSSSA005633\",\"CSSSA005645\",\"CSSSA005650\",\"CSSSA005662\",\"CSSSA005674\",\"CSSSA005686\",\"CSSSA005691\",\"CSSSA005715\",\"CSSSA005720\",\"CSSSA005732\",\"CSSSA005744\",\"CSSSA005756\",\"CSSSA005761\",\"CSSSA005773\",\"CSSSA005785\",\"CSSSA005790\",\"CSSSA005802\",\"CSSSA005814\",\"CSSSA005826\",\"CSSSA005831\",\"CSSSA005843\",\"CSSSA005855\",\"CSSSA005860\",\"CSSSA005872\",\"CSSSA005884\",\"CSSSA005896\",\"CSSSA005901\",\"CSSSA005913\",\"CSSSA005925\",\"CSSSA005930\",\"CSSSA005942\",\"CSSSA005954\",\"CSSSA005966\",\"CSSSA005971\",\"CSSSA005983\",\"CSSSA005995\",\"CSSSA006000\",\"CSSSA006012\",\"CSSSA006024\",\"CSSSA006036\",\"CSSSA006041\",\"CSSSA006053\",\"CSSSA006065\",\"CSSSA006070\",\"CSSSA006082\",\"CSSSA006094\",\"CSSSA006106\",\"CSSSA006111\",\"CSSSA006135\",\"CSSSA006140\",\"CSSSA006152\",\"CSSSA006164\",\"CSSSA006176\",\"CSSSA006181\",\"CSSSA006205\",\"CSSSA006210\",\"CSSSA006222\",\"CSSSA006234\",\"CSSSA006263\",\"CSSSA006275\",\"CSSSA006280\",\"CSSSA006292\",\"CSSSA006304\",\"CSSSA006316\",\"CSSSA006321\",\"CSSSA006333\",\"CSSSA006345\",\"CSSSA006350\",\"CSSSA006362\",\"CSSSA006374\",\"CSSSA006386\",\"CSSSA006391\",\"CSSSA006403\",\"CSSSA006415\",\"CSSSA006420\",\"CSSSA006432\",\"CSSSA006444\",\"CSSSA006456\",\"CSSSA006461\",\"CSSSA006473\",\"CSSSA006485\",\"CSSSA006490\",\"CSSSA006502\",\"CSSSA006514\",\"CSSSA006526\",\"CSSSA006531\",\"CSSSA006543\",\"CSSSA006555\",\"CSSSA006560\",\"CSSSA006572\",\"CSSSA006584\",\"CSSSA006596\",\"CSSSA006601\",\"CSSSA006613\",\"CSSSA006625\",\"CSSSA006630\",\"CSSSA006642\",\"CSSSA006654\",\"CSSSA006666\",\"CSSSA006683\",\"CSSSA006695\",\"CSSSA006700\",\"CSSSA006712\",\"CSSSA006724\",\"CSSSA006736\",\"CSSSA006741\",\"CSSSA006753\",\"CSSSA006765\",\"CSSSA006770\",\"CSSSA006782\",\"CSSSA006794\",\"CSSSA006806\",\"CSSSA006811\",\"CSSSA006823\",\"CSSSA006835\",\"CSSSA006840\",\"CSSSA006852\",\"CSSSA006864\",\"CSSSA006876\",\"CSSSA006881\",\"CSSSA006893\",\"CSSSA006905\",\"CSSSA006910\",\"CSSSA006922\",\"CSSSA006934\",\"CSSSA006946\",\"CSSSA006951\",\"CSSSA006963\",\"CSSSA006975\",\"CSSSA006980\",\"CSSSA006992\",\"CSSSA007004\",\"CSSSA007016\",\"CSSSA007021\",\"CSSSA007033\",\"CSSSA007045\",\"CSSSA007050\",\"CSSSA007062\",\"CSSSA007074\",\"CSSSA007086\",\"CSSSA007091\",\"CSSSA007103\",\"CSSSA007115\",\"CSSSA007120\",\"CSSSA007132\",\"CSSSA007144\",\"CSSSA007156\",\"CSSSA007161\",\"CSSSA007173\",\"CSSSA007185\",\"CSSSA007190\",\"CSSSA007202\",\"CSSSA007214\",\"CSSSA007226\",\"CSSSA007231\",\"CSSSA007243\",\"CSSSA007255\",\"CSSSA007260\",\"CSSSA007284\",\"CSSSA007296\",\"CSSSA007301\",\"CSSSA007313\",\"CSSSA007325\",\"CSSSA007330\",\"CSSSA007342\",\"CSSSA007354\",\"CSSSA007366\",\"CSSSA007371\",\"CSSSA007383\",\"CSSSA007395\",\"CSSSA007400\",\"CSSSA007412\",\"CSSSA007424\",\"CSSSA007436\",\"CSSSA007453\",\"CSSSA007465\",\"CSSSA007470\",\"CSSSA007494\",\"CSSSA007506\",\"CSSSA007511\",\"CSSSA007523\",\"CSSSA007535\",\"CSSSA007540\",\"CSSSA007552\",\"CSSSA007564\",\"CSSSA007576\",\"CSSSA007581\",\"CSSSA007593\",\"CSSSA007605\",\"CSSSA007610\",\"CSSSA007622\",\"CSSSA007634\",\"CSSSA007646\",\"CSSSA007651\",\"CSSSA007663\",\"CSSSA007675\",\"CSSSA007680\",\"CSSSA007692\",\"CSSSA007704\",\"CSSSA007716\",\"CSSSA007721\",\"CSSSA007733\",\"CSSSA007745\",\"CSSSA007750\",\"CSSSA007762\",\"CSSSA007786\",\"CSSSA007791\",\"CSSSA007803\",\"CSSSA007815\",\"CSSSA007820\",\"CSSSA007832\",\"CSSSA007844\",\"CSSSA007861\",\"CSSSA007885\",\"CSSSA007890\",\"CSSSA007902\",\"CSSSA007914\",\"CSSSA007926\",\"CSSSA007931\",\"CSSSA007943\",\"CSSSA007955\",\"CSSSA007960\",\"CSSSA007972\",\"CSSSA007984\",\"CSSSA007996\",\"CSSSA008001\",\"CSSSA008013\",\"CSSSA008025\",\"CSSSA008030\",\"CSSSA008042\",\"CSSSA008066\",\"CSSSA008071\",\"CSSSA008083\",\"CSSSA008095\",\"CSSSA008100\",\"CSSSA008112\",\"CSSSA008124\",\"CSSSA008136\",\"CSSSA008141\",\"CSSSA008153\",\"CSSSA008165\",\"CSSSA008170\",\"CSSSA008182\",\"CSSSA008194\",\"CSSSA008206\",\"CSSSA008211\",\"CSSSA008223\",\"CSSSA008235\",\"CSSSA008240\",\"CSSSA008252\",\"CSSSA008264\",\"CSSSA008276\",\"CSSSA008281\",\"CSSSA008293\",\"CSSSA008305\",\"CSSSA008310\",\"CSSSA008322\",\"CSSSA008334\",\"CSSSA008346\",\"CSSSA008351\",\"CSSSA008363\",\"CSSSA008375\",\"CSSSA008380\",\"CSSSA008392\",\"CSSSA008416\",\"CSSSA008421\",\"CSSSA008433\",\"CSSSA008445\",\"CSSSA008450\",\"CSSSA008474\",\"CSSSA008491\",\"CSSSA008503\",\"CSSSA008515\",\"CSSSA008520\",\"CSSSA008590\",\"CSSSA008614\",\"CSSSA008631\",\"CSSSA008643\",\"CSSSA008655\",\"CSSSA008672\",\"CSSSA008684\",\"CSSSA008696\",\"CSSSA008701\",\"CSSSA008713\",\"CSSSA008725\",\"CSSSA008754\",\"CSSSA008771\",\"CSSSA008812\",\"CSSSA008824\",\"CSSSA008836\",\"CSSSA008841\",\"CSSSA008853\",\"CSSSA008865\",\"CSSSA008870\",\"CSSSA008882\",\"CSSSA008894\",\"CSSSA008906\",\"CSSSA008911\",\"CSSSA008923\",\"CSSSA008935\",\"CSSSA008952\",\"CSSSA008964\",\"CSSSA008976\",\"CSSSA008981\",\"CSSSA008993\",\"CSSSA009005\",\"CSSSA009010\",\"CSSSA009022\",\"CSSSA009034\",\"CSSSA009046\",\"CSSSA009051\",\"CSSSA009063\",\"CSSSA009075\",\"CSSSA009080\",\"CSSSA009092\",\"CSSSA009104\",\"CSSSA009116\",\"CSSSA009121\",\"CSSSA009133\",\"CSSSA009145\",\"CSSSA009150\",\"CSSSA009162\",\"CSSSA017166\",\"CSSSA017171\",\"CSSSA017183\",\"CSSSA017196\",\"CSSSA017213\",\"CSSSA017225\",\"CSSSA017230\",\"CSSSA017242\",\"CSSSA017266\",\"CSSSA017271\",\"CSSSA017283\",\"CSSSA017295\",\"CSSSA017300\",\"CSSSA017312\",\"CSSSA017324\",\"CSSSA017336\",\"CSSSA017341\",\"CSSSA017353\",\"CSSSA017365\",\"CSSSA017370\",\"CSSSA017382\",\"CSSSA017394\",\"CSSSA017406\",\"CSSSA017411\",\"CSSSA017435\",\"CSSSA017446\",\"CSSSA017451\",\"CSSSA017463\",\"CSSSA017480\",\"CSSSA017492\",\"CSSSA017504\",\"CSSSA017516\",\"CSSSA017521\",\"CSSSA017533\",\"CSSSA017545\",\"CSSSA017550\",\"CSSSA017562\",\"CSSSA017574\",\"CSSSA017586\",\"CSSSA017591\",\"CSSSA017603\",\"CSSSA017615\",\"CSSSA017620\",\"CSSSA017632\",\"CSSSA017656\",\"CSSSA017661\",\"CSSSA017673\",\"CSSSA017685\",\"CSSSA017690\",\"CSSSA017702\",\"CSSSA017714\",\"CSSSA017726\",\"CSSSA017731\",\"CSSSA017743\",\"CSSSA017755\",\"CSSSA017760\",\"CSSSA017772\",\"CSSSA017784\",\"CSSSA017801\",\"CSSSA017813\",\"CSSSA017825\",\"CSSSA017830\",\"CSSSA017842\",\"CSSSA017854\",\"CSSSA017866\",\"CSSSA017883\",\"CSSSA017895\",\"CSSSA017900\",\"CSSSA017912\",\"CSSSA017924\",\"CSSSA017936\",\"CSSSA017941\",\"CSSSA017953\",\"CSSSA017965\",\"CSSSA017970\",\"CSSSA017982\",\"CSSSA017994\",\"CSSSA018006\",\"CSSSA018011\",\"CSSSA018023\",\"CSSSA018035\",\"CSSSA018040\",\"CSSSA018064\",\"CSSSA018076\",\"CSSSA018081\",\"CSSSA018093\",\"CSSSA018105\",\"CSSSA018110\",\"CSSSA018122\",\"CSSSA018134\",\"CSSSA018146\",\"CSSSA018151\",\"CSSSA018163\",\"CSSSA018175\",\"CSSSA018180\",\"CSSSA018192\",\"CSSSA018204\",\"CSSSA018216\",\"CSSSA018221\",\"CSSSA018233\",\"CSSSA018245\",\"CSSSA018250\",\"CSSSA018262\",\"CSSSA018274\",\"CSSSA018291\",\"CSSSA018303\",\"CSSSA018315\",\"CSSSA018320\",\"CSSSA018332\",\"CSSSA018344\",\"CSSSA018356\",\"CSSSA018361\",\"CSSSA018373\",\"CSSSA018385\",\"CSSSA018390\",\"CSSSA018402\",\"CSSSA018414\",\"CSSSA018426\",\"CSSSA018443\",\"CSSSA018455\",\"CSSSA018460\",\"CSSSA018472\",\"CSSSA018484\",\"CSSSA018496\",\"CSSSA018501\",\"CSSSA018513\",\"CSSSA018525\",\"CSSSA018530\",\"CSSSA018542\",\"CSSSA018554\",\"CSSSA018566\",\"CSSSA018571\",\"CSSSA018583\",\"CSSSA018595\",\"CSSSA018600\",\"CSSSA018612\",\"CSSSA018624\",\"CSSSA018636\",\"CSSSA018641\",\"CSSSA018653\",\"CSSSA018665\",\"CSSSA018670\",\"CSSSA018682\",\"CSSSA018694\",\"CSSSA018706\",\"CSSSA018711\",\"CSSSA018723\",\"CSSSA018735\",\"CSSSA018740\",\"CSSSA018752\",\"CSSSA018764\",\"CSSSA018776\",\"CSSSA018781\",\"CSSSA018793\",\"CSSSA018805\",\"CSSSA018810\",\"CSSSA018822\",\"CSSSA018834\",\"CSSSA018846\",\"CSSSA018851\",\"CSSSA018863\",\"CSSSA018875\",\"CSSSA018880\",\"CSSSA018892\",\"CSSSA018904\",\"CSSSA018916\",\"CSSSA018921\",\"CSSSA018933\",\"CSSSA018945\",\"CSSSA018950\",\"CSSSA018962\",\"CSSSA018974\",\"CSSSA018986\",\"CSSSA018991\",\"CSSSA019003\",\"CSSSA019015\",\"CSSSA019020\",\"CSSSA019032\",\"CSSSA019044\",\"CSSSA019056\",\"CSSSA019061\",\"CSSSA019073\",\"CSSSA019090\",\"CSSSA019102\",\"CSSSA019114\",\"CSSSA019126\",\"CSSSA019131\",\"CSSSA019143\",\"CSSSA019155\",\"CSSSA019160\",\"CSSSA019172\",\"CSSSA019184\",\"CSSSA019196\",\"CSSSA019201\",\"CSSSA019213\",\"CSSSA019225\",\"CSSSA019230\",\"CSSSA019242\",\"CSSSA019254\",\"CSSSA019266\",\"CSSSA019271\",\"CSSSA019283\",\"CSSSA019295\",\"CSSSA019300\",\"CSSSA019312\",\"CSSSA019324\",\"CSSSA019336\",\"CSSSA019341\",\"CSSSA019353\",\"CSSSA019365\",\"CSSSA019370\",\"CSSSA019382\",\"CSSSA019394\",\"CSSSA019406\",\"CSSSA019411\",\"CSSSA019423\",\"CSSSA019435\",\"CSSSA019440\",\"CSSSA019452\",\"CSSSA019464\",\"CSSSA019476\",\"CSSSA019481\",\"CSSSA019493\",\"CSSSA019505\",\"CSSSA019510\",\"CSSSA019522\",\"CSSSA019534\",\"CSSSA019546\",\"CSSSA019551\",\"CSSSA019563\",\"CSSSA019575\",\"CSSSA019580\",\"CSSSA019592\",\"CSSSA019604\",\"CSSSA019616\",\"CSSSA019621\",\"CSSSA019633\",\"CSSSA019645\",\"CSSSA019650\",\"CSSSA019662\",\"CSSSA019674\",\"CSSSA019686\",\"CSSSA019691\",\"CSSSA019703\",\"CSSSA019715\",\"CSSSA019720\",\"CSSSA019732\",\"CSSSA019744\",\"CSSSA019756\",\"CSSSA019761\",\"CSSSA019773\",\"CSSSA019785\",\"CSSSA019790\",\"CSSSA019802\",\"CSSSA019814\",\"CSSSA019826\",\"CSSSA019831\",\"CSSSA019843\",\"CSSSA019855\",\"CSSSA019860\",\"CSSSA019872\",\"CSSSA019884\",\"CSSSA019896\",\"CSSSA019901\",\"CSSSA019913\",\"CSSSA019925\",\"CSSSA019930\",\"CSSSA019942\",\"CSSSA019954\",\"CSSSA019966\",\"CSSSA019971\",\"CSSSA019983\",\"CSSSA019995\",\"CSSSA020000\",\"CSSSA020012\",\"CSSSA020024\",\"CSSSA020036\",\"CSSSA020041\",\"CSSSA020053\",\"CSSSA020065\",\"CSSSA020070\",\"CSSSA020082\",\"CSSSA020094\",\"CSSSA020106\",\"CSSSA020111\",\"CSSSA020123\",\"CSSSA020135\",\"CSSSA020140\",\"CSSSA020152\",\"CSSSA020164\",\"CSSSA020176\");\n} //fin de if($IdEstado == \"07\")\n\n//Condicion de estado-clues\nif($IdEstado == \"08\"){\n\t$Clues = array(\"CHSSA000022\",\"CHSSA000034\",\"CHSSA000075\",\"CHSSA000080\",\"CHSSA000104\",\"CHSSA000133\",\"CHSSA000150\",\"CHSSA000162\",\"CHSSA000191\",\"CHSSA000203\",\"CHSSA000215\",\"CHSSA000220\",\"CHSSA000232\",\"CHSSA000261\",\"CHSSA000273\",\"CHSSA000290\",\"CHSSA000302\",\"CHSSA000314\",\"CHSSA000326\",\"CHSSA000343\",\"CHSSA000355\",\"CHSSA000360\",\"CHSSA000372\",\"CHSSA000384\",\"CHSSA000396\",\"CHSSA000401\",\"CHSSA000413\",\"CHSSA000425\",\"CHSSA000430\",\"CHSSA000454\",\"CHSSA000466\",\"CHSSA000471\",\"CHSSA000483\",\"CHSSA000495\",\"CHSSA000500\",\"CHSSA000512\",\"CHSSA000524\",\"CHSSA000541\",\"CHSSA000553\",\"CHSSA000565\",\"CHSSA000570\",\"CHSSA000582\",\"CHSSA000594\",\"CHSSA000606\",\"CHSSA000611\",\"CHSSA000623\",\"CHSSA000640\",\"CHSSA000652\",\"CHSSA000664\",\"CHSSA000676\",\"CHSSA000681\",\"CHSSA000705\",\"CHSSA000722\",\"CHSSA000734\",\"CHSSA000746\",\"CHSSA000751\",\"CHSSA000891\",\"CHSSA000903\",\"CHSSA000915\",\"CHSSA000920\",\"CHSSA000932\",\"CHSSA000944\",\"CHSSA000956\",\"CHSSA000961\",\"CHSSA000973\",\"CHSSA000985\",\"CHSSA000990\",\"CHSSA001002\",\"CHSSA001026\",\"CHSSA001031\",\"CHSSA001055\",\"CHSSA001060\",\"CHSSA001072\",\"CHSSA001084\",\"CHSSA001096\",\"CHSSA001101\",\"CHSSA001113\",\"CHSSA001125\",\"CHSSA001130\",\"CHSSA001142\",\"CHSSA001166\",\"CHSSA001171\",\"CHSSA001183\",\"CHSSA001195\",\"CHSSA001241\",\"CHSSA001253\",\"CHSSA001265\",\"CHSSA001270\",\"CHSSA001282\",\"CHSSA001306\",\"CHSSA001323\",\"CHSSA001340\",\"CHSSA001364\",\"CHSSA001381\",\"CHSSA001393\",\"CHSSA001405\",\"CHSSA001422\",\"CHSSA001434\",\"CHSSA001446\",\"CHSSA001451\",\"CHSSA001463\",\"CHSSA001475\",\"CHSSA001492\",\"CHSSA001504\",\"CHSSA001516\",\"CHSSA001521\",\"CHSSA001533\",\"CHSSA001545\",\"CHSSA001550\",\"CHSSA001562\",\"CHSSA001574\",\"CHSSA001586\",\"CHSSA001591\",\"CHSSA001603\",\"CHSSA001620\",\"CHSSA001644\",\"CHSSA001656\",\"CHSSA001661\",\"CHSSA001673\",\"CHSSA001685\",\"CHSSA001690\",\"CHSSA001726\",\"CHSSA001743\",\"CHSSA001755\",\"CHSSA001760\",\"CHSSA001772\",\"CHSSA001784\",\"CHSSA001796\",\"CHSSA001801\",\"CHSSA001813\",\"CHSSA001842\",\"CHSSA001866\",\"CHSSA001871\",\"CHSSA001883\",\"CHSSA001895\",\"CHSSA001900\",\"CHSSA001912\",\"CHSSA001941\",\"CHSSA001953\",\"CHSSA001970\",\"CHSSA001982\",\"CHSSA002006\",\"CHSSA002011\",\"CHSSA002023\",\"CHSSA002040\",\"CHSSA002081\",\"CHSSA002093\",\"CHSSA002105\",\"CHSSA002110\",\"CHSSA002122\",\"CHSSA002134\",\"CHSSA002146\",\"CHSSA002151\",\"CHSSA002163\",\"CHSSA002175\",\"CHSSA002192\",\"CHSSA002233\",\"CHSSA002245\",\"CHSSA002250\",\"CHSSA002262\",\"CHSSA002274\",\"CHSSA002286\",\"CHSSA002291\",\"CHSSA002303\",\"CHSSA002315\",\"CHSSA002332\",\"CHSSA002344\",\"CHSSA002356\",\"CHSSA002361\",\"CHSSA002385\",\"CHSSA002390\",\"CHSSA002402\",\"CHSSA002414\",\"CHSSA002426\",\"CHSSA002431\",\"CHSSA002443\",\"CHSSA002455\",\"CHSSA002460\",\"CHSSA002484\",\"CHSSA002496\",\"CHSSA002501\",\"CHSSA002525\",\"CHSSA002530\",\"CHSSA002554\",\"CHSSA002566\",\"CHSSA002571\",\"CHSSA002583\",\"CHSSA002595\",\"CHSSA002600\",\"CHSSA002636\",\"CHSSA002653\",\"CHSSA002670\",\"CHSSA002682\",\"CHSSA002706\",\"CHSSA002711\",\"CHSSA002723\",\"CHSSA002735\",\"CHSSA002740\",\"CHSSA002752\",\"CHSSA002764\",\"CHSSA002834\",\"CHSSA002846\",\"CHSSA002851\",\"CHSSA002880\",\"CHSSA002904\",\"CHSSA002916\",\"CHSSA002921\",\"CHSSA017412\",\"CHSSA017424\",\"CHSSA017436\",\"CHSSA017441\",\"CHSSA017465\",\"CHSSA017470\",\"CHSSA017482\",\"CHSSA017494\",\"CHSSA017506\",\"CHSSA017511\",\"CHSSA017523\",\"CHSSA017535\",\"CHSSA017540\",\"CHSSA017552\",\"CHSSA017564\",\"CHSSA017576\",\"CHSSA017581\",\"CHSSA017593\",\"CHSSA017605\",\"CHSSA017610\",\"CHSSA017622\",\"CHSSA017634\",\"CHSSA017646\",\"CHSSA017651\",\"CHSSA017663\",\"CHSSA017675\",\"CHSSA017686\",\"CHSSA017691\",\"CHSSA017703\",\"CHSSA017715\",\"CHSSA017720\",\"CHSSA017732\",\"CHSSA017744\",\"CHSSA017761\",\"CHSSA017773\",\"CHSSA017785\",\"CHSSA017790\",\"CHSSA017802\",\"CHSSA017814\",\"CHSSA017826\",\"CHSSA017831\",\"CHSSA017855\",\"CHSSA017860\",\"CHSSA017872\",\"CHSSA017884\",\"CHSSA017896\",\"CHSSA017901\",\"CHSSA017913\",\"CHSSA017925\",\"CHSSA017930\",\"CHSSA017942\",\"CHSSA017954\",\"CHSSA017966\",\"CHSSA017971\",\"CHSSA017983\",\"CHSSA017995\",\"CHSSA018000\",\"CHSSA018012\",\"CHSSA018024\",\"CHSSA018036\",\"CHSSA018041\",\"CHSSA018053\",\"CHSSA018065\",\"CHSSA018070\",\"CHSSA018082\",\"CHSSA018094\",\"CHSSA018106\",\"CHSSA018111\",\"CHSSA018123\",\"CHSSA018135\",\"CHSSA018140\",\"CHSSA018152\",\"CHSSA018164\",\"CHSSA018176\",\"CHSSA018181\",\"CHSSA018193\",\"CHSSA018205\",\"CHSSA018210\",\"CHSSA018222\",\"CHSSA018234\",\"CHSSA018246\",\"CHSSA018251\",\"CHSSA018263\",\"CHSSA018275\",\"CHSSA018280\",\"CHSSA018292\",\"CHSSA018304\",\"CHSSA018316\",\"CHSSA018321\",\"CHSSA018345\",\"CHSSA018350\",\"CHSSA018362\",\"CHSSA018374\",\"CHSSA018386\",\"CHSSA018403\",\"CHSSA018415\",\"CHSSA018420\",\"CHSSA018432\",\"CHSSA018444\",\"CHSSA018456\",\"CHSSA018461\",\"CHSSA018473\",\"CHSSA018485\",\"CHSSA018490\",\"CHSSA018502\",\"CHSSA018514\",\"CHSSA018526\",\"CHSSA018531\",\"CHSSA018543\",\"CHSSA018555\",\"CHSSA018560\",\"CHSSA018572\",\"CHSSA018584\",\"CHSSA018596\",\"CHSSA018601\",\"CHSSA018613\",\"CHSSA018625\",\"CHSSA018630\",\"CHSSA018642\",\"CHSSA018654\",\"CHSSA018666\",\"CHSSA018671\",\"CHSSA018683\");\n} //fin de if($IdEstado == \"08\")\n\n//Condicion de estado-clues\nif($IdEstado == \"09\"){\n\t$Clues = array(\"DFSSA000053\",\"DFSSA000065\",\"DFSSA000111\",\"DFSSA000123\",\"DFSSA000135\",\"DFSSA000152\",\"DFSSA000176\",\"DFSSA000181\",\"DFSSA000205\",\"DFSSA000210\",\"DFSSA000222\",\"DFSSA000234\",\"DFSSA000246\",\"DFSSA000251\",\"DFSSA000263\",\"DFSSA000275\",\"DFSSA000350\",\"DFSSA000415\",\"DFSSA000420\",\"DFSSA000432\",\"DFSSA000444\",\"DFSSA000456\",\"DFSSA000461\",\"DFSSA000473\",\"DFSSA000485\",\"DFSSA000490\",\"DFSSA000502\",\"DFSSA000514\",\"DFSSA000526\",\"DFSSA000596\",\"DFSSA000613\",\"DFSSA000630\",\"DFSSA000642\",\"DFSSA000654\",\"DFSSA000666\",\"DFSSA000671\",\"DFSSA000683\",\"DFSSA000695\",\"DFSSA000700\",\"DFSSA000712\",\"DFSSA000835\",\"DFSSA000840\",\"DFSSA000852\",\"DFSSA000864\",\"DFSSA000881\",\"DFSSA000980\",\"DFSSA000992\",\"DFSSA001004\",\"DFSSA001016\",\"DFSSA001021\",\"DFSSA001033\",\"DFSSA001045\",\"DFSSA001050\",\"DFSSA001062\",\"DFSSA001074\",\"DFSSA001086\",\"DFSSA001091\",\"DFSSA001103\",\"DFSSA001115\",\"DFSSA001120\",\"DFSSA001132\",\"DFSSA001144\",\"DFSSA001156\",\"DFSSA001161\",\"DFSSA001173\",\"DFSSA001185\",\"DFSSA001190\",\"DFSSA001202\",\"DFSSA001214\",\"DFSSA001226\",\"DFSSA001231\",\"DFSSA001243\",\"DFSSA001255\",\"DFSSA001260\",\"DFSSA001272\",\"DFSSA001284\",\"DFSSA001296\",\"DFSSA001371\",\"DFSSA001383\",\"DFSSA001395\",\"DFSSA001400\",\"DFSSA001412\",\"DFSSA001424\",\"DFSSA001511\",\"DFSSA001540\",\"DFSSA001634\",\"DFSSA001651\",\"DFSSA001663\",\"DFSSA001675\",\"DFSSA001680\",\"DFSSA001692\",\"DFSSA001704\",\"DFSSA001716\",\"DFSSA001733\",\"DFSSA001745\",\"DFSSA001750\",\"DFSSA001762\",\"DFSSA001774\",\"DFSSA001786\",\"DFSSA001791\",\"DFSSA001803\",\"DFSSA001815\",\"DFSSA001820\",\"DFSSA001832\",\"DFSSA001844\",\"DFSSA001856\",\"DFSSA001926\",\"DFSSA001955\",\"DFSSA001960\",\"DFSSA001972\",\"DFSSA001984\",\"DFSSA001996\",\"DFSSA002001\",\"DFSSA002025\",\"DFSSA002030\",\"DFSSA002066\",\"DFSSA002100\",\"DFSSA002112\",\"DFSSA002124\",\"DFSSA002136\",\"DFSSA002141\",\"DFSSA002153\",\"DFSSA002165\",\"DFSSA002170\",\"DFSSA002182\",\"DFSSA002194\",\"DFSSA002206\",\"DFSSA002281\",\"DFSSA002305\",\"DFSSA002310\",\"DFSSA002322\",\"DFSSA002334\",\"DFSSA002346\",\"DFSSA002351\",\"DFSSA002363\",\"DFSSA002375\",\"DFSSA002380\",\"DFSSA002392\",\"DFSSA002404\",\"DFSSA002416\",\"DFSSA002421\",\"DFSSA002433\",\"DFSSA002491\",\"DFSSA002520\",\"DFSSA002532\",\"DFSSA002544\",\"DFSSA002556\",\"DFSSA002561\",\"DFSSA002573\",\"DFSSA002590\",\"DFSSA002602\",\"DFSSA002614\",\"DFSSA002626\",\"DFSSA002631\",\"DFSSA002643\",\"DFSSA002655\",\"DFSSA002660\",\"DFSSA002672\",\"DFSSA002701\",\"DFSSA002713\",\"DFSSA002725\",\"DFSSA002730\",\"DFSSA002742\",\"DFSSA002766\",\"DFSSA002771\",\"DFSSA002783\",\"DFSSA002795\",\"DFSSA002800\",\"DFSSA002812\",\"DFSSA002824\",\"DFSSA002836\",\"DFSSA002841\",\"DFSSA002853\",\"DFSSA002865\",\"DFSSA002870\",\"DFSSA002882\",\"DFSSA002894\",\"DFSSA002906\",\"DFSSA002911\",\"DFSSA002923\",\"DFSSA002993\",\"DFSSA003046\",\"DFSSA003051\",\"DFSSA003063\",\"DFSSA003075\",\"DFSSA003080\",\"DFSSA003092\",\"DFSSA003104\",\"DFSSA003121\",\"DFSSA003133\",\"DFSSA003145\",\"DFSSA003150\",\"DFSSA003162\",\"DFSSA003220\",\"DFSSA003232\",\"DFSSA003244\",\"DFSSA003256\",\"DFSSA003273\",\"DFSSA003285\",\"DFSSA003290\",\"DFSSA003302\",\"DFSSA003314\",\"DFSSA003326\",\"DFSSA003331\",\"DFSSA003372\",\"DFSSA003384\",\"DFSSA003454\",\"DFSSA003466\",\"DFSSA003471\",\"DFSSA003483\",\"DFSSA003495\",\"DFSSA003500\",\"DFSSA003536\",\"DFSSA003541\",\"DFSSA003553\",\"DFSSA003611\",\"DFSSA003623\",\"DFSSA003635\",\"DFSSA003640\",\"DFSSA003652\",\"DFSSA003664\",\"DFSSA003705\",\"DFSSA003710\",\"DFSSA003722\",\"DFSSA003804\",\"DFSSA003816\",\"DFSSA003821\",\"DFSSA003833\",\"DFSSA003845\",\"DFSSA003850\",\"DFSSA003862\",\"DFSSA003874\",\"DFSSA003886\",\"DFSSA003891\",\"DFSSA003903\",\"DFSSA003915\",\"DFSSA003920\",\"DFSSA003932\",\"DFSSA003944\",\"DFSSA003956\",\"DFSSA003961\",\"DFSSA003973\",\"DFSSA003990\",\"DFSSA004002\",\"DFSSA004014\",\"DFSSA004026\",\"DFSSA004031\",\"DFSSA004043\",\"DFSSA004055\",\"DFSSA004060\",\"DFSSA004072\",\"DFSSA004084\",\"DFSSA004096\",\"DFSSA004101\",\"DFSSA004113\",\"DFSSA004125\",\"DFSSA004130\",\"DFSSA004142\",\"DFSSA004154\",\"DFSSA004166\",\"DFSSA004195\",\"DFSSA004265\",\"DFSSA004270\",\"DFSSA017525\",\"DFSSA017530\",\"DFSSA017542\",\"DFSSA017554\",\"DFSSA017566\",\"DFSSA017571\",\"DFSSA017583\",\"DFSSA017595\",\"DFSSA017600\",\"DFSSA017612\",\"DFSSA017624\",\"DFSSA017636\",\"DFSSA017641\",\"DFSSA017653\",\"DFSSA017665\",\"DFSSA017670\",\"DFSSA017682\",\"DFSSA017694\",\"DFSSA017706\",\"DFSSA017711\",\"DFSSA017723\",\"DFSSA017735\",\"DFSSA017740\",\"DFSSA017752\",\"DFSSA017764\",\"DFSSA017776\",\"DFSSA017781\",\"DFSSA017793\",\"DFSSA017805\",\"DFSSA017810\",\"DFSSA017822\",\"DFSSA017834\",\"DFSSA017846\",\"DFSSA017851\",\"DFSSA017863\",\"DFSSA017875\",\"DFSSA017886\",\"DFSSA017891\",\"DFSSA017915\",\"DFSSA017920\",\"DFSSA017932\",\"DFSSA017944\",\"DFSSA017956\",\"DFSSA017961\",\"DFSSA017973\",\"DFSSA017985\",\"DFSSA017990\",\"DFSSA018002\",\"DFSSA018014\",\"DFSSA018026\",\"DFSSA018031\",\"DFSSA018043\",\"DFSSA018055\",\"DFSSA018060\",\"DFSSA018072\",\"DFSSA018084\",\"DFSSA018096\",\"DFSSA018101\",\"DFSSA018113\",\"DFSSA018125\",\"DFSSA018130\",\"DFSSA018142\",\"DFSSA018154\",\"DFSSA018166\",\"DFSSA018171\",\"DFSSA018323\",\"DFSSA018335\",\"DFSSA018340\",\"DFSSA018352\",\"DFSSA018364\",\"DFSSA018376\",\"DFSSA018381\",\"DFSSA018393\",\"DFSSA018405\",\"DFSSA018410\",\"DFSSA018422\",\"DFSSA018434\",\"DFSSA018446\",\"DFSSA018451\",\"DFSSA018463\",\"DFSSA018475\",\"DFSSA018480\",\"DFSSA018492\",\"DFSSA018504\",\"DFSSA018516\",\"DFSSA018521\",\"DFSSA018533\",\"DFSSA018545\",\"DFSSA018550\",\"DFSSA018562\",\"DFSSA018574\",\"DFSSA018586\",\"DFSSA018591\",\"DFSSA018603\",\"DFSSA018615\",\"DFSSA018620\",\"DFSSA018632\",\"DFSSA018644\",\"DFSSA018656\",\"DFSSA018661\",\"DFSSA018673\",\"DFSSA018685\",\"DFSSA018690\",\"DFSSA018702\",\"DFSSA018714\",\"DFSSA018726\",\"DFSSA018731\",\"DFSSA018743\",\"DFSSA018755\",\"DFSSA018760\",\"DFSSA018772\",\"DFSSA018784\",\"DFSSA018796\",\"DFSSA018801\",\"DFSSA018813\",\"DFSSA018825\",\"DFSSA018830\",\"DFSSA018842\",\"DFSSA018854\",\"DFSSA018866\",\"DFSSA018871\",\"DFSSA018883\",\"DFSSA018895\",\"DFSSA018900\",\"DFSSA018912\",\"DFSSA018924\",\"DFSSA018936\",\"DFSSA018941\",\"DFSSA018953\",\"DFSSA018965\",\"DFSSA018970\",\"DFSSA018982\",\"DFSSA018994\",\"DFSSA019006\",\"DFSSA019011\",\"DFSSA019023\",\"DFSSA019035\",\"DFSSA019040\",\"DFSSA019052\",\"DFSSA019064\",\"DFSSA019076\",\"DFSSA019081\",\"DFSSA019093\",\"DFSSA019105\",\"DFSSA019110\");\n} //fin de if($IdEstado == \"09\")\n\n//Condicion de estado-clues\nif($IdEstado == \"10\"){\n\t$Clues = array(\"DGSSA000010\",\"DGSSA000022\",\"DGSSA000034\",\"DGSSA000046\",\"DGSSA000051\",\"DGSSA000063\",\"DGSSA000075\",\"DGSSA000080\",\"DGSSA000092\",\"DGSSA000104\",\"DGSSA000116\",\"DGSSA000121\",\"DGSSA000133\",\"DGSSA000145\",\"DGSSA000150\",\"DGSSA000162\",\"DGSSA000174\",\"DGSSA000186\",\"DGSSA000191\",\"DGSSA000203\",\"DGSSA000215\",\"DGSSA000220\",\"DGSSA000232\",\"DGSSA000244\",\"DGSSA000256\",\"DGSSA000261\",\"DGSSA000273\",\"DGSSA000285\",\"DGSSA000302\",\"DGSSA000314\",\"DGSSA000326\",\"DGSSA000331\",\"DGSSA000343\",\"DGSSA000355\",\"DGSSA000360\",\"DGSSA000372\",\"DGSSA000384\",\"DGSSA000396\",\"DGSSA000401\",\"DGSSA000413\",\"DGSSA000425\",\"DGSSA000442\",\"DGSSA000454\",\"DGSSA000471\",\"DGSSA000483\",\"DGSSA000495\",\"DGSSA000500\",\"DGSSA000512\",\"DGSSA000524\",\"DGSSA000536\",\"DGSSA000541\",\"DGSSA000553\",\"DGSSA000565\",\"DGSSA000570\",\"DGSSA000582\",\"DGSSA000594\",\"DGSSA000606\",\"DGSSA000623\",\"DGSSA000635\",\"DGSSA000640\",\"DGSSA000652\",\"DGSSA000664\",\"DGSSA000676\",\"DGSSA000693\",\"DGSSA000705\",\"DGSSA000710\",\"DGSSA000722\",\"DGSSA000734\",\"DGSSA000746\",\"DGSSA000751\",\"DGSSA000763\",\"DGSSA000775\",\"DGSSA000780\",\"DGSSA000792\",\"DGSSA000804\",\"DGSSA000816\",\"DGSSA000821\",\"DGSSA000833\",\"DGSSA000845\",\"DGSSA000850\",\"DGSSA000862\",\"DGSSA000874\",\"DGSSA000886\",\"DGSSA000891\",\"DGSSA000903\",\"DGSSA000915\",\"DGSSA000920\",\"DGSSA000932\",\"DGSSA000944\",\"DGSSA000956\",\"DGSSA000961\",\"DGSSA000973\",\"DGSSA000985\",\"DGSSA000990\",\"DGSSA001014\",\"DGSSA001026\",\"DGSSA001031\",\"DGSSA001043\",\"DGSSA001055\",\"DGSSA001060\",\"DGSSA001072\",\"DGSSA001084\",\"DGSSA001096\",\"DGSSA001101\",\"DGSSA001113\",\"DGSSA001125\",\"DGSSA001130\",\"DGSSA001154\",\"DGSSA001166\",\"DGSSA001171\",\"DGSSA001183\",\"DGSSA001200\",\"DGSSA001212\",\"DGSSA001224\",\"DGSSA001241\",\"DGSSA001253\",\"DGSSA001265\",\"DGSSA001270\",\"DGSSA001282\",\"DGSSA001294\",\"DGSSA001306\",\"DGSSA001311\",\"DGSSA001323\",\"DGSSA001340\",\"DGSSA001352\",\"DGSSA001364\",\"DGSSA001376\",\"DGSSA001381\",\"DGSSA001393\",\"DGSSA001405\",\"DGSSA001410\",\"DGSSA001422\",\"DGSSA001434\",\"DGSSA001446\",\"DGSSA001451\",\"DGSSA001463\",\"DGSSA001475\",\"DGSSA001480\",\"DGSSA001492\",\"DGSSA001504\",\"DGSSA001516\",\"DGSSA001533\",\"DGSSA001545\",\"DGSSA001562\",\"DGSSA001574\",\"DGSSA001586\",\"DGSSA001591\",\"DGSSA001603\",\"DGSSA001615\",\"DGSSA001620\",\"DGSSA001632\",\"DGSSA001644\",\"DGSSA001656\",\"DGSSA001661\",\"DGSSA001673\",\"DGSSA001685\",\"DGSSA001690\",\"DGSSA001702\",\"DGSSA001714\",\"DGSSA001726\",\"DGSSA001731\",\"DGSSA001743\",\"DGSSA001755\",\"DGSSA001760\",\"DGSSA001772\",\"DGSSA001784\",\"DGSSA001796\",\"DGSSA001801\",\"DGSSA001813\",\"DGSSA001825\",\"DGSSA001830\",\"DGSSA001842\",\"DGSSA001854\",\"DGSSA001866\",\"DGSSA001871\",\"DGSSA001883\",\"DGSSA001895\",\"DGSSA001900\",\"DGSSA001912\",\"DGSSA001924\",\"DGSSA001965\",\"DGSSA001970\",\"DGSSA001982\",\"DGSSA001994\",\"DGSSA002006\",\"DGSSA002011\",\"DGSSA002052\",\"DGSSA002076\",\"DGSSA002081\",\"DGSSA002093\",\"DGSSA002105\",\"DGSSA002110\",\"DGSSA002122\",\"DGSSA002134\",\"DGSSA002146\",\"DGSSA002151\",\"DGSSA002163\",\"DGSSA002175\",\"DGSSA002180\",\"DGSSA002192\",\"DGSSA002204\",\"DGSSA002221\",\"DGSSA002233\",\"DGSSA002245\",\"DGSSA002250\",\"DGSSA002262\",\"DGSSA002274\",\"DGSSA002303\",\"DGSSA002315\",\"DGSSA002320\",\"DGSSA002332\",\"DGSSA017115\",\"DGSSA017132\",\"DGSSA017144\",\"DGSSA017156\",\"DGSSA017161\",\"DGSSA017173\",\"DGSSA017185\",\"DGSSA017190\",\"DGSSA017202\",\"DGSSA017214\",\"DGSSA017226\",\"DGSSA017231\",\"DGSSA017242\",\"DGSSA017254\",\"DGSSA017266\",\"DGSSA017271\",\"DGSSA017283\",\"DGSSA017295\",\"DGSSA017300\",\"DGSSA017312\",\"DGSSA017324\",\"DGSSA017336\",\"DGSSA017341\",\"DGSSA017365\",\"DGSSA017370\",\"DGSSA017382\",\"DGSSA017394\",\"DGSSA017406\",\"DGSSA017411\",\"DGSSA017423\",\"DGSSA017435\",\"DGSSA017440\",\"DGSSA017452\",\"DGSSA017464\",\"DGSSA017476\",\"DGSSA017481\",\"DGSSA017493\",\"DGSSA017505\",\"DGSSA017510\",\"DGSSA017522\",\"DGSSA017534\",\"DGSSA017546\",\"DGSSA017551\",\"DGSSA017563\",\"DGSSA017575\",\"DGSSA017580\",\"DGSSA017592\",\"DGSSA017604\",\"DGSSA017616\",\"DGSSA017621\",\"DGSSA017633\",\"DGSSA017645\",\"DGSSA017650\",\"DGSSA017662\",\"DGSSA017674\",\"DGSSA017686\",\"DGSSA017691\",\"DGSSA017703\",\"DGSSA017715\",\"DGSSA017720\",\"DGSSA017732\",\"DGSSA017744\",\"DGSSA017756\",\"DGSSA017761\",\"DGSSA017773\",\"DGSSA017785\",\"DGSSA017790\",\"DGSSA017802\",\"DGSSA017814\",\"DGSSA017826\",\"DGSSA017831\",\"DGSSA017843\",\"DGSSA017855\",\"DGSSA017860\",\"DGSSA017872\");\n} //fin de if($IdEstado == \"10\")\n\n//Condicion de estado-clues\nif($IdEstado == \"11\"){\n\t$Clues = array(\"GTSSA000013\",\"GTSSA000025\",\"GTSSA000030\",\"GTSSA000042\",\"GTSSA000054\",\"GTSSA000066\",\"GTSSA000071\",\"GTSSA000083\",\"GTSSA000095\",\"GTSSA000100\",\"GTSSA000112\",\"GTSSA000124\",\"GTSSA000136\",\"GTSSA000141\",\"GTSSA000153\",\"GTSSA000165\",\"GTSSA000170\",\"GTSSA000182\",\"GTSSA000194\",\"GTSSA000206\",\"GTSSA000211\",\"GTSSA000223\",\"GTSSA000235\",\"GTSSA000240\",\"GTSSA000252\",\"GTSSA000264\",\"GTSSA000276\",\"GTSSA000281\",\"GTSSA000293\",\"GTSSA000305\",\"GTSSA000310\",\"GTSSA000322\",\"GTSSA000334\",\"GTSSA000346\",\"GTSSA000351\",\"GTSSA000363\",\"GTSSA000375\",\"GTSSA000380\",\"GTSSA000392\",\"GTSSA000404\",\"GTSSA000416\",\"GTSSA000421\",\"GTSSA000433\",\"GTSSA000445\",\"GTSSA000450\",\"GTSSA000462\",\"GTSSA000474\",\"GTSSA000486\",\"GTSSA000491\",\"GTSSA000503\",\"GTSSA000515\",\"GTSSA000520\",\"GTSSA000532\",\"GTSSA000544\",\"GTSSA000556\",\"GTSSA000561\",\"GTSSA000573\",\"GTSSA000585\",\"GTSSA000590\",\"GTSSA000602\",\"GTSSA000614\",\"GTSSA000626\",\"GTSSA000631\",\"GTSSA000643\",\"GTSSA000655\",\"GTSSA000660\",\"GTSSA000672\",\"GTSSA000684\",\"GTSSA000696\",\"GTSSA000701\",\"GTSSA000713\",\"GTSSA000725\",\"GTSSA000730\",\"GTSSA000742\",\"GTSSA000754\",\"GTSSA000766\",\"GTSSA000771\",\"GTSSA000795\",\"GTSSA000800\",\"GTSSA000812\",\"GTSSA000824\",\"GTSSA000836\",\"GTSSA000841\",\"GTSSA000853\",\"GTSSA000865\",\"GTSSA000870\",\"GTSSA000882\",\"GTSSA000894\",\"GTSSA000906\",\"GTSSA000911\",\"GTSSA000923\",\"GTSSA000935\",\"GTSSA000940\",\"GTSSA000952\",\"GTSSA000964\",\"GTSSA000976\",\"GTSSA000981\",\"GTSSA000993\",\"GTSSA001005\",\"GTSSA001010\",\"GTSSA001022\",\"GTSSA001034\",\"GTSSA001046\",\"GTSSA001051\",\"GTSSA001063\",\"GTSSA001075\",\"GTSSA001080\",\"GTSSA001092\",\"GTSSA001104\",\"GTSSA001116\",\"GTSSA001121\",\"GTSSA001133\",\"GTSSA001145\",\"GTSSA001150\",\"GTSSA001162\",\"GTSSA001174\",\"GTSSA001186\",\"GTSSA001191\",\"GTSSA001203\",\"GTSSA001215\",\"GTSSA001220\",\"GTSSA001232\",\"GTSSA001244\",\"GTSSA001256\",\"GTSSA001261\",\"GTSSA001273\",\"GTSSA001285\",\"GTSSA001290\",\"GTSSA001302\",\"GTSSA001314\",\"GTSSA001326\",\"GTSSA001331\",\"GTSSA001343\",\"GTSSA001355\",\"GTSSA001360\",\"GTSSA001372\",\"GTSSA001384\",\"GTSSA001396\",\"GTSSA001401\",\"GTSSA001413\",\"GTSSA001425\",\"GTSSA001430\",\"GTSSA001442\",\"GTSSA001454\",\"GTSSA001466\",\"GTSSA001471\",\"GTSSA001483\",\"GTSSA001495\",\"GTSSA001500\",\"GTSSA001512\",\"GTSSA001524\",\"GTSSA001536\",\"GTSSA001541\",\"GTSSA001553\",\"GTSSA001565\",\"GTSSA001570\",\"GTSSA001582\",\"GTSSA001594\",\"GTSSA001606\",\"GTSSA001611\",\"GTSSA001623\",\"GTSSA001635\",\"GTSSA001640\",\"GTSSA001652\",\"GTSSA001664\",\"GTSSA001676\",\"GTSSA001681\",\"GTSSA001693\",\"GTSSA001705\",\"GTSSA001710\",\"GTSSA001722\",\"GTSSA001734\",\"GTSSA001746\",\"GTSSA001751\",\"GTSSA001763\",\"GTSSA001775\",\"GTSSA001780\",\"GTSSA001792\",\"GTSSA001816\",\"GTSSA001821\",\"GTSSA001833\",\"GTSSA001845\",\"GTSSA001850\",\"GTSSA001862\",\"GTSSA001874\",\"GTSSA001886\",\"GTSSA001891\",\"GTSSA001903\",\"GTSSA001915\",\"GTSSA001920\",\"GTSSA001932\",\"GTSSA001944\",\"GTSSA001956\",\"GTSSA001961\",\"GTSSA001973\",\"GTSSA001985\",\"GTSSA001990\",\"GTSSA002002\",\"GTSSA002014\",\"GTSSA002026\",\"GTSSA002031\",\"GTSSA002043\",\"GTSSA002055\",\"GTSSA002060\",\"GTSSA002072\",\"GTSSA002084\",\"GTSSA002096\",\"GTSSA002101\",\"GTSSA002113\",\"GTSSA002125\",\"GTSSA002130\",\"GTSSA002142\",\"GTSSA002154\",\"GTSSA002166\",\"GTSSA002171\",\"GTSSA002183\",\"GTSSA002195\",\"GTSSA002200\",\"GTSSA002212\",\"GTSSA002224\",\"GTSSA002236\",\"GTSSA002241\",\"GTSSA002253\",\"GTSSA002265\",\"GTSSA002270\",\"GTSSA002282\",\"GTSSA002294\",\"GTSSA002306\",\"GTSSA002311\",\"GTSSA002323\",\"GTSSA002335\",\"GTSSA002340\",\"GTSSA002352\",\"GTSSA002364\",\"GTSSA002376\",\"GTSSA002381\",\"GTSSA002393\",\"GTSSA002405\",\"GTSSA002410\",\"GTSSA002422\",\"GTSSA002434\",\"GTSSA002446\",\"GTSSA002451\",\"GTSSA002463\",\"GTSSA002475\",\"GTSSA002480\",\"GTSSA002492\",\"GTSSA002504\",\"GTSSA002516\",\"GTSSA002521\",\"GTSSA002533\",\"GTSSA002545\",\"GTSSA002550\",\"GTSSA002562\",\"GTSSA002574\",\"GTSSA002586\",\"GTSSA002591\",\"GTSSA002603\",\"GTSSA002615\",\"GTSSA002620\",\"GTSSA002632\",\"GTSSA002644\",\"GTSSA002656\",\"GTSSA002661\",\"GTSSA002673\",\"GTSSA002685\",\"GTSSA002690\",\"GTSSA002702\",\"GTSSA002714\",\"GTSSA002726\",\"GTSSA002731\",\"GTSSA002743\",\"GTSSA002755\",\"GTSSA002760\",\"GTSSA002772\",\"GTSSA002784\",\"GTSSA002796\",\"GTSSA002801\",\"GTSSA002813\",\"GTSSA002825\",\"GTSSA002830\",\"GTSSA002842\",\"GTSSA002854\",\"GTSSA002866\",\"GTSSA002871\",\"GTSSA002883\",\"GTSSA002895\",\"GTSSA002900\",\"GTSSA002912\",\"GTSSA002924\",\"GTSSA002936\",\"GTSSA002941\",\"GTSSA002953\",\"GTSSA002970\",\"GTSSA002982\",\"GTSSA002994\",\"GTSSA003011\",\"GTSSA003023\",\"GTSSA003035\",\"GTSSA003040\",\"GTSSA003052\",\"GTSSA003064\",\"GTSSA003076\",\"GTSSA003081\",\"GTSSA003093\",\"GTSSA003105\",\"GTSSA003110\",\"GTSSA003122\",\"GTSSA003134\",\"GTSSA003146\",\"GTSSA003151\",\"GTSSA003163\",\"GTSSA003175\",\"GTSSA003180\",\"GTSSA003192\",\"GTSSA003204\",\"GTSSA003216\",\"GTSSA003221\",\"GTSSA003233\",\"GTSSA003245\",\"GTSSA003250\",\"GTSSA003262\",\"GTSSA003274\",\"GTSSA003286\",\"GTSSA003291\",\"GTSSA003303\",\"GTSSA003315\",\"GTSSA003320\",\"GTSSA003332\",\"GTSSA003344\",\"GTSSA003361\",\"GTSSA003373\",\"GTSSA003385\",\"GTSSA003390\",\"GTSSA003402\",\"GTSSA003414\",\"GTSSA003426\",\"GTSSA003431\",\"GTSSA003443\",\"GTSSA003455\",\"GTSSA003460\",\"GTSSA003472\",\"GTSSA003484\",\"GTSSA003496\",\"GTSSA003501\",\"GTSSA003513\",\"GTSSA003525\",\"GTSSA003530\",\"GTSSA003542\",\"GTSSA003554\",\"GTSSA003566\",\"GTSSA003571\",\"GTSSA003583\",\"GTSSA003595\",\"GTSSA003600\",\"GTSSA003612\",\"GTSSA003624\",\"GTSSA003636\",\"GTSSA003641\",\"GTSSA003653\",\"GTSSA003665\",\"GTSSA003670\",\"GTSSA003682\",\"GTSSA003694\",\"GTSSA003706\",\"GTSSA003711\",\"GTSSA003723\",\"GTSSA003735\",\"GTSSA003740\",\"GTSSA003752\",\"GTSSA003764\",\"GTSSA003776\",\"GTSSA003781\",\"GTSSA003793\",\"GTSSA003805\",\"GTSSA003810\",\"GTSSA003822\",\"GTSSA003834\",\"GTSSA003846\",\"GTSSA003851\",\"GTSSA003863\",\"GTSSA003875\",\"GTSSA003880\",\"GTSSA003892\",\"GTSSA003904\",\"GTSSA003916\",\"GTSSA003921\",\"GTSSA003933\",\"GTSSA003945\",\"GTSSA003950\",\"GTSSA003962\",\"GTSSA003974\",\"GTSSA003986\",\"GTSSA003991\",\"GTSSA004003\",\"GTSSA004015\",\"GTSSA004020\",\"GTSSA004032\",\"GTSSA004044\",\"GTSSA004056\",\"GTSSA004061\",\"GTSSA004073\",\"GTSSA004085\",\"GTSSA004090\",\"GTSSA004102\",\"GTSSA004114\",\"GTSSA004126\",\"GTSSA004131\",\"GTSSA004143\",\"GTSSA004155\",\"GTSSA004160\",\"GTSSA004172\",\"GTSSA004184\",\"GTSSA004196\",\"GTSSA004201\",\"GTSSA004213\",\"GTSSA004225\",\"GTSSA004230\",\"GTSSA004242\",\"GTSSA004254\",\"GTSSA004266\",\"GTSSA004271\",\"GTSSA004283\",\"GTSSA004295\",\"GTSSA004300\",\"GTSSA004312\",\"GTSSA004324\",\"GTSSA004336\",\"GTSSA004341\",\"GTSSA004353\",\"GTSSA004365\",\"GTSSA004370\",\"GTSSA004382\",\"GTSSA004394\",\"GTSSA004406\",\"GTSSA004411\",\"GTSSA004423\",\"GTSSA004435\",\"GTSSA004440\",\"GTSSA004452\",\"GTSSA004464\",\"GTSSA004476\",\"GTSSA004481\",\"GTSSA004493\",\"GTSSA004505\",\"GTSSA004510\",\"GTSSA004522\",\"GTSSA004534\",\"GTSSA004546\",\"GTSSA004551\",\"GTSSA004563\",\"GTSSA004575\",\"GTSSA004580\",\"GTSSA004592\",\"GTSSA004604\",\"GTSSA004616\",\"GTSSA004621\",\"GTSSA004633\",\"GTSSA004645\",\"GTSSA004650\",\"GTSSA004662\",\"GTSSA004674\",\"GTSSA004686\",\"GTSSA004691\",\"GTSSA004703\",\"GTSSA004715\",\"GTSSA004720\",\"GTSSA004732\",\"GTSSA004744\",\"GTSSA004756\",\"GTSSA004761\",\"GTSSA004773\",\"GTSSA004785\",\"GTSSA004790\",\"GTSSA004802\",\"GTSSA004814\",\"GTSSA004826\",\"GTSSA004831\",\"GTSSA004843\",\"GTSSA004855\",\"GTSSA004860\",\"GTSSA004872\",\"GTSSA004884\",\"GTSSA004896\",\"GTSSA004901\",\"GTSSA004913\",\"GTSSA004925\",\"GTSSA004930\",\"GTSSA004942\",\"GTSSA004954\",\"GTSSA004966\",\"GTSSA004971\",\"GTSSA004983\",\"GTSSA004995\",\"GTSSA005000\",\"GTSSA005012\",\"GTSSA005024\",\"GTSSA005036\",\"GTSSA005041\",\"GTSSA005053\",\"GTSSA005065\",\"GTSSA005070\",\"GTSSA005082\",\"GTSSA005094\",\"GTSSA005106\",\"GTSSA005111\",\"GTSSA005123\",\"GTSSA005135\",\"GTSSA005140\",\"GTSSA005152\",\"GTSSA005164\",\"GTSSA005176\",\"GTSSA005181\",\"GTSSA005193\",\"GTSSA005205\",\"GTSSA005210\",\"GTSSA005222\",\"GTSSA005234\",\"GTSSA005246\",\"GTSSA005251\",\"GTSSA005263\",\"GTSSA005275\",\"GTSSA005280\",\"GTSSA005292\",\"GTSSA005304\",\"GTSSA005316\",\"GTSSA005386\",\"GTSSA005391\",\"GTSSA005403\",\"GTSSA005415\",\"GTSSA016481\",\"GTSSA016493\",\"GTSSA016505\",\"GTSSA016510\",\"GTSSA016534\",\"GTSSA016546\",\"GTSSA016551\",\"GTSSA016563\",\"GTSSA016575\",\"GTSSA016580\",\"GTSSA016592\",\"GTSSA016604\",\"GTSSA016616\",\"GTSSA016621\",\"GTSSA016633\",\"GTSSA016645\",\"GTSSA016650\",\"GTSSA016662\",\"GTSSA016674\",\"GTSSA016685\",\"GTSSA016690\",\"GTSSA016702\",\"GTSSA016714\",\"GTSSA016726\",\"GTSSA016731\",\"GTSSA016743\",\"GTSSA016755\",\"GTSSA016760\",\"GTSSA016772\",\"GTSSA016784\",\"GTSSA016796\",\"GTSSA016801\",\"GTSSA016813\",\"GTSSA016825\",\"GTSSA016830\",\"GTSSA016842\",\"GTSSA016854\",\"GTSSA016866\",\"GTSSA016871\",\"GTSSA016883\",\"GTSSA016895\",\"GTSSA016900\",\"GTSSA016912\",\"GTSSA016924\",\"GTSSA016936\",\"GTSSA016941\",\"GTSSA016953\",\"GTSSA016965\",\"GTSSA016970\",\"GTSSA016982\",\"GTSSA016994\",\"GTSSA017006\",\"GTSSA017011\",\"GTSSA017023\",\"GTSSA017035\",\"GTSSA017040\",\"GTSSA017052\",\"GTSSA017064\",\"GTSSA017076\",\"GTSSA017081\",\"GTSSA017093\",\"GTSSA017105\",\"GTSSA017110\",\"GTSSA017122\",\"GTSSA017134\",\"GTSSA017146\",\"GTSSA017151\",\"GTSSA017163\",\"GTSSA017175\",\"GTSSA017180\",\"GTSSA017192\",\"GTSSA017204\",\"GTSSA017216\",\"GTSSA017221\",\"GTSSA017233\",\"GTSSA017245\",\"GTSSA017250\",\"GTSSA017262\",\"GTSSA017274\",\"GTSSA017286\",\"GTSSA017291\",\"GTSSA017303\",\"GTSSA017315\",\"GTSSA017320\",\"GTSSA017332\",\"GTSSA017344\",\"GTSSA017356\",\"GTSSA017361\",\"GTSSA017373\",\"GTSSA017385\",\"GTSSA017390\",\"GTSSA017402\",\"GTSSA017414\",\"GTSSA017426\",\"GTSSA017431\",\"GTSSA017443\",\"GTSSA017455\",\"GTSSA017460\",\"GTSSA017472\",\"GTSSA017484\",\"GTSSA017496\",\"GTSSA017501\",\"GTSSA017513\",\"GTSSA017525\");\n} //fin de if($IdEstado == \"11\")\n\n//Condicion de estado-clues\nif($IdEstado == \"12\"){\n\t$Clues = array(\"GRSSA000010\",\"GRSSA000022\",\"GRSSA000034\",\"GRSSA000046\",\"GRSSA000051\",\"GRSSA000063\",\"GRSSA000075\",\"GRSSA000080\",\"GRSSA000092\",\"GRSSA000104\",\"GRSSA000116\",\"GRSSA000121\",\"GRSSA000133\",\"GRSSA000145\",\"GRSSA000150\",\"GRSSA000162\",\"GRSSA000174\",\"GRSSA000186\",\"GRSSA000191\",\"GRSSA000203\",\"GRSSA000215\",\"GRSSA000220\",\"GRSSA000232\",\"GRSSA000244\",\"GRSSA000256\",\"GRSSA000261\",\"GRSSA000273\",\"GRSSA000285\",\"GRSSA000290\",\"GRSSA000302\",\"GRSSA000314\",\"GRSSA000326\",\"GRSSA000331\",\"GRSSA000343\",\"GRSSA000355\",\"GRSSA000360\",\"GRSSA000372\",\"GRSSA000384\",\"GRSSA000396\",\"GRSSA000401\",\"GRSSA000413\",\"GRSSA000425\",\"GRSSA000430\",\"GRSSA000442\",\"GRSSA000454\",\"GRSSA000466\",\"GRSSA000471\",\"GRSSA000483\",\"GRSSA000495\",\"GRSSA000500\",\"GRSSA000512\",\"GRSSA000524\",\"GRSSA000536\",\"GRSSA000541\",\"GRSSA000553\",\"GRSSA000565\",\"GRSSA000570\",\"GRSSA000582\",\"GRSSA000594\",\"GRSSA000606\",\"GRSSA000611\",\"GRSSA000623\",\"GRSSA000635\",\"GRSSA000640\",\"GRSSA000652\",\"GRSSA000664\",\"GRSSA000676\",\"GRSSA000710\",\"GRSSA000722\",\"GRSSA000734\",\"GRSSA000746\",\"GRSSA000751\",\"GRSSA000763\",\"GRSSA000775\",\"GRSSA000780\",\"GRSSA000792\",\"GRSSA000804\",\"GRSSA000816\",\"GRSSA000821\",\"GRSSA000833\",\"GRSSA000845\",\"GRSSA000850\",\"GRSSA000862\",\"GRSSA000874\",\"GRSSA000886\",\"GRSSA000891\",\"GRSSA000903\",\"GRSSA000915\",\"GRSSA000920\",\"GRSSA000932\",\"GRSSA000944\",\"GRSSA000956\",\"GRSSA000961\",\"GRSSA000973\",\"GRSSA000985\",\"GRSSA000990\",\"GRSSA001002\",\"GRSSA001014\",\"GRSSA001026\",\"GRSSA001031\",\"GRSSA001043\",\"GRSSA001055\",\"GRSSA001060\",\"GRSSA001072\",\"GRSSA001096\",\"GRSSA001101\",\"GRSSA001113\",\"GRSSA001125\",\"GRSSA001130\",\"GRSSA001142\",\"GRSSA001154\",\"GRSSA001166\",\"GRSSA001171\",\"GRSSA001183\",\"GRSSA001195\",\"GRSSA001200\",\"GRSSA001212\",\"GRSSA001224\",\"GRSSA001236\",\"GRSSA001241\",\"GRSSA001253\",\"GRSSA001265\",\"GRSSA001270\",\"GRSSA001282\",\"GRSSA001294\",\"GRSSA001306\",\"GRSSA001311\",\"GRSSA001323\",\"GRSSA001335\",\"GRSSA001340\",\"GRSSA001352\",\"GRSSA001364\",\"GRSSA001376\",\"GRSSA001381\",\"GRSSA001393\",\"GRSSA001405\",\"GRSSA001410\",\"GRSSA001422\",\"GRSSA001434\",\"GRSSA001446\",\"GRSSA001451\",\"GRSSA001463\",\"GRSSA001475\",\"GRSSA001480\",\"GRSSA001492\",\"GRSSA001504\",\"GRSSA001516\",\"GRSSA001521\",\"GRSSA001533\",\"GRSSA001545\",\"GRSSA001550\",\"GRSSA001562\",\"GRSSA001586\",\"GRSSA001591\",\"GRSSA001603\",\"GRSSA001615\",\"GRSSA001620\",\"GRSSA001632\",\"GRSSA001644\",\"GRSSA001656\",\"GRSSA001661\",\"GRSSA001673\",\"GRSSA001685\",\"GRSSA001690\",\"GRSSA001702\",\"GRSSA001714\",\"GRSSA001726\",\"GRSSA001731\",\"GRSSA001743\",\"GRSSA001755\",\"GRSSA001760\",\"GRSSA001772\",\"GRSSA001784\",\"GRSSA001796\",\"GRSSA001801\",\"GRSSA001813\",\"GRSSA001825\",\"GRSSA001830\",\"GRSSA001842\",\"GRSSA001854\",\"GRSSA001866\",\"GRSSA001871\",\"GRSSA001883\",\"GRSSA001895\",\"GRSSA001900\",\"GRSSA001912\",\"GRSSA001924\",\"GRSSA001936\",\"GRSSA001941\",\"GRSSA001953\",\"GRSSA001965\",\"GRSSA001970\",\"GRSSA001982\",\"GRSSA001994\",\"GRSSA002006\",\"GRSSA002011\",\"GRSSA002023\",\"GRSSA002035\",\"GRSSA002040\",\"GRSSA002052\",\"GRSSA002064\",\"GRSSA002076\",\"GRSSA002081\",\"GRSSA002093\",\"GRSSA002105\",\"GRSSA002110\",\"GRSSA002122\",\"GRSSA002134\",\"GRSSA002146\",\"GRSSA002151\",\"GRSSA002163\",\"GRSSA002175\",\"GRSSA002180\",\"GRSSA002192\",\"GRSSA002204\",\"GRSSA002216\",\"GRSSA002221\",\"GRSSA002233\",\"GRSSA002245\",\"GRSSA002250\",\"GRSSA002262\",\"GRSSA002274\",\"GRSSA002286\",\"GRSSA002291\",\"GRSSA002303\",\"GRSSA002315\",\"GRSSA002320\",\"GRSSA002332\",\"GRSSA002344\",\"GRSSA002356\",\"GRSSA002361\",\"GRSSA002373\",\"GRSSA002385\",\"GRSSA002390\",\"GRSSA002402\",\"GRSSA002414\",\"GRSSA002426\",\"GRSSA002431\",\"GRSSA002443\",\"GRSSA002455\",\"GRSSA002460\",\"GRSSA002472\",\"GRSSA002484\",\"GRSSA002496\",\"GRSSA002501\",\"GRSSA002513\",\"GRSSA002525\",\"GRSSA002530\",\"GRSSA002542\",\"GRSSA002554\",\"GRSSA002566\",\"GRSSA002571\",\"GRSSA002583\",\"GRSSA002595\",\"GRSSA002600\",\"GRSSA002612\",\"GRSSA002624\",\"GRSSA002636\",\"GRSSA002641\",\"GRSSA002653\",\"GRSSA002665\",\"GRSSA002670\",\"GRSSA002682\",\"GRSSA002694\",\"GRSSA002706\",\"GRSSA002711\",\"GRSSA002723\",\"GRSSA002735\",\"GRSSA002740\",\"GRSSA002752\",\"GRSSA002764\",\"GRSSA002776\",\"GRSSA002781\",\"GRSSA002793\",\"GRSSA002805\",\"GRSSA002810\",\"GRSSA002822\",\"GRSSA002834\",\"GRSSA002846\",\"GRSSA002851\",\"GRSSA002863\",\"GRSSA002875\",\"GRSSA002880\",\"GRSSA002892\",\"GRSSA002904\",\"GRSSA002921\",\"GRSSA002933\",\"GRSSA002945\",\"GRSSA002950\",\"GRSSA002962\",\"GRSSA002974\",\"GRSSA002986\",\"GRSSA002991\",\"GRSSA003003\",\"GRSSA003015\",\"GRSSA003020\",\"GRSSA003032\",\"GRSSA003044\",\"GRSSA003056\",\"GRSSA003061\",\"GRSSA003073\",\"GRSSA003085\",\"GRSSA003090\",\"GRSSA003102\",\"GRSSA003114\",\"GRSSA003126\",\"GRSSA003131\",\"GRSSA003143\",\"GRSSA003155\",\"GRSSA003160\",\"GRSSA003172\",\"GRSSA003184\",\"GRSSA003196\",\"GRSSA003201\",\"GRSSA003213\",\"GRSSA003225\",\"GRSSA003230\",\"GRSSA003242\",\"GRSSA003254\",\"GRSSA003266\",\"GRSSA003271\",\"GRSSA003283\",\"GRSSA003295\",\"GRSSA003300\",\"GRSSA003312\",\"GRSSA003324\",\"GRSSA003336\",\"GRSSA003341\",\"GRSSA003353\",\"GRSSA003365\",\"GRSSA003370\",\"GRSSA003382\",\"GRSSA003394\",\"GRSSA003406\",\"GRSSA003411\",\"GRSSA003423\",\"GRSSA003435\",\"GRSSA003440\",\"GRSSA003452\",\"GRSSA003464\",\"GRSSA003476\",\"GRSSA003481\",\"GRSSA003493\",\"GRSSA003505\",\"GRSSA003510\",\"GRSSA003522\",\"GRSSA003534\",\"GRSSA003546\",\"GRSSA003551\",\"GRSSA003563\",\"GRSSA003575\",\"GRSSA003580\",\"GRSSA003592\",\"GRSSA003604\",\"GRSSA003616\",\"GRSSA003621\",\"GRSSA003633\",\"GRSSA003645\",\"GRSSA003650\",\"GRSSA003662\",\"GRSSA003674\",\"GRSSA003686\",\"GRSSA003691\",\"GRSSA003703\",\"GRSSA003715\",\"GRSSA003720\",\"GRSSA003732\",\"GRSSA003744\",\"GRSSA003756\",\"GRSSA003761\",\"GRSSA003773\",\"GRSSA003785\",\"GRSSA003790\",\"GRSSA003802\",\"GRSSA003814\",\"GRSSA003826\",\"GRSSA003831\",\"GRSSA003843\",\"GRSSA003855\",\"GRSSA003860\",\"GRSSA003872\",\"GRSSA003884\",\"GRSSA003896\",\"GRSSA003901\",\"GRSSA003913\",\"GRSSA003925\",\"GRSSA003930\",\"GRSSA003942\",\"GRSSA003954\",\"GRSSA003966\",\"GRSSA003971\",\"GRSSA003983\",\"GRSSA003995\",\"GRSSA004000\",\"GRSSA004012\",\"GRSSA004024\",\"GRSSA004036\",\"GRSSA004041\",\"GRSSA004053\",\"GRSSA004065\",\"GRSSA004070\",\"GRSSA004082\",\"GRSSA004094\",\"GRSSA004106\",\"GRSSA004111\",\"GRSSA004123\",\"GRSSA004135\",\"GRSSA004140\",\"GRSSA004152\",\"GRSSA004164\",\"GRSSA004176\",\"GRSSA004181\",\"GRSSA004193\",\"GRSSA004205\",\"GRSSA004210\",\"GRSSA004222\",\"GRSSA004234\",\"GRSSA004246\",\"GRSSA004251\",\"GRSSA004263\",\"GRSSA004275\",\"GRSSA004280\",\"GRSSA004292\",\"GRSSA004304\",\"GRSSA004316\",\"GRSSA004321\",\"GRSSA004333\",\"GRSSA004345\",\"GRSSA004350\",\"GRSSA004362\",\"GRSSA004374\",\"GRSSA004386\",\"GRSSA004391\",\"GRSSA004403\",\"GRSSA004415\",\"GRSSA004420\",\"GRSSA004432\",\"GRSSA004444\",\"GRSSA004456\",\"GRSSA004461\",\"GRSSA004473\",\"GRSSA004485\",\"GRSSA004490\",\"GRSSA004502\",\"GRSSA004514\",\"GRSSA004526\",\"GRSSA004531\",\"GRSSA004543\",\"GRSSA004555\",\"GRSSA004560\",\"GRSSA004572\",\"GRSSA004584\",\"GRSSA004596\",\"GRSSA004601\",\"GRSSA004613\",\"GRSSA004625\",\"GRSSA004630\",\"GRSSA004642\",\"GRSSA004654\",\"GRSSA004666\",\"GRSSA004671\",\"GRSSA004695\",\"GRSSA004700\",\"GRSSA004712\",\"GRSSA004724\",\"GRSSA004736\",\"GRSSA004741\",\"GRSSA004753\",\"GRSSA004765\",\"GRSSA004770\",\"GRSSA004782\",\"GRSSA004794\",\"GRSSA004806\",\"GRSSA004811\",\"GRSSA004823\",\"GRSSA004835\",\"GRSSA004840\",\"GRSSA004852\",\"GRSSA004864\",\"GRSSA004876\",\"GRSSA004881\",\"GRSSA004893\",\"GRSSA004905\",\"GRSSA004910\",\"GRSSA004922\",\"GRSSA004934\",\"GRSSA004946\",\"GRSSA004951\",\"GRSSA004963\",\"GRSSA004975\",\"GRSSA004980\",\"GRSSA004992\",\"GRSSA005004\",\"GRSSA005016\",\"GRSSA005021\",\"GRSSA005033\",\"GRSSA005045\",\"GRSSA005050\",\"GRSSA005062\",\"GRSSA005074\",\"GRSSA005086\",\"GRSSA005091\",\"GRSSA005103\",\"GRSSA005115\",\"GRSSA005120\",\"GRSSA005132\",\"GRSSA005144\",\"GRSSA005156\",\"GRSSA005161\",\"GRSSA005173\",\"GRSSA005185\",\"GRSSA005190\",\"GRSSA005202\",\"GRSSA005214\",\"GRSSA005226\",\"GRSSA005231\",\"GRSSA005243\",\"GRSSA005255\",\"GRSSA005260\",\"GRSSA005272\",\"GRSSA005284\",\"GRSSA005296\",\"GRSSA005301\",\"GRSSA005313\",\"GRSSA005325\",\"GRSSA005330\",\"GRSSA005342\",\"GRSSA005354\",\"GRSSA005366\",\"GRSSA005371\",\"GRSSA005383\",\"GRSSA005395\",\"GRSSA005400\",\"GRSSA005412\",\"GRSSA005424\",\"GRSSA005436\",\"GRSSA005441\",\"GRSSA005470\",\"GRSSA005482\",\"GRSSA005494\",\"GRSSA005506\",\"GRSSA005511\",\"GRSSA005523\",\"GRSSA005535\",\"GRSSA005540\",\"GRSSA005552\",\"GRSSA005564\",\"GRSSA005576\",\"GRSSA005581\",\"GRSSA005593\",\"GRSSA005605\",\"GRSSA005610\",\"GRSSA005622\",\"GRSSA005634\",\"GRSSA005646\",\"GRSSA005651\",\"GRSSA005663\",\"GRSSA005675\",\"GRSSA005680\",\"GRSSA005692\",\"GRSSA005704\",\"GRSSA005716\",\"GRSSA005721\",\"GRSSA005733\",\"GRSSA005745\",\"GRSSA005750\",\"GRSSA005762\",\"GRSSA005774\",\"GRSSA005786\",\"GRSSA005791\",\"GRSSA005803\",\"GRSSA005815\",\"GRSSA005820\",\"GRSSA005832\",\"GRSSA005844\",\"GRSSA005856\",\"GRSSA005861\",\"GRSSA005873\",\"GRSSA005885\",\"GRSSA005890\",\"GRSSA005902\",\"GRSSA005914\",\"GRSSA005926\",\"GRSSA005931\",\"GRSSA005943\",\"GRSSA005955\",\"GRSSA005960\",\"GRSSA005972\",\"GRSSA005984\",\"GRSSA005996\",\"GRSSA006001\",\"GRSSA006013\",\"GRSSA006025\",\"GRSSA006030\",\"GRSSA006042\",\"GRSSA006066\",\"GRSSA006071\",\"GRSSA006083\",\"GRSSA006095\",\"GRSSA006100\",\"GRSSA006112\",\"GRSSA006124\",\"GRSSA006136\",\"GRSSA006141\",\"GRSSA006153\",\"GRSSA006165\",\"GRSSA006170\",\"GRSSA006182\",\"GRSSA006194\",\"GRSSA006206\",\"GRSSA006211\",\"GRSSA006223\",\"GRSSA006235\",\"GRSSA006240\",\"GRSSA006252\",\"GRSSA006264\",\"GRSSA006276\",\"GRSSA006281\",\"GRSSA006293\",\"GRSSA006305\",\"GRSSA006310\",\"GRSSA006322\",\"GRSSA006334\",\"GRSSA006346\",\"GRSSA006351\",\"GRSSA006363\",\"GRSSA006375\",\"GRSSA006380\",\"GRSSA006392\",\"GRSSA006404\",\"GRSSA006416\",\"GRSSA006421\",\"GRSSA006433\",\"GRSSA006445\",\"GRSSA006450\",\"GRSSA006462\",\"GRSSA006474\",\"GRSSA006486\",\"GRSSA006491\",\"GRSSA006503\",\"GRSSA006515\",\"GRSSA006520\",\"GRSSA006532\",\"GRSSA006544\",\"GRSSA006556\",\"GRSSA006561\",\"GRSSA006573\",\"GRSSA006585\",\"GRSSA006590\",\"GRSSA006602\",\"GRSSA006614\",\"GRSSA006626\",\"GRSSA006631\",\"GRSSA006643\",\"GRSSA006655\",\"GRSSA006660\",\"GRSSA006672\",\"GRSSA006684\",\"GRSSA006696\",\"GRSSA006701\",\"GRSSA006713\",\"GRSSA006725\",\"GRSSA006730\",\"GRSSA006754\",\"GRSSA006766\",\"GRSSA006771\",\"GRSSA006783\",\"GRSSA006795\",\"GRSSA006800\",\"GRSSA006812\",\"GRSSA006824\",\"GRSSA006836\",\"GRSSA006841\",\"GRSSA006853\",\"GRSSA006865\",\"GRSSA006870\",\"GRSSA006882\",\"GRSSA006894\",\"GRSSA006906\",\"GRSSA006911\",\"GRSSA006923\",\"GRSSA006935\",\"GRSSA006940\",\"GRSSA006952\",\"GRSSA006964\",\"GRSSA006976\",\"GRSSA006981\",\"GRSSA006993\",\"GRSSA007005\",\"GRSSA007010\",\"GRSSA007022\",\"GRSSA007034\",\"GRSSA007046\",\"GRSSA007051\",\"GRSSA007063\",\"GRSSA007075\",\"GRSSA007080\",\"GRSSA007092\",\"GRSSA007104\",\"GRSSA007116\",\"GRSSA007121\",\"GRSSA007133\",\"GRSSA007145\",\"GRSSA007150\",\"GRSSA007162\",\"GRSSA007174\",\"GRSSA007186\",\"GRSSA007191\",\"GRSSA007203\",\"GRSSA007215\",\"GRSSA007220\",\"GRSSA007232\",\"GRSSA007244\",\"GRSSA007256\",\"GRSSA007261\",\"GRSSA007273\",\"GRSSA007285\",\"GRSSA007290\",\"GRSSA007302\",\"GRSSA007314\",\"GRSSA007326\",\"GRSSA007331\",\"GRSSA007343\",\"GRSSA007355\",\"GRSSA007360\",\"GRSSA007372\",\"GRSSA007384\",\"GRSSA007396\",\"GRSSA007401\",\"GRSSA007413\",\"GRSSA007425\",\"GRSSA007430\",\"GRSSA007442\",\"GRSSA007454\",\"GRSSA007466\",\"GRSSA007471\",\"GRSSA007483\",\"GRSSA007495\",\"GRSSA007500\",\"GRSSA007512\",\"GRSSA007524\",\"GRSSA007536\",\"GRSSA007541\",\"GRSSA007553\",\"GRSSA007565\",\"GRSSA007570\",\"GRSSA007582\",\"GRSSA007594\",\"GRSSA007606\",\"GRSSA007611\",\"GRSSA007623\",\"GRSSA007635\",\"GRSSA007640\",\"GRSSA007652\",\"GRSSA007664\",\"GRSSA007676\",\"GRSSA007681\",\"GRSSA007693\",\"GRSSA007705\",\"GRSSA007710\",\"GRSSA007722\",\"GRSSA007734\",\"GRSSA007746\",\"GRSSA007751\",\"GRSSA007763\",\"GRSSA007775\",\"GRSSA007780\",\"GRSSA007792\",\"GRSSA007804\",\"GRSSA007816\",\"GRSSA007821\",\"GRSSA007833\",\"GRSSA007845\",\"GRSSA007850\",\"GRSSA007862\",\"GRSSA007874\",\"GRSSA007886\",\"GRSSA007891\",\"GRSSA007903\",\"GRSSA007915\",\"GRSSA007920\",\"GRSSA007932\",\"GRSSA007944\",\"GRSSA007956\",\"GRSSA007961\",\"GRSSA007973\",\"GRSSA007985\",\"GRSSA007990\",\"GRSSA008002\",\"GRSSA008014\",\"GRSSA008026\",\"GRSSA008031\",\"GRSSA008043\",\"GRSSA008055\",\"GRSSA008060\",\"GRSSA008072\",\"GRSSA008084\",\"GRSSA008096\",\"GRSSA008101\",\"GRSSA008113\",\"GRSSA008125\",\"GRSSA008130\",\"GRSSA008142\",\"GRSSA008154\",\"GRSSA008166\",\"GRSSA008171\",\"GRSSA008183\",\"GRSSA008195\",\"GRSSA008200\",\"GRSSA008212\",\"GRSSA008224\",\"GRSSA008236\",\"GRSSA008241\",\"GRSSA008253\",\"GRSSA008265\",\"GRSSA008270\",\"GRSSA008282\",\"GRSSA008294\",\"GRSSA008306\",\"GRSSA008311\",\"GRSSA008323\",\"GRSSA008335\",\"GRSSA008340\",\"GRSSA008352\",\"GRSSA008364\",\"GRSSA008376\",\"GRSSA008381\",\"GRSSA008393\",\"GRSSA008405\",\"GRSSA008410\",\"GRSSA008422\",\"GRSSA008434\",\"GRSSA008446\",\"GRSSA008451\",\"GRSSA008463\",\"GRSSA008475\",\"GRSSA008480\",\"GRSSA008492\",\"GRSSA008504\",\"GRSSA008516\",\"GRSSA008521\",\"GRSSA008533\",\"GRSSA008545\",\"GRSSA008550\",\"GRSSA008562\",\"GRSSA008574\",\"GRSSA008586\",\"GRSSA008591\",\"GRSSA008603\",\"GRSSA008615\",\"GRSSA008620\",\"GRSSA008644\",\"GRSSA008656\",\"GRSSA008661\",\"GRSSA008673\",\"GRSSA008685\",\"GRSSA008690\",\"GRSSA008702\",\"GRSSA008714\",\"GRSSA008726\",\"GRSSA008731\",\"GRSSA008743\",\"GRSSA008755\",\"GRSSA008760\",\"GRSSA008772\",\"GRSSA008784\",\"GRSSA008796\",\"GRSSA008801\",\"GRSSA008813\",\"GRSSA008825\",\"GRSSA008830\",\"GRSSA008842\",\"GRSSA008854\",\"GRSSA008866\",\"GRSSA008871\",\"GRSSA008883\",\"GRSSA008895\",\"GRSSA008900\",\"GRSSA008912\",\"GRSSA008924\",\"GRSSA008936\",\"GRSSA008941\",\"GRSSA008953\",\"GRSSA008965\",\"GRSSA008970\",\"GRSSA008982\",\"GRSSA008994\",\"GRSSA009006\",\"GRSSA009011\",\"GRSSA009023\",\"GRSSA009035\",\"GRSSA009040\",\"GRSSA009052\",\"GRSSA009064\",\"GRSSA009076\",\"GRSSA009081\",\"GRSSA009105\",\"GRSSA009110\",\"GRSSA009122\",\"GRSSA009134\",\"GRSSA009146\",\"GRSSA009151\",\"GRSSA009163\",\"GRSSA009175\",\"GRSSA009216\",\"GRSSA009221\",\"GRSSA009233\",\"GRSSA009245\",\"GRSSA009274\",\"GRSSA009286\",\"GRSSA009291\",\"GRSSA009315\",\"GRSSA009332\",\"GRSSA009344\",\"GRSSA009361\",\"GRSSA009373\",\"GRSSA009390\",\"GRSSA009426\",\"GRSSA009431\",\"GRSSA009455\",\"GRSSA009472\",\"GRSSA009484\",\"GRSSA009501\",\"GRSSA009513\",\"GRSSA009525\",\"GRSSA009530\",\"GRSSA009542\",\"GRSSA009554\",\"GRSSA009566\",\"GRSSA009595\",\"GRSSA009600\",\"GRSSA009612\",\"GRSSA009624\",\"GRSSA009636\",\"GRSSA009735\",\"GRSSA009740\",\"GRSSA009752\",\"GRSSA009764\",\"GRSSA009776\",\"GRSSA009781\",\"GRSSA009793\",\"GRSSA009805\",\"GRSSA009810\",\"GRSSA009822\",\"GRSSA009834\",\"GRSSA009846\",\"GRSSA009851\",\"GRSSA009863\",\"GRSSA009875\",\"GRSSA009916\",\"GRSSA009921\",\"GRSSA011531\",\"GRSSA011560\",\"GRSSA011573\",\"GRSSA011585\",\"GRSSA011590\",\"GRSSA011602\",\"GRSSA011614\",\"GRSSA011626\",\"GRSSA011631\",\"GRSSA011643\",\"GRSSA011655\",\"GRSSA011660\",\"GRSSA011672\",\"GRSSA011684\",\"GRSSA011696\",\"GRSSA011701\",\"GRSSA011713\",\"GRSSA011725\",\"GRSSA011730\",\"GRSSA011742\",\"GRSSA011754\",\"GRSSA011766\",\"GRSSA011770\",\"GRSSA011782\",\"GRSSA011794\",\"GRSSA011806\",\"GRSSA011823\",\"GRSSA011835\",\"GRSSA011840\",\"GRSSA011852\",\"GRSSA011864\",\"GRSSA011876\",\"GRSSA011881\",\"GRSSA011893\",\"GRSSA011905\",\"GRSSA011910\",\"GRSSA011922\",\"GRSSA011934\",\"GRSSA011946\",\"GRSSA011951\",\"GRSSA011963\",\"GRSSA011975\",\"GRSSA011980\",\"GRSSA011992\",\"GRSSA012016\",\"GRSSA012021\",\"GRSSA012033\",\"GRSSA012045\",\"GRSSA012050\",\"GRSSA012062\",\"GRSSA012074\",\"GRSSA012086\",\"GRSSA012091\",\"GRSSA012103\",\"GRSSA012115\",\"GRSSA012120\",\"GRSSA012132\",\"GRSSA012144\",\"GRSSA012156\",\"GRSSA012161\",\"GRSSA012173\",\"GRSSA012185\",\"GRSSA012190\",\"GRSSA012202\",\"GRSSA012214\",\"GRSSA012226\",\"GRSSA012231\",\"GRSSA012243\",\"GRSSA012255\",\"GRSSA012260\",\"GRSSA012272\",\"GRSSA012284\",\"GRSSA012296\",\"GRSSA012301\",\"GRSSA012313\",\"GRSSA012325\",\"GRSSA012330\",\"GRSSA012342\",\"GRSSA012354\",\"GRSSA012366\",\"GRSSA012371\",\"GRSSA012383\",\"GRSSA012395\",\"GRSSA012400\",\"GRSSA012412\",\"GRSSA012424\",\"GRSSA012436\",\"GRSSA012441\",\"GRSSA012453\",\"GRSSA012465\",\"GRSSA012470\",\"GRSSA012482\",\"GRSSA012494\",\"GRSSA012506\",\"GRSSA012511\",\"GRSSA012523\",\"GRSSA012535\",\"GRSSA012540\",\"GRSSA012552\",\"GRSSA012564\",\"GRSSA012576\",\"GRSSA012581\");\n} //fin de if($IdEstado == \"12\")\n\n//Condicion de estado-clues\nif($IdEstado == \"13\"){\n\t$Clues = array(\"HGSSA000016\",\"HGSSA000021\",\"HGSSA000033\",\"HGSSA000045\",\"HGSSA000050\",\"HGSSA000062\",\"HGSSA000074\",\"HGSSA000086\",\"HGSSA000091\",\"HGSSA000103\",\"HGSSA000115\",\"HGSSA000120\",\"HGSSA000132\",\"HGSSA000144\",\"HGSSA000156\",\"HGSSA000161\",\"HGSSA000173\",\"HGSSA000185\",\"HGSSA000190\",\"HGSSA000202\",\"HGSSA000214\",\"HGSSA000226\",\"HGSSA000231\",\"HGSSA000243\",\"HGSSA000255\",\"HGSSA000260\",\"HGSSA000272\",\"HGSSA000284\",\"HGSSA000296\",\"HGSSA000301\",\"HGSSA000313\",\"HGSSA000330\",\"HGSSA000342\",\"HGSSA000354\",\"HGSSA000366\",\"HGSSA000371\",\"HGSSA000383\",\"HGSSA000395\",\"HGSSA000400\",\"HGSSA000412\",\"HGSSA000424\",\"HGSSA000436\",\"HGSSA000441\",\"HGSSA000453\",\"HGSSA000465\",\"HGSSA000470\",\"HGSSA000482\",\"HGSSA000494\",\"HGSSA000506\",\"HGSSA000511\",\"HGSSA000523\",\"HGSSA000535\",\"HGSSA000540\",\"HGSSA000552\",\"HGSSA000564\",\"HGSSA000576\",\"HGSSA000581\",\"HGSSA000593\",\"HGSSA000605\",\"HGSSA000610\",\"HGSSA000622\",\"HGSSA000634\",\"HGSSA000646\",\"HGSSA000651\",\"HGSSA000663\",\"HGSSA000675\",\"HGSSA000680\",\"HGSSA000692\",\"HGSSA000704\",\"HGSSA000716\",\"HGSSA000721\",\"HGSSA000733\",\"HGSSA000745\",\"HGSSA000750\",\"HGSSA000762\",\"HGSSA000774\",\"HGSSA000786\",\"HGSSA000791\",\"HGSSA000803\",\"HGSSA000815\",\"HGSSA000820\",\"HGSSA000832\",\"HGSSA000844\",\"HGSSA000856\",\"HGSSA000861\",\"HGSSA000873\",\"HGSSA000885\",\"HGSSA000890\",\"HGSSA000902\",\"HGSSA000914\",\"HGSSA000926\",\"HGSSA000931\",\"HGSSA000943\",\"HGSSA000955\",\"HGSSA000960\",\"HGSSA000972\",\"HGSSA000984\",\"HGSSA000996\",\"HGSSA001001\",\"HGSSA001013\",\"HGSSA001025\",\"HGSSA001030\",\"HGSSA001042\",\"HGSSA001054\",\"HGSSA001066\",\"HGSSA001071\",\"HGSSA001083\",\"HGSSA001095\",\"HGSSA001100\",\"HGSSA001112\",\"HGSSA001124\",\"HGSSA001136\",\"HGSSA001141\",\"HGSSA001153\",\"HGSSA001165\",\"HGSSA001170\",\"HGSSA001182\",\"HGSSA001194\",\"HGSSA001206\",\"HGSSA001211\",\"HGSSA001223\",\"HGSSA001235\",\"HGSSA001240\",\"HGSSA001252\",\"HGSSA001264\",\"HGSSA001276\",\"HGSSA001281\",\"HGSSA001293\",\"HGSSA001305\",\"HGSSA001310\",\"HGSSA001322\",\"HGSSA001334\",\"HGSSA001346\",\"HGSSA001351\",\"HGSSA001363\",\"HGSSA001375\",\"HGSSA001380\",\"HGSSA001392\",\"HGSSA001404\",\"HGSSA001416\",\"HGSSA001421\",\"HGSSA001433\",\"HGSSA001445\",\"HGSSA001450\",\"HGSSA001462\",\"HGSSA001474\",\"HGSSA001486\",\"HGSSA001491\",\"HGSSA001503\",\"HGSSA001515\",\"HGSSA001520\",\"HGSSA001532\",\"HGSSA001544\",\"HGSSA001556\",\"HGSSA001561\",\"HGSSA001573\",\"HGSSA001585\",\"HGSSA001590\",\"HGSSA001602\",\"HGSSA001614\",\"HGSSA001626\",\"HGSSA001631\",\"HGSSA001643\",\"HGSSA001655\",\"HGSSA001660\",\"HGSSA001672\",\"HGSSA001684\",\"HGSSA001696\",\"HGSSA001701\",\"HGSSA001713\",\"HGSSA001725\",\"HGSSA001730\",\"HGSSA001742\",\"HGSSA001754\",\"HGSSA001766\",\"HGSSA001771\",\"HGSSA001783\",\"HGSSA001795\",\"HGSSA001800\",\"HGSSA001812\",\"HGSSA001824\",\"HGSSA001836\",\"HGSSA001841\",\"HGSSA001853\",\"HGSSA001865\",\"HGSSA001870\",\"HGSSA001882\",\"HGSSA001894\",\"HGSSA001906\",\"HGSSA001923\",\"HGSSA001935\",\"HGSSA001940\",\"HGSSA001952\",\"HGSSA001964\",\"HGSSA001976\",\"HGSSA001981\",\"HGSSA001993\",\"HGSSA002005\",\"HGSSA002010\",\"HGSSA002022\",\"HGSSA002034\",\"HGSSA002046\",\"HGSSA002051\",\"HGSSA002063\",\"HGSSA002075\",\"HGSSA002080\",\"HGSSA002092\",\"HGSSA002104\",\"HGSSA002116\",\"HGSSA002121\",\"HGSSA002133\",\"HGSSA002145\",\"HGSSA002150\",\"HGSSA002162\",\"HGSSA002174\",\"HGSSA002186\",\"HGSSA002191\",\"HGSSA002203\",\"HGSSA002215\",\"HGSSA002220\",\"HGSSA002232\",\"HGSSA002244\",\"HGSSA002256\",\"HGSSA002261\",\"HGSSA002273\",\"HGSSA002285\",\"HGSSA002290\",\"HGSSA002302\",\"HGSSA002314\",\"HGSSA002326\",\"HGSSA002331\",\"HGSSA002343\",\"HGSSA002355\",\"HGSSA002360\",\"HGSSA002372\",\"HGSSA002384\",\"HGSSA002396\",\"HGSSA002401\",\"HGSSA002413\",\"HGSSA002425\",\"HGSSA002430\",\"HGSSA002442\",\"HGSSA002454\",\"HGSSA002466\",\"HGSSA002471\",\"HGSSA002483\",\"HGSSA002495\",\"HGSSA002500\",\"HGSSA002512\",\"HGSSA002524\",\"HGSSA002536\",\"HGSSA002541\",\"HGSSA002553\",\"HGSSA002565\",\"HGSSA002570\",\"HGSSA002582\",\"HGSSA002594\",\"HGSSA002611\",\"HGSSA002623\",\"HGSSA002635\",\"HGSSA002640\",\"HGSSA002652\",\"HGSSA002664\",\"HGSSA002676\",\"HGSSA002681\",\"HGSSA002693\",\"HGSSA002705\",\"HGSSA002710\",\"HGSSA002722\",\"HGSSA002734\",\"HGSSA002746\",\"HGSSA002751\",\"HGSSA002763\",\"HGSSA002775\",\"HGSSA002780\",\"HGSSA002792\",\"HGSSA002804\",\"HGSSA002816\",\"HGSSA002821\",\"HGSSA002833\",\"HGSSA002845\",\"HGSSA002850\",\"HGSSA002862\",\"HGSSA002874\",\"HGSSA002886\",\"HGSSA002891\",\"HGSSA002903\",\"HGSSA002920\",\"HGSSA002932\",\"HGSSA002944\",\"HGSSA002956\",\"HGSSA002961\",\"HGSSA002973\",\"HGSSA002985\",\"HGSSA002990\",\"HGSSA003002\",\"HGSSA003014\",\"HGSSA003026\",\"HGSSA003031\",\"HGSSA003043\",\"HGSSA003055\",\"HGSSA003060\",\"HGSSA003072\",\"HGSSA003084\",\"HGSSA003096\",\"HGSSA003101\",\"HGSSA003113\",\"HGSSA003125\",\"HGSSA003130\",\"HGSSA003142\",\"HGSSA003154\",\"HGSSA003166\",\"HGSSA003171\",\"HGSSA003183\",\"HGSSA003195\",\"HGSSA003200\",\"HGSSA003212\",\"HGSSA003224\",\"HGSSA003236\",\"HGSSA003241\",\"HGSSA003253\",\"HGSSA003265\",\"HGSSA003270\",\"HGSSA003282\",\"HGSSA003294\",\"HGSSA003306\",\"HGSSA003311\",\"HGSSA003323\",\"HGSSA003335\",\"HGSSA003340\",\"HGSSA003352\",\"HGSSA003364\",\"HGSSA003376\",\"HGSSA003381\",\"HGSSA003393\",\"HGSSA003405\",\"HGSSA003410\",\"HGSSA003422\",\"HGSSA003434\",\"HGSSA003446\",\"HGSSA003451\",\"HGSSA003463\",\"HGSSA003475\",\"HGSSA003480\",\"HGSSA003492\",\"HGSSA003504\",\"HGSSA003516\",\"HGSSA003521\",\"HGSSA003533\",\"HGSSA003545\",\"HGSSA003550\",\"HGSSA003562\",\"HGSSA003574\",\"HGSSA003586\",\"HGSSA003591\",\"HGSSA003603\",\"HGSSA003615\",\"HGSSA003620\",\"HGSSA003632\",\"HGSSA003644\",\"HGSSA003656\",\"HGSSA003661\",\"HGSSA003673\",\"HGSSA003685\",\"HGSSA003690\",\"HGSSA003702\",\"HGSSA003714\",\"HGSSA003726\",\"HGSSA003731\",\"HGSSA003743\",\"HGSSA003755\",\"HGSSA003760\",\"HGSSA003772\",\"HGSSA003784\",\"HGSSA003796\",\"HGSSA003801\",\"HGSSA003813\",\"HGSSA003825\",\"HGSSA003830\",\"HGSSA003842\",\"HGSSA003854\",\"HGSSA003866\",\"HGSSA003871\",\"HGSSA003883\",\"HGSSA003895\",\"HGSSA003900\",\"HGSSA003912\",\"HGSSA003924\",\"HGSSA003936\",\"HGSSA003941\",\"HGSSA003965\",\"HGSSA003970\",\"HGSSA003982\",\"HGSSA003994\",\"HGSSA004006\",\"HGSSA004011\",\"HGSSA004023\",\"HGSSA004035\",\"HGSSA004040\",\"HGSSA004052\",\"HGSSA004064\",\"HGSSA004076\",\"HGSSA004081\",\"HGSSA004093\",\"HGSSA004105\",\"HGSSA004110\",\"HGSSA004122\",\"HGSSA004134\",\"HGSSA004146\",\"HGSSA004163\",\"HGSSA004175\",\"HGSSA004180\",\"HGSSA004192\",\"HGSSA004204\",\"HGSSA004216\",\"HGSSA004221\",\"HGSSA004233\",\"HGSSA004245\",\"HGSSA004250\",\"HGSSA004262\",\"HGSSA004274\",\"HGSSA004286\",\"HGSSA004291\",\"HGSSA004303\",\"HGSSA004315\",\"HGSSA004320\",\"HGSSA004344\",\"HGSSA004356\",\"HGSSA004361\",\"HGSSA004373\",\"HGSSA004385\",\"HGSSA004390\",\"HGSSA004402\",\"HGSSA004414\",\"HGSSA004426\",\"HGSSA004431\",\"HGSSA004443\",\"HGSSA004455\",\"HGSSA004472\",\"HGSSA004484\",\"HGSSA004496\",\"HGSSA004501\",\"HGSSA004513\",\"HGSSA004525\",\"HGSSA004530\",\"HGSSA004554\",\"HGSSA004566\",\"HGSSA004571\",\"HGSSA004583\",\"HGSSA004595\",\"HGSSA004600\",\"HGSSA004612\",\"HGSSA004624\",\"HGSSA004636\",\"HGSSA004641\",\"HGSSA004653\",\"HGSSA004665\",\"HGSSA004670\",\"HGSSA004682\",\"HGSSA004694\",\"HGSSA004706\",\"HGSSA004711\",\"HGSSA004723\",\"HGSSA004735\",\"HGSSA004740\",\"HGSSA004752\",\"HGSSA004781\",\"HGSSA004793\",\"HGSSA004805\",\"HGSSA004810\",\"HGSSA004822\",\"HGSSA004834\",\"HGSSA004846\",\"HGSSA004851\",\"HGSSA004863\",\"HGSSA004875\",\"HGSSA015294\",\"HGSSA015306\",\"HGSSA015311\",\"HGSSA015323\",\"HGSSA015335\",\"HGSSA015340\",\"HGSSA015352\",\"HGSSA015364\",\"HGSSA015376\",\"HGSSA015381\",\"HGSSA015393\",\"HGSSA015405\",\"HGSSA015410\",\"HGSSA015422\",\"HGSSA015434\",\"HGSSA015446\",\"HGSSA015451\",\"HGSSA015463\",\"HGSSA015475\",\"HGSSA015480\",\"HGSSA015492\",\"HGSSA015503\",\"HGSSA015515\",\"HGSSA015520\",\"HGSSA015532\",\"HGSSA015544\",\"HGSSA015556\",\"HGSSA015561\",\"HGSSA015573\",\"HGSSA015585\",\"HGSSA015590\",\"HGSSA015602\",\"HGSSA015614\",\"HGSSA015626\",\"HGSSA015631\",\"HGSSA015655\",\"HGSSA015660\",\"HGSSA015672\",\"HGSSA015684\",\"HGSSA015696\",\"HGSSA015701\",\"HGSSA015713\",\"HGSSA015725\",\"HGSSA015730\",\"HGSSA015742\",\"HGSSA015754\",\"HGSSA015766\",\"HGSSA015771\",\"HGSSA015783\",\"HGSSA015795\",\"HGSSA015800\",\"HGSSA015812\",\"HGSSA015824\",\"HGSSA015853\",\"HGSSA015894\",\"HGSSA015906\",\"HGSSA015923\",\"HGSSA015935\",\"HGSSA015940\",\"HGSSA015952\",\"HGSSA015964\",\"HGSSA015976\",\"HGSSA015981\",\"HGSSA015993\",\"HGSSA016005\",\"HGSSA016022\",\"HGSSA016034\",\"HGSSA016046\",\"HGSSA016051\",\"HGSSA016063\",\"HGSSA016075\",\"HGSSA016092\",\"HGSSA016104\",\"HGSSA016116\",\"HGSSA016133\",\"HGSSA016145\",\"HGSSA016150\",\"HGSSA016162\",\"HGSSA016186\",\"HGSSA016191\",\"HGSSA016203\",\"HGSSA016232\",\"HGSSA016244\",\"HGSSA016256\",\"HGSSA016261\",\"HGSSA016273\",\"HGSSA016314\",\"HGSSA016326\",\"HGSSA016331\",\"HGSSA016360\",\"HGSSA016372\",\"HGSSA016396\",\"HGSSA016401\",\"HGSSA016413\",\"HGSSA016425\",\"HGSSA016442\",\"HGSSA016454\",\"HGSSA016466\",\"HGSSA016471\",\"HGSSA016483\",\"HGSSA016495\",\"HGSSA016500\",\"HGSSA016512\",\"HGSSA016524\",\"HGSSA016536\",\"HGSSA016541\",\"HGSSA016553\",\"HGSSA016565\",\"HGSSA016570\",\"HGSSA016582\",\"HGSSA016594\",\"HGSSA016606\",\"HGSSA016611\",\"HGSSA016676\",\"HGSSA016681\",\"HGSSA016705\",\"HGSSA016710\",\"HGSSA016722\",\"HGSSA016746\",\"HGSSA016751\",\"HGSSA016763\",\"HGSSA016775\",\"HGSSA016780\",\"HGSSA016821\",\"HGSSA016850\",\"HGSSA016862\",\"HGSSA016886\",\"HGSSA016891\",\"HGSSA016903\",\"HGSSA016915\",\"HGSSA016920\",\"HGSSA016932\",\"HGSSA016961\",\"HGSSA016973\",\"HGSSA016985\",\"HGSSA016990\",\"HGSSA017031\",\"HGSSA017043\",\"HGSSA017055\",\"HGSSA017060\",\"HGSSA017084\",\"HGSSA017096\",\"HGSSA017101\",\"HGSSA017113\",\"HGSSA017125\",\"HGSSA017142\",\"HGSSA017154\",\"HGSSA017166\",\"HGSSA017195\",\"HGSSA017200\",\"HGSSA017212\",\"HGSSA017241\",\"HGSSA017282\",\"HGSSA017306\",\"HGSSA017323\",\"HGSSA017335\",\"HGSSA017340\",\"HGSSA017352\",\"HGSSA017364\",\"HGSSA017376\",\"HGSSA017381\",\"HGSSA017393\",\"HGSSA017405\",\"HGSSA017410\",\"HGSSA017422\",\"HGSSA017434\",\"HGSSA017446\",\"HGSSA017451\",\"HGSSA017475\",\"HGSSA017480\",\"HGSSA017492\",\"HGSSA017516\",\"HGSSA017521\",\"HGSSA017545\",\"HGSSA017550\",\"HGSSA017562\",\"HGSSA017574\",\"HGSSA017591\",\"HGSSA017603\",\"HGSSA017615\",\"HGSSA017644\",\"HGSSA017656\",\"HGSSA017661\",\"HGSSA017673\",\"HGSSA017685\",\"HGSSA017690\",\"HGSSA017702\",\"HGSSA017714\",\"HGSSA017726\",\"HGSSA017731\",\"HGSSA017743\",\"HGSSA017755\",\"HGSSA017760\",\"HGSSA017772\",\"HGSSA017784\",\"HGSSA017796\",\"HGSSA017801\",\"HGSSA017813\",\"HGSSA017825\",\"HGSSA017830\",\"HGSSA017842\",\"HGSSA017854\",\"HGSSA017866\",\"HGSSA017871\",\"HGSSA017883\",\"HGSSA017895\",\"HGSSA017900\",\"HGSSA017912\",\"HGSSA017924\",\"HGSSA017936\",\"HGSSA017941\",\"HGSSA017953\",\"HGSSA017965\",\"HGSSA017970\",\"HGSSA017982\",\"HGSSA017994\");\n} //fin de if($IdEstado == \"13\")\n\n//Condicion de estado-clues\nif($IdEstado == \"14\"){\n\t$Clues = array(\"JCSSA000013\",\"JCSSA000025\",\"JCSSA000030\",\"JCSSA000042\",\"JCSSA000066\",\"JCSSA000071\",\"JCSSA000083\",\"JCSSA000095\",\"JCSSA000100\",\"JCSSA000112\",\"JCSSA000124\",\"JCSSA000136\",\"JCSSA000141\",\"JCSSA000153\",\"JCSSA000165\",\"JCSSA000170\",\"JCSSA000182\",\"JCSSA000206\",\"JCSSA000211\",\"JCSSA000223\",\"JCSSA000235\",\"JCSSA000240\",\"JCSSA000252\",\"JCSSA000264\",\"JCSSA000276\",\"JCSSA000281\",\"JCSSA000293\",\"JCSSA000305\",\"JCSSA000310\",\"JCSSA000322\",\"JCSSA000334\",\"JCSSA000346\",\"JCSSA000351\",\"JCSSA000363\",\"JCSSA000375\",\"JCSSA000380\",\"JCSSA000392\",\"JCSSA000404\",\"JCSSA000416\",\"JCSSA000421\",\"JCSSA000433\",\"JCSSA000445\",\"JCSSA000450\",\"JCSSA000462\",\"JCSSA000474\",\"JCSSA000486\",\"JCSSA000491\",\"JCSSA000503\",\"JCSSA000515\",\"JCSSA000520\",\"JCSSA000532\",\"JCSSA000544\",\"JCSSA000556\",\"JCSSA000561\",\"JCSSA000573\",\"JCSSA000585\",\"JCSSA000590\",\"JCSSA000602\",\"JCSSA000614\",\"JCSSA000626\",\"JCSSA000631\",\"JCSSA000643\",\"JCSSA000655\",\"JCSSA000660\",\"JCSSA000672\",\"JCSSA000684\",\"JCSSA000696\",\"JCSSA000701\",\"JCSSA000713\",\"JCSSA000725\",\"JCSSA000730\",\"JCSSA000742\",\"JCSSA000754\",\"JCSSA000766\",\"JCSSA000771\",\"JCSSA000783\",\"JCSSA000795\",\"JCSSA000800\",\"JCSSA000812\",\"JCSSA000836\",\"JCSSA000841\",\"JCSSA000853\",\"JCSSA000865\",\"JCSSA000870\",\"JCSSA000882\",\"JCSSA000906\",\"JCSSA000911\",\"JCSSA000935\",\"JCSSA000940\",\"JCSSA000952\",\"JCSSA000964\",\"JCSSA000976\",\"JCSSA000981\",\"JCSSA000993\",\"JCSSA001005\",\"JCSSA001010\",\"JCSSA001022\",\"JCSSA001034\",\"JCSSA001046\",\"JCSSA001051\",\"JCSSA001063\",\"JCSSA001075\",\"JCSSA001116\",\"JCSSA001121\",\"JCSSA001133\",\"JCSSA001145\",\"JCSSA001150\",\"JCSSA001162\",\"JCSSA001174\",\"JCSSA001186\",\"JCSSA001191\",\"JCSSA001203\",\"JCSSA001215\",\"JCSSA001220\",\"JCSSA001232\",\"JCSSA001244\",\"JCSSA001256\",\"JCSSA001261\",\"JCSSA001273\",\"JCSSA001285\",\"JCSSA001290\",\"JCSSA001302\",\"JCSSA001314\",\"JCSSA001326\",\"JCSSA001331\",\"JCSSA001384\",\"JCSSA001396\",\"JCSSA001401\",\"JCSSA001413\",\"JCSSA001425\",\"JCSSA001430\",\"JCSSA001442\",\"JCSSA001454\",\"JCSSA001466\",\"JCSSA001471\",\"JCSSA001483\",\"JCSSA001495\",\"JCSSA001500\",\"JCSSA001512\",\"JCSSA001524\",\"JCSSA001536\",\"JCSSA001541\",\"JCSSA001553\",\"JCSSA001565\",\"JCSSA001570\",\"JCSSA001582\",\"JCSSA001594\",\"JCSSA001606\",\"JCSSA001611\",\"JCSSA001623\",\"JCSSA001635\",\"JCSSA001640\",\"JCSSA001652\",\"JCSSA001664\",\"JCSSA001676\",\"JCSSA001681\",\"JCSSA001693\",\"JCSSA001705\",\"JCSSA001710\",\"JCSSA001722\",\"JCSSA001734\",\"JCSSA001746\",\"JCSSA001751\",\"JCSSA001763\",\"JCSSA001775\",\"JCSSA001780\",\"JCSSA001792\",\"JCSSA001804\",\"JCSSA001816\",\"JCSSA001821\",\"JCSSA001833\",\"JCSSA001845\",\"JCSSA001850\",\"JCSSA001862\",\"JCSSA001874\",\"JCSSA001886\",\"JCSSA001891\",\"JCSSA001903\",\"JCSSA001915\",\"JCSSA001920\",\"JCSSA001932\",\"JCSSA001944\",\"JCSSA001956\",\"JCSSA001961\",\"JCSSA001973\",\"JCSSA001985\",\"JCSSA001990\",\"JCSSA002002\",\"JCSSA002014\",\"JCSSA002026\",\"JCSSA002031\",\"JCSSA002043\",\"JCSSA002055\",\"JCSSA002060\",\"JCSSA002072\",\"JCSSA002084\",\"JCSSA002101\",\"JCSSA002113\",\"JCSSA002125\",\"JCSSA002130\",\"JCSSA002142\",\"JCSSA002154\",\"JCSSA002166\",\"JCSSA002171\",\"JCSSA002183\",\"JCSSA002195\",\"JCSSA002200\",\"JCSSA002212\",\"JCSSA002224\",\"JCSSA002236\",\"JCSSA002241\",\"JCSSA002253\",\"JCSSA002265\",\"JCSSA002270\",\"JCSSA002282\",\"JCSSA002294\",\"JCSSA002306\",\"JCSSA002311\",\"JCSSA002323\",\"JCSSA002335\",\"JCSSA002340\",\"JCSSA002352\",\"JCSSA002364\",\"JCSSA002376\",\"JCSSA002381\",\"JCSSA002393\",\"JCSSA002405\",\"JCSSA002410\",\"JCSSA002422\",\"JCSSA002434\",\"JCSSA002446\",\"JCSSA002451\",\"JCSSA002463\",\"JCSSA002475\",\"JCSSA002480\",\"JCSSA002492\",\"JCSSA002504\",\"JCSSA002516\",\"JCSSA002521\",\"JCSSA002533\",\"JCSSA002545\",\"JCSSA002550\",\"JCSSA002562\",\"JCSSA002574\",\"JCSSA002586\",\"JCSSA002603\",\"JCSSA002615\",\"JCSSA002620\",\"JCSSA002632\",\"JCSSA002644\",\"JCSSA002656\",\"JCSSA002661\",\"JCSSA002673\",\"JCSSA002685\",\"JCSSA002690\",\"JCSSA002702\",\"JCSSA002726\",\"JCSSA002731\",\"JCSSA002743\",\"JCSSA002755\",\"JCSSA002772\",\"JCSSA002784\",\"JCSSA002796\",\"JCSSA002801\",\"JCSSA002813\",\"JCSSA002825\",\"JCSSA002830\",\"JCSSA002842\",\"JCSSA002854\",\"JCSSA002866\",\"JCSSA002871\",\"JCSSA002883\",\"JCSSA002895\",\"JCSSA002900\",\"JCSSA002912\",\"JCSSA002924\",\"JCSSA002936\",\"JCSSA002941\",\"JCSSA002953\",\"JCSSA002965\",\"JCSSA002970\",\"JCSSA002982\",\"JCSSA002994\",\"JCSSA003006\",\"JCSSA003011\",\"JCSSA003023\",\"JCSSA003035\",\"JCSSA003040\",\"JCSSA003052\",\"JCSSA003064\",\"JCSSA003076\",\"JCSSA003081\",\"JCSSA003093\",\"JCSSA003105\",\"JCSSA003110\",\"JCSSA003122\",\"JCSSA003134\",\"JCSSA003146\",\"JCSSA003151\",\"JCSSA003163\",\"JCSSA003175\",\"JCSSA003180\",\"JCSSA003192\",\"JCSSA003204\",\"JCSSA003216\",\"JCSSA003221\",\"JCSSA003233\",\"JCSSA003245\",\"JCSSA003250\",\"JCSSA003262\",\"JCSSA003274\",\"JCSSA003286\",\"JCSSA003291\",\"JCSSA003303\",\"JCSSA003315\",\"JCSSA003320\",\"JCSSA003332\",\"JCSSA003344\",\"JCSSA003356\",\"JCSSA003361\",\"JCSSA003373\",\"JCSSA003385\",\"JCSSA003390\",\"JCSSA003402\",\"JCSSA003414\",\"JCSSA003426\",\"JCSSA003431\",\"JCSSA003443\",\"JCSSA003455\",\"JCSSA003460\",\"JCSSA003472\",\"JCSSA003484\",\"JCSSA003496\",\"JCSSA003501\",\"JCSSA003513\",\"JCSSA003525\",\"JCSSA003530\",\"JCSSA003542\",\"JCSSA003554\",\"JCSSA003566\",\"JCSSA003571\",\"JCSSA003583\",\"JCSSA003595\",\"JCSSA003600\",\"JCSSA003612\",\"JCSSA003624\",\"JCSSA003636\",\"JCSSA003641\",\"JCSSA003653\",\"JCSSA003665\",\"JCSSA003670\",\"JCSSA003694\",\"JCSSA003706\",\"JCSSA003711\",\"JCSSA003723\",\"JCSSA003735\",\"JCSSA003740\",\"JCSSA003752\",\"JCSSA003764\",\"JCSSA003776\",\"JCSSA003781\",\"JCSSA003793\",\"JCSSA003805\",\"JCSSA003810\",\"JCSSA003822\",\"JCSSA003846\",\"JCSSA003863\",\"JCSSA003875\",\"JCSSA003880\",\"JCSSA003892\",\"JCSSA003904\",\"JCSSA003916\",\"JCSSA003921\",\"JCSSA003933\",\"JCSSA003945\",\"JCSSA003950\",\"JCSSA003962\",\"JCSSA003974\",\"JCSSA003986\",\"JCSSA003991\",\"JCSSA004003\",\"JCSSA004015\",\"JCSSA004020\",\"JCSSA004032\",\"JCSSA004044\",\"JCSSA004056\",\"JCSSA004061\",\"JCSSA004073\",\"JCSSA004085\",\"JCSSA004090\",\"JCSSA004102\",\"JCSSA004114\",\"JCSSA004126\",\"JCSSA004131\",\"JCSSA004143\",\"JCSSA004155\",\"JCSSA004160\",\"JCSSA004172\",\"JCSSA004184\",\"JCSSA004196\",\"JCSSA004201\",\"JCSSA004213\",\"JCSSA004225\",\"JCSSA004230\",\"JCSSA004242\",\"JCSSA004266\",\"JCSSA004271\",\"JCSSA004283\",\"JCSSA004295\",\"JCSSA004300\",\"JCSSA004312\",\"JCSSA004324\",\"JCSSA004336\",\"JCSSA004341\",\"JCSSA004353\",\"JCSSA004365\",\"JCSSA004370\",\"JCSSA004382\",\"JCSSA004394\",\"JCSSA004406\",\"JCSSA004411\",\"JCSSA004423\",\"JCSSA004435\",\"JCSSA004440\",\"JCSSA004452\",\"JCSSA004464\",\"JCSSA004476\",\"JCSSA004481\",\"JCSSA004493\",\"JCSSA004505\",\"JCSSA004510\",\"JCSSA004522\",\"JCSSA004534\",\"JCSSA004546\",\"JCSSA004551\",\"JCSSA004563\",\"JCSSA004575\",\"JCSSA004580\",\"JCSSA004592\",\"JCSSA004604\",\"JCSSA004616\",\"JCSSA004621\",\"JCSSA004633\",\"JCSSA004645\",\"JCSSA004650\",\"JCSSA004662\",\"JCSSA004674\",\"JCSSA004686\",\"JCSSA004691\",\"JCSSA004703\",\"JCSSA004715\",\"JCSSA004720\",\"JCSSA004732\",\"JCSSA004744\",\"JCSSA004756\",\"JCSSA004761\",\"JCSSA004773\",\"JCSSA004785\",\"JCSSA004790\",\"JCSSA004802\",\"JCSSA004814\",\"JCSSA004826\",\"JCSSA004831\",\"JCSSA004843\",\"JCSSA004855\",\"JCSSA004860\",\"JCSSA004872\",\"JCSSA004884\",\"JCSSA004896\",\"JCSSA004913\",\"JCSSA004925\",\"JCSSA004930\",\"JCSSA004942\",\"JCSSA004954\",\"JCSSA004983\",\"JCSSA004995\",\"JCSSA005000\",\"JCSSA005012\",\"JCSSA005024\",\"JCSSA005036\",\"JCSSA005041\",\"JCSSA005053\",\"JCSSA005065\",\"JCSSA005070\",\"JCSSA005082\",\"JCSSA005094\",\"JCSSA005106\",\"JCSSA005111\",\"JCSSA005123\",\"JCSSA005135\",\"JCSSA005140\",\"JCSSA005164\",\"JCSSA005176\",\"JCSSA005181\",\"JCSSA005193\",\"JCSSA005205\",\"JCSSA005210\",\"JCSSA005222\",\"JCSSA005234\",\"JCSSA005246\",\"JCSSA005251\",\"JCSSA005263\",\"JCSSA005275\",\"JCSSA005280\",\"JCSSA005292\",\"JCSSA005304\",\"JCSSA005316\",\"JCSSA005321\",\"JCSSA005333\",\"JCSSA005345\",\"JCSSA005350\",\"JCSSA005362\",\"JCSSA005374\",\"JCSSA005386\",\"JCSSA005391\",\"JCSSA005403\",\"JCSSA005415\",\"JCSSA005420\",\"JCSSA005432\",\"JCSSA005444\",\"JCSSA005456\",\"JCSSA005461\",\"JCSSA005473\",\"JCSSA005485\",\"JCSSA005490\",\"JCSSA005502\",\"JCSSA005514\",\"JCSSA005526\",\"JCSSA005531\",\"JCSSA005543\",\"JCSSA005555\",\"JCSSA005560\",\"JCSSA005572\",\"JCSSA005584\",\"JCSSA005596\",\"JCSSA005601\",\"JCSSA005613\",\"JCSSA005625\",\"JCSSA005630\",\"JCSSA005642\",\"JCSSA005654\",\"JCSSA005666\",\"JCSSA005671\",\"JCSSA005683\",\"JCSSA005695\",\"JCSSA005700\",\"JCSSA005712\",\"JCSSA005724\",\"JCSSA005736\",\"JCSSA005741\",\"JCSSA005753\",\"JCSSA005765\",\"JCSSA005770\",\"JCSSA005782\",\"JCSSA005806\",\"JCSSA005811\",\"JCSSA005823\",\"JCSSA005835\",\"JCSSA005840\",\"JCSSA005852\",\"JCSSA005864\",\"JCSSA005876\",\"JCSSA005881\",\"JCSSA005893\",\"JCSSA005905\",\"JCSSA005910\",\"JCSSA005922\",\"JCSSA005934\",\"JCSSA005946\",\"JCSSA005951\",\"JCSSA005963\",\"JCSSA005975\",\"JCSSA005980\",\"JCSSA005992\",\"JCSSA006004\",\"JCSSA006016\",\"JCSSA006021\",\"JCSSA006033\",\"JCSSA006045\",\"JCSSA006050\",\"JCSSA006062\",\"JCSSA006074\",\"JCSSA006086\",\"JCSSA006091\",\"JCSSA006103\",\"JCSSA006115\",\"JCSSA006120\",\"JCSSA006132\",\"JCSSA006144\",\"JCSSA006156\",\"JCSSA006161\",\"JCSSA006173\",\"JCSSA006185\",\"JCSSA006190\",\"JCSSA006202\",\"JCSSA006214\",\"JCSSA006226\",\"JCSSA006231\",\"JCSSA006243\",\"JCSSA006255\",\"JCSSA006260\",\"JCSSA006272\",\"JCSSA006284\",\"JCSSA006296\",\"JCSSA006301\",\"JCSSA006313\",\"JCSSA006325\",\"JCSSA006330\",\"JCSSA006342\",\"JCSSA006354\",\"JCSSA006366\",\"JCSSA006371\",\"JCSSA006383\",\"JCSSA006395\",\"JCSSA006400\",\"JCSSA006412\",\"JCSSA006424\",\"JCSSA006436\",\"JCSSA006441\",\"JCSSA006453\",\"JCSSA006465\",\"JCSSA006470\",\"JCSSA006482\",\"JCSSA006494\",\"JCSSA006506\",\"JCSSA006511\",\"JCSSA006523\",\"JCSSA006535\",\"JCSSA006540\",\"JCSSA006552\",\"JCSSA006564\",\"JCSSA006576\",\"JCSSA006581\",\"JCSSA006593\",\"JCSSA006605\",\"JCSSA006610\",\"JCSSA006622\",\"JCSSA006634\",\"JCSSA006646\",\"JCSSA006651\",\"JCSSA006663\",\"JCSSA006675\",\"JCSSA006680\",\"JCSSA006692\",\"JCSSA006704\",\"JCSSA006716\",\"JCSSA006721\",\"JCSSA006733\",\"JCSSA006745\",\"JCSSA006750\",\"JCSSA006762\",\"JCSSA006774\",\"JCSSA006786\",\"JCSSA006791\",\"JCSSA006803\",\"JCSSA006815\",\"JCSSA006820\",\"JCSSA006832\",\"JCSSA006844\",\"JCSSA006856\",\"JCSSA006861\",\"JCSSA006873\",\"JCSSA006885\",\"JCSSA006890\",\"JCSSA006902\",\"JCSSA006914\",\"JCSSA006926\",\"JCSSA006931\",\"JCSSA006943\",\"JCSSA006955\",\"JCSSA006960\",\"JCSSA006972\",\"JCSSA006984\",\"JCSSA006996\",\"JCSSA007001\",\"JCSSA007013\",\"JCSSA007030\",\"JCSSA007042\",\"JCSSA007054\",\"JCSSA007066\",\"JCSSA007083\",\"JCSSA007095\",\"JCSSA007100\",\"JCSSA007112\",\"JCSSA007124\",\"JCSSA007136\",\"JCSSA007141\",\"JCSSA007153\",\"JCSSA007165\",\"JCSSA007170\",\"JCSSA007182\",\"JCSSA007194\",\"JCSSA007206\",\"JCSSA007211\",\"JCSSA007223\",\"JCSSA007235\",\"JCSSA007240\",\"JCSSA007252\",\"JCSSA007264\",\"JCSSA007276\",\"JCSSA007281\",\"JCSSA007293\",\"JCSSA007305\",\"JCSSA007310\",\"JCSSA007322\",\"JCSSA007334\",\"JCSSA007346\",\"JCSSA007351\",\"JCSSA007363\",\"JCSSA007375\",\"JCSSA007380\",\"JCSSA007392\",\"JCSSA007404\",\"JCSSA007416\",\"JCSSA007421\",\"JCSSA007433\",\"JCSSA007445\",\"JCSSA007450\",\"JCSSA007462\",\"JCSSA007474\",\"JCSSA007486\",\"JCSSA007491\",\"JCSSA007503\",\"JCSSA007515\",\"JCSSA007520\",\"JCSSA007532\",\"JCSSA007544\",\"JCSSA007556\",\"JCSSA007561\",\"JCSSA007573\",\"JCSSA007585\",\"JCSSA007590\",\"JCSSA007602\",\"JCSSA007614\",\"JCSSA007626\",\"JCSSA007631\",\"JCSSA007655\",\"JCSSA007660\",\"JCSSA007672\",\"JCSSA007684\",\"JCSSA007696\",\"JCSSA007701\",\"JCSSA007713\",\"JCSSA007725\",\"JCSSA007730\",\"JCSSA007742\",\"JCSSA007754\",\"JCSSA007766\",\"JCSSA007771\",\"JCSSA007783\",\"JCSSA007795\",\"JCSSA007800\",\"JCSSA007824\",\"JCSSA007836\",\"JCSSA007841\",\"JCSSA007853\",\"JCSSA007865\",\"JCSSA012596\",\"JCSSA012601\",\"JCSSA012613\",\"JCSSA012626\",\"JCSSA012631\",\"JCSSA012643\",\"JCSSA012655\",\"JCSSA012660\",\"JCSSA012672\",\"JCSSA012684\",\"JCSSA012696\",\"JCSSA012701\",\"JCSSA012713\",\"JCSSA012725\",\"JCSSA012730\",\"JCSSA012742\",\"JCSSA012754\",\"JCSSA012766\",\"JCSSA012771\",\"JCSSA012783\",\"JCSSA012795\",\"JCSSA012800\",\"JCSSA012812\",\"JCSSA012824\",\"JCSSA012836\",\"JCSSA012841\",\"JCSSA012853\",\"JCSSA012865\",\"JCSSA012870\",\"JCSSA012882\",\"JCSSA012894\",\"JCSSA012906\",\"JCSSA012911\",\"JCSSA012923\",\"JCSSA012935\",\"JCSSA012940\",\"JCSSA012952\",\"JCSSA012964\",\"JCSSA012976\",\"JCSSA012981\",\"JCSSA012992\",\"JCSSA013004\",\"JCSSA013016\",\"JCSSA013021\",\"JCSSA013033\",\"JCSSA013045\",\"JCSSA013050\",\"JCSSA013062\",\"JCSSA013074\",\"JCSSA013086\",\"JCSSA013091\",\"JCSSA013103\",\"JCSSA013115\",\"JCSSA013120\",\"JCSSA013132\",\"JCSSA013144\",\"JCSSA013156\",\"JCSSA013161\",\"JCSSA013173\",\"JCSSA013185\",\"JCSSA013190\",\"JCSSA013202\",\"JCSSA013214\",\"JCSSA013226\",\"JCSSA013231\",\"JCSSA013243\",\"JCSSA013255\",\"JCSSA013260\",\"JCSSA013272\",\"JCSSA013284\",\"JCSSA013296\",\"JCSSA013301\",\"JCSSA013313\",\"JCSSA013325\",\"JCSSA013330\",\"JCSSA013342\",\"JCSSA013354\",\"JCSSA013366\",\"JCSSA013371\",\"JCSSA013383\",\"JCSSA013395\",\"JCSSA013400\",\"JCSSA013412\",\"JCSSA013424\",\"JCSSA013436\",\"JCSSA013441\",\"JCSSA013453\",\"JCSSA013465\",\"JCSSA013470\",\"JCSSA013482\",\"JCSSA013494\",\"JCSSA013506\",\"JCSSA013511\",\"JCSSA013523\",\"JCSSA013535\",\"JCSSA013540\",\"JCSSA013552\",\"JCSSA013564\",\"JCSSA013576\",\"JCSSA013581\",\"JCSSA013593\",\"JCSSA013605\",\"JCSSA013610\",\"JCSSA013622\",\"JCSSA013634\",\"JCSSA013646\",\"JCSSA013651\",\"JCSSA013663\",\"JCSSA013675\",\"JCSSA013680\",\"JCSSA013692\",\"JCSSA013704\",\"JCSSA013716\",\"JCSSA013721\",\"JCSSA013733\",\"JCSSA013745\",\"JCSSA013750\",\"JCSSA013762\",\"JCSSA013774\",\"JCSSA013786\",\"JCSSA013791\",\"JCSSA013803\",\"JCSSA013815\",\"JCSSA013820\",\"JCSSA013832\",\"JCSSA013856\");\n} //fin de if($IdEstado == \"14\")\n\n//Condicion de estado-clues\nif($IdEstado == \"15\"){\n\t$Clues = array(\"MCSSA000014\",\"MCSSA000026\",\"MCSSA000031\",\"MCSSA000043\",\"MCSSA000055\",\"MCSSA000060\",\"MCSSA000072\",\"MCSSA000084\",\"MCSSA000096\",\"MCSSA000101\",\"MCSSA000113\",\"MCSSA000125\",\"MCSSA000130\",\"MCSSA000142\",\"MCSSA000154\",\"MCSSA000166\",\"MCSSA000171\",\"MCSSA000183\",\"MCSSA000195\",\"MCSSA000200\",\"MCSSA000212\",\"MCSSA000224\",\"MCSSA000236\",\"MCSSA000241\",\"MCSSA000253\",\"MCSSA000265\",\"MCSSA000270\",\"MCSSA000282\",\"MCSSA000294\",\"MCSSA000306\",\"MCSSA000311\",\"MCSSA000323\",\"MCSSA000335\",\"MCSSA000340\",\"MCSSA000352\",\"MCSSA000376\",\"MCSSA000381\",\"MCSSA000393\",\"MCSSA000405\",\"MCSSA000410\",\"MCSSA000422\",\"MCSSA000434\",\"MCSSA000446\",\"MCSSA000463\",\"MCSSA000475\",\"MCSSA000480\",\"MCSSA000492\",\"MCSSA000516\",\"MCSSA000521\",\"MCSSA000533\",\"MCSSA000545\",\"MCSSA000550\",\"MCSSA000562\",\"MCSSA000574\",\"MCSSA000586\",\"MCSSA000591\",\"MCSSA000603\",\"MCSSA000615\",\"MCSSA000632\",\"MCSSA000644\",\"MCSSA000656\",\"MCSSA000661\",\"MCSSA000673\",\"MCSSA000685\",\"MCSSA000702\",\"MCSSA000726\",\"MCSSA000731\",\"MCSSA000755\",\"MCSSA000760\",\"MCSSA000772\",\"MCSSA000784\",\"MCSSA000796\",\"MCSSA000801\",\"MCSSA000813\",\"MCSSA000825\",\"MCSSA000830\",\"MCSSA000842\",\"MCSSA000854\",\"MCSSA000866\",\"MCSSA000871\",\"MCSSA000883\",\"MCSSA000895\",\"MCSSA000900\",\"MCSSA000912\",\"MCSSA000924\",\"MCSSA000936\",\"MCSSA000941\",\"MCSSA000953\",\"MCSSA000965\",\"MCSSA000970\",\"MCSSA000982\",\"MCSSA000994\",\"MCSSA001011\",\"MCSSA001023\",\"MCSSA001035\",\"MCSSA001040\",\"MCSSA001064\",\"MCSSA001081\",\"MCSSA001093\",\"MCSSA001110\",\"MCSSA001146\",\"MCSSA001151\",\"MCSSA001163\",\"MCSSA001175\",\"MCSSA001180\",\"MCSSA001192\",\"MCSSA001204\",\"MCSSA001216\",\"MCSSA001221\",\"MCSSA001233\",\"MCSSA001245\",\"MCSSA001250\",\"MCSSA001262\",\"MCSSA001274\",\"MCSSA001286\",\"MCSSA001291\",\"MCSSA001303\",\"MCSSA001315\",\"MCSSA001320\",\"MCSSA001332\",\"MCSSA001344\",\"MCSSA001356\",\"MCSSA001361\",\"MCSSA001373\",\"MCSSA001385\",\"MCSSA001390\",\"MCSSA001402\",\"MCSSA001414\",\"MCSSA001426\",\"MCSSA001431\",\"MCSSA001443\",\"MCSSA001455\",\"MCSSA001460\",\"MCSSA001472\",\"MCSSA001484\",\"MCSSA001496\",\"MCSSA001513\",\"MCSSA001525\",\"MCSSA001530\",\"MCSSA001542\",\"MCSSA001554\",\"MCSSA001566\",\"MCSSA001571\",\"MCSSA001583\",\"MCSSA001595\",\"MCSSA001600\",\"MCSSA001612\",\"MCSSA001624\",\"MCSSA001636\",\"MCSSA001665\",\"MCSSA001670\",\"MCSSA001682\",\"MCSSA001694\",\"MCSSA001706\",\"MCSSA001711\",\"MCSSA001723\",\"MCSSA001735\",\"MCSSA001740\",\"MCSSA001752\",\"MCSSA001764\",\"MCSSA001776\",\"MCSSA001781\",\"MCSSA001793\",\"MCSSA001805\",\"MCSSA001810\",\"MCSSA001822\",\"MCSSA001834\",\"MCSSA001846\",\"MCSSA001851\",\"MCSSA001863\",\"MCSSA001875\",\"MCSSA001880\",\"MCSSA001892\",\"MCSSA001904\",\"MCSSA001916\",\"MCSSA001921\",\"MCSSA001933\",\"MCSSA001945\",\"MCSSA001950\",\"MCSSA001962\",\"MCSSA001974\",\"MCSSA001986\",\"MCSSA001991\",\"MCSSA002003\",\"MCSSA002015\",\"MCSSA002020\",\"MCSSA002032\",\"MCSSA002044\",\"MCSSA002056\",\"MCSSA002061\",\"MCSSA002073\",\"MCSSA002085\",\"MCSSA002090\",\"MCSSA002102\",\"MCSSA002114\",\"MCSSA002126\",\"MCSSA002131\",\"MCSSA002143\",\"MCSSA002155\",\"MCSSA002160\",\"MCSSA002172\",\"MCSSA002184\",\"MCSSA002196\",\"MCSSA002213\",\"MCSSA002225\",\"MCSSA002230\",\"MCSSA002242\",\"MCSSA002254\",\"MCSSA002266\",\"MCSSA002271\",\"MCSSA002283\",\"MCSSA002295\",\"MCSSA002300\",\"MCSSA002312\",\"MCSSA002324\",\"MCSSA002336\",\"MCSSA002341\",\"MCSSA002353\",\"MCSSA002365\",\"MCSSA002370\",\"MCSSA002382\",\"MCSSA002394\",\"MCSSA002406\",\"MCSSA002411\",\"MCSSA002423\",\"MCSSA002440\",\"MCSSA002452\",\"MCSSA002464\",\"MCSSA002476\",\"MCSSA002481\",\"MCSSA002493\",\"MCSSA002505\",\"MCSSA002510\",\"MCSSA002522\",\"MCSSA002534\",\"MCSSA002546\",\"MCSSA002551\",\"MCSSA002575\",\"MCSSA002580\",\"MCSSA002592\",\"MCSSA002604\",\"MCSSA002616\",\"MCSSA002621\",\"MCSSA002633\",\"MCSSA002645\",\"MCSSA002650\",\"MCSSA002662\",\"MCSSA002674\",\"MCSSA002686\",\"MCSSA002691\",\"MCSSA002703\",\"MCSSA002715\",\"MCSSA002720\",\"MCSSA002732\",\"MCSSA002744\",\"MCSSA002756\",\"MCSSA002761\",\"MCSSA002773\",\"MCSSA002802\",\"MCSSA002814\",\"MCSSA002826\",\"MCSSA002831\",\"MCSSA002843\",\"MCSSA002855\",\"MCSSA002860\",\"MCSSA002872\",\"MCSSA002896\",\"MCSSA002925\",\"MCSSA002930\",\"MCSSA002954\",\"MCSSA002966\",\"MCSSA002971\",\"MCSSA002983\",\"MCSSA003000\",\"MCSSA003024\",\"MCSSA003036\",\"MCSSA003041\",\"MCSSA003053\",\"MCSSA003065\",\"MCSSA003082\",\"MCSSA003094\",\"MCSSA003106\",\"MCSSA003111\",\"MCSSA003123\",\"MCSSA003135\",\"MCSSA003152\",\"MCSSA003176\",\"MCSSA003181\",\"MCSSA003193\",\"MCSSA003205\",\"MCSSA003210\",\"MCSSA003222\",\"MCSSA003234\",\"MCSSA003246\",\"MCSSA003251\",\"MCSSA003263\",\"MCSSA003275\",\"MCSSA003280\",\"MCSSA003292\",\"MCSSA003304\",\"MCSSA003316\",\"MCSSA003321\",\"MCSSA003333\",\"MCSSA003345\",\"MCSSA003350\",\"MCSSA003386\",\"MCSSA003391\",\"MCSSA003403\",\"MCSSA003415\",\"MCSSA003420\",\"MCSSA003444\",\"MCSSA003456\",\"MCSSA003461\",\"MCSSA003485\",\"MCSSA003490\",\"MCSSA003531\",\"MCSSA003543\",\"MCSSA003555\",\"MCSSA003560\",\"MCSSA003584\",\"MCSSA003596\",\"MCSSA003601\",\"MCSSA003613\",\"MCSSA003625\",\"MCSSA003630\",\"MCSSA003654\",\"MCSSA003666\",\"MCSSA003671\",\"MCSSA003683\",\"MCSSA003695\",\"MCSSA003700\",\"MCSSA003724\",\"MCSSA003736\",\"MCSSA003741\",\"MCSSA003753\",\"MCSSA003765\",\"MCSSA003770\",\"MCSSA003782\",\"MCSSA003794\",\"MCSSA003806\",\"MCSSA003823\",\"MCSSA003840\",\"MCSSA003852\",\"MCSSA003864\",\"MCSSA003876\",\"MCSSA003881\",\"MCSSA003893\",\"MCSSA003905\",\"MCSSA003922\",\"MCSSA003934\",\"MCSSA003946\",\"MCSSA003951\",\"MCSSA003963\",\"MCSSA003975\",\"MCSSA003992\",\"MCSSA004016\",\"MCSSA004021\",\"MCSSA004033\",\"MCSSA004045\",\"MCSSA004050\",\"MCSSA004062\",\"MCSSA004074\",\"MCSSA004086\",\"MCSSA004091\",\"MCSSA004103\",\"MCSSA004115\",\"MCSSA004120\",\"MCSSA004132\",\"MCSSA004144\",\"MCSSA004156\",\"MCSSA004161\",\"MCSSA004173\",\"MCSSA004185\",\"MCSSA004190\",\"MCSSA004202\",\"MCSSA004214\",\"MCSSA004226\",\"MCSSA004231\",\"MCSSA004243\",\"MCSSA004255\",\"MCSSA004260\",\"MCSSA004272\",\"MCSSA004284\",\"MCSSA004296\",\"MCSSA004301\",\"MCSSA004313\",\"MCSSA004325\",\"MCSSA004330\",\"MCSSA004342\",\"MCSSA004354\",\"MCSSA004366\",\"MCSSA004371\",\"MCSSA004383\",\"MCSSA004395\",\"MCSSA004400\",\"MCSSA004412\",\"MCSSA004441\",\"MCSSA004465\",\"MCSSA004470\",\"MCSSA004482\",\"MCSSA004494\",\"MCSSA004506\",\"MCSSA004511\",\"MCSSA004523\",\"MCSSA004535\",\"MCSSA004552\",\"MCSSA004564\",\"MCSSA004576\",\"MCSSA004581\",\"MCSSA004593\",\"MCSSA004605\",\"MCSSA004610\",\"MCSSA004622\",\"MCSSA004634\",\"MCSSA004646\",\"MCSSA004651\",\"MCSSA004663\",\"MCSSA004675\",\"MCSSA004680\",\"MCSSA004692\",\"MCSSA004704\",\"MCSSA004716\",\"MCSSA004721\",\"MCSSA004733\",\"MCSSA004745\",\"MCSSA004750\",\"MCSSA004762\",\"MCSSA004774\",\"MCSSA004786\",\"MCSSA004791\",\"MCSSA004803\",\"MCSSA004815\",\"MCSSA004820\",\"MCSSA004832\",\"MCSSA004856\",\"MCSSA004861\",\"MCSSA004873\",\"MCSSA004885\",\"MCSSA004890\",\"MCSSA004902\",\"MCSSA004914\",\"MCSSA004926\",\"MCSSA004931\",\"MCSSA004943\",\"MCSSA004955\",\"MCSSA004960\",\"MCSSA004972\",\"MCSSA004984\",\"MCSSA004996\",\"MCSSA005001\",\"MCSSA005013\",\"MCSSA005025\",\"MCSSA005030\",\"MCSSA005042\",\"MCSSA005054\",\"MCSSA005066\",\"MCSSA005071\",\"MCSSA005083\",\"MCSSA005095\",\"MCSSA005100\",\"MCSSA005112\",\"MCSSA005124\",\"MCSSA005165\",\"MCSSA005170\",\"MCSSA005206\",\"MCSSA005223\",\"MCSSA005235\",\"MCSSA005276\",\"MCSSA005281\",\"MCSSA005293\",\"MCSSA005305\",\"MCSSA005322\",\"MCSSA005346\",\"MCSSA005351\",\"MCSSA005363\",\"MCSSA005375\",\"MCSSA005380\",\"MCSSA005392\",\"MCSSA005416\",\"MCSSA005421\",\"MCSSA005433\",\"MCSSA005445\",\"MCSSA005450\",\"MCSSA005486\",\"MCSSA005491\",\"MCSSA005503\",\"MCSSA005515\",\"MCSSA005520\",\"MCSSA005532\",\"MCSSA005544\",\"MCSSA005556\",\"MCSSA005561\",\"MCSSA005573\",\"MCSSA005585\",\"MCSSA005602\",\"MCSSA005614\",\"MCSSA005626\",\"MCSSA005631\",\"MCSSA005643\",\"MCSSA005655\",\"MCSSA005672\",\"MCSSA005701\",\"MCSSA005725\",\"MCSSA005730\",\"MCSSA005754\",\"MCSSA005766\",\"MCSSA005771\",\"MCSSA005783\",\"MCSSA005812\",\"MCSSA005824\",\"MCSSA005836\",\"MCSSA005853\",\"MCSSA005865\",\"MCSSA005870\",\"MCSSA005882\",\"MCSSA005894\",\"MCSSA005906\",\"MCSSA005911\",\"MCSSA005923\",\"MCSSA005935\",\"MCSSA005940\",\"MCSSA005952\",\"MCSSA005964\",\"MCSSA005976\",\"MCSSA005981\",\"MCSSA005993\",\"MCSSA006005\",\"MCSSA006010\",\"MCSSA006022\",\"MCSSA006034\",\"MCSSA006046\",\"MCSSA006051\",\"MCSSA006075\",\"MCSSA006080\",\"MCSSA006092\",\"MCSSA006104\",\"MCSSA006116\",\"MCSSA006121\",\"MCSSA006133\",\"MCSSA006145\",\"MCSSA006150\",\"MCSSA006162\",\"MCSSA006174\",\"MCSSA006186\",\"MCSSA006191\",\"MCSSA006203\",\"MCSSA006215\",\"MCSSA006220\",\"MCSSA006232\",\"MCSSA006244\",\"MCSSA006256\",\"MCSSA006261\",\"MCSSA006273\",\"MCSSA006285\",\"MCSSA006290\",\"MCSSA006302\",\"MCSSA006314\",\"MCSSA006326\",\"MCSSA006331\",\"MCSSA006343\",\"MCSSA006355\",\"MCSSA006360\",\"MCSSA006372\",\"MCSSA006384\",\"MCSSA006396\",\"MCSSA006401\",\"MCSSA006413\",\"MCSSA006425\",\"MCSSA006430\",\"MCSSA006454\",\"MCSSA006471\",\"MCSSA006483\",\"MCSSA006495\",\"MCSSA006500\",\"MCSSA006512\",\"MCSSA006524\",\"MCSSA006536\",\"MCSSA006541\",\"MCSSA006565\",\"MCSSA006570\",\"MCSSA006582\",\"MCSSA006594\",\"MCSSA006606\",\"MCSSA006611\",\"MCSSA006623\",\"MCSSA006635\",\"MCSSA006640\",\"MCSSA006652\",\"MCSSA006664\",\"MCSSA006676\",\"MCSSA006681\",\"MCSSA006693\",\"MCSSA006705\",\"MCSSA006710\",\"MCSSA006722\",\"MCSSA006734\",\"MCSSA006746\",\"MCSSA006751\",\"MCSSA006763\",\"MCSSA006775\",\"MCSSA006780\",\"MCSSA006792\",\"MCSSA006804\",\"MCSSA006816\",\"MCSSA006821\",\"MCSSA006833\",\"MCSSA006845\",\"MCSSA006850\",\"MCSSA006862\",\"MCSSA006874\",\"MCSSA006886\",\"MCSSA006891\",\"MCSSA006903\",\"MCSSA006915\",\"MCSSA006920\",\"MCSSA006944\",\"MCSSA006956\",\"MCSSA006961\",\"MCSSA006973\",\"MCSSA006985\",\"MCSSA006990\",\"MCSSA007002\",\"MCSSA007026\",\"MCSSA007031\",\"MCSSA007043\",\"MCSSA007055\",\"MCSSA007060\",\"MCSSA007084\",\"MCSSA007096\",\"MCSSA007101\",\"MCSSA007113\",\"MCSSA007125\",\"MCSSA007130\",\"MCSSA007142\",\"MCSSA007154\",\"MCSSA007166\",\"MCSSA007171\",\"MCSSA007183\",\"MCSSA007195\",\"MCSSA007200\",\"MCSSA007212\",\"MCSSA007224\",\"MCSSA007236\",\"MCSSA007241\",\"MCSSA007253\",\"MCSSA007265\",\"MCSSA007282\",\"MCSSA007294\",\"MCSSA007306\",\"MCSSA007311\",\"MCSSA007323\",\"MCSSA007335\",\"MCSSA007352\",\"MCSSA007364\",\"MCSSA007376\",\"MCSSA007381\",\"MCSSA007393\",\"MCSSA007405\",\"MCSSA007410\",\"MCSSA007422\",\"MCSSA007434\",\"MCSSA007446\",\"MCSSA007463\",\"MCSSA007475\",\"MCSSA007480\",\"MCSSA007492\",\"MCSSA007504\",\"MCSSA007533\",\"MCSSA007545\",\"MCSSA007550\",\"MCSSA007562\",\"MCSSA007574\",\"MCSSA007586\",\"MCSSA007591\",\"MCSSA007603\",\"MCSSA007615\",\"MCSSA007620\",\"MCSSA007661\",\"MCSSA007673\",\"MCSSA007685\",\"MCSSA007690\",\"MCSSA007702\",\"MCSSA007714\",\"MCSSA007726\",\"MCSSA007731\",\"MCSSA007755\",\"MCSSA007760\",\"MCSSA007772\",\"MCSSA007784\",\"MCSSA007796\",\"MCSSA007801\",\"MCSSA007813\",\"MCSSA007825\",\"MCSSA007830\",\"MCSSA007842\",\"MCSSA007854\",\"MCSSA007866\",\"MCSSA007871\",\"MCSSA007900\",\"MCSSA007912\",\"MCSSA007924\",\"MCSSA007936\",\"MCSSA007941\",\"MCSSA007953\",\"MCSSA007965\",\"MCSSA007970\",\"MCSSA007982\",\"MCSSA007994\",\"MCSSA008006\",\"MCSSA008011\",\"MCSSA008023\",\"MCSSA008035\",\"MCSSA008040\",\"MCSSA008052\",\"MCSSA008064\",\"MCSSA008076\",\"MCSSA008081\",\"MCSSA008093\",\"MCSSA008105\",\"MCSSA008110\",\"MCSSA008122\",\"MCSSA008146\",\"MCSSA008163\",\"MCSSA008175\",\"MCSSA008180\",\"MCSSA008192\",\"MCSSA008204\",\"MCSSA008216\",\"MCSSA008221\",\"MCSSA008233\",\"MCSSA008245\",\"MCSSA008250\",\"MCSSA008274\",\"MCSSA008286\",\"MCSSA008291\",\"MCSSA008303\",\"MCSSA008315\",\"MCSSA008320\",\"MCSSA008332\",\"MCSSA008344\",\"MCSSA008356\",\"MCSSA008361\",\"MCSSA008385\",\"MCSSA008390\",\"MCSSA008414\",\"MCSSA008426\",\"MCSSA008431\",\"MCSSA008443\",\"MCSSA008455\",\"MCSSA008460\",\"MCSSA008472\",\"MCSSA008496\",\"MCSSA008501\",\"MCSSA008513\",\"MCSSA008525\",\"MCSSA008530\",\"MCSSA008542\",\"MCSSA008554\",\"MCSSA008566\",\"MCSSA008583\",\"MCSSA008595\",\"MCSSA008600\",\"MCSSA008624\",\"MCSSA008653\",\"MCSSA008670\",\"MCSSA008694\",\"MCSSA008706\",\"MCSSA008723\",\"MCSSA008735\",\"MCSSA008740\",\"MCSSA008752\",\"MCSSA008764\",\"MCSSA008776\",\"MCSSA008781\",\"MCSSA008793\",\"MCSSA008805\",\"MCSSA008810\",\"MCSSA008822\",\"MCSSA008834\",\"MCSSA008846\",\"MCSSA008851\",\"MCSSA008863\",\"MCSSA008875\",\"MCSSA008880\",\"MCSSA008892\",\"MCSSA008904\",\"MCSSA008916\",\"MCSSA008921\",\"MCSSA008945\",\"MCSSA008950\",\"MCSSA008962\",\"MCSSA008974\",\"MCSSA008986\",\"MCSSA008991\",\"MCSSA009003\",\"MCSSA009015\",\"MCSSA009020\",\"MCSSA009032\",\"MCSSA009044\",\"MCSSA009056\",\"MCSSA009073\",\"MCSSA009085\",\"MCSSA009090\",\"MCSSA009114\",\"MCSSA009126\",\"MCSSA009131\",\"MCSSA009143\",\"MCSSA009155\",\"MCSSA009160\",\"MCSSA009172\",\"MCSSA009184\",\"MCSSA009196\",\"MCSSA009213\",\"MCSSA009230\",\"MCSSA009242\",\"MCSSA009254\",\"MCSSA009266\",\"MCSSA009271\",\"MCSSA009283\",\"MCSSA009295\",\"MCSSA009300\",\"MCSSA009312\",\"MCSSA009324\",\"MCSSA009336\",\"MCSSA009341\",\"MCSSA009353\",\"MCSSA009365\",\"MCSSA009370\",\"MCSSA009382\",\"MCSSA009394\",\"MCSSA009406\",\"MCSSA009411\",\"MCSSA009423\",\"MCSSA009435\",\"MCSSA009440\",\"MCSSA009452\",\"MCSSA009464\",\"MCSSA009476\",\"MCSSA009481\",\"MCSSA009493\",\"MCSSA009505\",\"MCSSA009510\",\"MCSSA009522\",\"MCSSA009534\",\"MCSSA009551\",\"MCSSA009563\",\"MCSSA009575\",\"MCSSA009592\",\"MCSSA009604\",\"MCSSA009616\",\"MCSSA009621\",\"MCSSA009645\",\"MCSSA009650\",\"MCSSA009662\",\"MCSSA009674\",\"MCSSA009686\",\"MCSSA009691\",\"MCSSA009703\",\"MCSSA009720\",\"MCSSA009732\",\"MCSSA009756\",\"MCSSA009761\",\"MCSSA009773\",\"MCSSA009814\",\"MCSSA009826\",\"MCSSA009831\",\"MCSSA009843\",\"MCSSA009855\",\"MCSSA009860\",\"MCSSA009872\",\"MCSSA009884\",\"MCSSA009901\",\"MCSSA009925\",\"MCSSA009930\",\"MCSSA009942\",\"MCSSA009954\",\"MCSSA009966\",\"MCSSA009983\",\"MCSSA009995\",\"MCSSA010000\",\"MCSSA010012\",\"MCSSA010024\",\"MCSSA010036\",\"MCSSA010041\",\"MCSSA010053\",\"MCSSA010065\",\"MCSSA010082\",\"MCSSA010111\",\"MCSSA010123\",\"MCSSA010140\",\"MCSSA010152\",\"MCSSA010164\",\"MCSSA010176\",\"MCSSA010181\",\"MCSSA010210\",\"MCSSA010222\",\"MCSSA010234\",\"MCSSA010246\",\"MCSSA010251\",\"MCSSA010263\",\"MCSSA010275\",\"MCSSA010280\",\"MCSSA010292\",\"MCSSA010304\",\"MCSSA010316\",\"MCSSA010321\",\"MCSSA010333\",\"MCSSA010345\",\"MCSSA015233\",\"MCSSA015245\",\"MCSSA015250\",\"MCSSA015262\",\"MCSSA015286\",\"MCSSA015292\",\"MCSSA015304\",\"MCSSA015316\",\"MCSSA015321\",\"MCSSA015333\",\"MCSSA015345\",\"MCSSA015350\",\"MCSSA015362\",\"MCSSA015374\",\"MCSSA015386\",\"MCSSA015391\",\"MCSSA015403\",\"MCSSA015415\",\"MCSSA015420\",\"MCSSA015432\",\"MCSSA015444\",\"MCSSA015456\",\"MCSSA015461\",\"MCSSA015473\",\"MCSSA015485\",\"MCSSA015490\",\"MCSSA015514\",\"MCSSA015526\",\"MCSSA015531\",\"MCSSA015543\",\"MCSSA015555\",\"MCSSA015560\",\"MCSSA015572\",\"MCSSA015584\",\"MCSSA015596\",\"MCSSA015601\",\"MCSSA015613\",\"MCSSA015625\",\"MCSSA015630\",\"MCSSA015642\",\"MCSSA015654\",\"MCSSA015666\",\"MCSSA015671\",\"MCSSA015683\",\"MCSSA015695\",\"MCSSA015700\",\"MCSSA015712\",\"MCSSA015724\",\"MCSSA015736\",\"MCSSA015741\",\"MCSSA015753\",\"MCSSA015765\",\"MCSSA015770\",\"MCSSA015782\",\"MCSSA015794\",\"MCSSA015806\",\"MCSSA015811\",\"MCSSA015823\",\"MCSSA015835\",\"MCSSA015840\",\"MCSSA015852\",\"MCSSA015864\",\"MCSSA015876\",\"MCSSA015904\",\"MCSSA015916\",\"MCSSA015921\",\"MCSSA015933\",\"MCSSA015945\",\"MCSSA015950\",\"MCSSA015962\",\"MCSSA015974\",\"MCSSA015986\",\"MCSSA015991\",\"MCSSA016003\",\"MCSSA016015\",\"MCSSA016020\",\"MCSSA016032\",\"MCSSA016044\",\"MCSSA016061\",\"MCSSA016085\",\"MCSSA016102\",\"MCSSA016126\",\"MCSSA016131\",\"MCSSA016143\",\"MCSSA016155\",\"MCSSA016160\",\"MCSSA016184\",\"MCSSA016213\",\"MCSSA016242\",\"MCSSA016254\",\"MCSSA016283\",\"MCSSA016295\",\"MCSSA016300\",\"MCSSA016312\",\"MCSSA016382\",\"MCSSA016406\",\"MCSSA016411\",\"MCSSA016440\",\"MCSSA016452\",\"MCSSA016464\",\"MCSSA016476\",\"MCSSA016510\",\"MCSSA016534\",\"MCSSA016563\",\"MCSSA016575\",\"MCSSA016592\",\"MCSSA016604\",\"MCSSA016616\",\"MCSSA016621\",\"MCSSA016633\",\"MCSSA016645\",\"MCSSA016650\",\"MCSSA016662\",\"MCSSA016674\",\"MCSSA016691\",\"MCSSA016703\",\"MCSSA016744\",\"MCSSA016756\",\"MCSSA016761\",\"MCSSA016773\",\"MCSSA016790\",\"MCSSA016802\",\"MCSSA016814\",\"MCSSA016826\",\"MCSSA016831\",\"MCSSA016843\",\"MCSSA016855\",\"MCSSA016860\",\"MCSSA016872\",\"MCSSA016884\",\"MCSSA016896\",\"MCSSA016901\",\"MCSSA016913\",\"MCSSA016925\",\"MCSSA016930\",\"MCSSA016942\",\"MCSSA016954\",\"MCSSA016966\",\"MCSSA016971\",\"MCSSA016983\",\"MCSSA016995\",\"MCSSA017000\",\"MCSSA017012\",\"MCSSA017024\",\"MCSSA017036\",\"MCSSA017041\",\"MCSSA017053\",\"MCSSA017065\",\"MCSSA017070\",\"MCSSA017082\",\"MCSSA017094\",\"MCSSA017106\",\"MCSSA017152\",\"MCSSA017181\",\"MCSSA017193\",\"MCSSA017205\",\"MCSSA017222\",\"MCSSA017234\",\"MCSSA017246\",\"MCSSA017263\",\"MCSSA017275\",\"MCSSA017280\",\"MCSSA017292\",\"MCSSA017304\",\"MCSSA017316\",\"MCSSA017321\",\"MCSSA017333\",\"MCSSA017345\",\"MCSSA017350\",\"MCSSA017362\",\"MCSSA017374\",\"MCSSA017386\",\"MCSSA017391\",\"MCSSA017403\",\"MCSSA017415\",\"MCSSA017420\",\"MCSSA017432\",\"MCSSA017444\",\"MCSSA017456\",\"MCSSA017461\",\"MCSSA017473\",\"MCSSA017485\",\"MCSSA017490\",\"MCSSA017502\",\"MCSSA017526\",\"MCSSA017531\",\"MCSSA017543\",\"MCSSA017555\",\"MCSSA017560\",\"MCSSA017572\",\"MCSSA017584\",\"MCSSA017596\",\"MCSSA017601\",\"MCSSA017613\",\"MCSSA017625\",\"MCSSA017630\",\"MCSSA017642\",\"MCSSA017654\",\"MCSSA017666\",\"MCSSA017671\",\"MCSSA017683\",\"MCSSA017695\",\"MCSSA017700\",\"MCSSA017712\",\"MCSSA017724\",\"MCSSA017736\",\"MCSSA017741\",\"MCSSA017753\",\"MCSSA017765\",\"MCSSA017770\",\"MCSSA017782\",\"MCSSA017794\",\"MCSSA017806\",\"MCSSA017811\",\"MCSSA017823\",\"MCSSA017835\",\"MCSSA017840\",\"MCSSA017852\",\"MCSSA017864\",\"MCSSA017876\",\"MCSSA017881\",\"MCSSA017893\",\"MCSSA017905\",\"MCSSA017910\",\"MCSSA017922\",\"MCSSA017934\",\"MCSSA017951\",\"MCSSA017963\",\"MCSSA017975\",\"MCSSA017980\",\"MCSSA017992\",\"MCSSA018004\",\"MCSSA018016\",\"MCSSA018021\",\"MCSSA018033\",\"MCSSA018045\",\"MCSSA018050\",\"MCSSA018062\",\"MCSSA018074\",\"MCSSA018086\",\"MCSSA018091\",\"MCSSA018103\",\"MCSSA018115\",\"MCSSA018120\",\"MCSSA018132\",\"MCSSA018144\",\"MCSSA018156\",\"MCSSA018161\",\"MCSSA018173\",\"MCSSA018185\",\"MCSSA018190\",\"MCSSA018202\",\"MCSSA018214\",\"MCSSA018226\",\"MCSSA018231\",\"MCSSA018243\",\"MCSSA018255\",\"MCSSA018260\",\"MCSSA018272\",\"MCSSA018284\",\"MCSSA018296\",\"MCSSA018301\",\"MCSSA018313\",\"MCSSA018325\",\"MCSSA018330\",\"MCSSA018342\",\"MCSSA018354\",\"MCSSA018366\",\"MCSSA018371\",\"MCSSA018383\",\"MCSSA018395\",\"MCSSA018400\",\"MCSSA018412\",\"MCSSA018424\",\"MCSSA018436\",\"MCSSA018441\",\"MCSSA018453\",\"MCSSA018470\",\"MCSSA018482\",\"MCSSA018494\",\"MCSSA018506\",\"MCSSA018511\",\"MCSSA018523\",\"MCSSA018535\",\"MCSSA018540\",\"MCSSA018552\",\"MCSSA018564\",\"MCSSA018576\",\"MCSSA018581\",\"MCSSA018593\",\"MCSSA018605\",\"MCSSA018610\",\"MCSSA018622\",\"MCSSA018634\",\"MCSSA018646\",\"MCSSA018651\",\"MCSSA018663\",\"MCSSA018675\",\"MCSSA018680\",\"MCSSA018692\",\"MCSSA018704\",\"MCSSA018716\",\"MCSSA018721\",\"MCSSA018733\",\"MCSSA018745\",\"MCSSA018750\",\"MCSSA018762\",\"MCSSA018774\",\"MCSSA018786\",\"MCSSA018791\",\"MCSSA018803\",\"MCSSA018815\",\"MCSSA018820\",\"MCSSA018832\",\"MCSSA018844\",\"MCSSA018856\",\"MCSSA018861\",\"MCSSA018873\",\"MCSSA018885\",\"MCSSA018890\",\"MCSSA018902\",\"MCSSA018914\",\"MCSSA018926\",\"MCSSA018931\",\"MCSSA018943\");\n} //fin de if($IdEstado == \"15\")\n\n//Condicion de estado-clues\nif($IdEstado == \"16\"){\n\t$Clues = array(\"MNSSA000013\",\"MNSSA000030\",\"MNSSA000054\",\"MNSSA000066\",\"MNSSA000083\",\"MNSSA000095\",\"MNSSA000100\",\"MNSSA000112\",\"MNSSA000124\",\"MNSSA000136\",\"MNSSA000153\",\"MNSSA000165\",\"MNSSA000170\",\"MNSSA000194\",\"MNSSA000206\",\"MNSSA000211\",\"MNSSA000223\",\"MNSSA000235\",\"MNSSA000240\",\"MNSSA000252\",\"MNSSA000264\",\"MNSSA000276\",\"MNSSA000281\",\"MNSSA000293\",\"MNSSA000305\",\"MNSSA000310\",\"MNSSA000322\",\"MNSSA000334\",\"MNSSA000346\",\"MNSSA000351\",\"MNSSA000363\",\"MNSSA000375\",\"MNSSA000404\",\"MNSSA000416\",\"MNSSA000421\",\"MNSSA000433\",\"MNSSA000445\",\"MNSSA000450\",\"MNSSA000462\",\"MNSSA000474\",\"MNSSA000486\",\"MNSSA000491\",\"MNSSA000503\",\"MNSSA000515\",\"MNSSA000532\",\"MNSSA000544\",\"MNSSA000561\",\"MNSSA000573\",\"MNSSA000590\",\"MNSSA000602\",\"MNSSA000614\",\"MNSSA000626\",\"MNSSA000631\",\"MNSSA000643\",\"MNSSA000655\",\"MNSSA000660\",\"MNSSA000672\",\"MNSSA000684\",\"MNSSA000696\",\"MNSSA000701\",\"MNSSA000713\",\"MNSSA000725\",\"MNSSA000730\",\"MNSSA000742\",\"MNSSA000754\",\"MNSSA000766\",\"MNSSA000771\",\"MNSSA000783\",\"MNSSA000800\",\"MNSSA000812\",\"MNSSA000824\",\"MNSSA000836\",\"MNSSA000841\",\"MNSSA000853\",\"MNSSA000865\",\"MNSSA000870\",\"MNSSA000882\",\"MNSSA000894\",\"MNSSA000906\",\"MNSSA000911\",\"MNSSA000923\",\"MNSSA000935\",\"MNSSA000940\",\"MNSSA000952\",\"MNSSA000964\",\"MNSSA000981\",\"MNSSA000993\",\"MNSSA001005\",\"MNSSA001034\",\"MNSSA001046\",\"MNSSA001051\",\"MNSSA001063\",\"MNSSA001080\",\"MNSSA001092\",\"MNSSA001145\",\"MNSSA001150\",\"MNSSA001162\",\"MNSSA001174\",\"MNSSA001186\",\"MNSSA001191\",\"MNSSA001203\",\"MNSSA001220\",\"MNSSA001232\",\"MNSSA001244\",\"MNSSA001256\",\"MNSSA001261\",\"MNSSA001302\",\"MNSSA001314\",\"MNSSA001326\",\"MNSSA001331\",\"MNSSA001343\",\"MNSSA001355\",\"MNSSA001360\",\"MNSSA001372\",\"MNSSA001384\",\"MNSSA001396\",\"MNSSA001401\",\"MNSSA001413\",\"MNSSA001425\",\"MNSSA001430\",\"MNSSA001442\",\"MNSSA001466\",\"MNSSA001471\",\"MNSSA001495\",\"MNSSA001512\",\"MNSSA001524\",\"MNSSA001536\",\"MNSSA001541\",\"MNSSA001553\",\"MNSSA001565\",\"MNSSA001570\",\"MNSSA001582\",\"MNSSA001594\",\"MNSSA001606\",\"MNSSA001652\",\"MNSSA001664\",\"MNSSA001676\",\"MNSSA001681\",\"MNSSA001693\",\"MNSSA001710\",\"MNSSA001722\",\"MNSSA001751\",\"MNSSA001763\",\"MNSSA001775\",\"MNSSA001780\",\"MNSSA001792\",\"MNSSA001804\",\"MNSSA001816\",\"MNSSA001821\",\"MNSSA001833\",\"MNSSA001845\",\"MNSSA001850\",\"MNSSA001862\",\"MNSSA001874\",\"MNSSA001886\",\"MNSSA001891\",\"MNSSA001903\",\"MNSSA001956\",\"MNSSA001961\",\"MNSSA001973\",\"MNSSA001985\",\"MNSSA001990\",\"MNSSA002002\",\"MNSSA002014\",\"MNSSA002026\",\"MNSSA002031\",\"MNSSA002043\",\"MNSSA002055\",\"MNSSA002060\",\"MNSSA002072\",\"MNSSA002096\",\"MNSSA002101\",\"MNSSA002125\",\"MNSSA002130\",\"MNSSA002142\",\"MNSSA002171\",\"MNSSA002183\",\"MNSSA002195\",\"MNSSA002200\",\"MNSSA002212\",\"MNSSA002224\",\"MNSSA002236\",\"MNSSA002241\",\"MNSSA002265\",\"MNSSA002270\",\"MNSSA002294\",\"MNSSA002306\",\"MNSSA002311\",\"MNSSA002323\",\"MNSSA002340\",\"MNSSA002352\",\"MNSSA002376\",\"MNSSA002381\",\"MNSSA002405\",\"MNSSA002410\",\"MNSSA002422\",\"MNSSA002434\",\"MNSSA002446\",\"MNSSA002451\",\"MNSSA002475\",\"MNSSA002480\",\"MNSSA002492\",\"MNSSA002504\",\"MNSSA002521\",\"MNSSA002533\",\"MNSSA002545\",\"MNSSA002550\",\"MNSSA002562\",\"MNSSA002586\",\"MNSSA002615\",\"MNSSA002620\",\"MNSSA002632\",\"MNSSA002656\",\"MNSSA002661\",\"MNSSA002673\",\"MNSSA002690\",\"MNSSA002702\",\"MNSSA002726\",\"MNSSA002731\",\"MNSSA002743\",\"MNSSA002755\",\"MNSSA002760\",\"MNSSA002772\",\"MNSSA002784\",\"MNSSA002796\",\"MNSSA002801\",\"MNSSA002813\",\"MNSSA002825\",\"MNSSA002842\",\"MNSSA002854\",\"MNSSA002866\",\"MNSSA002871\",\"MNSSA002883\",\"MNSSA002900\",\"MNSSA002924\",\"MNSSA002936\",\"MNSSA002953\",\"MNSSA002965\",\"MNSSA002982\",\"MNSSA002994\",\"MNSSA003006\",\"MNSSA003011\",\"MNSSA003023\",\"MNSSA003052\",\"MNSSA003081\",\"MNSSA003093\",\"MNSSA003105\",\"MNSSA003110\",\"MNSSA003122\",\"MNSSA003146\",\"MNSSA003151\",\"MNSSA003175\",\"MNSSA003180\",\"MNSSA003204\",\"MNSSA003216\",\"MNSSA003221\",\"MNSSA003233\",\"MNSSA003245\",\"MNSSA003250\",\"MNSSA003262\",\"MNSSA003274\",\"MNSSA003291\",\"MNSSA003303\",\"MNSSA003315\",\"MNSSA003320\",\"MNSSA003344\",\"MNSSA003356\",\"MNSSA003361\",\"MNSSA003385\",\"MNSSA003390\",\"MNSSA003402\",\"MNSSA003414\",\"MNSSA003431\",\"MNSSA003443\",\"MNSSA003455\",\"MNSSA003460\",\"MNSSA003472\",\"MNSSA003484\",\"MNSSA003496\",\"MNSSA003501\",\"MNSSA003513\",\"MNSSA003525\",\"MNSSA003530\",\"MNSSA003542\",\"MNSSA003554\",\"MNSSA003566\",\"MNSSA003571\",\"MNSSA003583\",\"MNSSA003595\",\"MNSSA003600\",\"MNSSA003612\",\"MNSSA003624\",\"MNSSA003636\",\"MNSSA003653\",\"MNSSA003665\",\"MNSSA003670\",\"MNSSA003682\",\"MNSSA003694\",\"MNSSA003706\",\"MNSSA003711\",\"MNSSA003723\",\"MNSSA003735\",\"MNSSA003764\",\"MNSSA003776\",\"MNSSA003781\",\"MNSSA003793\",\"MNSSA003805\",\"MNSSA003810\",\"MNSSA003822\",\"MNSSA003834\",\"MNSSA003851\",\"MNSSA003875\",\"MNSSA003880\",\"MNSSA003904\",\"MNSSA003916\",\"MNSSA003921\",\"MNSSA003933\",\"MNSSA003945\",\"MNSSA003962\",\"MNSSA003974\",\"MNSSA003986\",\"MNSSA003991\",\"MNSSA004003\",\"MNSSA004020\",\"MNSSA004032\",\"MNSSA004044\",\"MNSSA004085\",\"MNSSA004090\",\"MNSSA004114\",\"MNSSA004126\",\"MNSSA004131\",\"MNSSA004143\",\"MNSSA004155\",\"MNSSA004160\",\"MNSSA004172\",\"MNSSA004184\",\"MNSSA004196\",\"MNSSA004201\",\"MNSSA004213\",\"MNSSA004225\",\"MNSSA004230\",\"MNSSA004242\",\"MNSSA004254\",\"MNSSA004266\",\"MNSSA004271\",\"MNSSA004283\",\"MNSSA004295\",\"MNSSA004300\",\"MNSSA004312\",\"MNSSA004324\",\"MNSSA004336\",\"MNSSA004341\",\"MNSSA004353\",\"MNSSA004365\",\"MNSSA004370\",\"MNSSA004382\",\"MNSSA004394\",\"MNSSA004406\",\"MNSSA004411\",\"MNSSA004423\",\"MNSSA004435\",\"MNSSA004440\",\"MNSSA004452\",\"MNSSA004464\",\"MNSSA004476\",\"MNSSA004481\",\"MNSSA004493\",\"MNSSA004505\",\"MNSSA004510\",\"MNSSA004522\",\"MNSSA004534\",\"MNSSA004546\",\"MNSSA004551\",\"MNSSA004563\",\"MNSSA004580\",\"MNSSA004592\",\"MNSSA004604\",\"MNSSA004616\",\"MNSSA004621\",\"MNSSA004633\",\"MNSSA004645\",\"MNSSA004650\",\"MNSSA004662\",\"MNSSA004674\",\"MNSSA004686\",\"MNSSA004691\",\"MNSSA004703\",\"MNSSA004715\",\"MNSSA004720\",\"MNSSA004732\",\"MNSSA004744\",\"MNSSA004756\",\"MNSSA004761\",\"MNSSA004773\",\"MNSSA004785\",\"MNSSA004790\",\"MNSSA004802\",\"MNSSA004814\",\"MNSSA004826\",\"MNSSA004831\",\"MNSSA004843\",\"MNSSA004855\",\"MNSSA004860\",\"MNSSA004896\",\"MNSSA004901\",\"MNSSA004913\",\"MNSSA004925\",\"MNSSA004930\",\"MNSSA004942\",\"MNSSA004954\",\"MNSSA004966\",\"MNSSA004971\",\"MNSSA004995\",\"MNSSA005000\",\"MNSSA005012\",\"MNSSA005024\",\"MNSSA005036\",\"MNSSA005041\",\"MNSSA005053\",\"MNSSA005065\",\"MNSSA005070\",\"MNSSA005082\",\"MNSSA005094\",\"MNSSA005106\",\"MNSSA005111\",\"MNSSA005123\",\"MNSSA005135\",\"MNSSA005140\",\"MNSSA005152\",\"MNSSA005164\",\"MNSSA005176\",\"MNSSA005193\",\"MNSSA005205\",\"MNSSA005210\",\"MNSSA005222\",\"MNSSA005234\",\"MNSSA005246\",\"MNSSA016043\",\"MNSSA016055\",\"MNSSA016060\",\"MNSSA016072\",\"MNSSA016084\",\"MNSSA016096\",\"MNSSA016102\",\"MNSSA016114\",\"MNSSA016126\",\"MNSSA016131\",\"MNSSA016143\",\"MNSSA016155\",\"MNSSA016160\",\"MNSSA016171\",\"MNSSA016183\",\"MNSSA016195\",\"MNSSA016200\",\"MNSSA016212\",\"MNSSA016224\",\"MNSSA016236\",\"MNSSA016241\",\"MNSSA016253\",\"MNSSA016265\",\"MNSSA016270\",\"MNSSA016282\",\"MNSSA016294\",\"MNSSA016306\",\"MNSSA016311\",\"MNSSA016323\",\"MNSSA016335\",\"MNSSA016340\",\"MNSSA016352\",\"MNSSA016364\",\"MNSSA016393\",\"MNSSA016405\",\"MNSSA016410\",\"MNSSA016422\",\"MNSSA016451\",\"MNSSA016463\",\"MNSSA016475\",\"MNSSA016480\",\"MNSSA016492\",\"MNSSA016504\",\"MNSSA016516\",\"MNSSA016521\",\"MNSSA016533\",\"MNSSA016545\",\"MNSSA016550\",\"MNSSA016562\",\"MNSSA016574\",\"MNSSA016586\",\"MNSSA016591\",\"MNSSA016603\",\"MNSSA016615\",\"MNSSA016620\",\"MNSSA016632\",\"MNSSA016644\",\"MNSSA016656\",\"MNSSA016661\",\"MNSSA016673\",\"MNSSA016685\",\"MNSSA016690\",\"MNSSA016714\",\"MNSSA016726\",\"MNSSA016731\",\"MNSSA016743\",\"MNSSA016755\",\"MNSSA016760\",\"MNSSA016772\",\"MNSSA016784\",\"MNSSA016796\",\"MNSSA016801\",\"MNSSA016813\",\"MNSSA016825\",\"MNSSA016830\",\"MNSSA016842\",\"MNSSA016854\",\"MNSSA016866\",\"MNSSA016871\",\"MNSSA016883\",\"MNSSA016895\",\"MNSSA016900\",\"MNSSA016912\",\"MNSSA016936\",\"MNSSA016941\",\"MNSSA016953\",\"MNSSA016965\",\"MNSSA016970\",\"MNSSA016982\",\"MNSSA016994\",\"MNSSA017006\",\"MNSSA017011\",\"MNSSA017023\",\"MNSSA017035\",\"MNSSA017040\",\"MNSSA017052\",\"MNSSA017064\",\"MNSSA017076\",\"MNSSA017081\",\"MNSSA017093\",\"MNSSA017105\",\"MNSSA017110\",\"MNSSA017122\",\"MNSSA017134\",\"MNSSA017146\",\"MNSSA017151\",\"MNSSA017163\",\"MNSSA017175\",\"MNSSA017180\",\"MNSSA017192\",\"MNSSA017204\",\"MNSSA017216\",\"MNSSA017221\",\"MNSSA017233\",\"MNSSA017245\",\"MNSSA017250\",\"MNSSA017262\",\"MNSSA017274\",\"MNSSA017286\",\"MNSSA017291\",\"MNSSA017303\",\"MNSSA017315\",\"MNSSA017320\",\"MNSSA017332\",\"MNSSA017344\",\"MNSSA017356\",\"MNSSA017361\",\"MNSSA017373\",\"MNSSA017385\");\n} //fin de if($IdEstado == \"16\")\n\n//Condicion de estado-clues\nif($IdEstado == \"17\"){\n\t$Clues = array(\"MSSSA000022\",\"MSSSA000034\",\"MSSSA000046\",\"MSSSA000051\",\"MSSSA000075\",\"MSSSA000080\",\"MSSSA000092\",\"MSSSA000104\",\"MSSSA000116\",\"MSSSA000121\",\"MSSSA000133\",\"MSSSA000145\",\"MSSSA000150\",\"MSSSA000162\",\"MSSSA000174\",\"MSSSA000186\",\"MSSSA000191\",\"MSSSA000203\",\"MSSSA000215\",\"MSSSA000220\",\"MSSSA000232\",\"MSSSA000256\",\"MSSSA000261\",\"MSSSA000273\",\"MSSSA000290\",\"MSSSA000302\",\"MSSSA000314\",\"MSSSA000326\",\"MSSSA000331\",\"MSSSA000343\",\"MSSSA000355\",\"MSSSA000360\",\"MSSSA000372\",\"MSSSA000384\",\"MSSSA000396\",\"MSSSA000401\",\"MSSSA000413\",\"MSSSA000425\",\"MSSSA000430\",\"MSSSA000442\",\"MSSSA000454\",\"MSSSA000466\",\"MSSSA000471\",\"MSSSA000495\",\"MSSSA000500\",\"MSSSA000512\",\"MSSSA000524\",\"MSSSA000536\",\"MSSSA000541\",\"MSSSA000553\",\"MSSSA000565\",\"MSSSA000570\",\"MSSSA000582\",\"MSSSA000606\",\"MSSSA000611\",\"MSSSA000623\",\"MSSSA000640\",\"MSSSA000652\",\"MSSSA000664\",\"MSSSA000676\",\"MSSSA000681\",\"MSSSA000693\",\"MSSSA000710\",\"MSSSA000734\",\"MSSSA000746\",\"MSSSA000751\",\"MSSSA000763\",\"MSSSA000775\",\"MSSSA000780\",\"MSSSA000792\",\"MSSSA000804\",\"MSSSA000816\",\"MSSSA000821\",\"MSSSA000833\",\"MSSSA000845\",\"MSSSA000850\",\"MSSSA000862\",\"MSSSA000874\",\"MSSSA000886\",\"MSSSA000891\",\"MSSSA000903\",\"MSSSA000915\",\"MSSSA000932\",\"MSSSA000944\",\"MSSSA000956\",\"MSSSA000961\",\"MSSSA000973\",\"MSSSA000985\",\"MSSSA000990\",\"MSSSA001002\",\"MSSSA001031\",\"MSSSA001043\",\"MSSSA001060\",\"MSSSA001072\",\"MSSSA001084\",\"MSSSA001096\",\"MSSSA001101\",\"MSSSA001113\",\"MSSSA001125\",\"MSSSA001142\",\"MSSSA001154\",\"MSSSA001166\",\"MSSSA001171\",\"MSSSA001183\",\"MSSSA001200\",\"MSSSA001212\",\"MSSSA001236\",\"MSSSA001241\",\"MSSSA001253\",\"MSSSA001265\",\"MSSSA001270\",\"MSSSA001282\",\"MSSSA001294\",\"MSSSA001306\",\"MSSSA001311\",\"MSSSA001323\",\"MSSSA001340\",\"MSSSA001376\",\"MSSSA001381\",\"MSSSA001393\",\"MSSSA001405\",\"MSSSA001410\",\"MSSSA001422\",\"MSSSA001434\",\"MSSSA001446\",\"MSSSA001451\",\"MSSSA001463\",\"MSSSA001475\",\"MSSSA001480\",\"MSSSA001492\",\"MSSSA001504\",\"MSSSA001516\",\"MSSSA001521\",\"MSSSA001533\",\"MSSSA001545\",\"MSSSA001550\",\"MSSSA001562\",\"MSSSA001574\",\"MSSSA001586\",\"MSSSA001591\",\"MSSSA001603\",\"MSSSA001615\",\"MSSSA001620\",\"MSSSA001632\",\"MSSSA001661\",\"MSSSA001673\",\"MSSSA001685\",\"MSSSA001690\",\"MSSSA001702\",\"MSSSA001714\",\"MSSSA001726\",\"MSSSA001731\",\"MSSSA001743\",\"MSSSA001755\",\"MSSSA001760\",\"MSSSA001772\",\"MSSSA001784\",\"MSSSA001796\",\"MSSSA001801\",\"MSSSA001813\",\"MSSSA001825\",\"MSSSA001830\",\"MSSSA001842\",\"MSSSA001866\",\"MSSSA001871\",\"MSSSA001883\",\"MSSSA001895\",\"MSSSA001900\",\"MSSSA001912\",\"MSSSA001924\",\"MSSSA001941\",\"MSSSA001953\",\"MSSSA001965\",\"MSSSA001994\",\"MSSSA002006\",\"MSSSA002023\",\"MSSSA002035\",\"MSSSA002040\",\"MSSSA002052\",\"MSSSA002064\",\"MSSSA002076\",\"MSSSA002081\",\"MSSSA002093\",\"MSSSA002105\",\"MSSSA002110\",\"MSSSA002122\",\"MSSSA002134\",\"MSSSA002146\",\"MSSSA002151\",\"MSSSA002164\",\"MSSSA002176\",\"MSSSA002193\",\"MSSSA002205\",\"MSSSA002210\",\"MSSSA002222\",\"MSSSA002234\",\"MSSSA002246\",\"MSSSA002251\",\"MSSSA002275\",\"MSSSA002280\",\"MSSSA002292\",\"MSSSA002303\",\"MSSSA002315\",\"MSSSA002320\",\"MSSSA002332\",\"MSSSA002344\",\"MSSSA002356\",\"MSSSA002361\",\"MSSSA002373\",\"MSSSA002385\",\"MSSSA002390\",\"MSSSA002402\",\"MSSSA002414\",\"MSSSA002426\",\"MSSSA002431\",\"MSSSA002443\",\"MSSSA002455\",\"MSSSA002460\",\"MSSSA002472\",\"MSSSA002484\",\"MSSSA002496\",\"MSSSA002513\",\"MSSSA002525\",\"MSSSA002530\",\"MSSSA002542\",\"MSSSA002554\",\"MSSSA002566\",\"MSSSA002571\",\"MSSSA002583\",\"MSSSA002595\",\"MSSSA002612\",\"MSSSA002624\",\"MSSSA002636\",\"MSSSA002641\",\"MSSSA002653\",\"MSSSA002665\",\"MSSSA002670\",\"MSSSA002682\",\"MSSSA002694\",\"MSSSA002706\",\"MSSSA002711\",\"MSSSA002723\",\"MSSSA002735\",\"MSSSA002740\",\"MSSSA002752\",\"MSSSA002764\",\"MSSSA002776\",\"MSSSA002781\",\"MSSSA002793\",\"MSSSA002805\",\"MSSSA002810\",\"MSSSA002822\",\"MSSSA002834\",\"MSSSA002846\",\"MSSSA002851\",\"MSSSA002863\",\"MSSSA002875\",\"MSSSA002880\",\"MSSSA002892\",\"MSSSA002904\",\"MSSSA002916\");\n} //fin de if($IdEstado == \"17\")\n\n//Condicion de estado-clues\nif($IdEstado == \"18\"){\n\t$Clues = array(\"NTSSA000013\",\"NTSSA000025\",\"NTSSA000030\",\"NTSSA000042\",\"NTSSA000054\",\"NTSSA000066\",\"NTSSA000071\",\"NTSSA000083\",\"NTSSA000095\",\"NTSSA000100\",\"NTSSA000112\",\"NTSSA000124\",\"NTSSA000136\",\"NTSSA000141\",\"NTSSA000153\",\"NTSSA000165\",\"NTSSA000170\",\"NTSSA000182\",\"NTSSA000194\",\"NTSSA000206\",\"NTSSA000211\",\"NTSSA000223\",\"NTSSA000235\",\"NTSSA000240\",\"NTSSA000252\",\"NTSSA000264\",\"NTSSA000276\",\"NTSSA000281\",\"NTSSA000293\",\"NTSSA000305\",\"NTSSA000310\",\"NTSSA000322\",\"NTSSA000346\",\"NTSSA000351\",\"NTSSA000363\",\"NTSSA000375\",\"NTSSA000416\",\"NTSSA000474\",\"NTSSA000486\",\"NTSSA000491\",\"NTSSA000503\",\"NTSSA000520\",\"NTSSA000532\",\"NTSSA000544\",\"NTSSA000556\",\"NTSSA000561\",\"NTSSA000573\",\"NTSSA000585\",\"NTSSA000590\",\"NTSSA000602\",\"NTSSA000614\",\"NTSSA000626\",\"NTSSA000631\",\"NTSSA000643\",\"NTSSA000655\",\"NTSSA000660\",\"NTSSA000672\",\"NTSSA000684\",\"NTSSA000696\",\"NTSSA000701\",\"NTSSA000713\",\"NTSSA000725\",\"NTSSA000730\",\"NTSSA000742\",\"NTSSA000754\",\"NTSSA000771\",\"NTSSA000783\",\"NTSSA000795\",\"NTSSA000800\",\"NTSSA000812\",\"NTSSA000824\",\"NTSSA000836\",\"NTSSA000841\",\"NTSSA000853\",\"NTSSA000865\",\"NTSSA000870\",\"NTSSA000882\",\"NTSSA000894\",\"NTSSA000906\",\"NTSSA000911\",\"NTSSA000923\",\"NTSSA000935\",\"NTSSA000952\",\"NTSSA000964\",\"NTSSA000976\",\"NTSSA000981\",\"NTSSA001005\",\"NTSSA001010\",\"NTSSA001022\",\"NTSSA001034\",\"NTSSA001046\",\"NTSSA001051\",\"NTSSA001063\",\"NTSSA001075\",\"NTSSA001080\",\"NTSSA001092\",\"NTSSA001104\",\"NTSSA001116\",\"NTSSA001121\",\"NTSSA001133\",\"NTSSA001145\",\"NTSSA001150\",\"NTSSA001162\",\"NTSSA001174\",\"NTSSA001186\",\"NTSSA001203\",\"NTSSA001215\",\"NTSSA001220\",\"NTSSA001232\",\"NTSSA001244\",\"NTSSA001261\",\"NTSSA001273\",\"NTSSA001285\",\"NTSSA001290\",\"NTSSA001302\",\"NTSSA001314\",\"NTSSA001326\",\"NTSSA001331\",\"NTSSA001343\",\"NTSSA001355\",\"NTSSA001360\",\"NTSSA001372\",\"NTSSA001384\",\"NTSSA001396\",\"NTSSA001401\",\"NTSSA001413\",\"NTSSA001425\",\"NTSSA001430\",\"NTSSA001442\",\"NTSSA001454\",\"NTSSA001471\",\"NTSSA001483\",\"NTSSA001495\",\"NTSSA001500\",\"NTSSA001512\",\"NTSSA001524\",\"NTSSA001536\",\"NTSSA001541\",\"NTSSA001553\",\"NTSSA001565\",\"NTSSA001570\",\"NTSSA001582\",\"NTSSA001594\",\"NTSSA001611\",\"NTSSA001623\",\"NTSSA001635\",\"NTSSA001640\",\"NTSSA001652\",\"NTSSA001664\",\"NTSSA001676\",\"NTSSA001681\",\"NTSSA001693\",\"NTSSA001705\",\"NTSSA001710\",\"NTSSA001722\",\"NTSSA001734\",\"NTSSA001746\",\"NTSSA001751\",\"NTSSA001763\",\"NTSSA001775\",\"NTSSA001780\",\"NTSSA001792\",\"NTSSA001804\",\"NTSSA001816\",\"NTSSA001821\",\"NTSSA001833\",\"NTSSA001845\",\"NTSSA001850\",\"NTSSA001862\",\"NTSSA001874\",\"NTSSA001886\",\"NTSSA001891\",\"NTSSA001903\",\"NTSSA001932\",\"NTSSA001956\",\"NTSSA001985\",\"NTSSA001990\",\"NTSSA002002\",\"NTSSA002014\",\"NTSSA002026\",\"NTSSA002031\",\"NTSSA002043\",\"NTSSA002055\",\"NTSSA002060\",\"NTSSA002072\",\"NTSSA002084\",\"NTSSA002096\",\"NTSSA002101\",\"NTSSA002113\",\"NTSSA002125\",\"NTSSA002130\",\"NTSSA002142\",\"NTSSA002154\",\"NTSSA002166\",\"NTSSA002171\",\"NTSSA002183\",\"NTSSA002195\",\"NTSSA002200\",\"NTSSA002212\",\"NTSSA002224\",\"NTSSA002236\",\"NTSSA002241\",\"NTSSA002253\",\"NTSSA002265\",\"NTSSA002270\",\"NTSSA002294\",\"NTSSA002306\",\"NTSSA015064\",\"NTSSA015076\",\"NTSSA015081\",\"NTSSA015093\",\"NTSSA015105\",\"NTSSA015110\",\"NTSSA015122\",\"NTSSA015134\",\"NTSSA015146\",\"NTSSA015151\",\"NTSSA015163\",\"NTSSA015175\",\"NTSSA015192\",\"NTSSA015204\",\"NTSSA015216\",\"NTSSA015220\",\"NTSSA015232\",\"NTSSA015244\",\"NTSSA015256\",\"NTSSA015261\",\"NTSSA015273\",\"NTSSA015285\",\"NTSSA015302\",\"NTSSA015314\",\"NTSSA015326\",\"NTSSA015331\",\"NTSSA015343\",\"NTSSA015355\",\"NTSSA015360\",\"NTSSA015372\",\"NTSSA015384\",\"NTSSA015396\",\"NTSSA015401\",\"NTSSA015413\",\"NTSSA015425\",\"NTSSA015430\",\"NTSSA015442\",\"NTSSA015454\",\"NTSSA015466\",\"NTSSA015471\",\"NTSSA015483\",\"NTSSA015495\",\"NTSSA015500\",\"NTSSA015512\",\"NTSSA015524\",\"NTSSA015536\",\"NTSSA015582\",\"NTSSA015664\",\"NTSSA015676\",\"NTSSA015681\",\"NTSSA015693\",\"NTSSA015705\",\"NTSSA015710\",\"NTSSA015722\",\"NTSSA015734\",\"NTSSA015746\",\"NTSSA015751\",\"NTSSA015763\",\"NTSSA015775\",\"NTSSA015780\",\"NTSSA015792\",\"NTSSA015804\",\"NTSSA015816\",\"NTSSA015821\",\"NTSSA015833\",\"NTSSA015845\",\"NTSSA015850\",\"NTSSA015862\",\"NTSSA015874\",\"NTSSA015886\",\"NTSSA015891\",\"NTSSA015903\",\"NTSSA015915\",\"NTSSA015920\",\"NTSSA015932\",\"NTSSA016031\",\"NTSSA016043\",\"NTSSA016055\",\"NTSSA016060\",\"NTSSA016072\",\"NTSSA016084\",\"NTSSA016096\",\"NTSSA016101\",\"NTSSA016113\",\"NTSSA016125\",\"NTSSA016130\",\"NTSSA016142\");\n} //fin de if($IdEstado == \"18\")\n\n//Condicion de estado-clues\nif($IdEstado == \"19\"){\n\t$Clues = array(\"NLSSA000015\",\"NLSSA000020\",\"NLSSA000032\",\"NLSSA000044\",\"NLSSA000056\",\"NLSSA000061\",\"NLSSA000073\",\"NLSSA000085\",\"NLSSA000090\",\"NLSSA000102\",\"NLSSA000126\",\"NLSSA000131\",\"NLSSA000143\",\"NLSSA000155\",\"NLSSA000160\",\"NLSSA000172\",\"NLSSA000196\",\"NLSSA000201\",\"NLSSA000213\",\"NLSSA000225\",\"NLSSA000230\",\"NLSSA000242\",\"NLSSA000254\",\"NLSSA000266\",\"NLSSA000271\",\"NLSSA000283\",\"NLSSA000295\",\"NLSSA000300\",\"NLSSA000312\",\"NLSSA000324\",\"NLSSA000336\",\"NLSSA000341\",\"NLSSA000365\",\"NLSSA000370\",\"NLSSA000382\",\"NLSSA000394\",\"NLSSA000406\",\"NLSSA000411\",\"NLSSA000423\",\"NLSSA000435\",\"NLSSA000440\",\"NLSSA000452\",\"NLSSA000464\",\"NLSSA000476\",\"NLSSA000481\",\"NLSSA000493\",\"NLSSA000505\",\"NLSSA000510\",\"NLSSA000522\",\"NLSSA000534\",\"NLSSA000546\",\"NLSSA000551\",\"NLSSA000575\",\"NLSSA000580\",\"NLSSA000592\",\"NLSSA000604\",\"NLSSA000616\",\"NLSSA000621\",\"NLSSA000633\",\"NLSSA000645\",\"NLSSA000650\",\"NLSSA000674\",\"NLSSA000686\",\"NLSSA000691\",\"NLSSA000703\",\"NLSSA000720\",\"NLSSA000732\",\"NLSSA000744\",\"NLSSA000761\",\"NLSSA000773\",\"NLSSA000785\",\"NLSSA000790\",\"NLSSA000802\",\"NLSSA000814\",\"NLSSA000831\",\"NLSSA000843\",\"NLSSA000855\",\"NLSSA000860\",\"NLSSA000884\",\"NLSSA000896\",\"NLSSA000901\",\"NLSSA000913\",\"NLSSA000925\",\"NLSSA000930\",\"NLSSA000942\",\"NLSSA000954\",\"NLSSA000966\",\"NLSSA000971\",\"NLSSA000983\",\"NLSSA000995\",\"NLSSA001000\",\"NLSSA001012\",\"NLSSA001024\",\"NLSSA001036\",\"NLSSA001041\",\"NLSSA001053\",\"NLSSA001065\",\"NLSSA001070\",\"NLSSA001082\",\"NLSSA001094\",\"NLSSA001106\",\"NLSSA001111\",\"NLSSA001123\",\"NLSSA001135\",\"NLSSA001140\",\"NLSSA001152\",\"NLSSA001164\",\"NLSSA001176\",\"NLSSA001181\",\"NLSSA001193\",\"NLSSA001205\",\"NLSSA001210\",\"NLSSA001222\",\"NLSSA001234\",\"NLSSA001246\",\"NLSSA001251\",\"NLSSA001263\",\"NLSSA001275\",\"NLSSA001280\",\"NLSSA001292\",\"NLSSA001304\",\"NLSSA001316\",\"NLSSA001321\",\"NLSSA001333\",\"NLSSA001345\",\"NLSSA001350\",\"NLSSA001362\",\"NLSSA001374\",\"NLSSA001386\",\"NLSSA001391\",\"NLSSA001403\",\"NLSSA001415\",\"NLSSA001420\",\"NLSSA001432\",\"NLSSA001444\",\"NLSSA001456\",\"NLSSA001461\",\"NLSSA001473\",\"NLSSA001485\",\"NLSSA001490\",\"NLSSA001502\",\"NLSSA001514\",\"NLSSA001526\",\"NLSSA001531\",\"NLSSA001543\",\"NLSSA001555\",\"NLSSA001560\",\"NLSSA001584\",\"NLSSA001596\",\"NLSSA001601\",\"NLSSA001625\",\"NLSSA001630\",\"NLSSA001642\",\"NLSSA001654\",\"NLSSA001666\",\"NLSSA001671\",\"NLSSA001683\",\"NLSSA001695\",\"NLSSA001700\",\"NLSSA001712\",\"NLSSA001724\",\"NLSSA001736\",\"NLSSA001741\",\"NLSSA001753\",\"NLSSA001765\",\"NLSSA001770\",\"NLSSA001782\",\"NLSSA001794\",\"NLSSA001806\",\"NLSSA001811\",\"NLSSA001823\",\"NLSSA001835\",\"NLSSA001840\",\"NLSSA001852\",\"NLSSA001864\",\"NLSSA001876\",\"NLSSA001881\",\"NLSSA001893\",\"NLSSA001905\",\"NLSSA001910\",\"NLSSA001922\",\"NLSSA001934\",\"NLSSA001951\",\"NLSSA001963\",\"NLSSA001975\",\"NLSSA001980\",\"NLSSA001992\",\"NLSSA002004\",\"NLSSA002016\",\"NLSSA002021\",\"NLSSA002033\",\"NLSSA002045\",\"NLSSA002050\",\"NLSSA002062\",\"NLSSA002074\",\"NLSSA002086\",\"NLSSA002091\",\"NLSSA002103\",\"NLSSA002115\",\"NLSSA002120\",\"NLSSA002132\",\"NLSSA002144\",\"NLSSA002156\",\"NLSSA002161\",\"NLSSA002173\",\"NLSSA002185\",\"NLSSA002190\",\"NLSSA002202\",\"NLSSA002226\",\"NLSSA002231\",\"NLSSA002243\",\"NLSSA002255\",\"NLSSA002260\",\"NLSSA002272\",\"NLSSA002284\",\"NLSSA002296\",\"NLSSA002301\",\"NLSSA002313\",\"NLSSA002325\",\"NLSSA002330\",\"NLSSA002342\",\"NLSSA002354\",\"NLSSA002366\",\"NLSSA002371\",\"NLSSA002383\",\"NLSSA002395\",\"NLSSA002400\",\"NLSSA002412\",\"NLSSA002424\",\"NLSSA002436\",\"NLSSA002441\",\"NLSSA002453\",\"NLSSA002465\",\"NLSSA002470\",\"NLSSA002482\",\"NLSSA002494\",\"NLSSA002506\",\"NLSSA002511\",\"NLSSA002523\",\"NLSSA002535\",\"NLSSA002540\",\"NLSSA002552\",\"NLSSA002564\",\"NLSSA002576\",\"NLSSA002581\",\"NLSSA002593\",\"NLSSA002605\",\"NLSSA002610\",\"NLSSA002622\",\"NLSSA002634\",\"NLSSA002646\",\"NLSSA002651\",\"NLSSA002663\",\"NLSSA002675\",\"NLSSA002680\",\"NLSSA002692\",\"NLSSA002704\",\"NLSSA002716\",\"NLSSA002721\",\"NLSSA002733\",\"NLSSA002745\",\"NLSSA002750\",\"NLSSA002762\",\"NLSSA002774\",\"NLSSA002786\",\"NLSSA002791\",\"NLSSA002803\",\"NLSSA002815\",\"NLSSA002820\",\"NLSSA002832\",\"NLSSA002856\",\"NLSSA002861\",\"NLSSA002873\",\"NLSSA002890\",\"NLSSA002902\",\"NLSSA002914\",\"NLSSA002926\",\"NLSSA002931\",\"NLSSA002943\",\"NLSSA002955\",\"NLSSA002972\",\"NLSSA002984\",\"NLSSA002996\",\"NLSSA003001\",\"NLSSA003025\",\"NLSSA003030\",\"NLSSA003042\",\"NLSSA003054\",\"NLSSA003066\",\"NLSSA003071\",\"NLSSA003083\",\"NLSSA003100\",\"NLSSA003112\",\"NLSSA003124\",\"NLSSA003136\",\"NLSSA003141\",\"NLSSA003153\",\"NLSSA003165\",\"NLSSA003170\",\"NLSSA003182\",\"NLSSA003194\",\"NLSSA003206\",\"NLSSA003211\",\"NLSSA003223\",\"NLSSA003235\",\"NLSSA003240\",\"NLSSA003252\",\"NLSSA003264\",\"NLSSA003276\",\"NLSSA003281\",\"NLSSA003293\",\"NLSSA003305\",\"NLSSA003310\",\"NLSSA003322\",\"NLSSA003334\",\"NLSSA003346\",\"NLSSA003351\",\"NLSSA003363\",\"NLSSA003375\",\"NLSSA003380\",\"NLSSA003392\",\"NLSSA003404\",\"NLSSA003416\",\"NLSSA003421\",\"NLSSA003433\",\"NLSSA003445\",\"NLSSA003450\",\"NLSSA003462\",\"NLSSA003474\",\"NLSSA003486\",\"NLSSA003491\",\"NLSSA003503\",\"NLSSA003515\",\"NLSSA003520\",\"NLSSA003532\",\"NLSSA003544\",\"NLSSA003556\",\"NLSSA003561\",\"NLSSA003573\",\"NLSSA003585\",\"NLSSA003590\",\"NLSSA003602\",\"NLSSA003614\",\"NLSSA003626\",\"NLSSA003631\",\"NLSSA003643\",\"NLSSA003655\",\"NLSSA003660\",\"NLSSA003672\",\"NLSSA003684\",\"NLSSA003696\",\"NLSSA003701\",\"NLSSA003713\",\"NLSSA003725\",\"NLSSA003730\",\"NLSSA003754\",\"NLSSA003766\",\"NLSSA003771\",\"NLSSA003783\",\"NLSSA003795\",\"NLSSA003800\",\"NLSSA003812\",\"NLSSA003824\",\"NLSSA003836\",\"NLSSA003841\",\"NLSSA003853\",\"NLSSA003865\",\"NLSSA003870\",\"NLSSA003882\",\"NLSSA003894\",\"NLSSA003906\",\"NLSSA003911\",\"NLSSA003923\",\"NLSSA003935\",\"NLSSA003940\",\"NLSSA003952\",\"NLSSA003964\",\"NLSSA003976\",\"NLSSA003981\",\"NLSSA003993\",\"NLSSA004005\",\"NLSSA004010\",\"NLSSA004034\",\"NLSSA004046\",\"NLSSA004051\",\"NLSSA004063\",\"NLSSA004075\",\"NLSSA004080\",\"NLSSA004092\",\"NLSSA004104\",\"NLSSA004116\",\"NLSSA004121\",\"NLSSA004145\",\"NLSSA004150\",\"NLSSA004162\",\"NLSSA004186\",\"NLSSA004191\",\"NLSSA004203\",\"NLSSA004215\",\"NLSSA004220\",\"NLSSA004232\",\"NLSSA004244\",\"NLSSA004256\",\"NLSSA004261\",\"NLSSA004273\",\"NLSSA004285\",\"NLSSA004290\",\"NLSSA004302\",\"NLSSA004314\",\"NLSSA004326\",\"NLSSA004331\",\"NLSSA004343\",\"NLSSA004355\",\"NLSSA004360\",\"NLSSA004372\",\"NLSSA004384\",\"NLSSA004396\",\"NLSSA004401\",\"NLSSA004413\",\"NLSSA004425\",\"NLSSA004430\",\"NLSSA004442\",\"NLSSA004454\",\"NLSSA004466\",\"NLSSA004471\",\"NLSSA004495\",\"NLSSA004512\",\"NLSSA004524\",\"NLSSA004536\",\"NLSSA004541\",\"NLSSA004553\",\"NLSSA004565\",\"NLSSA004570\",\"NLSSA004582\",\"NLSSA004606\",\"NLSSA004664\",\"NLSSA004676\",\"NLSSA004681\",\"NLSSA004693\",\"NLSSA004751\",\"NLSSA013991\",\"NLSSA014003\",\"NLSSA014015\",\"NLSSA014020\",\"NLSSA014032\",\"NLSSA014045\",\"NLSSA014050\",\"NLSSA014062\",\"NLSSA014074\",\"NLSSA014086\",\"NLSSA014091\",\"NLSSA014103\",\"NLSSA014115\",\"NLSSA014120\",\"NLSSA014144\",\"NLSSA014156\",\"NLSSA014161\",\"NLSSA014173\",\"NLSSA014185\",\"NLSSA014190\",\"NLSSA014202\",\"NLSSA014214\",\"NLSSA014226\",\"NLSSA014231\",\"NLSSA014243\",\"NLSSA014255\",\"NLSSA014260\",\"NLSSA014271\",\"NLSSA014283\",\"NLSSA014295\",\"NLSSA014300\",\"NLSSA014324\",\"NLSSA014336\",\"NLSSA014341\",\"NLSSA014353\",\"NLSSA014365\",\"NLSSA014370\",\"NLSSA014382\",\"NLSSA014394\",\"NLSSA014406\",\"NLSSA014411\",\"NLSSA014423\",\"NLSSA014435\",\"NLSSA014440\",\"NLSSA014452\",\"NLSSA014464\",\"NLSSA014476\",\"NLSSA014493\",\"NLSSA014505\",\"NLSSA014510\",\"NLSSA014522\",\"NLSSA014534\",\"NLSSA014546\",\"NLSSA014551\",\"NLSSA014563\",\"NLSSA014575\",\"NLSSA014580\",\"NLSSA014592\",\"NLSSA014604\",\"NLSSA014616\",\"NLSSA014621\",\"NLSSA014633\",\"NLSSA014645\",\"NLSSA014650\",\"NLSSA014662\",\"NLSSA014674\",\"NLSSA014686\",\"NLSSA014691\",\"NLSSA014703\",\"NLSSA014715\",\"NLSSA014720\",\"NLSSA014732\",\"NLSSA014744\",\"NLSSA014756\",\"NLSSA014761\",\"NLSSA014773\",\"NLSSA014785\",\"NLSSA014790\",\"NLSSA014802\",\"NLSSA014814\",\"NLSSA014826\",\"NLSSA014831\",\"NLSSA014843\",\"NLSSA014855\",\"NLSSA014860\",\"NLSSA014872\",\"NLSSA014884\",\"NLSSA014896\",\"NLSSA014901\",\"NLSSA014913\",\"NLSSA014925\",\"NLSSA014930\",\"NLSSA014942\",\"NLSSA014954\",\"NLSSA014966\",\"NLSSA014971\",\"NLSSA014983\",\"NLSSA014995\",\"NLSSA015000\",\"NLSSA015012\",\"NLSSA015024\",\"NLSSA015036\",\"NLSSA015041\");\n} //fin de if($IdEstado == \"19\")\n\n//Condicion de estado-clues\nif($IdEstado == \"20\"){\n\t$Clues = array(\"OCSSA000010\",\"OCSSA000022\",\"OCSSA000034\",\"OCSSA000046\",\"OCSSA000051\",\"OCSSA000063\",\"OCSSA000075\",\"OCSSA000080\",\"OCSSA000092\",\"OCSSA000104\",\"OCSSA000116\",\"OCSSA000121\",\"OCSSA000133\",\"OCSSA000145\",\"OCSSA000150\",\"OCSSA000162\",\"OCSSA000174\",\"OCSSA000186\",\"OCSSA000191\",\"OCSSA000203\",\"OCSSA000215\",\"OCSSA000220\",\"OCSSA000232\",\"OCSSA000244\",\"OCSSA000256\",\"OCSSA000261\",\"OCSSA000273\",\"OCSSA000285\",\"OCSSA000290\",\"OCSSA000302\",\"OCSSA000314\",\"OCSSA000326\",\"OCSSA000331\",\"OCSSA000343\",\"OCSSA000355\",\"OCSSA000360\",\"OCSSA000372\",\"OCSSA000384\",\"OCSSA000396\",\"OCSSA000413\",\"OCSSA000425\",\"OCSSA000430\",\"OCSSA000454\",\"OCSSA000466\",\"OCSSA000471\",\"OCSSA000483\",\"OCSSA000495\",\"OCSSA000500\",\"OCSSA000512\",\"OCSSA000524\",\"OCSSA000536\",\"OCSSA000541\",\"OCSSA000553\",\"OCSSA000565\",\"OCSSA000570\",\"OCSSA000582\",\"OCSSA000594\",\"OCSSA000606\",\"OCSSA000611\",\"OCSSA000623\",\"OCSSA000635\",\"OCSSA000640\",\"OCSSA000652\",\"OCSSA000664\",\"OCSSA000676\",\"OCSSA000681\",\"OCSSA000693\",\"OCSSA000705\",\"OCSSA000710\",\"OCSSA000722\",\"OCSSA000734\",\"OCSSA000746\",\"OCSSA000751\",\"OCSSA000763\",\"OCSSA000775\",\"OCSSA000780\",\"OCSSA000792\",\"OCSSA000804\",\"OCSSA000816\",\"OCSSA000821\",\"OCSSA000833\",\"OCSSA000850\",\"OCSSA000862\",\"OCSSA000874\",\"OCSSA000886\",\"OCSSA000891\",\"OCSSA000903\",\"OCSSA000920\",\"OCSSA000932\",\"OCSSA000944\",\"OCSSA000956\",\"OCSSA000961\",\"OCSSA000973\",\"OCSSA000985\",\"OCSSA000990\",\"OCSSA001002\",\"OCSSA001014\",\"OCSSA001026\",\"OCSSA001031\",\"OCSSA001043\",\"OCSSA001055\",\"OCSSA001060\",\"OCSSA001072\",\"OCSSA001084\",\"OCSSA001096\",\"OCSSA001101\",\"OCSSA001113\",\"OCSSA001130\",\"OCSSA001142\",\"OCSSA001154\",\"OCSSA001166\",\"OCSSA001171\",\"OCSSA001195\",\"OCSSA001200\",\"OCSSA001212\",\"OCSSA001224\",\"OCSSA001236\",\"OCSSA001241\",\"OCSSA001253\",\"OCSSA001265\",\"OCSSA001270\",\"OCSSA001282\",\"OCSSA001294\",\"OCSSA001306\",\"OCSSA001311\",\"OCSSA001323\",\"OCSSA001335\",\"OCSSA001340\",\"OCSSA001352\",\"OCSSA001364\",\"OCSSA001376\",\"OCSSA001381\",\"OCSSA001393\",\"OCSSA001405\",\"OCSSA001410\",\"OCSSA001422\",\"OCSSA001434\",\"OCSSA001446\",\"OCSSA001451\",\"OCSSA001463\",\"OCSSA001475\",\"OCSSA001480\",\"OCSSA001492\",\"OCSSA001504\",\"OCSSA001516\",\"OCSSA001521\",\"OCSSA001533\",\"OCSSA001545\",\"OCSSA001550\",\"OCSSA001562\",\"OCSSA001574\",\"OCSSA001591\",\"OCSSA001603\",\"OCSSA001615\",\"OCSSA001620\",\"OCSSA001632\",\"OCSSA001644\",\"OCSSA001661\",\"OCSSA001673\",\"OCSSA001685\",\"OCSSA001690\",\"OCSSA001702\",\"OCSSA001714\",\"OCSSA001726\",\"OCSSA001731\",\"OCSSA001743\",\"OCSSA001755\",\"OCSSA001760\",\"OCSSA001772\",\"OCSSA001784\",\"OCSSA001796\",\"OCSSA001801\",\"OCSSA001813\",\"OCSSA001825\",\"OCSSA001830\",\"OCSSA001842\",\"OCSSA001854\",\"OCSSA001866\",\"OCSSA001871\",\"OCSSA001883\",\"OCSSA001895\",\"OCSSA001900\",\"OCSSA001912\",\"OCSSA001924\",\"OCSSA001936\",\"OCSSA001941\",\"OCSSA001953\",\"OCSSA001965\",\"OCSSA001970\",\"OCSSA001982\",\"OCSSA001994\",\"OCSSA002006\",\"OCSSA002011\",\"OCSSA002023\",\"OCSSA002035\",\"OCSSA002040\",\"OCSSA002052\",\"OCSSA002064\",\"OCSSA002076\",\"OCSSA002081\",\"OCSSA002093\",\"OCSSA002105\",\"OCSSA002110\",\"OCSSA002122\",\"OCSSA002134\",\"OCSSA002146\",\"OCSSA002151\",\"OCSSA002163\",\"OCSSA002175\",\"OCSSA002180\",\"OCSSA002192\",\"OCSSA002204\",\"OCSSA002216\",\"OCSSA002221\",\"OCSSA002233\",\"OCSSA002245\",\"OCSSA002250\",\"OCSSA002262\",\"OCSSA002274\",\"OCSSA002286\",\"OCSSA002291\",\"OCSSA002303\",\"OCSSA002315\",\"OCSSA002320\",\"OCSSA002332\",\"OCSSA002344\",\"OCSSA002356\",\"OCSSA002361\",\"OCSSA002373\",\"OCSSA002385\",\"OCSSA002390\",\"OCSSA002402\",\"OCSSA002414\",\"OCSSA002426\",\"OCSSA002431\",\"OCSSA002443\",\"OCSSA002455\",\"OCSSA002460\",\"OCSSA002472\",\"OCSSA002484\",\"OCSSA002496\",\"OCSSA002501\",\"OCSSA002513\",\"OCSSA002525\",\"OCSSA002530\",\"OCSSA002542\",\"OCSSA002554\",\"OCSSA002566\",\"OCSSA002571\",\"OCSSA002583\",\"OCSSA002595\",\"OCSSA002600\",\"OCSSA002612\",\"OCSSA002624\",\"OCSSA002636\",\"OCSSA002641\",\"OCSSA002653\",\"OCSSA002665\",\"OCSSA002670\",\"OCSSA002682\",\"OCSSA002694\",\"OCSSA002706\",\"OCSSA002711\",\"OCSSA002723\",\"OCSSA002740\",\"OCSSA002752\",\"OCSSA002764\",\"OCSSA002776\",\"OCSSA002781\",\"OCSSA002793\",\"OCSSA002805\",\"OCSSA002810\",\"OCSSA002822\",\"OCSSA002834\",\"OCSSA002846\",\"OCSSA002851\",\"OCSSA002863\",\"OCSSA002875\",\"OCSSA002880\",\"OCSSA002892\",\"OCSSA002904\",\"OCSSA002916\",\"OCSSA002921\",\"OCSSA002933\",\"OCSSA002945\",\"OCSSA002950\",\"OCSSA002962\",\"OCSSA002974\",\"OCSSA002986\",\"OCSSA002991\",\"OCSSA003003\",\"OCSSA003015\",\"OCSSA003020\",\"OCSSA003032\",\"OCSSA003044\",\"OCSSA003056\",\"OCSSA003061\",\"OCSSA003073\",\"OCSSA003085\",\"OCSSA003090\",\"OCSSA003102\",\"OCSSA003114\",\"OCSSA003126\",\"OCSSA003131\",\"OCSSA003143\",\"OCSSA003155\",\"OCSSA003160\",\"OCSSA003172\",\"OCSSA003184\",\"OCSSA003196\",\"OCSSA003201\",\"OCSSA003213\",\"OCSSA003230\",\"OCSSA003242\",\"OCSSA003254\",\"OCSSA003266\",\"OCSSA003271\",\"OCSSA003283\",\"OCSSA003295\",\"OCSSA003300\",\"OCSSA003312\",\"OCSSA003324\",\"OCSSA003336\",\"OCSSA003341\",\"OCSSA003353\",\"OCSSA003365\",\"OCSSA003370\",\"OCSSA003382\",\"OCSSA003394\",\"OCSSA003406\",\"OCSSA003411\",\"OCSSA003423\",\"OCSSA003435\",\"OCSSA003440\",\"OCSSA003452\",\"OCSSA003464\",\"OCSSA003476\",\"OCSSA003481\",\"OCSSA003493\",\"OCSSA003505\",\"OCSSA003510\",\"OCSSA003522\",\"OCSSA003534\",\"OCSSA003546\",\"OCSSA003551\",\"OCSSA003563\",\"OCSSA003575\",\"OCSSA003580\",\"OCSSA003592\",\"OCSSA003604\",\"OCSSA003616\",\"OCSSA003621\",\"OCSSA003633\",\"OCSSA003645\",\"OCSSA003662\",\"OCSSA003674\",\"OCSSA003686\",\"OCSSA003691\",\"OCSSA003703\",\"OCSSA003715\",\"OCSSA003732\",\"OCSSA003744\",\"OCSSA003756\",\"OCSSA003761\",\"OCSSA003773\",\"OCSSA003785\",\"OCSSA003790\",\"OCSSA003802\",\"OCSSA003814\",\"OCSSA003826\",\"OCSSA003831\",\"OCSSA003843\",\"OCSSA003855\",\"OCSSA003860\",\"OCSSA003872\",\"OCSSA003884\",\"OCSSA003896\",\"OCSSA003913\",\"OCSSA003925\",\"OCSSA003930\",\"OCSSA003942\",\"OCSSA003954\",\"OCSSA003966\",\"OCSSA003971\",\"OCSSA003983\",\"OCSSA003995\",\"OCSSA004000\",\"OCSSA004012\",\"OCSSA004024\",\"OCSSA004036\",\"OCSSA004041\",\"OCSSA004053\",\"OCSSA004065\",\"OCSSA004070\",\"OCSSA004082\",\"OCSSA004094\",\"OCSSA004106\",\"OCSSA004111\",\"OCSSA004123\",\"OCSSA004135\",\"OCSSA004140\",\"OCSSA004152\",\"OCSSA004176\",\"OCSSA004181\",\"OCSSA004193\",\"OCSSA004205\",\"OCSSA004210\",\"OCSSA004222\",\"OCSSA004234\",\"OCSSA004246\",\"OCSSA004251\",\"OCSSA004263\",\"OCSSA004275\",\"OCSSA004280\",\"OCSSA004292\",\"OCSSA004304\",\"OCSSA004316\",\"OCSSA004321\",\"OCSSA004333\",\"OCSSA004345\",\"OCSSA004350\",\"OCSSA004362\",\"OCSSA004374\",\"OCSSA004386\",\"OCSSA004391\",\"OCSSA004403\",\"OCSSA004415\",\"OCSSA004420\",\"OCSSA004432\",\"OCSSA004444\",\"OCSSA004456\",\"OCSSA004461\",\"OCSSA004473\",\"OCSSA004485\",\"OCSSA004490\",\"OCSSA004502\",\"OCSSA004514\",\"OCSSA004526\",\"OCSSA004531\",\"OCSSA004543\",\"OCSSA004555\",\"OCSSA004560\",\"OCSSA004572\",\"OCSSA004584\",\"OCSSA004596\",\"OCSSA004601\",\"OCSSA004613\",\"OCSSA004630\",\"OCSSA004642\",\"OCSSA004666\",\"OCSSA004683\",\"OCSSA004695\",\"OCSSA004700\",\"OCSSA004712\",\"OCSSA004724\",\"OCSSA004736\",\"OCSSA004741\",\"OCSSA004753\",\"OCSSA004765\",\"OCSSA004770\",\"OCSSA004782\",\"OCSSA004794\",\"OCSSA004806\",\"OCSSA004811\",\"OCSSA004823\",\"OCSSA004835\",\"OCSSA004840\",\"OCSSA004852\",\"OCSSA004864\",\"OCSSA004876\",\"OCSSA004881\",\"OCSSA004893\",\"OCSSA004905\",\"OCSSA004910\",\"OCSSA004922\",\"OCSSA004934\",\"OCSSA004946\",\"OCSSA004951\",\"OCSSA004963\",\"OCSSA004975\",\"OCSSA004980\",\"OCSSA004992\",\"OCSSA005004\",\"OCSSA005016\",\"OCSSA005033\",\"OCSSA005045\",\"OCSSA005050\",\"OCSSA005062\",\"OCSSA005074\",\"OCSSA005086\",\"OCSSA005091\",\"OCSSA005103\",\"OCSSA005115\",\"OCSSA005132\",\"OCSSA005144\",\"OCSSA005156\",\"OCSSA005161\",\"OCSSA005173\",\"OCSSA005185\",\"OCSSA005190\",\"OCSSA005202\",\"OCSSA005214\",\"OCSSA005226\",\"OCSSA005231\",\"OCSSA005243\",\"OCSSA005255\",\"OCSSA005260\",\"OCSSA005272\",\"OCSSA005284\",\"OCSSA005296\",\"OCSSA005301\",\"OCSSA005313\",\"OCSSA005325\",\"OCSSA005330\",\"OCSSA005342\",\"OCSSA005354\",\"OCSSA005366\",\"OCSSA005383\",\"OCSSA005395\",\"OCSSA005400\",\"OCSSA005412\",\"OCSSA005424\",\"OCSSA005436\",\"OCSSA005441\",\"OCSSA005453\",\"OCSSA005465\",\"OCSSA005470\",\"OCSSA005482\",\"OCSSA005494\",\"OCSSA005506\",\"OCSSA005511\",\"OCSSA005540\",\"OCSSA005552\",\"OCSSA005564\",\"OCSSA005576\",\"OCSSA005581\",\"OCSSA005593\",\"OCSSA005605\",\"OCSSA005610\",\"OCSSA005622\",\"OCSSA005634\",\"OCSSA005646\",\"OCSSA005651\",\"OCSSA005663\",\"OCSSA005675\",\"OCSSA005680\",\"OCSSA005692\",\"OCSSA005704\",\"OCSSA005716\",\"OCSSA005721\",\"OCSSA005733\",\"OCSSA005745\",\"OCSSA005750\",\"OCSSA005762\",\"OCSSA005774\",\"OCSSA005786\",\"OCSSA005791\",\"OCSSA005803\",\"OCSSA005815\",\"OCSSA005820\",\"OCSSA005832\",\"OCSSA005844\",\"OCSSA005861\",\"OCSSA005873\",\"OCSSA005885\",\"OCSSA005890\",\"OCSSA005902\",\"OCSSA005914\",\"OCSSA005926\",\"OCSSA005931\",\"OCSSA005943\",\"OCSSA005955\",\"OCSSA005960\",\"OCSSA005972\",\"OCSSA005984\",\"OCSSA005996\",\"OCSSA006001\",\"OCSSA006025\",\"OCSSA006030\",\"OCSSA006042\",\"OCSSA006054\",\"OCSSA006066\",\"OCSSA006071\",\"OCSSA006083\",\"OCSSA006095\",\"OCSSA006100\",\"OCSSA006112\",\"OCSSA006124\",\"OCSSA006136\",\"OCSSA006141\",\"OCSSA006153\",\"OCSSA006165\",\"OCSSA006170\",\"OCSSA006182\",\"OCSSA006206\",\"OCSSA006223\",\"OCSSA006235\",\"OCSSA006240\",\"OCSSA006252\",\"OCSSA006264\",\"OCSSA006276\",\"OCSSA006281\",\"OCSSA006293\",\"OCSSA006305\",\"OCSSA006322\",\"OCSSA006334\",\"OCSSA006346\",\"OCSSA006351\",\"OCSSA006363\",\"OCSSA006380\",\"OCSSA006392\",\"OCSSA006404\",\"OCSSA006416\",\"OCSSA006421\",\"OCSSA006433\",\"OCSSA006445\",\"OCSSA006450\",\"OCSSA006462\",\"OCSSA006474\",\"OCSSA006486\",\"OCSSA006491\",\"OCSSA006503\",\"OCSSA006515\",\"OCSSA006520\",\"OCSSA006532\",\"OCSSA006544\",\"OCSSA006556\",\"OCSSA006561\",\"OCSSA006573\",\"OCSSA006585\",\"OCSSA006590\",\"OCSSA006602\",\"OCSSA006614\",\"OCSSA006626\",\"OCSSA006631\",\"OCSSA006643\",\"OCSSA006655\",\"OCSSA006660\",\"OCSSA006672\",\"OCSSA006684\",\"OCSSA006696\",\"OCSSA006701\",\"OCSSA006725\",\"OCSSA006730\",\"OCSSA006742\",\"OCSSA006754\",\"OCSSA006766\",\"OCSSA006771\",\"OCSSA006783\",\"OCSSA006795\",\"OCSSA006800\",\"OCSSA006812\",\"OCSSA006824\",\"OCSSA006836\",\"OCSSA006841\",\"OCSSA006853\",\"OCSSA006865\",\"OCSSA006870\",\"OCSSA006882\",\"OCSSA006894\",\"OCSSA006906\",\"OCSSA006911\",\"OCSSA006923\",\"OCSSA006935\",\"OCSSA006940\",\"OCSSA006952\",\"OCSSA006964\",\"OCSSA006976\",\"OCSSA006981\",\"OCSSA006993\",\"OCSSA007005\",\"OCSSA007010\",\"OCSSA007022\",\"OCSSA007034\",\"OCSSA007046\",\"OCSSA007051\",\"OCSSA007063\",\"OCSSA007075\",\"OCSSA007080\",\"OCSSA007092\",\"OCSSA007104\",\"OCSSA007116\",\"OCSSA007121\",\"OCSSA007133\",\"OCSSA007145\",\"OCSSA007150\",\"OCSSA007162\",\"OCSSA007174\",\"OCSSA007186\",\"OCSSA007191\",\"OCSSA007203\",\"OCSSA007215\",\"OCSSA007232\",\"OCSSA007244\",\"OCSSA007256\",\"OCSSA007314\",\"OCSSA007360\",\"OCSSA007372\",\"OCSSA007384\",\"OCSSA007396\",\"OCSSA007401\",\"OCSSA007413\",\"OCSSA007425\",\"OCSSA007430\",\"OCSSA007442\",\"OCSSA007454\",\"OCSSA007466\",\"OCSSA007471\",\"OCSSA007483\",\"OCSSA007495\",\"OCSSA007500\",\"OCSSA007512\",\"OCSSA007524\",\"OCSSA007536\",\"OCSSA007541\",\"OCSSA007553\",\"OCSSA007565\",\"OCSSA007570\",\"OCSSA007582\",\"OCSSA007594\",\"OCSSA014740\",\"OCSSA014752\",\"OCSSA014764\",\"OCSSA014776\",\"OCSSA014781\",\"OCSSA014810\",\"OCSSA014822\",\"OCSSA014851\",\"OCSSA014863\",\"OCSSA014880\",\"OCSSA014892\",\"OCSSA014916\",\"OCSSA014933\",\"OCSSA014950\",\"OCSSA014974\",\"OCSSA014991\",\"OCSSA015015\",\"OCSSA015032\",\"OCSSA015044\",\"OCSSA015056\",\"OCSSA015061\",\"OCSSA015073\",\"OCSSA015085\",\"OCSSA015102\",\"OCSSA015114\",\"OCSSA015126\",\"OCSSA015131\",\"OCSSA015143\",\"OCSSA015155\",\"OCSSA015160\",\"OCSSA015172\",\"OCSSA015184\",\"OCSSA015225\",\"OCSSA015230\",\"OCSSA015266\",\"OCSSA015283\",\"OCSSA015295\",\"OCSSA015300\",\"OCSSA015312\",\"OCSSA015336\",\"OCSSA015341\",\"OCSSA015353\",\"OCSSA015365\",\"OCSSA015370\",\"OCSSA015382\",\"OCSSA015394\",\"OCSSA015406\",\"OCSSA015423\",\"OCSSA015452\",\"OCSSA015464\",\"OCSSA015481\",\"OCSSA015522\",\"OCSSA015546\",\"OCSSA015580\",\"OCSSA015592\",\"OCSSA015604\",\"OCSSA015621\",\"OCSSA015662\",\"OCSSA015703\",\"OCSSA015715\",\"OCSSA015720\",\"OCSSA015773\",\"OCSSA015785\",\"OCSSA015790\",\"OCSSA015826\",\"OCSSA015843\",\"OCSSA015855\",\"OCSSA015884\",\"OCSSA015896\",\"OCSSA015925\",\"OCSSA015930\",\"OCSSA015954\",\"OCSSA015966\",\"OCSSA015971\",\"OCSSA015983\",\"OCSSA015995\",\"OCSSA016000\",\"OCSSA016012\",\"OCSSA016036\",\"OCSSA016041\",\"OCSSA016065\",\"OCSSA016094\",\"OCSSA016106\",\"OCSSA016111\",\"OCSSA016123\",\"OCSSA016135\",\"OCSSA016152\",\"OCSSA016181\",\"OCSSA016193\",\"OCSSA016210\",\"OCSSA016222\",\"OCSSA016234\",\"OCSSA016246\",\"OCSSA016263\",\"OCSSA016280\",\"OCSSA016304\",\"OCSSA016316\",\"OCSSA016333\",\"OCSSA016345\",\"OCSSA016350\",\"OCSSA016374\",\"OCSSA016391\",\"OCSSA016403\",\"OCSSA016432\",\"OCSSA016456\",\"OCSSA016461\",\"OCSSA016473\",\"OCSSA016490\",\"OCSSA016502\",\"OCSSA016514\",\"OCSSA016526\",\"OCSSA016543\",\"OCSSA016560\",\"OCSSA016613\",\"OCSSA016642\",\"OCSSA016666\",\"OCSSA016695\",\"OCSSA016711\",\"OCSSA016723\",\"OCSSA016735\",\"OCSSA016740\",\"OCSSA016752\",\"OCSSA016764\",\"OCSSA016776\",\"OCSSA016781\",\"OCSSA016793\",\"OCSSA016805\",\"OCSSA016810\",\"OCSSA016822\",\"OCSSA016834\",\"OCSSA016846\",\"OCSSA016851\",\"OCSSA016863\",\"OCSSA016875\",\"OCSSA016880\",\"OCSSA016892\",\"OCSSA016904\",\"OCSSA016916\",\"OCSSA016921\",\"OCSSA016933\",\"OCSSA016945\",\"OCSSA016950\",\"OCSSA016962\",\"OCSSA016974\",\"OCSSA016986\",\"OCSSA016991\",\"OCSSA017003\",\"OCSSA017015\",\"OCSSA017020\",\"OCSSA017032\",\"OCSSA017044\",\"OCSSA017056\",\"OCSSA017061\",\"OCSSA017073\",\"OCSSA017085\",\"OCSSA017090\",\"OCSSA017102\",\"OCSSA017114\",\"OCSSA017126\",\"OCSSA017131\",\"OCSSA017143\",\"OCSSA017160\",\"OCSSA017172\",\"OCSSA017184\",\"OCSSA017196\",\"OCSSA017201\",\"OCSSA017213\",\"OCSSA017225\",\"OCSSA017230\",\"OCSSA017242\",\"OCSSA017254\",\"OCSSA017266\",\"OCSSA017271\",\"OCSSA017283\",\"OCSSA017295\",\"OCSSA017300\",\"OCSSA017312\",\"OCSSA017324\",\"OCSSA017336\",\"OCSSA017341\",\"OCSSA017353\",\"OCSSA017365\",\"OCSSA017370\",\"OCSSA017382\",\"OCSSA017394\",\"OCSSA017406\",\"OCSSA017411\",\"OCSSA017423\",\"OCSSA017435\",\"OCSSA017440\",\"OCSSA017452\",\"OCSSA017464\",\"OCSSA017476\",\"OCSSA017481\",\"OCSSA017493\",\"OCSSA017505\",\"OCSSA017510\",\"OCSSA017522\",\"OCSSA017534\",\"OCSSA017546\",\"OCSSA017551\",\"OCSSA017563\",\"OCSSA017575\",\"OCSSA017580\",\"OCSSA017604\",\"OCSSA017616\",\"OCSSA017621\",\"OCSSA017633\",\"OCSSA017645\",\"OCSSA017650\",\"OCSSA017662\",\"OCSSA017674\",\"OCSSA017686\",\"OCSSA017691\",\"OCSSA017703\",\"OCSSA017715\",\"OCSSA017720\",\"OCSSA017732\",\"OCSSA017744\",\"OCSSA017756\",\"OCSSA017761\",\"OCSSA017773\",\"OCSSA017785\",\"OCSSA017790\",\"OCSSA017802\",\"OCSSA017814\",\"OCSSA017826\",\"OCSSA017831\",\"OCSSA017843\",\"OCSSA017855\",\"OCSSA017860\",\"OCSSA017872\",\"OCSSA017884\",\"OCSSA017896\",\"OCSSA017901\",\"OCSSA017913\",\"OCSSA017925\",\"OCSSA017930\",\"OCSSA017942\",\"OCSSA017954\",\"OCSSA017966\",\"OCSSA017971\",\"OCSSA017983\",\"OCSSA017995\",\"OCSSA018000\",\"OCSSA018012\",\"OCSSA018024\",\"OCSSA018036\",\"OCSSA018041\",\"OCSSA018053\",\"OCSSA018065\",\"OCSSA018070\",\"OCSSA018082\",\"OCSSA018094\",\"OCSSA018106\",\"OCSSA018111\",\"OCSSA018123\",\"OCSSA018135\",\"OCSSA018140\",\"OCSSA018152\",\"OCSSA018164\",\"OCSSA018176\",\"OCSSA018181\",\"OCSSA018193\",\"OCSSA018205\",\"OCSSA018210\",\"OCSSA018222\",\"OCSSA018234\",\"OCSSA018246\",\"OCSSA018251\",\"OCSSA018263\",\"OCSSA018275\",\"OCSSA018280\",\"OCSSA018292\",\"OCSSA018304\",\"OCSSA018316\",\"OCSSA018321\",\"OCSSA018333\",\"OCSSA018345\",\"OCSSA018362\",\"OCSSA018374\",\"OCSSA018386\",\"OCSSA018391\",\"OCSSA018403\",\"OCSSA018420\",\"OCSSA018432\",\"OCSSA018444\",\"OCSSA018456\",\"OCSSA018461\",\"OCSSA018473\",\"OCSSA018485\",\"OCSSA018490\",\"OCSSA018502\",\"OCSSA018514\",\"OCSSA018526\",\"OCSSA018531\",\"OCSSA018543\",\"OCSSA018555\",\"OCSSA018560\",\"OCSSA018572\",\"OCSSA018584\",\"OCSSA018596\",\"OCSSA018601\",\"OCSSA018613\",\"OCSSA018625\",\"OCSSA018630\",\"OCSSA018642\",\"OCSSA018654\",\"OCSSA018666\",\"OCSSA018671\",\"OCSSA018683\",\"OCSSA018695\",\"OCSSA018700\",\"OCSSA018712\",\"OCSSA018724\",\"OCSSA018736\",\"OCSSA018741\",\"OCSSA018753\",\"OCSSA018770\",\"OCSSA018782\",\"OCSSA018794\",\"OCSSA018806\",\"OCSSA018811\",\"OCSSA018823\",\"OCSSA018835\",\"OCSSA018840\",\"OCSSA018852\",\"OCSSA018864\",\"OCSSA018876\",\"OCSSA018881\",\"OCSSA018893\",\"OCSSA018905\",\"OCSSA018910\",\"OCSSA018922\",\"OCSSA018934\",\"OCSSA018946\",\"OCSSA018951\",\"OCSSA018963\",\"OCSSA018975\",\"OCSSA018980\",\"OCSSA019004\",\"OCSSA019016\",\"OCSSA019021\",\"OCSSA019033\",\"OCSSA019045\",\"OCSSA019050\",\"OCSSA019062\",\"OCSSA019074\",\"OCSSA019086\",\"OCSSA019091\",\"OCSSA019103\",\"OCSSA019115\",\"OCSSA019132\",\"OCSSA019144\",\"OCSSA019156\",\"OCSSA019161\",\"OCSSA019173\",\"OCSSA019185\",\"OCSSA019190\",\"OCSSA019202\",\"OCSSA019214\",\"OCSSA019226\",\"OCSSA019231\",\"OCSSA019243\",\"OCSSA019255\",\"OCSSA019260\",\"OCSSA019272\",\"OCSSA019284\",\"OCSSA019296\",\"OCSSA019301\",\"OCSSA019313\",\"OCSSA019325\",\"OCSSA019330\",\"OCSSA019342\",\"OCSSA019354\",\"OCSSA019366\",\"OCSSA019371\",\"OCSSA019383\",\"OCSSA019395\",\"OCSSA019400\",\"OCSSA019412\",\"OCSSA019424\",\"OCSSA019436\",\"OCSSA019441\",\"OCSSA019453\",\"OCSSA019465\",\"OCSSA019470\",\"OCSSA019494\",\"OCSSA019506\",\"OCSSA019511\",\"OCSSA019523\",\"OCSSA019535\",\"OCSSA019540\",\"OCSSA019552\",\"OCSSA019564\",\"OCSSA019581\",\"OCSSA019593\",\"OCSSA019605\",\"OCSSA019610\",\"OCSSA019622\",\"OCSSA019634\",\"OCSSA019646\",\"OCSSA019651\",\"OCSSA019663\",\"OCSSA019675\",\"OCSSA019680\",\"OCSSA019692\",\"OCSSA019704\",\"OCSSA019716\",\"OCSSA019721\",\"OCSSA019733\",\"OCSSA019745\",\"OCSSA019750\",\"OCSSA019762\",\"OCSSA019774\",\"OCSSA019786\",\"OCSSA019791\",\"OCSSA019803\",\"OCSSA019815\",\"OCSSA019820\",\"OCSSA019832\",\"OCSSA019844\",\"OCSSA019856\",\"OCSSA019861\",\"OCSSA019873\",\"OCSSA019885\",\"OCSSA019890\",\"OCSSA019902\",\"OCSSA019914\",\"OCSSA019926\",\"OCSSA019955\",\"OCSSA019960\",\"OCSSA019972\",\"OCSSA019996\",\"OCSSA020001\",\"OCSSA020013\",\"OCSSA020025\",\"OCSSA020030\",\"OCSSA020042\",\"OCSSA020054\",\"OCSSA020066\",\"OCSSA020071\",\"OCSSA020083\",\"OCSSA020100\",\"OCSSA020112\",\"OCSSA020124\",\"OCSSA020136\",\"OCSSA020141\",\"OCSSA020153\",\"OCSSA020165\",\"OCSSA020170\",\"OCSSA020182\",\"OCSSA020194\",\"OCSSA020206\",\"OCSSA020211\",\"OCSSA020223\",\"OCSSA020235\",\"OCSSA020240\",\"OCSSA020252\",\"OCSSA020264\",\"OCSSA020276\",\"OCSSA020281\",\"OCSSA020293\",\"OCSSA020305\",\"OCSSA020310\",\"OCSSA020322\",\"OCSSA020334\",\"OCSSA020346\",\"OCSSA020351\",\"OCSSA020363\",\"OCSSA020375\",\"OCSSA020380\",\"OCSSA020392\",\"OCSSA020404\",\"OCSSA020416\",\"OCSSA020421\",\"OCSSA020433\",\"OCSSA020445\",\"OCSSA020450\",\"OCSSA020474\",\"OCSSA020486\",\"OCSSA020491\",\"OCSSA020515\",\"OCSSA020520\",\"OCSSA020532\",\"OCSSA020544\",\"OCSSA020556\",\"OCSSA020561\",\"OCSSA020573\",\"OCSSA020585\",\"OCSSA020590\",\"OCSSA020602\",\"OCSSA020614\",\"OCSSA020626\",\"OCSSA020631\",\"OCSSA020643\",\"OCSSA020655\",\"OCSSA020660\",\"OCSSA020672\",\"OCSSA020684\",\"OCSSA020696\",\"OCSSA020701\",\"OCSSA020713\",\"OCSSA020725\",\"OCSSA020730\",\"OCSSA020766\",\"OCSSA020771\",\"OCSSA020783\",\"OCSSA020795\",\"OCSSA020800\",\"OCSSA020812\",\"OCSSA020824\",\"OCSSA020836\",\"OCSSA020841\",\"OCSSA020865\",\"OCSSA020870\",\"OCSSA020911\",\"OCSSA020923\",\"OCSSA020935\",\"OCSSA020940\",\"OCSSA020952\",\"OCSSA020964\",\"OCSSA020976\",\"OCSSA020981\",\"OCSSA020993\",\"OCSSA021005\",\"OCSSA021010\",\"OCSSA021022\",\"OCSSA021034\",\"OCSSA021046\",\"OCSSA021051\",\"OCSSA021063\",\"OCSSA021075\",\"OCSSA021080\",\"OCSSA021092\",\"OCSSA021104\",\"OCSSA021116\",\"OCSSA021121\",\"OCSSA021133\",\"OCSSA021145\",\"OCSSA021150\",\"OCSSA021162\",\"OCSSA021174\",\"OCSSA021186\",\"OCSSA021191\",\"OCSSA021203\",\"OCSSA021215\",\"OCSSA021220\",\"OCSSA021232\",\"OCSSA021244\");\n} //fin de if($IdEstado == \"20\")\n\n//Condicion de estado-clues\nif($IdEstado == \"21\"){\n\t$Clues = array(\"PLSSA000011\",\"PLSSA000035\",\"PLSSA000052\",\"PLSSA000064\",\"PLSSA000076\",\"PLSSA000081\",\"PLSSA000122\",\"PLSSA000134\",\"PLSSA000146\",\"PLSSA000163\",\"PLSSA000175\",\"PLSSA000192\",\"PLSSA000204\",\"PLSSA000216\",\"PLSSA000221\",\"PLSSA000233\",\"PLSSA000245\",\"PLSSA000250\",\"PLSSA000262\",\"PLSSA000274\",\"PLSSA000291\",\"PLSSA000303\",\"PLSSA000315\",\"PLSSA000320\",\"PLSSA000332\",\"PLSSA000344\",\"PLSSA000356\",\"PLSSA000361\",\"PLSSA000373\",\"PLSSA000385\",\"PLSSA000390\",\"PLSSA000414\",\"PLSSA000426\",\"PLSSA000431\",\"PLSSA000443\",\"PLSSA000455\",\"PLSSA000460\",\"PLSSA000472\",\"PLSSA000484\",\"PLSSA000496\",\"PLSSA000501\",\"PLSSA000513\",\"PLSSA000525\",\"PLSSA000530\",\"PLSSA000542\",\"PLSSA000554\",\"PLSSA000566\",\"PLSSA000571\",\"PLSSA000583\",\"PLSSA000595\",\"PLSSA000600\",\"PLSSA000612\",\"PLSSA000624\",\"PLSSA000636\",\"PLSSA000641\",\"PLSSA000653\",\"PLSSA000665\",\"PLSSA000670\",\"PLSSA000682\",\"PLSSA000694\",\"PLSSA000706\",\"PLSSA000711\",\"PLSSA000723\",\"PLSSA000735\",\"PLSSA000752\",\"PLSSA000764\",\"PLSSA000776\",\"PLSSA000781\",\"PLSSA000793\",\"PLSSA000805\",\"PLSSA000810\",\"PLSSA000822\",\"PLSSA000834\",\"PLSSA000846\",\"PLSSA000851\",\"PLSSA000863\",\"PLSSA000880\",\"PLSSA000892\",\"PLSSA000904\",\"PLSSA000916\",\"PLSSA000921\",\"PLSSA000933\",\"PLSSA000945\",\"PLSSA000950\",\"PLSSA000962\",\"PLSSA000974\",\"PLSSA000986\",\"PLSSA000991\",\"PLSSA001003\",\"PLSSA001015\",\"PLSSA001020\",\"PLSSA001032\",\"PLSSA001044\",\"PLSSA001056\",\"PLSSA001061\",\"PLSSA001073\",\"PLSSA001085\",\"PLSSA001114\",\"PLSSA001126\",\"PLSSA001131\",\"PLSSA001143\",\"PLSSA001155\",\"PLSSA001160\",\"PLSSA001172\",\"PLSSA001184\",\"PLSSA001196\",\"PLSSA001201\",\"PLSSA001213\",\"PLSSA001225\",\"PLSSA001230\",\"PLSSA001242\",\"PLSSA001254\",\"PLSSA001266\",\"PLSSA001271\",\"PLSSA001283\",\"PLSSA001295\",\"PLSSA001300\",\"PLSSA001312\",\"PLSSA001324\",\"PLSSA001336\",\"PLSSA001341\",\"PLSSA001353\",\"PLSSA001365\",\"PLSSA001370\",\"PLSSA001382\",\"PLSSA001394\",\"PLSSA001406\",\"PLSSA001411\",\"PLSSA001423\",\"PLSSA001435\",\"PLSSA001493\",\"PLSSA001505\",\"PLSSA001510\",\"PLSSA001522\",\"PLSSA001534\",\"PLSSA001546\",\"PLSSA001551\",\"PLSSA001563\",\"PLSSA001575\",\"PLSSA001580\",\"PLSSA001592\",\"PLSSA001604\",\"PLSSA001616\",\"PLSSA001621\",\"PLSSA001645\",\"PLSSA001662\",\"PLSSA001674\",\"PLSSA001686\",\"PLSSA001691\",\"PLSSA001703\",\"PLSSA001715\",\"PLSSA001720\",\"PLSSA001732\",\"PLSSA001744\",\"PLSSA001756\",\"PLSSA001761\",\"PLSSA001773\",\"PLSSA001802\",\"PLSSA001814\",\"PLSSA001826\",\"PLSSA001831\",\"PLSSA001843\",\"PLSSA001855\",\"PLSSA001860\",\"PLSSA001872\",\"PLSSA001913\",\"PLSSA001925\",\"PLSSA001930\",\"PLSSA001942\",\"PLSSA001954\",\"PLSSA001966\",\"PLSSA001971\",\"PLSSA001983\",\"PLSSA001995\",\"PLSSA002000\",\"PLSSA002012\",\"PLSSA002024\",\"PLSSA002036\",\"PLSSA002041\",\"PLSSA002053\",\"PLSSA002065\",\"PLSSA002070\",\"PLSSA002094\",\"PLSSA002106\",\"PLSSA002123\",\"PLSSA002135\",\"PLSSA002140\",\"PLSSA002152\",\"PLSSA002164\",\"PLSSA002176\",\"PLSSA002181\",\"PLSSA002193\",\"PLSSA002205\",\"PLSSA002210\",\"PLSSA002222\",\"PLSSA002234\",\"PLSSA002246\",\"PLSSA002251\",\"PLSSA002263\",\"PLSSA002275\",\"PLSSA002280\",\"PLSSA002292\",\"PLSSA002304\",\"PLSSA002316\",\"PLSSA002321\",\"PLSSA002333\",\"PLSSA002345\",\"PLSSA002350\",\"PLSSA002362\",\"PLSSA002374\",\"PLSSA002386\",\"PLSSA002403\",\"PLSSA002415\",\"PLSSA002420\",\"PLSSA002432\",\"PLSSA002444\",\"PLSSA002461\",\"PLSSA002473\",\"PLSSA002485\",\"PLSSA002490\",\"PLSSA002502\",\"PLSSA002514\",\"PLSSA002526\",\"PLSSA002531\",\"PLSSA002543\",\"PLSSA002683\",\"PLSSA002695\",\"PLSSA002700\",\"PLSSA002712\",\"PLSSA002724\",\"PLSSA002736\",\"PLSSA002741\",\"PLSSA002753\",\"PLSSA002765\",\"PLSSA002770\",\"PLSSA002782\",\"PLSSA002794\",\"PLSSA002806\",\"PLSSA002811\",\"PLSSA002823\",\"PLSSA002835\",\"PLSSA002840\",\"PLSSA002852\",\"PLSSA002864\",\"PLSSA002876\",\"PLSSA002881\",\"PLSSA002893\",\"PLSSA002905\",\"PLSSA002910\",\"PLSSA002934\",\"PLSSA002946\",\"PLSSA002951\",\"PLSSA002963\",\"PLSSA002975\",\"PLSSA002980\",\"PLSSA002992\",\"PLSSA003004\",\"PLSSA003021\",\"PLSSA003033\",\"PLSSA003045\",\"PLSSA003050\",\"PLSSA003062\",\"PLSSA003074\",\"PLSSA003086\",\"PLSSA003091\",\"PLSSA003103\",\"PLSSA003115\",\"PLSSA003120\",\"PLSSA003132\",\"PLSSA003156\",\"PLSSA003161\",\"PLSSA003173\",\"PLSSA003185\",\"PLSSA003190\",\"PLSSA003214\",\"PLSSA003226\",\"PLSSA003231\",\"PLSSA003243\",\"PLSSA003255\",\"PLSSA003260\",\"PLSSA003284\",\"PLSSA003296\",\"PLSSA003301\",\"PLSSA003325\",\"PLSSA003330\",\"PLSSA003342\",\"PLSSA003354\",\"PLSSA003366\",\"PLSSA003371\",\"PLSSA003383\",\"PLSSA003400\",\"PLSSA003412\",\"PLSSA003424\",\"PLSSA003441\",\"PLSSA003453\",\"PLSSA003465\",\"PLSSA003470\",\"PLSSA003482\",\"PLSSA003494\",\"PLSSA003506\",\"PLSSA003523\",\"PLSSA003535\",\"PLSSA003540\",\"PLSSA003552\",\"PLSSA003581\",\"PLSSA003593\",\"PLSSA003605\",\"PLSSA003610\",\"PLSSA003622\",\"PLSSA003634\",\"PLSSA003646\",\"PLSSA003651\",\"PLSSA003663\",\"PLSSA003716\",\"PLSSA003721\",\"PLSSA003733\",\"PLSSA003745\",\"PLSSA003750\",\"PLSSA003762\",\"PLSSA003774\",\"PLSSA003786\",\"PLSSA003791\",\"PLSSA003803\",\"PLSSA003815\",\"PLSSA003832\",\"PLSSA003856\",\"PLSSA003861\",\"PLSSA003873\",\"PLSSA003885\",\"PLSSA003890\",\"PLSSA003902\",\"PLSSA003914\",\"PLSSA003926\",\"PLSSA003931\",\"PLSSA003943\",\"PLSSA003955\",\"PLSSA003972\",\"PLSSA003984\",\"PLSSA003996\",\"PLSSA004001\",\"PLSSA004013\",\"PLSSA004025\",\"PLSSA004042\",\"PLSSA004054\",\"PLSSA004066\",\"PLSSA004071\",\"PLSSA004083\",\"PLSSA004095\",\"PLSSA004100\",\"PLSSA004112\",\"PLSSA004136\",\"PLSSA004141\",\"PLSSA004153\",\"PLSSA004165\",\"PLSSA004170\",\"PLSSA004182\",\"PLSSA004194\",\"PLSSA004206\",\"PLSSA004211\",\"PLSSA004223\",\"PLSSA004235\",\"PLSSA004240\",\"PLSSA004252\",\"PLSSA004264\",\"PLSSA004276\",\"PLSSA004281\",\"PLSSA004293\",\"PLSSA004305\",\"PLSSA004310\",\"PLSSA004322\",\"PLSSA004334\",\"PLSSA004346\",\"PLSSA004351\",\"PLSSA004363\",\"PLSSA004375\",\"PLSSA004380\",\"PLSSA004404\",\"PLSSA004416\",\"PLSSA004421\",\"PLSSA004433\",\"PLSSA004445\",\"PLSSA004450\",\"PLSSA004462\",\"PLSSA004474\",\"PLSSA004486\",\"PLSSA004491\",\"PLSSA004503\",\"PLSSA004515\",\"PLSSA004520\",\"PLSSA004532\",\"PLSSA004544\",\"PLSSA004556\",\"PLSSA004561\",\"PLSSA004573\",\"PLSSA004585\",\"PLSSA004590\",\"PLSSA004602\",\"PLSSA004614\",\"PLSSA004626\",\"PLSSA004631\",\"PLSSA004643\",\"PLSSA004655\",\"PLSSA004660\",\"PLSSA004672\",\"PLSSA004684\",\"PLSSA004696\",\"PLSSA004701\",\"PLSSA004713\",\"PLSSA004725\",\"PLSSA004730\",\"PLSSA004742\",\"PLSSA004754\",\"PLSSA004766\",\"PLSSA004771\",\"PLSSA004783\",\"PLSSA004795\",\"PLSSA004800\",\"PLSSA004812\",\"PLSSA004865\",\"PLSSA004870\",\"PLSSA004882\",\"PLSSA004894\",\"PLSSA004906\",\"PLSSA004911\",\"PLSSA004923\",\"PLSSA004935\",\"PLSSA004940\",\"PLSSA004964\",\"PLSSA004976\",\"PLSSA004981\",\"PLSSA004993\",\"PLSSA005005\",\"PLSSA005010\",\"PLSSA005022\",\"PLSSA005034\",\"PLSSA005046\",\"PLSSA005051\",\"PLSSA005063\",\"PLSSA005075\",\"PLSSA005080\",\"PLSSA005092\",\"PLSSA005104\",\"PLSSA005116\",\"PLSSA005121\",\"PLSSA005133\",\"PLSSA005145\",\"PLSSA005150\",\"PLSSA005162\",\"PLSSA005174\",\"PLSSA005186\",\"PLSSA005191\",\"PLSSA005203\",\"PLSSA005215\",\"PLSSA005220\",\"PLSSA005232\",\"PLSSA005244\",\"PLSSA005256\",\"PLSSA005261\",\"PLSSA005273\",\"PLSSA005285\",\"PLSSA005290\",\"PLSSA005302\",\"PLSSA005314\",\"PLSSA005326\",\"PLSSA005331\",\"PLSSA005355\",\"PLSSA005360\",\"PLSSA005384\",\"PLSSA005396\",\"PLSSA005401\",\"PLSSA005413\",\"PLSSA005425\",\"PLSSA005430\",\"PLSSA005442\",\"PLSSA005454\",\"PLSSA005466\",\"PLSSA005471\",\"PLSSA005483\",\"PLSSA005495\",\"PLSSA005500\",\"PLSSA005512\",\"PLSSA005524\",\"PLSSA005536\",\"PLSSA005541\",\"PLSSA005553\",\"PLSSA005565\",\"PLSSA005570\",\"PLSSA005582\",\"PLSSA005594\",\"PLSSA005606\",\"PLSSA005611\",\"PLSSA005623\",\"PLSSA005635\",\"PLSSA005640\",\"PLSSA005652\",\"PLSSA005664\",\"PLSSA005676\",\"PLSSA005681\",\"PLSSA005693\",\"PLSSA005705\",\"PLSSA005710\",\"PLSSA005722\",\"PLSSA005734\",\"PLSSA005746\",\"PLSSA005816\",\"PLSSA005821\",\"PLSSA005833\",\"PLSSA005845\",\"PLSSA005850\",\"PLSSA005862\",\"PLSSA014641\",\"PLSSA014653\",\"PLSSA014665\",\"PLSSA014670\",\"PLSSA014683\",\"PLSSA014695\",\"PLSSA014700\",\"PLSSA014712\",\"PLSSA014724\",\"PLSSA014736\",\"PLSSA014741\",\"PLSSA014753\",\"PLSSA014765\",\"PLSSA014770\",\"PLSSA014782\",\"PLSSA014794\",\"PLSSA014806\",\"PLSSA014811\",\"PLSSA014823\",\"PLSSA014835\",\"PLSSA014840\",\"PLSSA014852\",\"PLSSA014864\",\"PLSSA014876\",\"PLSSA014881\",\"PLSSA014893\",\"PLSSA014905\",\"PLSSA014910\",\"PLSSA014922\",\"PLSSA015016\",\"PLSSA015021\",\"PLSSA015032\",\"PLSSA015044\",\"PLSSA015056\",\"PLSSA015061\",\"PLSSA015085\",\"PLSSA015090\",\"PLSSA015102\",\"PLSSA015114\",\"PLSSA015126\",\"PLSSA015131\",\"PLSSA015143\",\"PLSSA015155\",\"PLSSA015160\",\"PLSSA015172\",\"PLSSA015184\",\"PLSSA015196\",\"PLSSA015201\",\"PLSSA015213\",\"PLSSA015225\",\"PLSSA015230\",\"PLSSA015242\",\"PLSSA015254\",\"PLSSA015266\",\"PLSSA015271\",\"PLSSA015283\",\"PLSSA015295\",\"PLSSA015300\",\"PLSSA015312\",\"PLSSA015324\",\"PLSSA015336\",\"PLSSA015341\",\"PLSSA015353\",\"PLSSA015365\",\"PLSSA015370\",\"PLSSA015382\",\"PLSSA015394\",\"PLSSA015406\",\"PLSSA015411\",\"PLSSA015423\",\"PLSSA015435\",\"PLSSA015440\",\"PLSSA015452\",\"PLSSA015464\",\"PLSSA015476\",\"PLSSA015481\",\"PLSSA015493\",\"PLSSA015505\",\"PLSSA015510\",\"PLSSA015522\",\"PLSSA015534\",\"PLSSA015546\",\"PLSSA015551\",\"PLSSA015563\",\"PLSSA015575\",\"PLSSA015580\",\"PLSSA015592\",\"PLSSA015604\",\"PLSSA015616\",\"PLSSA015621\",\"PLSSA015633\",\"PLSSA015645\",\"PLSSA015650\",\"PLSSA015662\",\"PLSSA015674\",\"PLSSA015686\",\"PLSSA015691\",\"PLSSA015703\",\"PLSSA015715\",\"PLSSA015720\",\"PLSSA015732\",\"PLSSA015744\",\"PLSSA015756\",\"PLSSA015761\",\"PLSSA015773\",\"PLSSA015785\",\"PLSSA015790\",\"PLSSA015802\",\"PLSSA015814\",\"PLSSA015826\",\"PLSSA015831\",\"PLSSA015843\",\"PLSSA015855\",\"PLSSA015860\",\"PLSSA015872\",\"PLSSA015884\",\"PLSSA015896\",\"PLSSA015901\",\"PLSSA015913\",\"PLSSA015925\",\"PLSSA015930\",\"PLSSA015942\",\"PLSSA015954\",\"PLSSA015966\",\"PLSSA015971\",\"PLSSA015983\",\"PLSSA015995\",\"PLSSA016000\",\"PLSSA016012\",\"PLSSA016024\",\"PLSSA016036\",\"PLSSA016041\",\"PLSSA016053\",\"PLSSA016065\",\"PLSSA016070\",\"PLSSA016082\",\"PLSSA016094\",\"PLSSA016106\",\"PLSSA016111\",\"PLSSA016123\",\"PLSSA016135\",\"PLSSA016140\",\"PLSSA016152\",\"PLSSA016164\",\"PLSSA016176\",\"PLSSA016181\",\"PLSSA016193\",\"PLSSA016205\",\"PLSSA016210\",\"PLSSA016222\",\"PLSSA016234\",\"PLSSA016246\",\"PLSSA016251\",\"PLSSA016263\",\"PLSSA016275\",\"PLSSA016280\",\"PLSSA016292\",\"PLSSA016304\",\"PLSSA016316\",\"PLSSA016321\",\"PLSSA016333\",\"PLSSA016345\",\"PLSSA016350\",\"PLSSA016362\",\"PLSSA016374\",\"PLSSA016386\",\"PLSSA016391\",\"PLSSA016403\",\"PLSSA016415\",\"PLSSA016420\",\"PLSSA016432\",\"PLSSA016444\",\"PLSSA016456\",\"PLSSA016461\",\"PLSSA016473\",\"PLSSA016485\",\"PLSSA016490\",\"PLSSA016502\",\"PLSSA016514\",\"PLSSA016526\",\"PLSSA016531\",\"PLSSA016543\",\"PLSSA016555\",\"PLSSA016560\",\"PLSSA016572\",\"PLSSA016584\",\"PLSSA016596\",\"PLSSA016601\",\"PLSSA016613\",\"PLSSA016625\",\"PLSSA016630\",\"PLSSA016642\",\"PLSSA016654\",\"PLSSA016666\",\"PLSSA016671\",\"PLSSA016683\",\"PLSSA016695\",\"PLSSA016700\",\"PLSSA016712\",\"PLSSA016724\",\"PLSSA016736\",\"PLSSA016741\",\"PLSSA016753\",\"PLSSA016765\",\"PLSSA016770\",\"PLSSA016782\",\"PLSSA016794\",\"PLSSA016806\",\"PLSSA016811\",\"PLSSA016823\",\"PLSSA016835\",\"PLSSA016840\",\"PLSSA016852\",\"PLSSA016864\",\"PLSSA016876\",\"PLSSA016881\",\"PLSSA016893\",\"PLSSA016905\",\"PLSSA016910\",\"PLSSA016922\",\"PLSSA016934\",\"PLSSA016946\",\"PLSSA016951\",\"PLSSA016963\",\"PLSSA016975\",\"PLSSA016980\",\"PLSSA016992\",\"PLSSA017004\",\"PLSSA017016\");\n} //fin de if($IdEstado == \"21\")\n\n//Condicion de estado-clues\nif($IdEstado == \"22\"){\n\t$Clues = array(\"QTSSA000014\",\"QTSSA000031\",\"QTSSA000043\",\"QTSSA000055\",\"QTSSA000060\",\"QTSSA000072\",\"QTSSA000084\",\"QTSSA000096\",\"QTSSA000101\",\"QTSSA000113\",\"QTSSA000125\",\"QTSSA000130\",\"QTSSA000142\",\"QTSSA000166\",\"QTSSA000171\",\"QTSSA000183\",\"QTSSA000200\",\"QTSSA000212\",\"QTSSA000236\",\"QTSSA000253\",\"QTSSA000282\",\"QTSSA000294\",\"QTSSA000311\",\"QTSSA000323\",\"QTSSA000352\",\"QTSSA000364\",\"QTSSA000376\",\"QTSSA000405\",\"QTSSA000434\",\"QTSSA000446\",\"QTSSA000463\",\"QTSSA000475\",\"QTSSA000480\",\"QTSSA000492\",\"QTSSA000516\",\"QTSSA000521\",\"QTSSA000533\",\"QTSSA000545\",\"QTSSA000550\",\"QTSSA000562\",\"QTSSA000574\",\"QTSSA000586\",\"QTSSA000591\",\"QTSSA000603\",\"QTSSA000615\",\"QTSSA000620\",\"QTSSA000632\",\"QTSSA000644\",\"QTSSA000656\",\"QTSSA000673\",\"QTSSA000685\",\"QTSSA000714\",\"QTSSA000726\",\"QTSSA000731\",\"QTSSA000755\",\"QTSSA000760\",\"QTSSA000772\",\"QTSSA000784\",\"QTSSA000796\",\"QTSSA000830\",\"QTSSA000842\",\"QTSSA000854\",\"QTSSA000866\",\"QTSSA000871\",\"QTSSA000883\",\"QTSSA000895\",\"QTSSA000912\",\"QTSSA000924\",\"QTSSA000936\",\"QTSSA000941\",\"QTSSA000953\",\"QTSSA000970\",\"QTSSA000982\",\"QTSSA000994\",\"QTSSA001006\",\"QTSSA001011\",\"QTSSA001023\",\"QTSSA001035\",\"QTSSA001040\",\"QTSSA001052\",\"QTSSA001064\",\"QTSSA001076\",\"QTSSA001093\",\"QTSSA001105\",\"QTSSA001110\",\"QTSSA001122\",\"QTSSA001134\",\"QTSSA001146\",\"QTSSA001151\",\"QTSSA001163\",\"QTSSA001175\",\"QTSSA001192\",\"QTSSA001204\",\"QTSSA001216\",\"QTSSA001221\",\"QTSSA001233\",\"QTSSA001245\",\"QTSSA001250\",\"QTSSA001274\",\"QTSSA001286\",\"QTSSA001291\",\"QTSSA001303\",\"QTSSA001315\",\"QTSSA001332\",\"QTSSA001344\",\"QTSSA001356\",\"QTSSA001373\",\"QTSSA001390\",\"QTSSA001402\",\"QTSSA001414\",\"QTSSA001426\",\"QTSSA001431\",\"QTSSA001443\",\"QTSSA001460\",\"QTSSA001472\",\"QTSSA001484\",\"QTSSA001496\",\"QTSSA001501\",\"QTSSA001513\",\"QTSSA001525\",\"QTSSA001530\",\"QTSSA001542\",\"QTSSA001554\",\"QTSSA001566\",\"QTSSA001583\",\"QTSSA001595\",\"QTSSA001600\",\"QTSSA001612\",\"QTSSA001624\",\"QTSSA001636\",\"QTSSA001641\",\"QTSSA001653\",\"QTSSA001665\",\"QTSSA001682\",\"QTSSA001694\",\"QTSSA001706\",\"QTSSA001711\",\"QTSSA001723\",\"QTSSA001735\",\"QTSSA001740\",\"QTSSA001752\",\"QTSSA001764\",\"QTSSA001793\",\"QTSSA001805\",\"QTSSA001810\",\"QTSSA001822\",\"QTSSA001834\",\"QTSSA001846\",\"QTSSA001863\",\"QTSSA001875\",\"QTSSA001880\",\"QTSSA001904\",\"QTSSA001916\",\"QTSSA001921\",\"QTSSA001933\",\"QTSSA001945\",\"QTSSA001962\",\"QTSSA001974\",\"QTSSA002003\",\"QTSSA002015\",\"QTSSA002020\",\"QTSSA002044\",\"QTSSA002061\",\"QTSSA002073\",\"QTSSA002085\",\"QTSSA002090\",\"QTSSA002102\",\"QTSSA002114\",\"QTSSA002160\",\"QTSSA002172\",\"QTSSA002184\",\"QTSSA002196\",\"QTSSA002213\",\"QTSSA002225\",\"QTSSA002230\",\"QTSSA002242\",\"QTSSA002266\",\"QTSSA002271\",\"QTSSA002283\",\"QTSSA002300\",\"QTSSA002312\",\"QTSSA002324\",\"QTSSA002336\",\"QTSSA002341\",\"QTSSA002353\",\"QTSSA002370\",\"QTSSA002382\",\"QTSSA002394\",\"QTSSA002406\",\"QTSSA002411\",\"QTSSA002435\",\"QTSSA002452\",\"QTSSA002464\",\"QTSSA002476\",\"QTSSA002481\",\"QTSSA002493\",\"QTSSA002505\",\"QTSSA002522\",\"QTSSA002534\",\"QTSSA002546\",\"QTSSA002551\",\"QTSSA012101\",\"QTSSA012113\",\"QTSSA012125\",\"QTSSA012130\",\"QTSSA012142\",\"QTSSA012154\",\"QTSSA012166\",\"QTSSA012171\",\"QTSSA012183\",\"QTSSA012195\",\"QTSSA012200\",\"QTSSA012212\",\"QTSSA012224\",\"QTSSA012236\",\"QTSSA012240\",\"QTSSA012252\",\"QTSSA012264\",\"QTSSA012276\",\"QTSSA012281\",\"QTSSA012293\",\"QTSSA012305\",\"QTSSA012310\",\"QTSSA012322\",\"QTSSA012334\",\"QTSSA012346\",\"QTSSA012351\",\"QTSSA012363\",\"QTSSA012380\",\"QTSSA012392\",\"QTSSA012404\",\"QTSSA012416\",\"QTSSA012421\",\"QTSSA012433\",\"QTSSA012445\",\"QTSSA012450\",\"QTSSA012462\",\"QTSSA012474\",\"QTSSA012486\",\"QTSSA012491\",\"QTSSA012503\",\"QTSSA012515\",\"QTSSA012520\",\"QTSSA012532\",\"QTSSA012544\",\"QTSSA012556\",\"QTSSA012561\",\"QTSSA012573\",\"QTSSA012585\",\"QTSSA012590\",\"QTSSA012602\",\"QTSSA012614\",\"QTSSA012626\",\"QTSSA012631\",\"QTSSA012643\",\"QTSSA012655\",\"QTSSA012660\",\"QTSSA012672\",\"QTSSA012684\",\"QTSSA012696\",\"QTSSA012725\",\"QTSSA012730\",\"QTSSA012742\",\"QTSSA012754\",\"QTSSA012766\",\"QTSSA012771\",\"QTSSA012783\",\"QTSSA012795\",\"QTSSA012800\",\"QTSSA012812\",\"QTSSA012824\",\"QTSSA012836\",\"QTSSA012841\",\"QTSSA012853\",\"QTSSA012865\",\"QTSSA012870\",\"QTSSA012882\",\"QTSSA012894\",\"QTSSA012906\",\"QTSSA012911\",\"QTSSA012923\",\"QTSSA012935\",\"QTSSA012940\",\"QTSSA012952\",\"QTSSA012964\");\n} //fin de if($IdEstado == \"22\")\n\n//Condicion de estado-clues\nif($IdEstado == \"23\"){\n\t$Clues = array(\"QRSSA000011\",\"QRSSA000023\",\"QRSSA000035\",\"QRSSA000040\",\"QRSSA000052\",\"QRSSA000064\",\"QRSSA000076\",\"QRSSA000081\",\"QRSSA000093\",\"QRSSA000105\",\"QRSSA000110\",\"QRSSA000122\",\"QRSSA000134\",\"QRSSA000146\",\"QRSSA000151\",\"QRSSA000163\",\"QRSSA000175\",\"QRSSA000180\",\"QRSSA000192\",\"QRSSA000204\",\"QRSSA000233\",\"QRSSA000245\",\"QRSSA000250\",\"QRSSA000262\",\"QRSSA000274\",\"QRSSA000286\",\"QRSSA000291\",\"QRSSA000303\",\"QRSSA000315\",\"QRSSA000320\",\"QRSSA000332\",\"QRSSA000344\",\"QRSSA000356\",\"QRSSA000361\",\"QRSSA000373\",\"QRSSA000390\",\"QRSSA000402\",\"QRSSA000414\",\"QRSSA000426\",\"QRSSA000431\",\"QRSSA000443\",\"QRSSA000455\",\"QRSSA000460\",\"QRSSA000472\",\"QRSSA000484\",\"QRSSA000496\",\"QRSSA000501\",\"QRSSA000525\",\"QRSSA000530\",\"QRSSA000542\",\"QRSSA000554\",\"QRSSA000566\",\"QRSSA000571\",\"QRSSA000583\",\"QRSSA000595\",\"QRSSA000600\",\"QRSSA000612\",\"QRSSA000624\",\"QRSSA000636\",\"QRSSA000641\",\"QRSSA000653\",\"QRSSA000665\",\"QRSSA000670\",\"QRSSA000682\",\"QRSSA000694\",\"QRSSA000706\",\"QRSSA000711\",\"QRSSA000723\",\"QRSSA000735\",\"QRSSA000740\",\"QRSSA000752\",\"QRSSA000764\",\"QRSSA000776\",\"QRSSA000781\",\"QRSSA000793\",\"QRSSA000805\",\"QRSSA000810\",\"QRSSA000822\",\"QRSSA000834\",\"QRSSA000846\",\"QRSSA000851\",\"QRSSA000863\",\"QRSSA000875\",\"QRSSA000880\",\"QRSSA000904\",\"QRSSA000916\",\"QRSSA000933\",\"QRSSA000945\",\"QRSSA000950\",\"QRSSA000962\",\"QRSSA000974\",\"QRSSA000986\",\"QRSSA000991\",\"QRSSA001003\",\"QRSSA001020\",\"QRSSA001044\",\"QRSSA001056\",\"QRSSA001061\",\"QRSSA001073\",\"QRSSA001085\",\"QRSSA001102\",\"QRSSA001114\",\"QRSSA001126\",\"QRSSA001131\",\"QRSSA001143\",\"QRSSA001155\",\"QRSSA001160\",\"QRSSA001172\",\"QRSSA001184\",\"QRSSA001196\",\"QRSSA001201\",\"QRSSA001213\",\"QRSSA001225\",\"QRSSA001230\",\"QRSSA001300\",\"QRSSA001411\",\"QRSSA001423\",\"QRSSA001435\",\"QRSSA001440\",\"QRSSA001452\",\"QRSSA001464\",\"QRSSA001476\",\"QRSSA001481\",\"QRSSA001493\",\"QRSSA001505\",\"QRSSA001510\",\"QRSSA001522\",\"QRSSA001534\",\"QRSSA001546\",\"QRSSA001551\",\"QRSSA001563\",\"QRSSA001575\",\"QRSSA001580\",\"QRSSA001592\",\"QRSSA001650\",\"QRSSA001662\",\"QRSSA001674\",\"QRSSA001715\",\"QRSSA001720\",\"QRSSA001732\",\"QRSSA017470\",\"QRSSA017482\",\"QRSSA017494\",\"QRSSA017506\",\"QRSSA017523\",\"QRSSA017535\",\"QRSSA017552\",\"QRSSA017564\",\"QRSSA017576\",\"QRSSA017581\",\"QRSSA017593\",\"QRSSA017605\",\"QRSSA017610\",\"QRSSA017622\",\"QRSSA017634\",\"QRSSA017646\",\"QRSSA017651\",\"QRSSA017663\",\"QRSSA017675\",\"QRSSA017680\",\"QRSSA017692\",\"QRSSA017704\",\"QRSSA017716\",\"QRSSA017721\",\"QRSSA017733\",\"QRSSA017745\",\"QRSSA017750\",\"QRSSA017762\",\"QRSSA017774\",\"QRSSA017786\",\"QRSSA017791\",\"QRSSA017803\",\"QRSSA017815\",\"QRSSA017820\",\"QRSSA017832\",\"QRSSA017844\",\"QRSSA017861\",\"QRSSA017873\",\"QRSSA017885\",\"QRSSA017890\",\"QRSSA017902\",\"QRSSA017914\",\"QRSSA017926\",\"QRSSA017931\",\"QRSSA017943\",\"QRSSA017955\",\"QRSSA017960\",\"QRSSA017972\",\"QRSSA017984\",\"QRSSA017996\",\"QRSSA018001\",\"QRSSA018013\",\"QRSSA018025\",\"QRSSA018030\",\"QRSSA018042\",\"QRSSA018054\");\n} //fin de if($IdEstado == \"23\")\n\n//Condicion de estado-clues\nif($IdEstado == \"24\"){\n\t$Clues = array(\"SPSSA000011\",\"SPSSA000023\",\"SPSSA000035\",\"SPSSA000040\",\"SPSSA000052\",\"SPSSA000064\",\"SPSSA000076\",\"SPSSA000081\",\"SPSSA000093\",\"SPSSA000105\",\"SPSSA000110\",\"SPSSA000122\",\"SPSSA000134\",\"SPSSA000146\",\"SPSSA000151\",\"SPSSA000163\",\"SPSSA000175\",\"SPSSA000180\",\"SPSSA000192\",\"SPSSA000204\",\"SPSSA000216\",\"SPSSA000221\",\"SPSSA000233\",\"SPSSA000245\",\"SPSSA000250\",\"SPSSA000262\",\"SPSSA000274\",\"SPSSA000286\",\"SPSSA000291\",\"SPSSA000303\",\"SPSSA000315\",\"SPSSA000320\",\"SPSSA000332\",\"SPSSA000344\",\"SPSSA000356\",\"SPSSA000361\",\"SPSSA000373\",\"SPSSA000385\",\"SPSSA000390\",\"SPSSA000402\",\"SPSSA000414\",\"SPSSA000426\",\"SPSSA000431\",\"SPSSA000455\",\"SPSSA000460\",\"SPSSA000472\",\"SPSSA000484\",\"SPSSA000496\",\"SPSSA000501\",\"SPSSA000513\",\"SPSSA000525\",\"SPSSA000530\",\"SPSSA000542\",\"SPSSA000554\",\"SPSSA000566\",\"SPSSA000571\",\"SPSSA000583\",\"SPSSA000595\",\"SPSSA000600\",\"SPSSA000612\",\"SPSSA000624\",\"SPSSA000636\",\"SPSSA000641\",\"SPSSA000653\",\"SPSSA000665\",\"SPSSA000670\",\"SPSSA000682\",\"SPSSA000694\",\"SPSSA000706\",\"SPSSA000711\",\"SPSSA000723\",\"SPSSA000735\",\"SPSSA000740\",\"SPSSA000752\",\"SPSSA000764\",\"SPSSA000776\",\"SPSSA000781\",\"SPSSA000793\",\"SPSSA000805\",\"SPSSA000810\",\"SPSSA000822\",\"SPSSA000834\",\"SPSSA000846\",\"SPSSA000851\",\"SPSSA000863\",\"SPSSA000875\",\"SPSSA000880\",\"SPSSA000892\",\"SPSSA000904\",\"SPSSA000921\",\"SPSSA000933\",\"SPSSA000945\",\"SPSSA000950\",\"SPSSA000962\",\"SPSSA000974\",\"SPSSA000986\",\"SPSSA000991\",\"SPSSA001003\",\"SPSSA001015\",\"SPSSA001020\",\"SPSSA001032\",\"SPSSA001044\",\"SPSSA001056\",\"SPSSA001061\",\"SPSSA001073\",\"SPSSA001085\",\"SPSSA001102\",\"SPSSA001114\",\"SPSSA001126\",\"SPSSA001143\",\"SPSSA001160\",\"SPSSA001172\",\"SPSSA001184\",\"SPSSA001196\",\"SPSSA001201\",\"SPSSA001213\",\"SPSSA001225\",\"SPSSA001230\",\"SPSSA001242\",\"SPSSA001254\",\"SPSSA001266\",\"SPSSA001271\",\"SPSSA001283\",\"SPSSA001295\",\"SPSSA001300\",\"SPSSA001312\",\"SPSSA001324\",\"SPSSA001336\",\"SPSSA001341\",\"SPSSA001353\",\"SPSSA001365\",\"SPSSA001370\",\"SPSSA001382\",\"SPSSA001394\",\"SPSSA001406\",\"SPSSA001411\",\"SPSSA001423\",\"SPSSA001435\",\"SPSSA001440\",\"SPSSA001452\",\"SPSSA001464\",\"SPSSA001476\",\"SPSSA001481\",\"SPSSA001493\",\"SPSSA001505\",\"SPSSA001510\",\"SPSSA001522\",\"SPSSA001534\",\"SPSSA001551\",\"SPSSA001563\",\"SPSSA001575\",\"SPSSA001592\",\"SPSSA001604\",\"SPSSA001616\",\"SPSSA001621\",\"SPSSA001633\",\"SPSSA001645\",\"SPSSA001650\",\"SPSSA001662\",\"SPSSA001674\",\"SPSSA001686\",\"SPSSA001691\",\"SPSSA001703\",\"SPSSA001720\",\"SPSSA001732\",\"SPSSA001756\",\"SPSSA001761\",\"SPSSA001773\",\"SPSSA001785\",\"SPSSA001802\",\"SPSSA001814\",\"SPSSA001826\",\"SPSSA001831\",\"SPSSA001843\",\"SPSSA001855\",\"SPSSA001860\",\"SPSSA001872\",\"SPSSA001884\",\"SPSSA001896\",\"SPSSA001901\",\"SPSSA001913\",\"SPSSA001925\",\"SPSSA001930\",\"SPSSA001942\",\"SPSSA001954\",\"SPSSA001971\",\"SPSSA001983\",\"SPSSA001995\",\"SPSSA002000\",\"SPSSA002012\",\"SPSSA002024\",\"SPSSA002036\",\"SPSSA002041\",\"SPSSA002053\",\"SPSSA002065\",\"SPSSA002070\",\"SPSSA002082\",\"SPSSA002094\",\"SPSSA002106\",\"SPSSA002111\",\"SPSSA002123\",\"SPSSA002135\",\"SPSSA002140\",\"SPSSA002152\",\"SPSSA002164\",\"SPSSA002176\",\"SPSSA002181\",\"SPSSA002193\",\"SPSSA002205\",\"SPSSA002210\",\"SPSSA002222\",\"SPSSA002234\",\"SPSSA002246\",\"SPSSA002251\",\"SPSSA002263\",\"SPSSA002275\",\"SPSSA002280\",\"SPSSA002292\",\"SPSSA002304\",\"SPSSA002316\",\"SPSSA002321\",\"SPSSA002333\",\"SPSSA002345\",\"SPSSA002350\",\"SPSSA002362\",\"SPSSA002374\",\"SPSSA002386\",\"SPSSA002391\",\"SPSSA002403\",\"SPSSA002415\",\"SPSSA002420\",\"SPSSA002432\",\"SPSSA002444\",\"SPSSA002456\",\"SPSSA002461\",\"SPSSA002473\",\"SPSSA002485\",\"SPSSA002490\",\"SPSSA002502\",\"SPSSA002514\",\"SPSSA002526\",\"SPSSA002531\",\"SPSSA002543\",\"SPSSA002555\",\"SPSSA002560\",\"SPSSA002572\",\"SPSSA002584\",\"SPSSA002596\",\"SPSSA002601\",\"SPSSA002613\",\"SPSSA002625\",\"SPSSA002630\",\"SPSSA002642\",\"SPSSA002654\",\"SPSSA002666\",\"SPSSA002671\",\"SPSSA002683\",\"SPSSA002695\",\"SPSSA002700\",\"SPSSA002712\",\"SPSSA002724\",\"SPSSA002736\",\"SPSSA002741\",\"SPSSA002753\",\"SPSSA002765\",\"SPSSA002770\",\"SPSSA002782\",\"SPSSA002794\",\"SPSSA002806\",\"SPSSA002811\",\"SPSSA002823\",\"SPSSA002835\",\"SPSSA002840\",\"SPSSA002852\",\"SPSSA002864\",\"SPSSA002876\",\"SPSSA002881\",\"SPSSA002893\",\"SPSSA002905\",\"SPSSA002910\",\"SPSSA002922\",\"SPSSA002951\",\"SPSSA002963\",\"SPSSA002975\",\"SPSSA016823\",\"SPSSA016835\",\"SPSSA016841\",\"SPSSA016853\",\"SPSSA016865\",\"SPSSA016870\",\"SPSSA016882\",\"SPSSA016894\",\"SPSSA016906\",\"SPSSA016911\",\"SPSSA016923\",\"SPSSA016935\",\"SPSSA016940\",\"SPSSA016952\",\"SPSSA016964\",\"SPSSA016976\",\"SPSSA016981\",\"SPSSA016993\",\"SPSSA017005\",\"SPSSA017010\",\"SPSSA017022\",\"SPSSA017034\",\"SPSSA017046\",\"SPSSA017051\",\"SPSSA017062\",\"SPSSA017074\",\"SPSSA017086\",\"SPSSA017091\",\"SPSSA017103\",\"SPSSA017115\",\"SPSSA017120\",\"SPSSA017132\",\"SPSSA017144\",\"SPSSA017156\",\"SPSSA017161\",\"SPSSA017173\",\"SPSSA017185\",\"SPSSA017190\",\"SPSSA017202\",\"SPSSA017214\",\"SPSSA017226\",\"SPSSA017231\",\"SPSSA017243\",\"SPSSA017255\",\"SPSSA017260\",\"SPSSA017272\",\"SPSSA017284\",\"SPSSA017296\",\"SPSSA017301\",\"SPSSA017313\",\"SPSSA017325\",\"SPSSA017330\",\"SPSSA017342\",\"SPSSA017354\",\"SPSSA017366\",\"SPSSA017371\",\"SPSSA017383\",\"SPSSA017395\",\"SPSSA017400\",\"SPSSA017412\",\"SPSSA017424\",\"SPSSA017436\",\"SPSSA017441\",\"SPSSA017453\",\"SPSSA017465\",\"SPSSA017470\",\"SPSSA017482\",\"SPSSA017494\",\"SPSSA017506\",\"SPSSA017511\",\"SPSSA017523\",\"SPSSA017535\",\"SPSSA017540\");\n} //fin de if($IdEstado == \"24\")\n\n//Condicion de estado-clues\nif($IdEstado == \"25\"){\n\t$Clues = array(\"SLSSA000024\",\"SLSSA000036\",\"SLSSA000041\",\"SLSSA000053\",\"SLSSA000065\",\"SLSSA000070\",\"SLSSA000082\",\"SLSSA000094\",\"SLSSA000106\",\"SLSSA000111\",\"SLSSA000123\",\"SLSSA000135\",\"SLSSA000140\",\"SLSSA000152\",\"SLSSA000164\",\"SLSSA000176\",\"SLSSA000181\",\"SLSSA000193\",\"SLSSA000205\",\"SLSSA000210\",\"SLSSA000222\",\"SLSSA000234\",\"SLSSA000246\",\"SLSSA000251\",\"SLSSA000263\",\"SLSSA000275\",\"SLSSA000280\",\"SLSSA000292\",\"SLSSA000304\",\"SLSSA000316\",\"SLSSA000321\",\"SLSSA000333\",\"SLSSA000345\",\"SLSSA000350\",\"SLSSA000362\",\"SLSSA000374\",\"SLSSA000386\",\"SLSSA000391\",\"SLSSA000403\",\"SLSSA000415\",\"SLSSA000420\",\"SLSSA000432\",\"SLSSA000444\",\"SLSSA000456\",\"SLSSA000473\",\"SLSSA000485\",\"SLSSA000490\",\"SLSSA000502\",\"SLSSA000514\",\"SLSSA000526\",\"SLSSA000531\",\"SLSSA000543\",\"SLSSA000555\",\"SLSSA000560\",\"SLSSA000572\",\"SLSSA000584\",\"SLSSA000596\",\"SLSSA000601\",\"SLSSA000613\",\"SLSSA000625\",\"SLSSA000630\",\"SLSSA000642\",\"SLSSA000666\",\"SLSSA000671\",\"SLSSA000683\",\"SLSSA000695\",\"SLSSA000700\",\"SLSSA000712\",\"SLSSA000724\",\"SLSSA000736\",\"SLSSA000741\",\"SLSSA000753\",\"SLSSA000765\",\"SLSSA000770\",\"SLSSA000782\",\"SLSSA000794\",\"SLSSA000806\",\"SLSSA000811\",\"SLSSA000823\",\"SLSSA000835\",\"SLSSA000840\",\"SLSSA000852\",\"SLSSA000864\",\"SLSSA000876\",\"SLSSA000881\",\"SLSSA000893\",\"SLSSA000905\",\"SLSSA000910\",\"SLSSA000922\",\"SLSSA000934\",\"SLSSA000946\",\"SLSSA000951\",\"SLSSA000963\",\"SLSSA000980\",\"SLSSA000992\",\"SLSSA001004\",\"SLSSA001016\",\"SLSSA001021\",\"SLSSA001033\",\"SLSSA001045\",\"SLSSA001050\",\"SLSSA001062\",\"SLSSA001074\",\"SLSSA001086\",\"SLSSA001091\",\"SLSSA001103\",\"SLSSA001115\",\"SLSSA001120\",\"SLSSA001132\",\"SLSSA001144\",\"SLSSA001156\",\"SLSSA001161\",\"SLSSA001173\",\"SLSSA001185\",\"SLSSA001190\",\"SLSSA001202\",\"SLSSA001214\",\"SLSSA001226\",\"SLSSA001255\",\"SLSSA001260\",\"SLSSA001272\",\"SLSSA001284\",\"SLSSA001296\",\"SLSSA001301\",\"SLSSA001313\",\"SLSSA001325\",\"SLSSA001330\",\"SLSSA001342\",\"SLSSA001354\",\"SLSSA001366\",\"SLSSA001371\",\"SLSSA001383\",\"SLSSA001395\",\"SLSSA001400\",\"SLSSA001412\",\"SLSSA001424\",\"SLSSA001436\",\"SLSSA001441\",\"SLSSA001453\",\"SLSSA001465\",\"SLSSA001470\",\"SLSSA001482\",\"SLSSA001494\",\"SLSSA001506\",\"SLSSA001511\",\"SLSSA001523\",\"SLSSA001540\",\"SLSSA001552\",\"SLSSA001564\",\"SLSSA001576\",\"SLSSA001581\",\"SLSSA001593\",\"SLSSA001605\",\"SLSSA001610\",\"SLSSA001622\",\"SLSSA001634\",\"SLSSA001646\",\"SLSSA001651\",\"SLSSA001663\",\"SLSSA001675\",\"SLSSA001680\",\"SLSSA001692\",\"SLSSA001704\",\"SLSSA001716\",\"SLSSA001721\",\"SLSSA001733\",\"SLSSA001745\",\"SLSSA001750\",\"SLSSA001762\",\"SLSSA001774\",\"SLSSA001786\",\"SLSSA001791\",\"SLSSA001803\",\"SLSSA001815\",\"SLSSA001820\",\"SLSSA001832\",\"SLSSA001844\",\"SLSSA001856\",\"SLSSA001861\",\"SLSSA001873\",\"SLSSA001885\",\"SLSSA001902\",\"SLSSA001914\",\"SLSSA001926\",\"SLSSA001931\",\"SLSSA001943\",\"SLSSA001955\",\"SLSSA001960\",\"SLSSA001972\",\"SLSSA001984\",\"SLSSA001996\",\"SLSSA002001\",\"SLSSA002013\",\"SLSSA002025\",\"SLSSA002030\",\"SLSSA002042\",\"SLSSA002054\",\"SLSSA002066\",\"SLSSA002071\",\"SLSSA002083\",\"SLSSA002095\",\"SLSSA002100\",\"SLSSA002112\",\"SLSSA002124\",\"SLSSA002136\",\"SLSSA002141\",\"SLSSA002153\",\"SLSSA002165\",\"SLSSA002170\",\"SLSSA002182\",\"SLSSA002194\",\"SLSSA002206\",\"SLSSA002211\",\"SLSSA002223\",\"SLSSA002235\",\"SLSSA002240\",\"SLSSA002252\",\"SLSSA002264\",\"SLSSA002276\",\"SLSSA002281\",\"SLSSA002293\",\"SLSSA002305\",\"SLSSA002310\",\"SLSSA002351\",\"SLSSA002363\",\"SLSSA002380\",\"SLSSA002392\",\"SLSSA002404\",\"SLSSA002416\",\"SLSSA002445\",\"SLSSA002450\",\"SLSSA002462\",\"SLSSA002474\",\"SLSSA002486\",\"SLSSA002491\",\"SLSSA002503\",\"SLSSA002515\",\"SLSSA002532\",\"SLSSA002544\",\"SLSSA017273\",\"SLSSA017285\",\"SLSSA017314\",\"SLSSA017320\",\"SLSSA017332\",\"SLSSA017344\",\"SLSSA017356\",\"SLSSA017361\",\"SLSSA017373\",\"SLSSA017385\",\"SLSSA017390\",\"SLSSA017402\",\"SLSSA017414\",\"SLSSA017426\",\"SLSSA017431\",\"SLSSA017443\",\"SLSSA017455\",\"SLSSA017460\",\"SLSSA017472\",\"SLSSA017484\",\"SLSSA017496\",\"SLSSA017501\",\"SLSSA017513\",\"SLSSA017524\",\"SLSSA017536\",\"SLSSA017541\",\"SLSSA017553\",\"SLSSA017565\",\"SLSSA017570\",\"SLSSA017582\",\"SLSSA017594\",\"SLSSA017606\",\"SLSSA017611\",\"SLSSA017623\",\"SLSSA017635\",\"SLSSA017640\",\"SLSSA017652\",\"SLSSA017664\",\"SLSSA017676\",\"SLSSA017681\",\"SLSSA017693\",\"SLSSA017705\",\"SLSSA017710\",\"SLSSA017722\",\"SLSSA017734\",\"SLSSA017746\",\"SLSSA017751\",\"SLSSA017763\",\"SLSSA017775\",\"SLSSA017780\",\"SLSSA017792\",\"SLSSA017804\",\"SLSSA017816\",\"SLSSA017821\",\"SLSSA017833\",\"SLSSA017845\",\"SLSSA017850\",\"SLSSA017862\",\"SLSSA017874\",\"SLSSA017886\",\"SLSSA017891\",\"SLSSA017903\",\"SLSSA017944\",\"SLSSA017956\",\"SLSSA017961\",\"SLSSA017973\",\"SLSSA017985\",\"SLSSA017990\",\"SLSSA018002\",\"SLSSA018014\",\"SLSSA018026\",\"SLSSA018031\",\"SLSSA018043\",\"SLSSA018055\",\"SLSSA018060\",\"SLSSA018072\",\"SLSSA018084\",\"SLSSA018096\",\"SLSSA018101\",\"SLSSA018113\",\"SLSSA018125\",\"SLSSA018130\",\"SLSSA018142\",\"SLSSA018154\",\"SLSSA018166\",\"SLSSA018183\",\"SLSSA018195\",\"SLSSA018200\",\"SLSSA018212\",\"SLSSA018224\",\"SLSSA018236\",\"SLSSA018241\",\"SLSSA018253\",\"SLSSA018265\",\"SLSSA018270\",\"SLSSA018282\",\"SLSSA018294\",\"SLSSA018306\",\"SLSSA018311\",\"SLSSA018323\",\"SLSSA018335\",\"SLSSA018340\",\"SLSSA018352\",\"SLSSA018364\",\"SLSSA018376\",\"SLSSA018381\",\"SLSSA018393\",\"SLSSA018405\",\"SLSSA018410\",\"SLSSA018422\",\"SLSSA018446\");\n} //fin de if($IdEstado == \"25\")\n\n//Condicion de estado-clues\nif($IdEstado == \"26\"){\n\t$Clues = array(\"SRSSA000014\",\"SRSSA000026\",\"SRSSA000043\",\"SRSSA000055\",\"SRSSA000060\",\"SRSSA000072\",\"SRSSA000084\",\"SRSSA000096\",\"SRSSA000101\",\"SRSSA000113\",\"SRSSA000125\",\"SRSSA000130\",\"SRSSA000142\",\"SRSSA000154\",\"SRSSA000166\",\"SRSSA000171\",\"SRSSA000183\",\"SRSSA000195\",\"SRSSA000200\",\"SRSSA000212\",\"SRSSA000224\",\"SRSSA000236\",\"SRSSA000241\",\"SRSSA000253\",\"SRSSA000265\",\"SRSSA000270\",\"SRSSA000282\",\"SRSSA000294\",\"SRSSA000306\",\"SRSSA000311\",\"SRSSA000323\",\"SRSSA000335\",\"SRSSA000340\",\"SRSSA000352\",\"SRSSA000364\",\"SRSSA000376\",\"SRSSA000381\",\"SRSSA000393\",\"SRSSA000405\",\"SRSSA000410\",\"SRSSA000416\",\"SRSSA000434\",\"SRSSA000446\",\"SRSSA000451\",\"SRSSA000463\",\"SRSSA000475\",\"SRSSA000480\",\"SRSSA000492\",\"SRSSA000504\",\"SRSSA000521\",\"SRSSA000545\",\"SRSSA000550\",\"SRSSA000562\",\"SRSSA000574\",\"SRSSA000586\",\"SRSSA000591\",\"SRSSA000603\",\"SRSSA000615\",\"SRSSA000620\",\"SRSSA000632\",\"SRSSA000644\",\"SRSSA000656\",\"SRSSA000661\",\"SRSSA000673\",\"SRSSA000685\",\"SRSSA000690\",\"SRSSA000702\",\"SRSSA000714\",\"SRSSA000726\",\"SRSSA000731\",\"SRSSA000743\",\"SRSSA000755\",\"SRSSA000760\",\"SRSSA000772\",\"SRSSA000784\",\"SRSSA000796\",\"SRSSA000801\",\"SRSSA000813\",\"SRSSA000825\",\"SRSSA000830\",\"SRSSA000842\",\"SRSSA000854\",\"SRSSA000866\",\"SRSSA000871\",\"SRSSA000883\",\"SRSSA000895\",\"SRSSA000900\",\"SRSSA000912\",\"SRSSA000924\",\"SRSSA000936\",\"SRSSA000941\",\"SRSSA000953\",\"SRSSA000965\",\"SRSSA000970\",\"SRSSA000982\",\"SRSSA000994\",\"SRSSA001006\",\"SRSSA001011\",\"SRSSA001023\",\"SRSSA001035\",\"SRSSA001040\",\"SRSSA001052\",\"SRSSA001064\",\"SRSSA001081\",\"SRSSA001093\",\"SRSSA001105\",\"SRSSA001110\",\"SRSSA001122\",\"SRSSA001134\",\"SRSSA001146\",\"SRSSA001151\",\"SRSSA001163\",\"SRSSA001180\",\"SRSSA001192\",\"SRSSA001204\",\"SRSSA001216\",\"SRSSA001221\",\"SRSSA001233\",\"SRSSA001245\",\"SRSSA001250\",\"SRSSA001262\",\"SRSSA001274\",\"SRSSA001286\",\"SRSSA001291\",\"SRSSA001303\",\"SRSSA001315\",\"SRSSA001320\",\"SRSSA001332\",\"SRSSA001344\",\"SRSSA001356\",\"SRSSA001361\",\"SRSSA001385\",\"SRSSA001390\",\"SRSSA001402\",\"SRSSA001414\",\"SRSSA001426\",\"SRSSA001431\",\"SRSSA001443\",\"SRSSA001455\",\"SRSSA001460\",\"SRSSA001472\",\"SRSSA001484\",\"SRSSA001496\",\"SRSSA001501\",\"SRSSA001513\",\"SRSSA001525\",\"SRSSA001530\",\"SRSSA001542\",\"SRSSA001554\",\"SRSSA001566\",\"SRSSA001571\",\"SRSSA001583\",\"SRSSA001595\",\"SRSSA001600\",\"SRSSA001612\",\"SRSSA001624\",\"SRSSA001636\",\"SRSSA001641\",\"SRSSA001653\",\"SRSSA001665\",\"SRSSA001670\",\"SRSSA001682\",\"SRSSA001694\",\"SRSSA001706\",\"SRSSA001711\",\"SRSSA001723\",\"SRSSA001735\",\"SRSSA001740\",\"SRSSA001752\",\"SRSSA001764\",\"SRSSA001776\",\"SRSSA001781\",\"SRSSA001793\",\"SRSSA001805\",\"SRSSA001810\",\"SRSSA001822\",\"SRSSA001834\",\"SRSSA001846\",\"SRSSA001851\",\"SRSSA001863\",\"SRSSA001875\",\"SRSSA001880\",\"SRSSA001892\",\"SRSSA001904\",\"SRSSA001916\",\"SRSSA001921\",\"SRSSA001933\",\"SRSSA001945\",\"SRSSA001950\",\"SRSSA001962\",\"SRSSA001974\",\"SRSSA001986\",\"SRSSA001991\",\"SRSSA002003\",\"SRSSA002015\",\"SRSSA002020\",\"SRSSA002032\",\"SRSSA002044\",\"SRSSA002056\",\"SRSSA002061\",\"SRSSA002073\",\"SRSSA002085\",\"SRSSA002090\",\"SRSSA002102\",\"SRSSA002114\",\"SRSSA002126\",\"SRSSA002131\",\"SRSSA002143\",\"SRSSA002155\",\"SRSSA002160\",\"SRSSA002172\",\"SRSSA002184\",\"SRSSA002198\",\"SRSSA002201\",\"SRSSA002213\",\"SRSSA002225\",\"SRSSA002230\",\"SRSSA002242\",\"SRSSA002254\",\"SRSSA002266\",\"SRSSA002271\",\"SRSSA002283\",\"SRSSA002295\",\"SRSSA002300\",\"SRSSA002312\",\"SRSSA002324\",\"SRSSA002336\",\"SRSSA002341\",\"SRSSA002353\",\"SRSSA002365\",\"SRSSA002370\",\"SRSSA002382\",\"SRSSA002394\",\"SRSSA002406\",\"SRSSA002411\",\"SRSSA002423\",\"SRSSA002435\",\"SRSSA002440\",\"SRSSA002452\",\"SRSSA002464\",\"SRSSA002476\",\"SRSSA002481\",\"SRSSA002493\",\"SRSSA002505\",\"SRSSA002510\",\"SRSSA002551\",\"SRSSA002575\",\"SRSSA002580\",\"SRSSA002592\",\"SRSSA002604\",\"SRSSA002616\",\"SRSSA002621\",\"SRSSA002633\",\"SRSSA002645\",\"SRSSA002650\",\"SRSSA002662\",\"SRSSA002674\",\"SRSSA002686\",\"SRSSA002691\",\"SRSSA002703\",\"SRSSA002715\",\"SRSSA002720\",\"SRSSA002732\",\"SRSSA002744\",\"SRSSA002756\",\"SRSSA002773\",\"SRSSA002790\",\"SRSSA002802\",\"SRSSA002814\",\"SRSSA002826\",\"SRSSA002843\",\"SRSSA002884\",\"SRSSA002913\",\"SRSSA002925\",\"SRSSA002930\",\"SRSSA002954\",\"SRSSA002966\",\"SRSSA002971\",\"SRSSA002983\",\"SRSSA003000\",\"SRSSA003012\",\"SRSSA003024\",\"SRSSA003036\",\"SRSSA003065\",\"SRSSA003082\",\"SRSSA003140\",\"SRSSA003152\",\"SRSSA003176\",\"SRSSA003251\",\"SRSSA003263\",\"SRSSA003292\",\"SRSSA003304\",\"SRSSA003316\",\"SRSSA003362\",\"SRSSA003374\",\"SRSSA003391\",\"SRSSA003420\",\"SRSSA003432\",\"SRSSA003444\",\"SRSSA003456\",\"SRSSA003461\",\"SRSSA003473\",\"SRSSA003502\",\"SRSSA003514\",\"SRSSA003526\",\"SRSSA003531\",\"SRSSA003543\",\"SRSSA003555\",\"SRSSA003560\",\"SRSSA003572\",\"SRSSA003625\",\"SRSSA003630\",\"SRSSA003654\",\"SRSSA003671\",\"SRSSA003695\",\"SRSSA003700\",\"SRSSA003712\",\"SRSSA003736\",\"SRSSA003741\",\"SRSSA003765\",\"SRSSA003770\",\"SRSSA003782\",\"SRSSA003794\",\"SRSSA003806\",\"SRSSA003811\",\"SRSSA003823\",\"SRSSA003840\",\"SRSSA003852\",\"SRSSA003881\",\"SRSSA003893\",\"SRSSA003905\",\"SRSSA003934\",\"SRSSA004004\",\"SRSSA004021\",\"SRSSA004033\",\"SRSSA004045\",\"SRSSA004062\",\"SRSSA004103\",\"SRSSA004115\",\"SRSSA004120\",\"SRSSA004144\",\"SRSSA004173\",\"SRSSA004190\",\"SRSSA004202\",\"SRSSA004214\",\"SRSSA004226\",\"SRSSA004231\",\"SRSSA004243\",\"SRSSA004255\",\"SRSSA004260\",\"SRSSA004272\",\"SRSSA004284\",\"SRSSA004296\",\"SRSSA004301\",\"SRSSA004313\",\"SRSSA004325\",\"SRSSA004330\",\"SRSSA004342\",\"SRSSA004366\",\"SRSSA004371\",\"SRSSA004383\",\"SRSSA004395\",\"SRSSA004400\",\"SRSSA004412\",\"SRSSA004424\",\"SRSSA004436\",\"SRSSA004453\",\"SRSSA004465\",\"SRSSA004482\",\"SRSSA004494\",\"SRSSA004506\",\"SRSSA004511\",\"SRSSA004523\",\"SRSSA004535\",\"SRSSA004540\",\"SRSSA004552\",\"SRSSA004564\",\"SRSSA004576\",\"SRSSA004581\",\"SRSSA004593\",\"SRSSA004605\",\"SRSSA004610\",\"SRSSA004622\",\"SRSSA004634\",\"SRSSA004646\",\"SRSSA004651\",\"SRSSA004663\",\"SRSSA004675\",\"SRSSA004692\",\"SRSSA004704\",\"SRSSA004716\",\"SRSSA004733\",\"SRSSA004745\",\"SRSSA004750\",\"SRSSA004762\",\"SRSSA004786\",\"SRSSA004844\",\"SRSSA004856\",\"SRSSA004861\",\"SRSSA004873\",\"SRSSA004885\",\"SRSSA004890\",\"SRSSA004902\",\"SRSSA004914\",\"SRSSA004926\",\"SRSSA004943\",\"SRSSA004960\",\"SRSSA004996\",\"SRSSA005001\",\"SRSSA005013\",\"SRSSA005025\",\"SRSSA005030\",\"SRSSA005042\",\"SRSSA005054\",\"SRSSA005083\",\"SRSSA005095\",\"SRSSA005100\",\"SRSSA005112\",\"SRSSA005124\",\"SRSSA005136\",\"SRSSA005153\",\"SRSSA005165\",\"SRSSA005170\",\"SRSSA005182\",\"SRSSA005211\",\"SRSSA005223\",\"SRSSA005235\",\"SRSSA005240\",\"SRSSA005252\",\"SRSSA005276\",\"SRSSA005281\",\"SRSSA005293\",\"SRSSA005305\",\"SRSSA005310\",\"SRSSA005346\",\"SRSSA005351\",\"SRSSA005375\",\"SRSSA005380\",\"SRSSA005392\",\"SRSSA005404\",\"SRSSA005416\",\"SRSSA005421\",\"SRSSA005433\",\"SRSSA005445\",\"SRSSA005474\",\"SRSSA005486\",\"SRSSA005491\",\"SRSSA005503\",\"SRSSA005532\",\"SRSSA005556\",\"SRSSA005561\",\"SRSSA005573\",\"SRSSA005590\",\"SRSSA005602\",\"SRSSA005626\",\"SRSSA005631\",\"SRSSA005643\",\"SRSSA005684\",\"SRSSA005696\",\"SRSSA005701\",\"SRSSA005725\",\"SRSSA005730\",\"SRSSA005836\",\"SRSSA005841\",\"SRSSA005865\",\"SRSSA005870\",\"SRSSA005894\",\"SRSSA005906\",\"SRSSA005911\",\"SRSSA005923\",\"SRSSA005935\",\"SRSSA005952\",\"SRSSA005964\",\"SRSSA005976\",\"SRSSA005981\",\"SRSSA006075\",\"SRSSA006121\",\"SRSSA006145\",\"SRSSA006174\",\"SRSSA006186\",\"SRSSA006191\",\"SRSSA006203\",\"SRSSA017444\",\"SRSSA017450\",\"SRSSA017462\",\"SRSSA017474\",\"SRSSA017486\",\"SRSSA017491\",\"SRSSA017503\",\"SRSSA017515\",\"SRSSA017520\",\"SRSSA017532\",\"SRSSA017544\",\"SRSSA017556\",\"SRSSA017561\",\"SRSSA017573\",\"SRSSA017585\",\"SRSSA017590\",\"SRSSA017602\",\"SRSSA017614\",\"SRSSA017626\",\"SRSSA017631\",\"SRSSA017643\",\"SRSSA017655\",\"SRSSA017666\",\"SRSSA017671\",\"SRSSA017683\",\"SRSSA017695\",\"SRSSA017700\",\"SRSSA017712\",\"SRSSA017736\",\"SRSSA017741\",\"SRSSA017753\",\"SRSSA017765\",\"SRSSA017770\",\"SRSSA017806\",\"SRSSA017811\",\"SRSSA017835\",\"SRSSA017840\",\"SRSSA017852\",\"SRSSA017864\",\"SRSSA017876\",\"SRSSA017893\",\"SRSSA017905\",\"SRSSA018004\",\"SRSSA018016\",\"SRSSA018021\",\"SRSSA018045\",\"SRSSA018050\",\"SRSSA018062\",\"SRSSA018074\",\"SRSSA018086\",\"SRSSA018103\",\"SRSSA018115\",\"SRSSA018120\",\"SRSSA018132\",\"SRSSA018156\",\"SRSSA018161\",\"SRSSA018173\",\"SRSSA018185\",\"SRSSA018190\",\"SRSSA018202\",\"SRSSA018214\",\"SRSSA018226\",\"SRSSA018231\",\"SRSSA018243\",\"SRSSA018255\",\"SRSSA018260\",\"SRSSA018272\",\"SRSSA018284\",\"SRSSA018296\",\"SRSSA018301\",\"SRSSA018313\",\"SRSSA018325\",\"SRSSA018330\",\"SRSSA018342\",\"SRSSA018366\",\"SRSSA018371\",\"SRSSA018395\",\"SRSSA018400\",\"SRSSA018412\",\"SRSSA018424\",\"SRSSA018436\",\"SRSSA018441\",\"SRSSA018453\",\"SRSSA018465\",\"SRSSA018470\",\"SRSSA018482\");\n} //fin de if($IdEstado == \"26\")\n\n//Condicion de estado-clues\nif($IdEstado == \"27\"){\n\t$Clues = array(\"TCSSA000014\",\"TCSSA000031\",\"TCSSA000043\",\"TCSSA000055\",\"TCSSA000060\",\"TCSSA000096\",\"TCSSA000101\",\"TCSSA000113\",\"TCSSA000125\",\"TCSSA000130\",\"TCSSA000142\",\"TCSSA000154\",\"TCSSA000166\",\"TCSSA000171\",\"TCSSA000183\",\"TCSSA000195\",\"TCSSA000200\",\"TCSSA000212\",\"TCSSA000224\",\"TCSSA000236\",\"TCSSA000241\",\"TCSSA000253\",\"TCSSA000265\",\"TCSSA000270\",\"TCSSA000282\",\"TCSSA000294\",\"TCSSA000306\",\"TCSSA000335\",\"TCSSA000340\",\"TCSSA000352\",\"TCSSA000364\",\"TCSSA000376\",\"TCSSA000381\",\"TCSSA000405\",\"TCSSA000410\",\"TCSSA000422\",\"TCSSA000434\",\"TCSSA000446\",\"TCSSA000451\",\"TCSSA000463\",\"TCSSA000475\",\"TCSSA000480\",\"TCSSA000504\",\"TCSSA000516\",\"TCSSA000521\",\"TCSSA000533\",\"TCSSA000545\",\"TCSSA000550\",\"TCSSA000562\",\"TCSSA000574\",\"TCSSA000586\",\"TCSSA000591\",\"TCSSA000603\",\"TCSSA000615\",\"TCSSA000632\",\"TCSSA000644\",\"TCSSA000656\",\"TCSSA000661\",\"TCSSA000673\",\"TCSSA000685\",\"TCSSA000726\",\"TCSSA000743\",\"TCSSA000755\",\"TCSSA000760\",\"TCSSA000772\",\"TCSSA000784\",\"TCSSA000796\",\"TCSSA000801\",\"TCSSA000813\",\"TCSSA000825\",\"TCSSA000830\",\"TCSSA000842\",\"TCSSA000854\",\"TCSSA000866\",\"TCSSA000871\",\"TCSSA000883\",\"TCSSA000895\",\"TCSSA000900\",\"TCSSA000912\",\"TCSSA000924\",\"TCSSA000936\",\"TCSSA000941\",\"TCSSA000953\",\"TCSSA000965\",\"TCSSA000970\",\"TCSSA000982\",\"TCSSA000994\",\"TCSSA001006\",\"TCSSA001023\",\"TCSSA001035\",\"TCSSA001040\",\"TCSSA001052\",\"TCSSA001064\",\"TCSSA001076\",\"TCSSA001081\",\"TCSSA001163\",\"TCSSA001175\",\"TCSSA001180\",\"TCSSA001192\",\"TCSSA001204\",\"TCSSA001216\",\"TCSSA001221\",\"TCSSA001233\",\"TCSSA001245\",\"TCSSA001250\",\"TCSSA001262\",\"TCSSA001274\",\"TCSSA001286\",\"TCSSA001291\",\"TCSSA001303\",\"TCSSA001315\",\"TCSSA001320\",\"TCSSA001332\",\"TCSSA001344\",\"TCSSA001356\",\"TCSSA001361\",\"TCSSA001373\",\"TCSSA001385\",\"TCSSA001390\",\"TCSSA001402\",\"TCSSA001414\",\"TCSSA001426\",\"TCSSA001431\",\"TCSSA001443\",\"TCSSA001455\",\"TCSSA001460\",\"TCSSA001472\",\"TCSSA001484\",\"TCSSA001496\",\"TCSSA001501\",\"TCSSA001513\",\"TCSSA001525\",\"TCSSA001542\",\"TCSSA001554\",\"TCSSA001566\",\"TCSSA001571\",\"TCSSA001583\",\"TCSSA001595\",\"TCSSA001600\",\"TCSSA001612\",\"TCSSA001624\",\"TCSSA001636\",\"TCSSA001653\",\"TCSSA001706\",\"TCSSA001711\",\"TCSSA001723\",\"TCSSA001735\",\"TCSSA001740\",\"TCSSA001752\",\"TCSSA001764\",\"TCSSA001776\",\"TCSSA001781\",\"TCSSA001793\",\"TCSSA001805\",\"TCSSA001810\",\"TCSSA001822\",\"TCSSA001834\",\"TCSSA001846\",\"TCSSA001851\",\"TCSSA001863\",\"TCSSA001875\",\"TCSSA001880\",\"TCSSA001892\",\"TCSSA001904\",\"TCSSA001916\",\"TCSSA001921\",\"TCSSA001933\",\"TCSSA001945\",\"TCSSA001950\",\"TCSSA001974\",\"TCSSA001986\",\"TCSSA001991\",\"TCSSA002003\",\"TCSSA002061\",\"TCSSA002073\",\"TCSSA002085\",\"TCSSA002090\",\"TCSSA002102\",\"TCSSA002114\",\"TCSSA002126\",\"TCSSA002131\",\"TCSSA002143\",\"TCSSA002155\",\"TCSSA002160\",\"TCSSA002172\",\"TCSSA002184\",\"TCSSA002196\",\"TCSSA002201\",\"TCSSA002213\",\"TCSSA002225\",\"TCSSA002230\",\"TCSSA002242\",\"TCSSA002254\",\"TCSSA002266\",\"TCSSA002271\",\"TCSSA002283\",\"TCSSA002295\",\"TCSSA002300\",\"TCSSA002312\",\"TCSSA002324\",\"TCSSA002336\",\"TCSSA002341\",\"TCSSA002353\",\"TCSSA002370\",\"TCSSA002382\",\"TCSSA002394\",\"TCSSA002406\",\"TCSSA002411\",\"TCSSA002423\",\"TCSSA002440\",\"TCSSA002464\",\"TCSSA002481\",\"TCSSA002493\",\"TCSSA002505\",\"TCSSA002510\",\"TCSSA002522\",\"TCSSA002534\",\"TCSSA002546\",\"TCSSA002551\",\"TCSSA002563\",\"TCSSA002575\",\"TCSSA002580\",\"TCSSA002592\",\"TCSSA002604\",\"TCSSA002616\",\"TCSSA002621\",\"TCSSA002633\",\"TCSSA002645\",\"TCSSA002650\",\"TCSSA002662\",\"TCSSA002674\",\"TCSSA002686\",\"TCSSA002691\",\"TCSSA002703\",\"TCSSA002715\",\"TCSSA002720\",\"TCSSA002732\",\"TCSSA002756\",\"TCSSA002761\",\"TCSSA002773\",\"TCSSA002785\",\"TCSSA002802\",\"TCSSA002814\",\"TCSSA002831\",\"TCSSA002843\",\"TCSSA002855\",\"TCSSA002860\",\"TCSSA002872\",\"TCSSA002884\",\"TCSSA002896\",\"TCSSA002901\",\"TCSSA002913\",\"TCSSA002925\",\"TCSSA002930\",\"TCSSA002942\",\"TCSSA002954\",\"TCSSA002966\",\"TCSSA002971\",\"TCSSA003024\",\"TCSSA003036\",\"TCSSA003041\",\"TCSSA003053\",\"TCSSA003065\",\"TCSSA003070\",\"TCSSA003082\",\"TCSSA003094\",\"TCSSA003106\",\"TCSSA003111\",\"TCSSA003123\",\"TCSSA003135\",\"TCSSA003164\",\"TCSSA003176\",\"TCSSA003181\",\"TCSSA003193\",\"TCSSA003205\",\"TCSSA003210\",\"TCSSA003222\",\"TCSSA003234\",\"TCSSA003246\",\"TCSSA003251\",\"TCSSA003263\",\"TCSSA003275\",\"TCSSA003280\",\"TCSSA003292\",\"TCSSA003304\",\"TCSSA003316\",\"TCSSA003333\",\"TCSSA003350\",\"TCSSA003386\",\"TCSSA003391\",\"TCSSA003403\",\"TCSSA003415\",\"TCSSA003420\",\"TCSSA003432\",\"TCSSA003444\",\"TCSSA003456\",\"TCSSA003461\",\"TCSSA003473\",\"TCSSA003485\",\"TCSSA003490\",\"TCSSA003502\",\"TCSSA003514\",\"TCSSA003526\",\"TCSSA003584\",\"TCSSA003596\",\"TCSSA003601\",\"TCSSA003613\",\"TCSSA003625\",\"TCSSA003630\",\"TCSSA003642\",\"TCSSA003654\",\"TCSSA003666\",\"TCSSA003671\",\"TCSSA003683\",\"TCSSA003695\",\"TCSSA003700\",\"TCSSA003712\",\"TCSSA003724\",\"TCSSA003736\",\"TCSSA003741\",\"TCSSA003753\",\"TCSSA003765\",\"TCSSA003770\",\"TCSSA003806\",\"TCSSA003811\",\"TCSSA003823\",\"TCSSA003835\",\"TCSSA003840\",\"TCSSA003852\",\"TCSSA003864\",\"TCSSA003876\",\"TCSSA003881\",\"TCSSA003893\",\"TCSSA003905\",\"TCSSA003910\",\"TCSSA003922\",\"TCSSA003934\",\"TCSSA003946\",\"TCSSA003951\",\"TCSSA003963\",\"TCSSA003980\",\"TCSSA003992\",\"TCSSA004004\",\"TCSSA004016\",\"TCSSA004021\",\"TCSSA004033\",\"TCSSA004045\",\"TCSSA004050\",\"TCSSA004062\",\"TCSSA004074\",\"TCSSA004086\",\"TCSSA004091\",\"TCSSA004103\",\"TCSSA004115\",\"TCSSA004120\",\"TCSSA004132\",\"TCSSA004144\",\"TCSSA004156\",\"TCSSA004161\",\"TCSSA004173\",\"TCSSA004185\",\"TCSSA004202\",\"TCSSA004214\",\"TCSSA004226\",\"TCSSA004231\",\"TCSSA004243\",\"TCSSA004255\",\"TCSSA004260\",\"TCSSA004272\",\"TCSSA004284\",\"TCSSA004296\",\"TCSSA004301\",\"TCSSA004313\",\"TCSSA004325\",\"TCSSA004330\",\"TCSSA004366\",\"TCSSA004371\",\"TCSSA004383\",\"TCSSA004395\",\"TCSSA004400\",\"TCSSA004412\",\"TCSSA004424\",\"TCSSA004436\",\"TCSSA004441\",\"TCSSA004453\",\"TCSSA004465\",\"TCSSA004470\",\"TCSSA004494\",\"TCSSA004506\",\"TCSSA004511\",\"TCSSA004523\",\"TCSSA004535\",\"TCSSA004540\",\"TCSSA004552\",\"TCSSA004564\",\"TCSSA004576\",\"TCSSA004581\",\"TCSSA004593\",\"TCSSA004605\",\"TCSSA004610\",\"TCSSA004622\",\"TCSSA004634\",\"TCSSA004646\",\"TCSSA004651\",\"TCSSA004663\",\"TCSSA004675\",\"TCSSA004680\",\"TCSSA004692\",\"TCSSA004704\",\"TCSSA004716\",\"TCSSA004721\",\"TCSSA004733\",\"TCSSA004745\",\"TCSSA004750\",\"TCSSA004762\",\"TCSSA004774\",\"TCSSA004786\",\"TCSSA004791\",\"TCSSA004803\",\"TCSSA004815\",\"TCSSA004820\",\"TCSSA004832\",\"TCSSA004844\",\"TCSSA004861\",\"TCSSA004873\",\"TCSSA004885\",\"TCSSA004890\",\"TCSSA004902\",\"TCSSA004914\",\"TCSSA004926\",\"TCSSA004943\",\"TCSSA004955\",\"TCSSA004960\",\"TCSSA004972\",\"TCSSA004984\",\"TCSSA005001\",\"TCSSA005013\",\"TCSSA005025\",\"TCSSA005030\",\"TCSSA005042\",\"TCSSA005054\",\"TCSSA005066\",\"TCSSA005071\",\"TCSSA005083\",\"TCSSA005095\",\"TCSSA005100\",\"TCSSA005112\",\"TCSSA005124\",\"TCSSA005136\",\"TCSSA005153\",\"TCSSA005165\",\"TCSSA005170\",\"TCSSA005182\",\"TCSSA005194\",\"TCSSA005211\",\"TCSSA005235\",\"TCSSA005240\",\"TCSSA005252\",\"TCSSA005264\",\"TCSSA005276\",\"TCSSA005281\",\"TCSSA005293\",\"TCSSA005305\",\"TCSSA005310\",\"TCSSA005322\",\"TCSSA005334\",\"TCSSA005346\",\"TCSSA005351\",\"TCSSA005363\",\"TCSSA005392\",\"TCSSA005404\",\"TCSSA005416\",\"TCSSA005421\",\"TCSSA005433\",\"TCSSA005445\",\"TCSSA005450\",\"TCSSA005462\",\"TCSSA005474\",\"TCSSA005486\",\"TCSSA005491\",\"TCSSA005503\",\"TCSSA005515\",\"TCSSA005520\",\"TCSSA005532\",\"TCSSA005544\",\"TCSSA005556\",\"TCSSA005561\",\"TCSSA005573\",\"TCSSA005585\",\"TCSSA005590\",\"TCSSA005602\",\"TCSSA005614\",\"TCSSA005626\",\"TCSSA005631\",\"TCSSA005643\",\"TCSSA005655\",\"TCSSA005660\",\"TCSSA005672\",\"TCSSA005684\",\"TCSSA005701\",\"TCSSA005713\",\"TCSSA005725\",\"TCSSA005742\",\"TCSSA005754\",\"TCSSA005766\",\"TCSSA005771\",\"TCSSA005783\",\"TCSSA005795\",\"TCSSA005976\",\"TCSSA005981\",\"TCSSA005993\",\"TCSSA006005\",\"TCSSA006010\",\"TCSSA006022\",\"TCSSA006051\",\"TCSSA006063\",\"TCSSA006075\",\"TCSSA006080\",\"TCSSA006092\",\"TCSSA006104\",\"TCSSA006116\",\"TCSSA006121\",\"TCSSA006145\",\"TCSSA006150\",\"TCSSA006162\",\"TCSSA006174\",\"TCSSA006186\",\"TCSSA006191\",\"TCSSA006215\",\"TCSSA006220\",\"TCSSA006232\",\"TCSSA006244\",\"TCSSA016371\",\"TCSSA016383\",\"TCSSA016395\",\"TCSSA016400\",\"TCSSA016412\",\"TCSSA016424\",\"TCSSA016436\",\"TCSSA016441\",\"TCSSA016453\",\"TCSSA016465\",\"TCSSA016470\",\"TCSSA016482\",\"TCSSA016494\",\"TCSSA016506\",\"TCSSA016511\",\"TCSSA016523\",\"TCSSA016535\",\"TCSSA016540\",\"TCSSA016552\",\"TCSSA016564\",\"TCSSA016576\",\"TCSSA016581\",\"TCSSA016605\",\"TCSSA016610\",\"TCSSA016622\",\"TCSSA016634\",\"TCSSA016646\",\"TCSSA016651\",\"TCSSA016663\",\"TCSSA016675\",\"TCSSA016680\",\"TCSSA016692\",\"TCSSA016704\",\"TCSSA016716\",\"TCSSA016721\",\"TCSSA016733\",\"TCSSA016744\",\"TCSSA016756\",\"TCSSA016761\",\"TCSSA016773\",\"TCSSA016785\",\"TCSSA016831\",\"TCSSA016843\",\"TCSSA016855\",\"TCSSA016860\",\"TCSSA016872\",\"TCSSA016884\",\"TCSSA016896\",\"TCSSA016901\",\"TCSSA016913\",\"TCSSA016925\",\"TCSSA016930\",\"TCSSA016942\",\"TCSSA016954\",\"TCSSA016966\",\"TCSSA016983\",\"TCSSA016995\",\"TCSSA017000\",\"TCSSA017012\",\"TCSSA017024\",\"TCSSA017036\",\"TCSSA017041\",\"TCSSA017053\",\"TCSSA017065\",\"TCSSA017070\",\"TCSSA017082\",\"TCSSA017094\",\"TCSSA017106\",\"TCSSA017111\",\"TCSSA017123\",\"TCSSA017135\",\"TCSSA017140\",\"TCSSA017152\",\"TCSSA017164\",\"TCSSA017176\",\"TCSSA017181\",\"TCSSA017193\",\"TCSSA017205\",\"TCSSA017210\",\"TCSSA017222\",\"TCSSA017234\",\"TCSSA017246\",\"TCSSA017251\",\"TCSSA017263\",\"TCSSA017275\",\"TCSSA017280\",\"TCSSA017292\",\"TCSSA017304\",\"TCSSA017316\",\"TCSSA017321\",\"TCSSA017333\",\"TCSSA017345\",\"TCSSA017350\",\"TCSSA017362\",\"TCSSA017374\",\"TCSSA017386\",\"TCSSA017391\",\"TCSSA017403\",\"TCSSA017415\",\"TCSSA017420\",\"TCSSA017432\",\"TCSSA017444\",\"TCSSA017456\",\"TCSSA017461\",\"TCSSA017473\",\"TCSSA017485\",\"TCSSA017490\",\"TCSSA017502\",\"TCSSA017514\",\"TCSSA017526\",\"TCSSA017531\",\"TCSSA017543\",\"TCSSA017555\",\"TCSSA017560\",\"TCSSA017572\",\"TCSSA017584\",\"TCSSA017596\",\"TCSSA017601\",\"TCSSA017613\",\"TCSSA017625\",\"TCSSA017630\",\"TCSSA017642\",\"TCSSA017654\",\"TCSSA017666\",\"TCSSA017671\",\"TCSSA017683\",\"TCSSA017695\",\"TCSSA017700\",\"TCSSA017712\",\"TCSSA017724\",\"TCSSA017736\",\"TCSSA017741\",\"TCSSA017753\",\"TCSSA017765\",\"TCSSA017770\",\"TCSSA017782\");\n} //fin de if($IdEstado == \"27\")\n\n//Condicion de estado-clues\nif($IdEstado == \"28\"){\n\t$Clues = array(\"TSSSA000010\",\"TSSSA000022\",\"TSSSA000034\",\"TSSSA000046\",\"TSSSA000051\",\"TSSSA000063\",\"TSSSA000075\",\"TSSSA000092\",\"TSSSA000104\",\"TSSSA000116\",\"TSSSA000121\",\"TSSSA000145\",\"TSSSA000150\",\"TSSSA000162\",\"TSSSA000174\",\"TSSSA000186\",\"TSSSA000191\",\"TSSSA000203\",\"TSSSA000215\",\"TSSSA000220\",\"TSSSA000232\",\"TSSSA000244\",\"TSSSA000256\",\"TSSSA000261\",\"TSSSA000273\",\"TSSSA000285\",\"TSSSA000290\",\"TSSSA000302\",\"TSSSA000326\",\"TSSSA000331\",\"TSSSA000372\",\"TSSSA000384\",\"TSSSA000396\",\"TSSSA000401\",\"TSSSA000413\",\"TSSSA000425\",\"TSSSA000442\",\"TSSSA000454\",\"TSSSA000466\",\"TSSSA000483\",\"TSSSA000495\",\"TSSSA000500\",\"TSSSA000512\",\"TSSSA000524\",\"TSSSA000536\",\"TSSSA000553\",\"TSSSA000565\",\"TSSSA000582\",\"TSSSA000594\",\"TSSSA000611\",\"TSSSA000623\",\"TSSSA000635\",\"TSSSA000676\",\"TSSSA000681\",\"TSSSA000693\",\"TSSSA000705\",\"TSSSA000710\",\"TSSSA000722\",\"TSSSA000734\",\"TSSSA000746\",\"TSSSA000763\",\"TSSSA000775\",\"TSSSA000780\",\"TSSSA000792\",\"TSSSA000804\",\"TSSSA000816\",\"TSSSA000821\",\"TSSSA000833\",\"TSSSA000845\",\"TSSSA000874\",\"TSSSA000886\",\"TSSSA000891\",\"TSSSA000903\",\"TSSSA000915\",\"TSSSA000920\",\"TSSSA000932\",\"TSSSA000944\",\"TSSSA000961\",\"TSSSA000973\",\"TSSSA000985\",\"TSSSA000990\",\"TSSSA001002\",\"TSSSA001014\",\"TSSSA001026\",\"TSSSA001031\",\"TSSSA001096\",\"TSSSA001101\",\"TSSSA001113\",\"TSSSA001125\",\"TSSSA001130\",\"TSSSA001142\",\"TSSSA001154\",\"TSSSA001166\",\"TSSSA001171\",\"TSSSA001183\",\"TSSSA001195\",\"TSSSA001212\",\"TSSSA001253\",\"TSSSA001265\",\"TSSSA001270\",\"TSSSA001294\",\"TSSSA001306\",\"TSSSA001311\",\"TSSSA001323\",\"TSSSA001335\",\"TSSSA001340\",\"TSSSA001352\",\"TSSSA001364\",\"TSSSA001376\",\"TSSSA001381\",\"TSSSA001393\",\"TSSSA001405\",\"TSSSA001410\",\"TSSSA001422\",\"TSSSA001434\",\"TSSSA001446\",\"TSSSA001451\",\"TSSSA001463\",\"TSSSA001475\",\"TSSSA001492\",\"TSSSA001504\",\"TSSSA001516\",\"TSSSA001521\",\"TSSSA001533\",\"TSSSA001545\",\"TSSSA001550\",\"TSSSA001562\",\"TSSSA001586\",\"TSSSA001615\",\"TSSSA001620\",\"TSSSA001632\",\"TSSSA001644\",\"TSSSA001656\",\"TSSSA001661\",\"TSSSA001673\",\"TSSSA001685\",\"TSSSA001702\",\"TSSSA001714\",\"TSSSA001726\",\"TSSSA001731\",\"TSSSA001755\",\"TSSSA001760\",\"TSSSA001772\",\"TSSSA001825\",\"TSSSA001854\",\"TSSSA001866\",\"TSSSA001871\",\"TSSSA001883\",\"TSSSA001895\",\"TSSSA001900\",\"TSSSA001912\",\"TSSSA001924\",\"TSSSA001936\",\"TSSSA001941\",\"TSSSA001953\",\"TSSSA001965\",\"TSSSA001982\",\"TSSSA001994\",\"TSSSA002011\",\"TSSSA002035\",\"TSSSA002040\",\"TSSSA002052\",\"TSSSA002093\",\"TSSSA002110\",\"TSSSA002122\",\"TSSSA002134\",\"TSSSA002146\",\"TSSSA002151\",\"TSSSA002163\",\"TSSSA002175\",\"TSSSA002192\",\"TSSSA002221\",\"TSSSA002233\",\"TSSSA002245\",\"TSSSA002250\",\"TSSSA002262\",\"TSSSA002274\",\"TSSSA002286\",\"TSSSA002291\",\"TSSSA002303\",\"TSSSA002315\",\"TSSSA002320\",\"TSSSA002332\",\"TSSSA002344\",\"TSSSA002356\",\"TSSSA002361\",\"TSSSA002373\",\"TSSSA002402\",\"TSSSA002414\",\"TSSSA002426\",\"TSSSA002431\",\"TSSSA002443\",\"TSSSA002460\",\"TSSSA002484\",\"TSSSA002496\",\"TSSSA002501\",\"TSSSA002530\",\"TSSSA002542\",\"TSSSA002554\",\"TSSSA002566\",\"TSSSA002571\",\"TSSSA002583\",\"TSSSA002595\",\"TSSSA002600\",\"TSSSA002612\",\"TSSSA002624\",\"TSSSA002636\",\"TSSSA002641\",\"TSSSA002653\",\"TSSSA002665\",\"TSSSA002711\",\"TSSSA002723\",\"TSSSA002735\",\"TSSSA002740\",\"TSSSA002764\",\"TSSSA002776\",\"TSSSA002781\",\"TSSSA002793\",\"TSSSA002805\",\"TSSSA002810\",\"TSSSA002846\",\"TSSSA002851\",\"TSSSA002863\",\"TSSSA002875\",\"TSSSA002880\",\"TSSSA002892\",\"TSSSA002904\",\"TSSSA002916\",\"TSSSA002921\",\"TSSSA002933\",\"TSSSA002945\",\"TSSSA002950\",\"TSSSA002962\",\"TSSSA002974\",\"TSSSA002991\",\"TSSSA003003\",\"TSSSA003032\",\"TSSSA003056\",\"TSSSA003061\",\"TSSSA003073\",\"TSSSA003085\",\"TSSSA003090\",\"TSSSA003114\",\"TSSSA003131\",\"TSSSA003143\",\"TSSSA003155\",\"TSSSA003160\",\"TSSSA003172\",\"TSSSA003184\",\"TSSSA017535\",\"TSSSA017540\",\"TSSSA017552\",\"TSSSA017564\",\"TSSSA017576\",\"TSSSA017581\",\"TSSSA017593\",\"TSSSA017605\",\"TSSSA017610\",\"TSSSA017622\",\"TSSSA017634\",\"TSSSA017646\",\"TSSSA017651\",\"TSSSA017663\",\"TSSSA017675\",\"TSSSA017680\",\"TSSSA017692\",\"TSSSA017704\",\"TSSSA017716\",\"TSSSA017721\",\"TSSSA017733\",\"TSSSA017745\",\"TSSSA017750\",\"TSSSA017762\",\"TSSSA017774\",\"TSSSA017786\",\"TSSSA017791\",\"TSSSA017803\",\"TSSSA017814\",\"TSSSA017826\",\"TSSSA017831\",\"TSSSA017843\",\"TSSSA017860\",\"TSSSA017872\",\"TSSSA017884\",\"TSSSA017896\",\"TSSSA017901\",\"TSSSA017913\",\"TSSSA017925\",\"TSSSA017930\",\"TSSSA017942\",\"TSSSA017954\",\"TSSSA017971\",\"TSSSA017983\",\"TSSSA017995\",\"TSSSA018000\",\"TSSSA018012\",\"TSSSA018024\",\"TSSSA018036\",\"TSSSA018041\",\"TSSSA018053\",\"TSSSA018065\",\"TSSSA018070\",\"TSSSA018082\",\"TSSSA018094\",\"TSSSA018106\",\"TSSSA018111\",\"TSSSA018123\",\"TSSSA018135\",\"TSSSA018140\",\"TSSSA018152\",\"TSSSA018164\",\"TSSSA018176\",\"TSSSA018181\",\"TSSSA018193\",\"TSSSA018205\",\"TSSSA018210\",\"TSSSA018222\",\"TSSSA018234\",\"TSSSA018246\",\"TSSSA018251\",\"TSSSA018263\",\"TSSSA018275\",\"TSSSA018280\",\"TSSSA018292\",\"TSSSA018304\",\"TSSSA018316\",\"TSSSA018321\",\"TSSSA018333\",\"TSSSA018345\",\"TSSSA018350\",\"TSSSA018362\",\"TSSSA018374\",\"TSSSA018386\",\"TSSSA018403\",\"TSSSA018415\",\"TSSSA018420\",\"TSSSA018432\",\"TSSSA018444\",\"TSSSA018456\",\"TSSSA018461\",\"TSSSA018473\",\"TSSSA018485\",\"TSSSA018490\",\"TSSSA018502\",\"TSSSA018514\",\"TSSSA018526\",\"TSSSA018531\",\"TSSSA018543\",\"TSSSA018555\",\"TSSSA018560\",\"TSSSA018572\",\"TSSSA018584\",\"TSSSA018596\",\"TSSSA018601\",\"TSSSA018613\",\"TSSSA018625\",\"TSSSA018630\",\"TSSSA018642\",\"TSSSA018654\",\"TSSSA018666\",\"TSSSA018671\",\"TSSSA018683\",\"TSSSA018695\",\"TSSSA018700\",\"TSSSA018712\",\"TSSSA018724\",\"TSSSA018741\",\"TSSSA018753\",\"TSSSA018765\",\"TSSSA018770\",\"TSSSA018782\",\"TSSSA018794\",\"TSSSA018806\",\"TSSSA018811\",\"TSSSA018823\",\"TSSSA018835\",\"TSSSA018840\",\"TSSSA018852\",\"TSSSA018864\",\"TSSSA018876\",\"TSSSA018881\",\"TSSSA018893\",\"TSSSA018905\",\"TSSSA018910\",\"TSSSA018922\",\"TSSSA018934\",\"TSSSA018946\",\"TSSSA018951\",\"TSSSA018963\",\"TSSSA018975\",\"TSSSA018980\",\"TSSSA018992\",\"TSSSA019004\",\"TSSSA019016\",\"TSSSA019021\",\"TSSSA019033\",\"TSSSA019045\",\"TSSSA019050\",\"TSSSA019062\",\"TSSSA019074\",\"TSSSA019086\",\"TSSSA019091\",\"TSSSA019103\",\"TSSSA019115\",\"TSSSA019120\",\"TSSSA019132\",\"TSSSA019144\",\"TSSSA019156\",\"TSSSA019161\",\"TSSSA019173\",\"TSSSA019185\",\"TSSSA019190\",\"TSSSA019202\",\"TSSSA019214\",\"TSSSA019226\",\"TSSSA019231\",\"TSSSA019243\",\"TSSSA019255\",\"TSSSA019260\",\"TSSSA019272\",\"TSSSA019284\",\"TSSSA019296\",\"TSSSA019301\",\"TSSSA019313\",\"TSSSA019325\",\"TSSSA019330\",\"TSSSA019342\",\"TSSSA019354\",\"TSSSA019366\",\"TSSSA019371\",\"TSSSA019383\",\"TSSSA019395\",\"TSSSA019400\",\"TSSSA019412\",\"TSSSA019424\",\"TSSSA019436\",\"TSSSA019441\");\n} //fin de if($IdEstado == \"28\")\n\n//Condicion de estado-clues\nif($IdEstado == \"29\"){\n\t$Clues = array(\"TLSSA000010\",\"TLSSA000022\",\"TLSSA000034\",\"TLSSA000051\",\"TLSSA000063\",\"TLSSA000075\",\"TLSSA000080\",\"TLSSA000092\",\"TLSSA000104\",\"TLSSA000116\",\"TLSSA000121\",\"TLSSA000133\",\"TLSSA000145\",\"TLSSA000150\",\"TLSSA000162\",\"TLSSA000174\",\"TLSSA000186\",\"TLSSA000191\",\"TLSSA000203\",\"TLSSA000215\",\"TLSSA000220\",\"TLSSA000232\",\"TLSSA000244\",\"TLSSA000256\",\"TLSSA000261\",\"TLSSA000273\",\"TLSSA000285\",\"TLSSA000290\",\"TLSSA000302\",\"TLSSA000314\",\"TLSSA000326\",\"TLSSA000343\",\"TLSSA000355\",\"TLSSA000360\",\"TLSSA000372\",\"TLSSA000384\",\"TLSSA000396\",\"TLSSA000401\",\"TLSSA000413\",\"TLSSA000425\",\"TLSSA000430\",\"TLSSA000442\",\"TLSSA000454\",\"TLSSA000466\",\"TLSSA000471\",\"TLSSA000495\",\"TLSSA000500\",\"TLSSA000512\",\"TLSSA000524\",\"TLSSA000536\",\"TLSSA000541\",\"TLSSA000553\",\"TLSSA000565\",\"TLSSA000570\",\"TLSSA000582\",\"TLSSA000594\",\"TLSSA000606\",\"TLSSA000611\",\"TLSSA000623\",\"TLSSA000635\",\"TLSSA000640\",\"TLSSA000652\",\"TLSSA000664\",\"TLSSA000676\",\"TLSSA000681\",\"TLSSA000693\",\"TLSSA000705\",\"TLSSA000710\",\"TLSSA000722\",\"TLSSA000734\",\"TLSSA000746\",\"TLSSA000751\",\"TLSSA000763\",\"TLSSA000775\",\"TLSSA000780\",\"TLSSA000792\",\"TLSSA000804\",\"TLSSA000816\",\"TLSSA000821\",\"TLSSA000833\",\"TLSSA000845\",\"TLSSA000850\",\"TLSSA000862\",\"TLSSA000874\",\"TLSSA000886\",\"TLSSA000891\",\"TLSSA000903\",\"TLSSA000915\",\"TLSSA000920\",\"TLSSA000932\",\"TLSSA000944\",\"TLSSA000956\",\"TLSSA000961\",\"TLSSA000973\",\"TLSSA000985\",\"TLSSA000990\",\"TLSSA001002\",\"TLSSA001014\",\"TLSSA001026\",\"TLSSA001031\",\"TLSSA001043\",\"TLSSA001055\",\"TLSSA001060\",\"TLSSA001072\",\"TLSSA001084\",\"TLSSA001096\",\"TLSSA001101\",\"TLSSA001113\",\"TLSSA001125\",\"TLSSA001130\",\"TLSSA001142\",\"TLSSA001166\",\"TLSSA001183\",\"TLSSA001195\",\"TLSSA001200\",\"TLSSA001212\",\"TLSSA001224\",\"TLSSA001236\",\"TLSSA001241\",\"TLSSA001253\",\"TLSSA001265\",\"TLSSA001270\",\"TLSSA001282\",\"TLSSA001294\",\"TLSSA001306\",\"TLSSA001311\",\"TLSSA001323\",\"TLSSA001335\",\"TLSSA001340\",\"TLSSA001352\",\"TLSSA001364\",\"TLSSA001376\",\"TLSSA001381\",\"TLSSA001393\",\"TLSSA001405\",\"TLSSA001410\",\"TLSSA001422\",\"TLSSA001434\",\"TLSSA001446\",\"TLSSA001451\",\"TLSSA001463\",\"TLSSA001475\",\"TLSSA001480\",\"TLSSA001492\",\"TLSSA001504\",\"TLSSA001516\",\"TLSSA001521\",\"TLSSA001533\",\"TLSSA001545\",\"TLSSA001550\",\"TLSSA001562\",\"TLSSA001574\",\"TLSSA001586\",\"TLSSA001591\",\"TLSSA001603\",\"TLSSA001615\",\"TLSSA001620\",\"TLSSA001632\",\"TLSSA001644\",\"TLSSA001656\",\"TLSSA001661\",\"TLSSA001673\",\"TLSSA001685\",\"TLSSA001690\",\"TLSSA001702\",\"TLSSA001714\",\"TLSSA001726\",\"TLSSA001731\",\"TLSSA001743\",\"TLSSA001755\",\"TLSSA001772\",\"TLSSA017540\",\"TLSSA017552\",\"TLSSA017564\",\"TLSSA017576\",\"TLSSA017581\",\"TLSSA017593\",\"TLSSA017605\",\"TLSSA017610\",\"TLSSA017634\",\"TLSSA017645\",\"TLSSA017650\",\"TLSSA017662\",\"TLSSA017686\",\"TLSSA017703\",\"TLSSA017715\",\"TLSSA017720\",\"TLSSA017732\",\"TLSSA017773\",\"TLSSA017790\",\"TLSSA017802\",\"TLSSA017814\",\"TLSSA017826\",\"TLSSA017831\",\"TLSSA017843\",\"TLSSA017860\",\"TLSSA017872\",\"TLSSA017884\",\"TLSSA017896\",\"TLSSA017901\",\"TLSSA017913\",\"TLSSA017925\",\"TLSSA017930\",\"TLSSA017942\",\"TLSSA017954\",\"TLSSA017966\",\"TLSSA017971\",\"TLSSA017983\",\"TLSSA017995\",\"TLSSA018000\",\"TLSSA018012\",\"TLSSA018024\");\n} //fin de if($IdEstado == \"29\")\n\n//Condicion de estado-clues\nif($IdEstado == \"30\"){\n\t$Clues = array(\"VZSSA000013\",\"VZSSA000025\",\"VZSSA000030\",\"VZSSA000042\",\"VZSSA000066\",\"VZSSA000071\",\"VZSSA000083\",\"VZSSA000095\",\"VZSSA000100\",\"VZSSA000112\",\"VZSSA000124\",\"VZSSA000136\",\"VZSSA000141\",\"VZSSA000153\",\"VZSSA000165\",\"VZSSA000170\",\"VZSSA000194\",\"VZSSA000206\",\"VZSSA000211\",\"VZSSA000223\",\"VZSSA000235\",\"VZSSA000240\",\"VZSSA000252\",\"VZSSA000264\",\"VZSSA000281\",\"VZSSA000293\",\"VZSSA000310\",\"VZSSA000322\",\"VZSSA000346\",\"VZSSA000351\",\"VZSSA000363\",\"VZSSA000375\",\"VZSSA000380\",\"VZSSA000392\",\"VZSSA000404\",\"VZSSA000416\",\"VZSSA000421\",\"VZSSA000433\",\"VZSSA000445\",\"VZSSA000450\",\"VZSSA000474\",\"VZSSA000486\",\"VZSSA000491\",\"VZSSA000515\",\"VZSSA000532\",\"VZSSA000544\",\"VZSSA000556\",\"VZSSA000561\",\"VZSSA000573\",\"VZSSA000585\",\"VZSSA000590\",\"VZSSA000602\",\"VZSSA000614\",\"VZSSA000626\",\"VZSSA000631\",\"VZSSA000643\",\"VZSSA000655\",\"VZSSA000660\",\"VZSSA000672\",\"VZSSA000684\",\"VZSSA000696\",\"VZSSA000701\",\"VZSSA000713\",\"VZSSA000730\",\"VZSSA000742\",\"VZSSA000754\",\"VZSSA000766\",\"VZSSA000771\",\"VZSSA000783\",\"VZSSA000795\",\"VZSSA000800\",\"VZSSA000812\",\"VZSSA000824\",\"VZSSA000836\",\"VZSSA000841\",\"VZSSA000853\",\"VZSSA000870\",\"VZSSA000882\",\"VZSSA000894\",\"VZSSA000906\",\"VZSSA000911\",\"VZSSA000923\",\"VZSSA000935\",\"VZSSA000940\",\"VZSSA000952\",\"VZSSA000976\",\"VZSSA000981\",\"VZSSA000993\",\"VZSSA001005\",\"VZSSA001022\",\"VZSSA001046\",\"VZSSA001063\",\"VZSSA001080\",\"VZSSA001092\",\"VZSSA001104\",\"VZSSA001116\",\"VZSSA001121\",\"VZSSA001133\",\"VZSSA001145\",\"VZSSA001150\",\"VZSSA001162\",\"VZSSA001174\",\"VZSSA001186\",\"VZSSA001191\",\"VZSSA001203\",\"VZSSA001215\",\"VZSSA001220\",\"VZSSA001232\",\"VZSSA001244\",\"VZSSA001256\",\"VZSSA001261\",\"VZSSA001273\",\"VZSSA001290\",\"VZSSA001302\",\"VZSSA001314\",\"VZSSA001326\",\"VZSSA001343\",\"VZSSA001355\",\"VZSSA001372\",\"VZSSA001384\",\"VZSSA001396\",\"VZSSA001401\",\"VZSSA001425\",\"VZSSA001430\",\"VZSSA001442\",\"VZSSA001454\",\"VZSSA001466\",\"VZSSA001471\",\"VZSSA001483\",\"VZSSA001495\",\"VZSSA001500\",\"VZSSA001512\",\"VZSSA001524\",\"VZSSA001536\",\"VZSSA001541\",\"VZSSA001553\",\"VZSSA001565\",\"VZSSA001570\",\"VZSSA001582\",\"VZSSA001594\",\"VZSSA001606\",\"VZSSA001611\",\"VZSSA001623\",\"VZSSA001635\",\"VZSSA001640\",\"VZSSA001652\",\"VZSSA001664\",\"VZSSA001676\",\"VZSSA001681\",\"VZSSA001693\",\"VZSSA001705\",\"VZSSA001710\",\"VZSSA001722\",\"VZSSA001734\",\"VZSSA001746\",\"VZSSA001751\",\"VZSSA001763\",\"VZSSA001775\",\"VZSSA001780\",\"VZSSA001792\",\"VZSSA001804\",\"VZSSA001816\",\"VZSSA001821\",\"VZSSA001833\",\"VZSSA001845\",\"VZSSA001850\",\"VZSSA001862\",\"VZSSA001874\",\"VZSSA001886\",\"VZSSA001891\",\"VZSSA001903\",\"VZSSA001915\",\"VZSSA001920\",\"VZSSA001932\",\"VZSSA001944\",\"VZSSA001956\",\"VZSSA001961\",\"VZSSA001973\",\"VZSSA001990\",\"VZSSA002002\",\"VZSSA002014\",\"VZSSA002026\",\"VZSSA002031\",\"VZSSA002043\",\"VZSSA002055\",\"VZSSA002060\",\"VZSSA002072\",\"VZSSA002084\",\"VZSSA002096\",\"VZSSA002101\",\"VZSSA002113\",\"VZSSA002125\",\"VZSSA002130\",\"VZSSA002142\",\"VZSSA002154\",\"VZSSA002171\",\"VZSSA002183\",\"VZSSA002195\",\"VZSSA002212\",\"VZSSA002224\",\"VZSSA002236\",\"VZSSA002241\",\"VZSSA002253\",\"VZSSA002265\",\"VZSSA002270\",\"VZSSA002282\",\"VZSSA002294\",\"VZSSA002306\",\"VZSSA002311\",\"VZSSA002323\",\"VZSSA002335\",\"VZSSA002340\",\"VZSSA002352\",\"VZSSA002364\",\"VZSSA002376\",\"VZSSA002381\",\"VZSSA002393\",\"VZSSA002405\",\"VZSSA002410\",\"VZSSA002422\",\"VZSSA002434\",\"VZSSA002446\",\"VZSSA002451\",\"VZSSA002463\",\"VZSSA002475\",\"VZSSA002480\",\"VZSSA002492\",\"VZSSA002504\",\"VZSSA002521\",\"VZSSA002545\",\"VZSSA002550\",\"VZSSA002562\",\"VZSSA002574\",\"VZSSA002586\",\"VZSSA002591\",\"VZSSA002603\",\"VZSSA002620\",\"VZSSA002644\",\"VZSSA002656\",\"VZSSA002673\",\"VZSSA002685\",\"VZSSA002690\",\"VZSSA002702\",\"VZSSA002714\",\"VZSSA002726\",\"VZSSA002731\",\"VZSSA002743\",\"VZSSA002755\",\"VZSSA002760\",\"VZSSA002772\",\"VZSSA002784\",\"VZSSA002796\",\"VZSSA002813\",\"VZSSA002825\",\"VZSSA002830\",\"VZSSA002842\",\"VZSSA002854\",\"VZSSA002866\",\"VZSSA002871\",\"VZSSA002883\",\"VZSSA002900\",\"VZSSA002912\",\"VZSSA002924\",\"VZSSA002936\",\"VZSSA002941\",\"VZSSA002953\",\"VZSSA002965\",\"VZSSA002970\",\"VZSSA002982\",\"VZSSA003006\",\"VZSSA003011\",\"VZSSA003023\",\"VZSSA003035\",\"VZSSA003040\",\"VZSSA003052\",\"VZSSA003064\",\"VZSSA003076\",\"VZSSA003081\",\"VZSSA003093\",\"VZSSA003105\",\"VZSSA003110\",\"VZSSA003122\",\"VZSSA003146\",\"VZSSA003151\",\"VZSSA003163\",\"VZSSA003175\",\"VZSSA003180\",\"VZSSA003192\",\"VZSSA003204\",\"VZSSA003216\",\"VZSSA003221\",\"VZSSA003233\",\"VZSSA003245\",\"VZSSA003250\",\"VZSSA003262\",\"VZSSA003274\",\"VZSSA003286\",\"VZSSA003291\",\"VZSSA003315\",\"VZSSA003320\",\"VZSSA003344\",\"VZSSA003356\",\"VZSSA003361\",\"VZSSA003373\",\"VZSSA003385\",\"VZSSA003390\",\"VZSSA003402\",\"VZSSA003414\",\"VZSSA003426\",\"VZSSA003431\",\"VZSSA003443\",\"VZSSA003460\",\"VZSSA003472\",\"VZSSA003484\",\"VZSSA003496\",\"VZSSA003501\",\"VZSSA003513\",\"VZSSA003525\",\"VZSSA003530\",\"VZSSA003542\",\"VZSSA003554\",\"VZSSA003566\",\"VZSSA003571\",\"VZSSA003583\",\"VZSSA003595\",\"VZSSA003600\",\"VZSSA003612\",\"VZSSA003624\",\"VZSSA003636\",\"VZSSA003641\",\"VZSSA003653\",\"VZSSA003665\",\"VZSSA003670\",\"VZSSA003682\",\"VZSSA003706\",\"VZSSA003723\",\"VZSSA003735\",\"VZSSA003740\",\"VZSSA003752\",\"VZSSA003764\",\"VZSSA003776\",\"VZSSA003781\",\"VZSSA003793\",\"VZSSA003805\",\"VZSSA003810\",\"VZSSA003822\",\"VZSSA003834\",\"VZSSA003846\",\"VZSSA003851\",\"VZSSA003863\",\"VZSSA003875\",\"VZSSA003892\",\"VZSSA003904\",\"VZSSA003916\",\"VZSSA003921\",\"VZSSA003933\",\"VZSSA003945\",\"VZSSA003950\",\"VZSSA003962\",\"VZSSA003974\",\"VZSSA003986\",\"VZSSA003991\",\"VZSSA004003\",\"VZSSA004015\",\"VZSSA004020\",\"VZSSA004032\",\"VZSSA004044\",\"VZSSA004056\",\"VZSSA004061\",\"VZSSA004073\",\"VZSSA004085\",\"VZSSA004102\",\"VZSSA004114\",\"VZSSA004126\",\"VZSSA004131\",\"VZSSA004143\",\"VZSSA004155\",\"VZSSA004160\",\"VZSSA004172\",\"VZSSA004184\",\"VZSSA004196\",\"VZSSA004201\",\"VZSSA004213\",\"VZSSA004225\",\"VZSSA004230\",\"VZSSA004242\",\"VZSSA004254\",\"VZSSA004271\",\"VZSSA004283\",\"VZSSA004295\",\"VZSSA004300\",\"VZSSA004312\",\"VZSSA004324\",\"VZSSA004336\",\"VZSSA004341\",\"VZSSA004353\",\"VZSSA004365\",\"VZSSA004370\",\"VZSSA004382\",\"VZSSA004394\",\"VZSSA004406\",\"VZSSA004411\",\"VZSSA004423\",\"VZSSA004435\",\"VZSSA004440\",\"VZSSA004452\",\"VZSSA004464\",\"VZSSA004476\",\"VZSSA004481\",\"VZSSA004493\",\"VZSSA004505\",\"VZSSA004510\",\"VZSSA004522\",\"VZSSA004534\",\"VZSSA004546\",\"VZSSA004551\",\"VZSSA004563\",\"VZSSA004580\",\"VZSSA004604\",\"VZSSA004616\",\"VZSSA004621\",\"VZSSA004650\",\"VZSSA004662\",\"VZSSA004674\",\"VZSSA004686\",\"VZSSA004691\",\"VZSSA004703\",\"VZSSA004715\",\"VZSSA004720\",\"VZSSA004732\",\"VZSSA004744\",\"VZSSA004756\",\"VZSSA004761\",\"VZSSA004773\",\"VZSSA004785\",\"VZSSA004790\",\"VZSSA004802\",\"VZSSA004814\",\"VZSSA004826\",\"VZSSA004831\",\"VZSSA004843\",\"VZSSA004855\",\"VZSSA004860\",\"VZSSA004872\",\"VZSSA004884\",\"VZSSA004896\",\"VZSSA004901\",\"VZSSA004913\",\"VZSSA004925\",\"VZSSA004930\",\"VZSSA004942\",\"VZSSA004954\",\"VZSSA004966\",\"VZSSA004971\",\"VZSSA004995\",\"VZSSA005000\",\"VZSSA005012\",\"VZSSA005024\",\"VZSSA005036\",\"VZSSA005053\",\"VZSSA005065\",\"VZSSA005070\",\"VZSSA005082\",\"VZSSA005094\",\"VZSSA005106\",\"VZSSA005111\",\"VZSSA005123\",\"VZSSA005135\",\"VZSSA005140\",\"VZSSA005152\",\"VZSSA005164\",\"VZSSA005176\",\"VZSSA005181\",\"VZSSA005193\",\"VZSSA005205\",\"VZSSA005210\",\"VZSSA005234\",\"VZSSA005246\",\"VZSSA005251\",\"VZSSA005263\",\"VZSSA005275\",\"VZSSA005280\",\"VZSSA005292\",\"VZSSA005304\",\"VZSSA005316\",\"VZSSA005321\",\"VZSSA005333\",\"VZSSA005345\",\"VZSSA005350\",\"VZSSA005362\",\"VZSSA005374\",\"VZSSA005386\",\"VZSSA005391\",\"VZSSA005403\",\"VZSSA005415\",\"VZSSA005420\",\"VZSSA005432\",\"VZSSA005444\",\"VZSSA005456\",\"VZSSA005461\",\"VZSSA005485\",\"VZSSA005490\",\"VZSSA005502\",\"VZSSA005514\",\"VZSSA005526\",\"VZSSA005531\",\"VZSSA005543\",\"VZSSA005555\",\"VZSSA005560\",\"VZSSA005572\",\"VZSSA005584\",\"VZSSA005596\",\"VZSSA005601\",\"VZSSA005613\",\"VZSSA005625\",\"VZSSA005630\",\"VZSSA005642\",\"VZSSA005654\",\"VZSSA005671\",\"VZSSA005683\",\"VZSSA005695\",\"VZSSA005700\",\"VZSSA005712\",\"VZSSA005724\",\"VZSSA005736\",\"VZSSA005741\",\"VZSSA005753\",\"VZSSA005765\",\"VZSSA005770\",\"VZSSA005782\",\"VZSSA005794\",\"VZSSA005811\",\"VZSSA005823\",\"VZSSA005835\",\"VZSSA005852\",\"VZSSA005864\",\"VZSSA005876\",\"VZSSA005881\",\"VZSSA005893\",\"VZSSA005905\",\"VZSSA005922\",\"VZSSA005934\",\"VZSSA005946\",\"VZSSA005951\",\"VZSSA005963\",\"VZSSA005975\",\"VZSSA005980\",\"VZSSA005992\",\"VZSSA006004\",\"VZSSA006016\",\"VZSSA006021\",\"VZSSA006033\",\"VZSSA006045\",\"VZSSA006050\",\"VZSSA006062\",\"VZSSA006086\",\"VZSSA006091\",\"VZSSA006103\",\"VZSSA006115\",\"VZSSA006120\",\"VZSSA006132\",\"VZSSA006156\",\"VZSSA006161\",\"VZSSA006173\",\"VZSSA006190\",\"VZSSA006202\",\"VZSSA006214\",\"VZSSA006226\",\"VZSSA006231\",\"VZSSA006243\",\"VZSSA006272\",\"VZSSA006284\",\"VZSSA006301\",\"VZSSA006313\",\"VZSSA006325\",\"VZSSA006330\",\"VZSSA006342\",\"VZSSA006354\",\"VZSSA006366\",\"VZSSA006371\",\"VZSSA006383\",\"VZSSA006395\",\"VZSSA006400\",\"VZSSA006412\",\"VZSSA006436\",\"VZSSA006441\",\"VZSSA006453\",\"VZSSA006465\",\"VZSSA006470\",\"VZSSA006482\",\"VZSSA006494\",\"VZSSA006506\",\"VZSSA006511\",\"VZSSA006523\",\"VZSSA006535\",\"VZSSA006540\",\"VZSSA006552\",\"VZSSA006564\",\"VZSSA006576\",\"VZSSA006581\",\"VZSSA006593\",\"VZSSA006605\",\"VZSSA006610\",\"VZSSA006622\",\"VZSSA006634\",\"VZSSA006646\",\"VZSSA006651\",\"VZSSA006663\",\"VZSSA006675\",\"VZSSA006692\",\"VZSSA006704\",\"VZSSA006716\",\"VZSSA006721\",\"VZSSA006733\",\"VZSSA006745\",\"VZSSA006750\",\"VZSSA006762\",\"VZSSA006774\",\"VZSSA006786\",\"VZSSA006791\",\"VZSSA006803\",\"VZSSA006815\",\"VZSSA006820\",\"VZSSA006832\",\"VZSSA006844\",\"VZSSA006856\",\"VZSSA006861\",\"VZSSA006873\",\"VZSSA006885\",\"VZSSA006902\",\"VZSSA006914\",\"VZSSA006926\",\"VZSSA006931\",\"VZSSA006943\",\"VZSSA006955\",\"VZSSA006960\",\"VZSSA006972\",\"VZSSA006984\",\"VZSSA006996\",\"VZSSA007001\",\"VZSSA007013\",\"VZSSA007025\",\"VZSSA007030\",\"VZSSA007042\",\"VZSSA007054\",\"VZSSA007066\",\"VZSSA007071\",\"VZSSA007083\",\"VZSSA007095\",\"VZSSA007100\",\"VZSSA007112\",\"VZSSA007124\",\"VZSSA007136\",\"VZSSA007141\",\"VZSSA007153\",\"VZSSA007165\",\"VZSSA007170\",\"VZSSA007182\",\"VZSSA007194\",\"VZSSA007211\",\"VZSSA007223\",\"VZSSA007235\",\"VZSSA007240\",\"VZSSA007252\",\"VZSSA007264\",\"VZSSA007276\",\"VZSSA007281\",\"VZSSA007293\",\"VZSSA007305\",\"VZSSA007310\",\"VZSSA007322\",\"VZSSA007334\",\"VZSSA007346\",\"VZSSA007351\",\"VZSSA007375\",\"VZSSA007392\",\"VZSSA007404\",\"VZSSA007416\",\"VZSSA007421\",\"VZSSA007433\",\"VZSSA007445\",\"VZSSA007450\",\"VZSSA007462\",\"VZSSA007474\",\"VZSSA007486\",\"VZSSA007491\",\"VZSSA007503\",\"VZSSA007515\",\"VZSSA007520\",\"VZSSA007532\",\"VZSSA007544\",\"VZSSA007556\",\"VZSSA007561\",\"VZSSA007573\",\"VZSSA007585\",\"VZSSA007590\",\"VZSSA007602\",\"VZSSA007614\",\"VZSSA007626\",\"VZSSA007631\",\"VZSSA007643\",\"VZSSA007655\",\"VZSSA007660\",\"VZSSA007672\",\"VZSSA007684\",\"VZSSA007696\",\"VZSSA007701\",\"VZSSA007713\",\"VZSSA007725\",\"VZSSA007730\",\"VZSSA007742\",\"VZSSA007754\",\"VZSSA007766\",\"VZSSA007771\",\"VZSSA007783\",\"VZSSA007795\",\"VZSSA007800\",\"VZSSA007812\",\"VZSSA007824\",\"VZSSA007836\",\"VZSSA007841\",\"VZSSA007853\",\"VZSSA007865\",\"VZSSA007870\",\"VZSSA007882\",\"VZSSA007891\",\"VZSSA007903\",\"VZSSA007915\",\"VZSSA014862\",\"VZSSA014874\",\"VZSSA014886\",\"VZSSA014891\",\"VZSSA014904\",\"VZSSA014916\",\"VZSSA014921\",\"VZSSA014933\",\"VZSSA014945\",\"VZSSA014950\",\"VZSSA014962\",\"VZSSA014974\",\"VZSSA014986\",\"VZSSA015003\",\"VZSSA015015\",\"VZSSA015020\",\"VZSSA015032\",\"VZSSA015044\",\"VZSSA015056\",\"VZSSA015061\",\"VZSSA015073\",\"VZSSA015085\",\"VZSSA015090\",\"VZSSA015102\",\"VZSSA015114\",\"VZSSA015126\",\"VZSSA015131\",\"VZSSA015160\",\"VZSSA015172\",\"VZSSA015184\",\"VZSSA015196\",\"VZSSA015201\",\"VZSSA015213\",\"VZSSA015242\",\"VZSSA015254\",\"VZSSA015283\",\"VZSSA015295\",\"VZSSA015300\",\"VZSSA015312\",\"VZSSA015324\",\"VZSSA015336\",\"VZSSA015341\",\"VZSSA015353\",\"VZSSA015365\",\"VZSSA015370\",\"VZSSA015382\",\"VZSSA015394\",\"VZSSA015406\",\"VZSSA015411\",\"VZSSA015423\",\"VZSSA015435\",\"VZSSA015440\",\"VZSSA015452\",\"VZSSA015463\",\"VZSSA015475\",\"VZSSA015480\",\"VZSSA015492\",\"VZSSA015504\",\"VZSSA015516\",\"VZSSA015521\",\"VZSSA015533\",\"VZSSA015545\",\"VZSSA015550\",\"VZSSA015562\",\"VZSSA015574\",\"VZSSA015586\",\"VZSSA015591\",\"VZSSA015603\",\"VZSSA015615\",\"VZSSA015620\",\"VZSSA015632\",\"VZSSA015644\",\"VZSSA015656\",\"VZSSA015661\",\"VZSSA015673\",\"VZSSA015685\",\"VZSSA015690\",\"VZSSA015702\",\"VZSSA015714\",\"VZSSA015726\",\"VZSSA015731\",\"VZSSA015743\",\"VZSSA015755\",\"VZSSA015760\",\"VZSSA015772\",\"VZSSA015784\",\"VZSSA015796\",\"VZSSA015801\",\"VZSSA015813\",\"VZSSA015825\",\"VZSSA015830\",\"VZSSA015842\",\"VZSSA015854\",\"VZSSA015866\",\"VZSSA015871\",\"VZSSA015895\",\"VZSSA015900\",\"VZSSA015912\",\"VZSSA015936\",\"VZSSA015941\",\"VZSSA015953\",\"VZSSA015965\",\"VZSSA015970\",\"VZSSA015982\",\"VZSSA015994\",\"VZSSA016006\",\"VZSSA016011\",\"VZSSA016023\",\"VZSSA016035\",\"VZSSA016040\",\"VZSSA016052\",\"VZSSA016076\",\"VZSSA016081\",\"VZSSA016093\",\"VZSSA016101\",\"VZSSA016113\",\"VZSSA016125\",\"VZSSA016130\",\"VZSSA016142\",\"VZSSA016154\",\"VZSSA016166\",\"VZSSA016171\",\"VZSSA016183\",\"VZSSA016195\",\"VZSSA016200\",\"VZSSA016212\",\"VZSSA016224\",\"VZSSA016236\",\"VZSSA016241\",\"VZSSA016253\",\"VZSSA016265\",\"VZSSA016270\",\"VZSSA016294\",\"VZSSA016306\",\"VZSSA016311\",\"VZSSA016323\",\"VZSSA016335\",\"VZSSA016340\",\"VZSSA016352\",\"VZSSA016364\",\"VZSSA016376\",\"VZSSA016381\",\"VZSSA016393\",\"VZSSA016405\",\"VZSSA016410\",\"VZSSA016422\",\"VZSSA016434\",\"VZSSA016446\",\"VZSSA016451\",\"VZSSA016463\",\"VZSSA016475\",\"VZSSA016480\",\"VZSSA016492\",\"VZSSA016504\",\"VZSSA016516\",\"VZSSA016521\",\"VZSSA016533\",\"VZSSA016545\",\"VZSSA016550\",\"VZSSA016562\",\"VZSSA016574\",\"VZSSA016586\",\"VZSSA016591\",\"VZSSA016603\",\"VZSSA016615\",\"VZSSA016620\",\"VZSSA016632\",\"VZSSA016644\",\"VZSSA016656\",\"VZSSA016661\",\"VZSSA016673\",\"VZSSA016685\",\"VZSSA016690\",\"VZSSA016702\",\"VZSSA016714\",\"VZSSA016726\",\"VZSSA016731\",\"VZSSA016743\",\"VZSSA016755\",\"VZSSA016760\",\"VZSSA016772\",\"VZSSA016784\",\"VZSSA016796\",\"VZSSA016801\",\"VZSSA016813\",\"VZSSA016825\",\"VZSSA016830\",\"VZSSA016842\",\"VZSSA016854\",\"VZSSA016866\",\"VZSSA016871\",\"VZSSA016883\",\"VZSSA016895\",\"VZSSA016900\",\"VZSSA016912\",\"VZSSA016924\",\"VZSSA016936\",\"VZSSA016941\",\"VZSSA016953\",\"VZSSA016965\",\"VZSSA016970\",\"VZSSA016982\",\"VZSSA016994\",\"VZSSA017006\",\"VZSSA017011\",\"VZSSA017023\",\"VZSSA017035\",\"VZSSA017040\",\"VZSSA017052\",\"VZSSA017064\",\"VZSSA017076\",\"VZSSA017081\",\"VZSSA017093\",\"VZSSA017105\",\"VZSSA017110\");\n} //fin de if($IdEstado == \"30\")\n\n//Condicion de estado-clues\nif($IdEstado == \"31\"){\n\t$Clues = array(\"YNSSA000022\",\"YNSSA000034\",\"YNSSA000046\",\"YNSSA000051\",\"YNSSA000063\",\"YNSSA000075\",\"YNSSA000092\",\"YNSSA000104\",\"YNSSA000116\",\"YNSSA000121\",\"YNSSA000133\",\"YNSSA000145\",\"YNSSA000150\",\"YNSSA000162\",\"YNSSA000174\",\"YNSSA000186\",\"YNSSA000203\",\"YNSSA000215\",\"YNSSA000220\",\"YNSSA000232\",\"YNSSA000244\",\"YNSSA000256\",\"YNSSA000273\",\"YNSSA000285\",\"YNSSA000290\",\"YNSSA000314\",\"YNSSA000326\",\"YNSSA000331\",\"YNSSA000343\",\"YNSSA000355\",\"YNSSA000360\",\"YNSSA000372\",\"YNSSA000384\",\"YNSSA000396\",\"YNSSA000401\",\"YNSSA000413\",\"YNSSA000425\",\"YNSSA000442\",\"YNSSA000454\",\"YNSSA000466\",\"YNSSA000471\",\"YNSSA000483\",\"YNSSA000524\",\"YNSSA000541\",\"YNSSA000553\",\"YNSSA000565\",\"YNSSA000570\",\"YNSSA000582\",\"YNSSA000606\",\"YNSSA000611\",\"YNSSA000623\",\"YNSSA000635\",\"YNSSA000640\",\"YNSSA000664\",\"YNSSA000676\",\"YNSSA000681\",\"YNSSA000693\",\"YNSSA000705\",\"YNSSA000710\",\"YNSSA000734\",\"YNSSA000746\",\"YNSSA000751\",\"YNSSA000763\",\"YNSSA000780\",\"YNSSA000792\",\"YNSSA000804\",\"YNSSA000821\",\"YNSSA000833\",\"YNSSA000845\",\"YNSSA000850\",\"YNSSA000862\",\"YNSSA000886\",\"YNSSA000891\",\"YNSSA000903\",\"YNSSA000915\",\"YNSSA000920\",\"YNSSA000932\",\"YNSSA000944\",\"YNSSA000956\",\"YNSSA000961\",\"YNSSA000973\",\"YNSSA000985\",\"YNSSA000990\",\"YNSSA001002\",\"YNSSA001014\",\"YNSSA001026\",\"YNSSA001031\",\"YNSSA001043\",\"YNSSA001055\",\"YNSSA001060\",\"YNSSA001072\",\"YNSSA001084\",\"YNSSA001096\",\"YNSSA001101\",\"YNSSA001113\",\"YNSSA001125\",\"YNSSA001130\",\"YNSSA001142\",\"YNSSA001154\",\"YNSSA001166\",\"YNSSA001171\",\"YNSSA001183\",\"YNSSA001195\",\"YNSSA001200\",\"YNSSA001212\",\"YNSSA001224\",\"YNSSA001236\",\"YNSSA001241\",\"YNSSA001253\",\"YNSSA001265\",\"YNSSA001270\",\"YNSSA001282\",\"YNSSA001294\",\"YNSSA001306\",\"YNSSA001311\",\"YNSSA001323\",\"YNSSA001335\",\"YNSSA001340\",\"YNSSA001352\",\"YNSSA001376\",\"YNSSA001393\",\"YNSSA001405\",\"YNSSA001422\",\"YNSSA001446\",\"YNSSA001451\",\"YNSSA001463\",\"YNSSA001475\",\"YNSSA001480\",\"YNSSA001492\",\"YNSSA001504\",\"YNSSA001516\",\"YNSSA001521\",\"YNSSA001533\",\"YNSSA001545\",\"YNSSA001550\",\"YNSSA001562\",\"YNSSA001574\",\"YNSSA001586\",\"YNSSA001591\",\"YNSSA001603\",\"YNSSA001615\",\"YNSSA001620\",\"YNSSA001632\",\"YNSSA001644\",\"YNSSA001656\",\"YNSSA001661\",\"YNSSA001702\",\"YNSSA001714\",\"YNSSA001726\",\"YNSSA001731\",\"YNSSA001743\",\"YNSSA013423\",\"YNSSA013435\",\"YNSSA013440\",\"YNSSA013452\",\"YNSSA013464\",\"YNSSA013476\",\"YNSSA013481\",\"YNSSA013510\",\"YNSSA013522\",\"YNSSA013534\",\"YNSSA013546\",\"YNSSA013551\",\"YNSSA013563\",\"YNSSA013575\",\"YNSSA013580\",\"YNSSA013604\",\"YNSSA013616\",\"YNSSA013621\",\"YNSSA013633\",\"YNSSA013645\",\"YNSSA013650\",\"YNSSA013662\",\"YNSSA013674\",\"YNSSA013684\",\"YNSSA013696\",\"YNSSA013701\",\"YNSSA013713\",\"YNSSA013725\",\"YNSSA013730\",\"YNSSA013742\",\"YNSSA013766\",\"YNSSA013771\",\"YNSSA013783\",\"YNSSA013795\",\"YNSSA013800\",\"YNSSA013812\",\"YNSSA013824\",\"YNSSA013836\",\"YNSSA013841\",\"YNSSA013853\",\"YNSSA013865\",\"YNSSA013870\",\"YNSSA013882\",\"YNSSA013894\",\"YNSSA013906\",\"YNSSA013911\",\"YNSSA013923\",\"YNSSA013935\",\"YNSSA013981\",\"YNSSA013993\",\"YNSSA014005\",\"YNSSA014010\",\"YNSSA014022\",\"YNSSA014034\",\"YNSSA014046\",\"YNSSA014051\",\"YNSSA014063\",\"YNSSA014075\",\"YNSSA014080\",\"YNSSA014092\",\"YNSSA014104\",\"YNSSA014116\",\"YNSSA014121\",\"YNSSA014133\",\"YNSSA014145\",\"YNSSA014150\",\"YNSSA014162\");\n} //fin de if($IdEstado == \"31\")\n\t\n\t\n\t$LocCampo = $Campo;\n\tif (strlen($LocCampo) == 11){\n\t\tif(!in_array($LocCampo,$Clues)){ \n\t\t\t$Error = $NumReg .\"|\".$DI_68.\"|\".$LocCampo.\"|\" . $DI_68_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_68.\"|\".$LocCampo.\"|\" . $DI_68_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function validaSelect($selectDestino)\n{\n\tglobal $listadoSelects;\n\tif(isset($listadoSelects[$selectDestino])) return true;\n\telse return false;\n}", "public function validateEditor($attribute, $params)\n\t{\n\t\t $this->addError($attribute, QUESTION_BLANK_ERR);\n\t}", "function validateEthnicity($id){\n global $isValidSSWelcome;\n if (in_array($id, array(1,2,3,4,5,6,7,8,9,10,11))){\n return;\n }\n else{\n echo \"<p>Please select an Ethnicity Option</p>\";\n $isValidSSWelcome = false;\n\n }\n}", "function validate() {\n $errors = parent::validate();\n // Verify that search fields are set up.\n $style_options = $this->get_option('style_options');\n if (!isset($style_options['search_fields'])) {\n $errors[] = t('Display \"@display\" needs a selected search fields to work properly. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title));\n }\n else {\n // Verify that the search fields used actually exist.\n //$fields = array_keys($this->view->get_items('field'));\n $fields = array_keys($this->handlers['field']);\n foreach ($style_options['search_fields'] as $field_alias => $enabled) {\n if ($enabled && !in_array($field_alias, $fields)) {\n $errors[] = t('Display \"@display\" uses field %field as search field, but the field is no longer present. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title, '%field' => $field_alias));\n }\n }\n }\n return $errors;\n }", "private function tbl_permisos_seleccion() {\r\n\t\t\t$this->permisos_seleccion = $this->esquema->createTable('PERMISOS_SELECCION');\r\n\t\t\t$this->permisos_seleccion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso Seleccion'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->addColumn('PERMISO', '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 Permiso del Usuario [ID de la tabla PERMISOS]'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->addColumn('MODULO', '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 Permiso del Modulo [ID de la tabla PERMISOS_MODULOS]'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->addColumn('ACCESO', '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 Permiso del Permiso Acceso [ID de la tabla PERMISOS_ACCESO]'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->permisos_seleccion->addForeignKeyConstraint($this->permisos, array('PERMISO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->permisos_seleccion->addForeignKeyConstraint($this->permisos_modulo, array('MODULO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->permisos_seleccion->addForeignKeyConstraint($this->permisos_acceso, array('ACCESO'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function validate()\n {\n if ($this->getSearchOperatorsControl()->getValue() === GridSearchDialogBase::OPER_LOGICAL_BETWEEN)\n {\n $this->argumentAltControl->setIsRequired(true);\n }\n \n return parent::validate();\n }", "public function validate()\n {\n if ($this->getSearchOperatorsControl()->getValue() === GridSearchDialogBase::OPER_LOGICAL_BETWEEN)\n {\n $this->argumentAltControl->setIsRequired(true);\n }\n \n return parent::validate();\n }", "public function _on_validate()\n {\n return true;\n }", "function add_user_validation($jenis_pengguna) {\n global $pesan_error; //memanggil global variabel tampungan error\n global $conn; //memanggil koneksi di global\n //select databse berdasarkan nama pengguna yang ada di data $_POST\n $q = $conn->prepare(\"SELECT * FROM pengguna WHERE nama_pengguna='{$_POST['nama-pengguna']}' AND aktif='1'\");\n $q->execute();\n //jika menghasilkan nilai (setidaknya ada 1/true) maka data tersebut sudah ada, dan tidak diperbolehkan\n if (@$q->fetchAll()) $pesan_error['nama-pengguna'] = 'Nama pengguna sudah digunakan';\n validasi_masukan_alfanumerik($pesan_error, 'nama-pengguna'); //validasi aflanumerik untuk nama pengguna\n validasi_masukan_wajib($pesan_error, 'nama-pengguna'); //masukan wajib juga\n validasi_masukan_minimal($pesan_error, 'sandi', 4); //validasi minimal 4 untuk sandi\n validasi_masukan_wajib($pesan_error, 'sandi'); //validasi wajib juga\n validasi_masukan_sama($pesan_error, 'konfirmasi-sandi', 'sandi', 'Sandi'); //validasi harus sama dengan konfirmasi sandi\n validasi_masukan_alfabet($pesan_error, 'nama'); //validasi alfabet untuk nama tampilan\n validasi_masukan_wajib($pesan_error, 'nama'); //validasi wajib juga\n $q = $conn->prepare(\"SELECT * FROM pengguna WHERE nomor_hp='{$_POST['nomor-hp']}'\"); //melakukan select berdasarkan data nomor hp yang dimasukkan\n $q->execute();\n //jika ternyata ada nilainya, maka data tersebut sudah ada dan tidak boleh\n if (@$q->fetchAll()) $pesan_error['nomor-hp'] = 'Nomor HP sudah digunakan';\n validasi_masukan_panjang($pesan_error, 'nomor-hp', 10, 15); //validasi minimal 10 dan maks 15 untuk no hp\n validasi_masukan_numerik($pesan_error, 'nomor-hp'); //numerik juga\n validasi_masukan_wajib($pesan_error, 'nomor-hp'); //dan masukan wajib\n $q = $conn->prepare(\"SELECT * FROM pengguna WHERE email='{$_POST['email']}'\"); //melakuakn select pada email berdasarkan data yang dimasukkan\n $q->execute();\n //jika ada (true), maka tidak diperbolehkan\n if (@$q->fetchAll()) $pesan_error['email'] = 'E-mail sudah digunakan';\n validasi_masukan_email($pesan_error, 'email'); //validasi format email\n validasi_masukan_wajib($pesan_error, 'email'); //masukan wajib juga\n if ($jenis_pengguna!=0) { //jika jenis penggunanya tidak 0 (bukan admin) harus ada validasi setoran awal untuk nomor rekening\n if ($_POST['set-awal'] < 50000) $pesan_error['set-awal'] = 'Minimal Rp 50.000,-'; //pengecekan jika saldo awal kurang dari 50 ribu\n validasi_masukan_numerik($pesan_error, 'set-awal'); //validasi numerik\n validasi_masukan_wajib($pesan_error, 'set-awal'); //masukan wajib juga\n }\n if (!empty($pesan_error)) return; //jika ada pesan error, maka ditahan sampai disini dengan return\n //memasukkan data yang baru tadi ke tabel pengguna\n $q = $conn->prepare(\"INSERT INTO pengguna VALUES ('{$_POST['nama-pengguna']}', SHA2('{$_POST['sandi']}', 0), '$jenis_pengguna', '{$_POST['email']}', '{$_POST['nama']}', '{$_POST['alamat']}', '{$_POST['nomor-hp']}', '1')\");\n $q->execute();\n //jika yang ditambahkan bukan admin, maka akan memanggil validasi penambahan rekening juga dan proses penyimpanan dan validasinya ada di sana\n if ($jenis_pengguna!=0) add_bank_account_validation();\n}", "static public function ctrEditarClase(){\r\n\r\n\r\n if(isset($_POST[\"editarDescripClase\"])){\r\n\r\n\r\n if(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarDescripClase\"])){\r\n\r\n $tabla = \"tbl_clases\";\r\n\r\n $datos = array(\"Id_Clase\" => $_POST[\"editarIdClase\"],\r\n \"DescripClase\" => strtoupper($_POST[\"editarDescripClase\"]),\r\n \"Duracion\" => $_POST[\"editarDuracion\"]);\r\n\r\n $respuesta = ModeloClases::mdlEditarClase($tabla, $datos);\r\n\r\n if($respuesta == \"ok\"){\r\n\r\n echo'<script>\r\n\r\n swal({\r\n type: \"success\",\r\n title: \"La Clase ha sido editada correctamente\",\r\n showConfirmButton: true,\r\n confirmButtonText: \"Cerrar\",\r\n closeOnConfirm: false\r\n }).then((result) => {\r\n if (result.value) {\r\n\r\n window.location = \"modalidades\";\r\n\r\n }\r\n })\r\n\r\n </script>';\r\n\r\n }\r\n\r\n }else{\r\n\r\n echo'<script>\r\n\r\n swal({\r\n type: \"error\",\r\n title: \"¡El nombre de la Clase no puede ir vacío o llevar caracteres especiales!\",\r\n showConfirmButton: true,\r\n confirmButtonText: \"Cerrar\",\r\n closeOnConfirm: false\r\n }).then((result) => {\r\n if (result.value) {\r\n\r\n window.location = \"modalidades\";\r\n\r\n }\r\n })\r\n\r\n </script>';\r\n\r\n }\r\n\r\n }\r\n\r\n }", "public function validate_and_convert_id($insert_data)\r\n {\r\n // Perform type cast to ensure it is array\r\n //$insert_data = (array) $insert_data;\r\n \r\n if($this->is_error === true){return;}\r\n \r\n // Convert name to id name\r\n $insert_data = $this->_convert_id($insert_data);\r\n \r\n $new_dataset = array();\r\n $data_hit = false;\r\n \r\n if($this->is_error === true){return;}\r\n\r\n // Validate the column and transfer data\r\n foreach ($this->column_list() as $checker)\r\n {\r\n $column = $checker[\"name\"];\r\n\r\n // @todo - strict check, as currently as the key exist it allow it to be pass\r\n if(array_key_exists($column, $insert_data))\r\n {\r\n $new_dataset[$column] = $insert_data[$column];\r\n $data_hit = true;\r\n }\r\n elseif ($checker[\"must_have\"] === true)\r\n {\r\n $display_list = json_encode($insert_data);\r\n $this->set_error(\r\n \"MBE-\".$this->model_code.\"-VACI-1\", \r\n \"Internal error, please contact admin\", \r\n \"Missing $column in $display_list for model \".$this->model_name);\r\n }\r\n }\r\n \r\n return $new_dataset;\r\n }", "function select($name = \"txt\", $alttext = \"\", $selecttype = \"array\", $lookup = \"\", $value = \"\", $event = \"\", $cssid = \"\", $readonly = false, $nochoose = true) {\n\n if (isset($_REQUEST[$name])) {\n if ($value == \"\") {\n $value = $_REQUEST[$name];\n }\n }\n $lookuplist = [];\n if ($selecttype == \"array\" || $selecttype == \"multiarray\") {\n\n if (is_array($lookup)) {\n $lookuplist = $lookup;\n } else {\n $lookuplist = explode(\"|\", $lookup);\n }\n } else if ($selecttype == \"sql\" || $selecttype == \"multisql\") {\n $lookuprow = $this->DEB->getRows($lookup, DEB_ARRAY); //format [0] = NAME\n\n\n foreach ($lookuprow as $irow => $row) {\n $lookuplist[$irow] = $row[0] . \",\" . $row[1]; //make it in the form of array\n }\n }\n //make options for the type of select etc .....\n if ($selecttype == \"multiarray\" || $selecttype == \"multisql\") {\n $options = \"multiple=\\\"multiple\\\"\";\n } else {\n $options = \"\";\n }\n if ($readonly == true) {\n $disabled = \"disabled=\\\"disabled\\\"\";\n } else {\n $disabled = \"\";\n }\n //default text\n if ($alttext == \"\") {\n $alttext = \"Choose\";\n }\n if ($cssid != \"\") {\n $cssid = \"id=\\\"{$cssid}\\\"\";\n } else {\n $cssid = \"\";\n }\n $html = \"<select class=\\\"form-control\\\" $cssid name=\\\"{$name}\\\" $options {$event} $disabled >\";\n\n if (!$nochoose) {\n $html .= \"<option value=\\\"\\\">{$alttext}</option>\";\n }\n\n foreach ($lookuplist as $lid => $option) {\n\n $toption = explode(\",\", $option);\n if (count($toption) != 2) {\n $toption[0] = $lid;\n $toption[1] = $option;\n }\n\n $option = $toption;\n\n if (trim($value) == trim($option[0])) {\n $html .= \"<option selected=\\\"selected\\\" value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n } else {\n $html .= \"<option value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n }\n }\n $html .= \"</select>\";\n return $html;\n }", "function fncValidaDI_27($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_27 = \"(27)Centro de Responsabilidad\";\n\t$DI_27_ErrTam = \"Tamaño de campo Centro de Responsabilidad debe ser a 10 Caracters\";\n\t$DI_27_Edo \t = \"El Centro de Responsabilidad no corresponde al Estado\";\n\t$DI_27_CR \t = \"El Centro de Responsabilidad no corresponde al catalogo de DGRH\";\n\t\n\t// agregar catalogo de Municpios\n $Edo= array($IdEstado);\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DIEZ)\n\t{\n\t\tif(!in_array(substr($LocCampo,0,2),$Edo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_27.\"|\".$LocCampo.\"|\" . $DI_27_Edo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t\tif(!preg_match(\"/\\d{8}/\",substr($LocCampo,2,8)))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_27.\"|\".$LocCampo.\"|\" . $DI_27_CR.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_27.\"|\".$LocCampo.\"|\" . $DI_27_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function onBeforeEdit() {\n\t\treturn true;\n\t}", "function selectEntry($display,$name,$options,$errors,$selected=0)\n{\n\t$returnVal = \"<tr>\n\t\t<td>$display:</td>\n\t\t<td>\n\t\t\t<select name='$name'>\n\t\t\t<option value='0'>Choose one...</option>\";\n\t\t\tforeach ($options as $key=>$option)\n\t\t\t{\n\t\t\t\tif ($key == $selected)\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$key' selected>\n\t\t\t\t\t\t\t\t$option</option>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$key'>\n\t\t\t\t\t\t\t\t$option</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$returnVal .= \"</select>\n\t\t</td>\n\t\t</tr>\";\n\n\t\tif (array_key_exists($name,$errors))\n\t\t{\n\t\t\t$returnVal .= addErrorRow($name,$errors);\n\t\t}\n\treturn $returnVal;\n}", "public function validate() {\n//\t\tif( intval($this->params[\"startYear\"] < date(\"yyyy\"))) $this->add_validation_error(\"Season cannot exist in the past.\");\n\t}", "protected function prepareForValidation()\n {\n $input = array_filter(\n $this->all(['voucher-start', 'voucher-end', 'centre', 'date-sent']),\n 'strlen'\n );\n\n foreach ($input as $key => $value) {\n if (in_array($key, ['voucher-start', 'voucher-end'])) {\n $clean = Voucher::cleanCodes((array)$value);\n $input[$key] = strtoupper((array_shift($clean)));\n }\n }\n // replace old input with new input\n $this->replace($input);\n }", "function presentInputForm($id, $matr, $cargo, $agrup, $eaf, $ecom, $epp, $n_ref, $ref, $tipo, $obs,$ano, $fcnLetter)\n {\n global $BD3;\n global $BD1;\n global $ANO_REF;\n switch ($fcnLetter)\n {\n case \"E\":\n case \"A\":\n break;\n default: \n print \"<p><h1>Letra de funcao ilegal ($fcnLetter) in presentInputForm()<p>\\n\";\n print \"<p><a href=\\\"cadastra.php\\\">Volte para selecionar </a>\";\nreturn;\n break;\n }\n\n echo \"<font class=corpo><b>Cadastramento</b></font> <br><br>\";\n print \"<form action=\\\"cadastra.php\\\" method=\\\"POST\\\">\\n\";\n\n $res_sql_nome= sql($BD1,\"select $BD1.empregados.nome from $BD1.empregados where $BD1.empregados.matr='$matr'\");\n $res_nome= mysql_result($res_sql_nome,0,\"nome\");\n\n switch ($fcnLetter)\n {\n case \"E\": //don't allow editing of key value\n echo \" $id\\n\";\n echo \" - \";\n echo \" $res_nome\\n\";\n\n $rec_nome=sql($BD1,\"SELECT matr,nome \n FROM empregados\n WHERE empregados.tipo='e'\n AND empregados.situacao='a'\n ORDER BY nome;\");\n\n print \"<input type=\\\"hidden\\\" name=\\\"HILid\\\" value=\\\"$id\\\">\\n<br>\";\n print \"<input type=\\\"hidden\\\" name=\\\"TImatr\\\" value=\\\"$matr:::$res_nome\\\">\\n<br>\";\n break;\n case \"A\":\n $rec_nome=sql($BD1,\"SELECT $BD1.empregados.matr, $BD1.empregados.nome\n FROM $BD1.empregados\n WHERE $BD1.empregados.tipo = 'e'\n AND $BD1.empregados.situacao = 'a'\n AND $BD1.empregados.matr NOT IN ( SELECT matr FROM $BD3.final WHERE ano=$ANO_REF)\n ORDER BY $BD1.empregados.nome;\");\n\n echo \"<br>Matricula: \";\n break;\n }\n \n if ($fcnLetter ==\"A\")\n {\n echo \"<SELECT NAME=\\\"TImatr\\\">\\n\";\n while ($lista4=mysql_fetch_row($rec_nome))\n {\n if ($lista4[0]== $matr)\n {\n echo \"<OPTION SELECTED>\";\n echo \"$lista4[0]\".\":::\".\"$lista4[1]\";\n }\n else\n {\n echo \"<OPTION>\";\n echo \"$lista4[0]\".\":::\".\"$lista4[1]\";\n }\n }\n echo \"</SELECT>\\n\";\n }\n echo \"<br>\";\n echo \"<br><i>Atencao:Utilize pontos nas casas decimais</i>\";\n echo \"<br>\";\n print \"<br>EAF: \";\n print \"<input type=\\\"text\\\" name=\\\"TIeaf\\\" value=\\\"$eaf\\\" size=10 maxlength=10>\\n<br>\";\n\n print \"<br>ECOM: \";\n print \"<input type=\\\"text\\\" name=\\\"TIecom\\\" value=\\\"$ecom\\\" size=10 maxlength=10>\\n<br>\";\n\n print \"<br>EPP: \";\n print \"<input type=\\\"text\\\" name=\\\"TIepp\\\" value=\\\"$epp\\\" size=10 maxlength=10>\\n<br>\";\n/*\n print \"<br>Classificacao no agrupamento: \";\n print \"<input type=\\\"text\\\" name=\\\"TIclass\\\" value=\\\"$class\\\" size=2 maxlength=2>\\n<br>\";\n*/\n\n print \"<br>Numero de Referencias : \";\n print \"<input type=\\\"text\\\" name=\\\"TIn_ref\\\" value=\\\"$n_ref\\\" size=2 maxlength=2>\\n<br>\";\n\n print \"<br>Nova referencia: \";\n print \"<input type=\\\"text\\\" name=\\\"TIref\\\" value=\\\"$ref\\\" size=5 maxlength=5>\\n<br>\";\n\n# print \"<br>Tipo (e-elegivel n-Nao elegivel): \";\n# print \"<input type=\\\"text\\\" name=\\\"TItipo\\\" value=\\\"$tipo\\\" size=2 maxlength=2>\\n<br>\";\n\n echo \"<br>\";\n echo \"<br>\";\n echo \"<INPUT TYPE=RADIO NAME=\\\"TItipo\\\" VALUE=\\\"e\\\"\";\n if ($tipo==\"e\")\n {\n echo \" checked>Elegivel\";\n }\n else\n {\n echo \" >Elegivel\";\n }\n echo \"<INPUT TYPE=RADIO NAME=\\\"TItipo\\\" VALUE=\\\"n\\\"\";\n if ($tipo==\"t\")\n {\n echo \" checked>Nao elegivel\";\n }\n else\n {\n echo \" >Nao elegivel\";\n }\n\n echo \"<br>\";\n echo \"<br>\";\n\n print \"<br>Observacaoes: \";\n print \"<input type=\\\"text\\\" name=\\\"TIobs\\\" value=\\\"$obs\\\" size=50 maxlength=200>\\n<br>\";\n print \"<input type=\\\"HIDDEN\\\" name=\\\"TIano\\\" value=\\\"$ANO_REF\\\">\\n<br>\";\n\n\n //**** PLACE FUNCTION LETTER IN BUTTON NAMES TO CONVEY STATE ****\n print \" <p><input type=\\\"submit\\\" name=\\\"B\" . $fcnLetter;\n print \"Submit\\\" value=\\\"Submit\\\">\\n\";\n print \"&nbsp;&nbsp;\\n\";\n\n print \"<input type=\\\"submit\\\" name=\\\"B\" . $fcnLetter;\n print \"Cancel\\\" value=\\\"Cancel\\\">\\n\";\n print \"</form>\\n\";\n\n }", "function validate_chauffeur_by_name($chauffeur_name,$warning_me=false){\n\n global $connection;\n global $errors;\n global $warnings;\n\n\n $safe_chauffeur = mysqli_real_escape_string($connection, $chauffeur_name);\n $field = $safe_chauffeur;\n\n $msg_chauffeur=\"\";\n\n $query = \"SELECT * \";\n $query .= \"FROM chauffeurs \";\n $query .= \"WHERE chauffeur_name = '{$safe_chauffeur}' \";\n $query .= \"LIMIT 1\";\n $chauffeur_set = mysqli_query($connection, $query);\n confirm_query($chauffeur_set);\n\n $chauffeur_count = mysqli_num_rows($chauffeur_set);\n if($chauffeur_count == 0) {\n\n // $text=\"<br><a href='new_chauffeur.php'>Ajouter un chauffeur</a> \";\n\n if($warning_me){\n $warnings[$field] = fieldname_as_text($field) . \" n'est pas inclus dans la liste des chauffeurs. Si c'est un nouveau chauffeur demander à l'adminstrateur de le rajouter\";\n $msg_chauffeur=$warnings[$field];\n }else{\n\n $errors[$field] = fieldname_as_text($field) . \" n'est pas inclus dans la liste des chauffeurs. Si c'est un nouveau chauffeur demander à l'adminstrateur de le rajouter\";\n $msg_chauffeur=$errors[$field];\n }\n\n\n\n }\n\n\n mysqli_free_result($chauffeur_set);\n return $msg_chauffeur;\n}", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "function insert()\n\t{\n\t\t$this->edit(true);\n\t}", "public function validate()\n {\n // query for validation information\n // set the validation flag\n // close database\n }", "protected function localValidation()\n\t\t{\n\t\t}", "protected function prepareValidations() {}" ]
[ "0.558866", "0.5427373", "0.53022766", "0.5189251", "0.51486194", "0.51402164", "0.5112708", "0.5078795", "0.5063454", "0.495644", "0.49560943", "0.494284", "0.49298766", "0.4879945", "0.48395976", "0.48100886", "0.48039868", "0.48031828", "0.48013327", "0.4796365", "0.47957262", "0.477337", "0.47716603", "0.47709462", "0.47689688", "0.47666636", "0.47535625", "0.4741288", "0.47237122", "0.47233117", "0.47212487", "0.4716673", "0.47157073", "0.47145733", "0.4714254", "0.47103262", "0.47014654", "0.46993664", "0.4695683", "0.4695471", "0.4695322", "0.4693701", "0.4689973", "0.46797344", "0.46782368", "0.46751717", "0.4657737", "0.4655501", "0.46484628", "0.46428016", "0.46386868", "0.46317473", "0.46304554", "0.46250013", "0.46222723", "0.46210217", "0.46151614", "0.461133", "0.46104205", "0.46087992", "0.46064636", "0.4603398", "0.46024254", "0.4602169", "0.45982015", "0.45966825", "0.45954448", "0.45953625", "0.4582374", "0.45778343", "0.4572178", "0.45712367", "0.45668805", "0.45607924", "0.45532832", "0.4551667", "0.45507243", "0.4543762", "0.45395333", "0.45344767", "0.4533479", "0.4532392", "0.45313323", "0.45313323", "0.45275742", "0.4527498", "0.45264423", "0.45228952", "0.45216346", "0.4521592", "0.45191887", "0.45177412", "0.45167693", "0.45166352", "0.4514233", "0.45127273", "0.45115703", "0.45114076", "0.45043147", "0.4502334", "0.44994962" ]
0.0
-1
Function Insert the selected column into the board with the current player Id Player 1 as [1] or Player 2 as [2] cell update only if the cell is empty
protected function insertMoveToBoard($userMove){ $current_player = "[$this->currentPlayer]"; for($row = ($this->board->getRows() - 1) ; $row >-1 ; $row-- ){ //check if cell is empty if($this->board->gameBoard[$row][$userMove-1] == Board::CELL){ $this->board->gameBoard[$row][$userMove-1] = $current_player; $this->lastRowInsert =$row; $this->totalMoves++; break; } else{ continue; } } echo $this->board->printBoard(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPiece($col){\n\t\t$gameId = getCurrentGameIdFromPlayerId();\n\t\tif(!$gameId['currentGameId']){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting currentGameId of player\");\n\t\t}\n\t\n\t\t$gameId = $gameId['currentGameId'];\n\t\t$game = getCurrentGame($gameId);\n\t\tif(!$game){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting current game of player\");\n\t\t}\n\t\t\n\t\t//check if player is on turn\n\t\tif($game['nextTurn'] != $_SESSION['playerId']){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"its not your turn\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\t$board = json_decode($game['board']);\n\t\tfor($i = -1;$i<count($board)-1;$i++){\n\t\t\tif($board[$i+1][$col]!=0){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif($i==-1){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"column is full\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\tif($game['player1']==$_SESSION['playerId']){\n\t\t\t$nextTurnPlayer = $game['player2'];\n\t\t\t$playerNumber = 1;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}else{\n\t\t\t$nextTurnPlayer = $game['player1'];\n\t\t\t$playerNumber = 2;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}\n\t\t\n\t\t//save updated board\n\t\t$my_db = mysqli_connect($GLOBALS['servername'],$GLOBALS['username'],$GLOBALS['password'],$GLOBALS['db_name']) or die(\"db connection konnte nicht hergestellt werden\");\n\t\t$updateGameQuery = \"UPDATE games SET board='\".json_encode($board).\"',nextTurn=\".$nextTurnPlayer.\" WHERE gameId=\".$game['gameId'];\n\t\t$result = $my_db->query($updateGameQuery);\n\t\tif(!$result){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error udpating game in database\");\n\t\t}\t\t\n\t\t\n\t\t$gameOver = checkWin($board,$i,$col,$playerNumber);\n\t\tif($gameOver){\n\t\t\t$gameOverQuery = \"UPDATE games SET gameOver=1,nextTurn=0,winner=\".$_SESSION['playerId'].\" WHERE gameId=\".$game['gameId'];\n\t\t\t$result = $my_db->query($gameOverQuery);\n\t\t\t\n\t\t\tif(!$result){\n\t\t\t\thttp_response_code(500);\n\t\t\t\tdie(\"error updating gameOver field\");\n\t\t\t}\n\t\t}\n\t}", "function pick_move() {\n for ($cell = 0; $cell < 8; $cell++) {\n\n //if this the cell is a dash put an X in it\n if ($this->position[$cell] == '-') {\n\n //place X in the following cell\n $this->position[$cell] = 'x';\n break;\n }\n }\n }", "public function switchPlayer(){\n\t\tfor($col = 0; $col < 3; $col++){\n\t\t\tfor($row = 0; $row < 3; $row++){\n\t\t\t\tif(isset($_GET[\"cell-\".$col.\"-\".$row])){\n\t\t\t\t\tif($this->player1->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player1;\n\t\t\t\t\t}\n\t\t\t\t\tif($this->player2->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->currentPlayer === $this->player1){\n\t\t\t$this->currentPlayer = $this->player2;\n\t\t} else {\n\t\t\t$this->currentPlayer = $this->player1;\n\t\t}\n\t}", "function updateBoard() {\n\tglobal $game, $message;\n\t$cellClicked = $game['clicked']; //identify which button was submitted \t\t\t\t\t\n\tif ($cellClicked !== 9 ) {\n\t\t$curPos = $cellClicked; // get the actual button clicked. 0 to 8 correspond to respective cell\n\t\t$game[\"board\"][$curPos] = $game[\"player\"]; // set our game's data with player mark\n\t\t$game[\"player\"] = ($game[\"player\"]+1)%2; // switch the player turn\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t} else {\n\t\t$game[\"player\"] = 0;\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t}\n\t$message = \"Player \".substr($game[\"playToken\"],$game[\"player\"],1).\" go!\";\n}", "public function addInsert() {\n if(count($this->cols) != 0) {\n // Only use the parameters that match with columns\n $params = array_slice($this->params, 0, count($this->cols));\n $this->sql .= \" (\" . implode(\", \", $this->cols) . \")\";\n $this->sql .= \" VALUES (\" . implode(\", \", $this->params) . \")\";\n }\n }", "function place($column, $player){\n for($row = $this->height-1; $row >= 0; $row--){\n if($this->places[$column][$row] == 0){\n $this->places[$column][$row] = $player;\n return $row;\n }\n }\n return -1;\n }", "function show_cell($which) {\r\n $token = $this->position[$which];\r\n if ($token <> '-') {\r\n $player_board = str_split($this->board); \r\n return '<td style=\"text-align:center;' . ($token != $player_board[$which] ? ' background-color: #FFA500;' : '' ) . '\"><div style=\"padding: 1em;\">' . $token . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $which . ':(' . ((int) ($which / $this->grid_size) + 1) . ',' . (($which % $this->grid_size) + 1) . ')</span>') : '') . '</div></td>';\r\n }\r\n $this->newposition = $this->position; \r\n $this->newposition[$which] = 'x'; \r\n $move = implode($this->newposition); \r\n $link = '?size=' . $this->grid_size . '&board=' . $move . ($this->debug ? '&debug' : ''); \r\n return '<td style=\"text-align:center;\"><a href = \"' . $link . '\" style = \"text-decoration: none;\"><div style=\"padding: 1em;\">-' . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $which . ':(' . ((int) ($which / $this->grid_size) + 1) . ',' . (($which % $this->grid_size) + 1) . ')</span>') : '') . '</div></a></td>';\r\n }", "function makePlayerMove($x,$y){\n if (!$this->board->isEmpty($x,$y)){\n return False;\n } else {\n $this->board[$x][$y] = 2;\n }\n }", "public function run()\n {\n DB::table('players')->insert([\n ['name' => 'Kane Williamson', 'age' => '29', 'role' => 'Top-order', 'batting' => 'Right-hand', 'bowling' => 'Right-arm offbreak', 'image' => 'williamson.jpg', 'odiRuns' => '6132', 'country_id' => '1'],\n ['name' => 'Trent Boult', 'age' => '29', 'role' => 'Bowler', 'batting' => 'Right-hand', 'bowling' => 'Left-arm fast-medium', 'image' => 'boult.jpg', 'odiRuns' => '154', 'country_id' => '1'],\n ['name' => 'Tom Blundell', 'age' => '28', 'role' => 'WicketKeeper', 'batting' => 'Right-hand', 'bowling' => 'Right-arm offbreak', 'image' => 'blundell.jpg', 'odiRuns' => '0', 'country_id' => '1'],\n ['name' => 'Colin de Grandhomme', 'age' => '32', 'role' => 'AllRounder', 'batting' => 'Right-hand', 'bowling' => 'Right-arm fast-medium', 'image' => 'grandhomme.jpg', 'odiRuns' => '633', 'country_id' => '1'],\n ['name' => 'Lockie Ferguson', 'age' => '27', 'role' => 'Bowler', 'batting' => 'Right-hand', 'bowling' => 'Right-arm fast', 'image' => 'ferguson.jpg', 'odiRuns' => '62', 'country_id' => '1'],\n ['name' => 'Martin Guptill', 'age' => '32', 'role' => 'Opening Batsman', 'batting' => 'Right-hand', 'bowling' => 'Right-arm offbreak', 'image' => 'guptil.jpg', 'odiRuns' => '6626', 'country_id' => '1'],\n ['name' => 'Matt Henry', 'age' => '27', 'role' => 'Bowler', 'batting' => 'Right-hand', 'bowling' => 'Right-arm fast-medium', 'image' => 'henry.jpg', 'odiRuns' => '221', 'country_id' => '1'],\n ['name' => 'Tom Latham', 'age' => '27', 'role' => 'WicketKeeper', 'batting' => 'left-hand', 'bowling' => 'Right-arm medium', 'image' => 'latham.jpg', 'odiRuns' => '2550', 'country_id' => '1'],\n ['name' => 'Colin Munro', 'age' => '32', 'role' => 'Middle-order', 'batting' => 'left-hand', 'bowling' => 'Right-arm medium-fast', 'image' => 'munro.jpg', 'odiRuns' => '1271', 'country_id' => '1'],\n ['name' => 'James Neesham', 'age' => '28', 'role' => 'Batter allrounder', 'batting' => 'left-hand', 'bowling' => 'Right-arm medium', 'image' => 'neesham.jpg', 'odiRuns' => '1247', 'country_id' => '1'],\n ['name' => 'Henry Nicholls', 'age' => '27', 'role' => 'Top-order allrounder', 'batting' => 'left-hand', 'bowling' => 'Right-arm offbreak', 'image' => 'nicholls.jpg', 'odiRuns' => '1120', 'country_id' => '1'],\n ['name' => 'Mitchell Santner', 'age' => '27', 'role' => 'Bowling allrounder', 'batting' => 'left-hand', 'bowling' => 'Slow left-arm orthodox', 'image' => 'santer.jpg', 'odiRuns' => '898', 'country_id' => '1'],\n ['name' => 'Ish Sodhi', 'age' => '26', 'role' => 'Bowler', 'batting' => 'Right-hand', 'bowling' => 'Legbreak', 'image' => 'sodhi.jpg', 'odiRuns' => '67', 'country_id' => '1'],\n ['name' => 'Tim Southee,', 'age' => '30', 'role' => 'Bowler', 'batting' => 'Right-hand', 'bowling' => 'Right-arm medium-fast', 'image' => 'southee.jpg', 'odiRuns' => '676', 'country_id' => '1'],\n ['name' => 'Ross Taylor', 'age' => '35', 'role' => 'Middle-order', 'batting' => 'Right-hand', 'bowling' => 'Right-arm medium-fast', 'image' => 'taylor.jpg', 'odiRuns' => '8376', 'country_id' => '1']\n ]);\n }", "function incrementFlagForMonument($player_id, $column_name) { // The player tucked or scored a card. Update database accordingly\n self::DbQuery(self::format(\"\n UPDATE\n player\n SET\n {column_name} = {column_name} + 1\n WHERE\n player_id = {player_id}\n \",\n array('player_id' => $player_id, 'column_name' => $column_name)\n ));\n }", "private function newCol( $row, $cell, $value ) {\n\n if ( count( $row->c ) > 0 ) {\n\n $rowCopy = clone $row;\n unset( $row->c );\n\n // SimpleXML does not seem to allow adding XML objects directly into other XML objects, and so some trickery must be used to insert a column between\n // already existing columns. We must redraw the entire columns ('c') section of the xml object but insert our new column in the correct place as we redraw.\n foreach ( $rowCopy as $col ) {\n\n if ( $cell < $col->attributes()->r && empty( $inserted ) ) {\n $insertedCol = $row->addChild( 'c' );\n $insertedCol->addAttribute( 'r', $cell );\n $insertedCol->addChild( 'v', $value );\n\n $inserted = true;\n }\n\n $copiedCol = $row->addChild( 'c' );\n $copiedCol->addAttribute( 'r', $col->attributes()->r );\n $copiedCol->addChild( 'v', $col->v );\n }\n\n if ( ! empty( $inserted ) )\n return $insertedCol;\n }\n\n $insertedCol = $row->addChild( 'c' );\n $insertedCol->addAttribute( 'r', $cell );\n $insertedCol->addChild( 'v', $value );\n\n return $insertedCol;\n }", "public function move(){\r\n\t\t\tif( empty($lastShot) ){\r\n\t\t\t\t$lastShot = new Play( $initialRow, $initialRow );\r\n\t\t\t\treturn $lastShot;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//if it is not empty, and is on the last cell\r\n\t\t\t\t//go to the first column of next row\r\n\t\t\t\tif( $lastShot.getX() == 10 ){\r\n\t\t\t\t\t$lastShot.setX( $initialRow );\r\n\t\t\t\t\t$lastShot.setY( $lastShot.getY() + 1 );\r\n\t\t\t\t}\r\n\t\t\t\t//if it is not in the last cell, then move 1 cell to the right.\r\n\t\t\t\telse{\r\n\t\t\t\t\t$lastShot.setX( $lastShot.getX() + 1 );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function dunkdog_player_edit_columns($cols) { \n\t$cols = array('cb' => '<input type=\"checkbox\" />',\n\t\t'headshot' => 'Headshot',\n\t\t'title' => 'Title', \n\t\t'taxonomy-dd-class' => 'Class',\n \t\t'taxonomy-dd-height' => 'Height',\n \t\t'taxonomy-dd-weight' => 'Weight',\n \t\t'taxonomy-dd-position' => 'Player Position',\n \t\t'high_school' => 'High School',\n \t\t'travel_team' => 'Travel',\n \t\t'college_team' => 'College',\n \t\t'news' => 'News'\n \t\t);\n return $cols;\n}", "function care_modify_user_table( $column ) {\n // $column['id'] = 'ID';\n // return $column;\n \n $new = array();\n foreach($column as $key => $title) {\n if ($key == 'username') { \n $new['user_id'] = 'ID'; // Our custom column’s identifier and text\n $new['registered'] = 'Registered';\n }\n $new[$key] = $title;\n }\n return $new;\n}", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "private function add_user_to_existing_game()\n {\n\n $number_of_existing_players = intval($this->gameUserCanPlay[\"number_of_players\"]) + 1;\n $this->number_of_players_in_current_user_game = $number_of_existing_players;\n $this->update_multiple_fields($this->games_table_name, [\"number_of_players\" => $number_of_existing_players], \"game_id ='{$this->gameIDUserCanPlay}'\");\n $this->update_multiple_fields($this->users_table_name, [\"game_id_about_to_play\" => $this->gameIDUserCanPlay], \"user_id='{$this->userID}'\");\n $this->game_10_words = $this->fetch_data_from_table($this->games_table_name , 'game_id' , $this->gameIDUserCanPlay)[0][\"words\"];\n $this->game_10_words = json_decode($this->game_10_words);\n\n /* if players are complete game should start */\n if ($number_of_existing_players == $this->config->MaximumNumberOfPlayers) {\n /* tell javascript that the game has started */\n $this->update_record($this->games_table_name, 'started', '1', 'game_id', $this->gameIDUserCanPlay);\n /* update current_game_id for all users in game */\n $this->update_record($this->users_table_name , 'current_game_id' , $this->gameIDUserCanPlay , 'game_id_about_to_play' , $this->gameIDUserCanPlay );\n /* Subtract the amount for all players */\n //$this->update_multiple_fields($this->users_table_name , ['account_balance' => \" account_balance - {$this->amount}\"] , \"game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n /* Make sure all users point is set to 0 immediately game starts and ends*/\n // $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) - {$this->amount} WHERE game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n $this->update_record($this->users_table_name , 'current_point' , 0 , 'game_id_about_to_play' , $this->gameIDUserCanPlay);\n $this->start_time = time() * 1000;\n $this->update_record($this->games_table_name , 'start_time' , $this->start_time , 'game_id' , $this->gameIDUserCanPlay);\n\n $this->showGameChat = true;\n\n }\n\n return true;\n }", "protected function replacePluginForRows()\n {\n $this->newRow(new Row); // NOVA LINHA\n $col = new Col($this->currentRow); // CRIANDO COLUNA\n $this->currentRow->newCol($col); // ADICIONANDO COLUNA NA LINHA ATUAL\n $col->newPlugin($this->plugins[0]); // ADICIONANDO PLUGIN ATUAL NA COLUNA\n $this->plugins = null; // EXCLUINDO PLUGIN ANTIGO DA COLUNA\n }", "function AlterBoard($board_id, $board_name, $parent_id, $description, $user_id=\"\", $strDatabase=\"\")\n{\n\tif($strDatabase==\"\")\n\t{\n\t\t$strDatabase=our_db;\n\t}\n\tif($board_id!=\"\")\n\t{\n\t\t UpdateOrInsert($strDatabase, \"mb_board\", Array(\"board_id\"=>$board_id), Array(\"board_name\"=>$board_name,\"parent_id\"=>$parent_id,\"description\"=>$description,\"user_id\"=>$user_id), true, false);\n\t}\n\telse\n\t{\n\t\t $out_id= UpdateOrInsert($strDatabase, \"mb_board\", \"\", Array(\"board_name\"=>$board_name,\"parent_id\"=>$parent_id,\"description\"=>$description,\"user_id\"=>$user_id), true, false);\n\t}\n\tif($board_id==\"\")\n\t{\n\t\treturn $out_id;\n\t}\n}", "function add_tournament_player($params)\n {\n $data = [];\n foreach($params[\"player_id\"] as $param){\n $data[] = [\n \"tournament_team_id\" => $params[\"tournament_team_id\"], \n \"player_id\" => $param \n ];\n }\n $this->db->insert_batch('tournament_players', $data);\n }", "public function insertPlayer(Player $playerData){\n $sql = \"INSERT INTO jogador (time_id_time, nome, data_nascimento, cpf, numero) \n VALUES ('{$playerData->__getPlayerName()}','{$playerData->__getIdTeam()}',\n '{$playerData->__getBirthDatePlayer()}',\n '{$playerData->__getCpfPlayer()}','{$playerData->__getPlayerNumber()}')\";\n $this->connection->dataBase->Execute($sql);\n\t}", "private function setAddColumnSql() {\n\n if (!empty($this->add_columns)) {\n\n foreach ($this->add_columns as $key => $value) {\n\n foreach ($value as $keys) {\n\n $column_data = $this->one_db_table_columns[$key][$keys];\n\n\n\n $add_colum_params = \"\";\n $default_is_string = false;\n $null_string = \"\";\n $default_string = \"\";\n\n\n\n\n //Sütun tipi\n $add_colum_params .= \" \" . $column_data['Type'] . \" \";\n\n\n if ($column_data['Null'] == \"NO\") {\n\n $null_string = \"NOT NULL\";\n } else if ($column_data['Null'] == \"YES\") {\n\n $null_string = \"NULL\";\n }\n\n\n\n $field_type_detect = substr($column_data['Type'], 0, 4);\n\n if (\n $field_type_detect == \"varc\" ||\n $field_type_detect == \"text\" ||\n $field_type_detect == \"date\") {\n\n $default_is_string = true;\n }\n\n\n\n if ($column_data['Default'] != \"\" || !empty($column_data['Default']) || $column_data['Default'] != NULL) {\n\n\n $default_string = \" DEFAULT \";\n\n\n if ($default_is_string) {\n\n\n $default_string .= \" '\" . $column_data['Default'] . \"' \";\n } else {\n\n $default_string .= \" \" . $column_data['Default'] . \" \";\n }\n }\n\n\n\n $add_colum_params .= $null_string . $default_string;\n\n $writesql = <<< EOT\nALTER TABLE {$key} ADD COLUMN {$column_data['Field']} {$add_colum_params};\nEOT;\n\n $this->execute_sql[\"add_columns\"][] = $writesql;\n }\n }\n }\n }", "public function updateColumn($col = array())\n {\n if (!empty($col)) {\n foreach ($col as $key => $value) {\n $this->select_list .= \"$key = \" . \"'\" . $value . \"'w,\";\n }\n }\n $this->select_list = rtrim($this->select_list, ',');\n }", "public function addColumn()\n {\n $input = Request::onlyLegacy('name', 'board_id', 'sort_order');\n\n $validator = Validator::make($input, ProductionBoardColumn::getRules());\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $this->service->getById($input['board_id']);\n try {\n $column = $this->service->saveColumn($input['name'], $input['board_id'], $input);\n\n return ApiResponse::success([\n 'message' => trans('response.success.saved', ['attribute' => 'Column']),\n 'column' => $this->response->item($column, new ProductionBoardColumnTransformer)\n ]);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "function set(array $grid, int $rowIndex, int $columnIndex, int $value): void {//tiene\n $grid[$rowIndex][$columnIndex] = $value; \n}", "protected function tempPosition()\n {\n $this->{$this->getPositionColumn()} = static::$insanePosition;\n $this->save();\n }", "private function prepareColumns()\n {\n $readOnlyAttribute = $this->readOnlyAttribute;\n\n $columns = [];\n if ($this->canMove) {\n $columns[] = [\n 'class' => MovingColumn::className(),\n 'movingDisabledAttribute' => $readOnlyAttribute,\n ];\n }\n foreach ($this->columns as $column) {\n if (is_string($column)) {\n $column = ['attribute' => $column];\n }\n\n if (empty($column['class'])) {\n $column['class'] = isset($column['items']) ? DropdownInputColumn::className() : TextInputColumn::className();\n }\n\n if ($this->itemClass === null && empty($column['label'])) {\n $column['label'] = Inflector::camel2words($column['attribute'], true);\n }\n\n $column = array_merge([\n 'readOnlyAttribute' => $readOnlyAttribute,\n ], $column);\n\n $columns[] = $column;\n }\n\n if ($this->canRemove) {\n $columns[] = [\n 'class' => 'smart\\grid\\ActionColumn',\n 'options' => ['style' => 'width: 25px;'],\n 'template' => '{remove}',\n 'buttons' => [\n 'remove' => function ($url, $model, $key) use ($readOnlyAttribute) {\n $readOnly = false;\n if ($readOnlyAttribute !== null) {\n $readOnly = ArrayHelper::getValue($model, $readOnlyAttribute);\n }\n\n if ($readOnly) {\n return '';\n }\n\n return Html::a('<span class=\"fas fa-remove\"></span>', '#', [\n 'class' => 'item-remove',\n 'title' => $this->removeLabel,\n ]);\n },\n ],\n ];\n }\n\n $this->_columns = $columns;\n }", "public function updateCell($gameid, $row, $col, $val) {\n\n $sql =<<<SQL\nUPDATE $this->tableName\nSET val=?\nWHERE gameid=? AND row=? AND col=?\nSQL;\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n try {\n $ret = $statement->execute(array($val, $gameid, $row, $col));\n } catch(\\PDOException $e) {\n // do something when the exception occurs...\n return false;\n }\n\n if($statement->rowCount() === 0) {\n //user does not exist\n return false;\n }\n return true; //update successful\n\n }", "public function getPositionColumn();", "function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}", "protected function prepareColumnsInsert($columns)\n\t{\n\t\t$columns[0] = \":\". $columns[0];\n\n\t\t//implode o array de colunas\n\t\treturn implode(\",:\", $columns);\n\n\t}", "private function managePlayersPresence()\n {\n if($this->isNewRecord) {\n return;\n }\n\n if( $player = Player::findIdentity($this->join_player) ){\n $presence = 1;\n }elseif( $player = Player::findIdentity($this->reject_player) ){\n $presence = 0;\n } else {\n return;\n }\n\n $sql = \"INSERT INTO `game_has_player` (`game_id`, `player_id`, `presence`)\n VALUES ('{$this->id}', '{$player->id}', '{$presence}')\n ON DUPLICATE KEY UPDATE `presence` = '{$presence}'\";\n\n return Yii::$app->db->createCommand($sql)->execute();\n }", "function StartGame($idGame, $FirstPlayer)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"UPDATE fishermenland.game SET TourGame = '1', FirstPlayerGame = '$FirstPlayer' WHERE idGame = '$idGame' AND TourGame IS NULL\");\n $req = $dbh->query(\"UPDATE fishermenland.place SET fkStatusPlace = '2' WHERE fkPlayerPlace = (SELECT idPlayer FROM fishermenland.player WHERE PseudoPlayer = '$FirstPlayer')\");\n}", "public function Save()\r\n\t\t{\r\n\t\t\tif ($this->id == -1) {\r\n\t\t\t\tunset($this->columns[\"id\"]);\r\n\t\t\t\t$sqlCol = null;\r\n\t\t\t\t$sqlKey = null;\r\n\t\t\t\tforeach ($this->columns as $column => $value) {\r\n\t\t\t\t\t$data[$column] = $this->$column;\r\n\t\t\t\t\t$sqlCol .= \",\" . $column;\r\n\t\t\t\t\t$sqlKey .= \",:\" . $column;\r\n\t\t\t\t}\r\n\t\t\t\t$sqlCol = ltrim($sqlCol, \",\");\r\n\t\t\t\t$sqlKey = ltrim($sqlKey, \",\");\r\n\t\t\t\t$query = $this->db->prepare(\r\n\t\t\t\t\t\"INSERT INTO \" . $this->table . \" (\" . $sqlCol . \")\r\n\t\t\t\t\t\tVALUES (\" . $sqlKey . \") ;\"\r\n\t\t\t\t);\r\n\t\t\t\t$query->execute($data);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t// Sinon faire un update dynamique\r\n\t\t\t\t$sqlSet = null;\r\n\t\t\t\tforeach ($this->columns as $column => $value) {\r\n\t\t\t\t\t$data[$column] = $this->$column;\r\n\t\t\t\t\t$sqlSet[] .= $column . \"=:\" . $column;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Suppression de la mise à jour de la date d'update \r\n\t\t\t\t// la mise à jour des dates est maintenant faites en BDD.\r\n\t\t\t\t$query = $this->db->prepare(\r\n\t\t\t\t\t\"UPDATE \" . $this->table . \" SET \r\n\t\t\t\t\t\t\" . implode(\",\", $sqlSet) . \"\r\n\t\t\t\t\t\tWHERE id=:id;\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$query->execute($data);\r\n\t\t\t}\r\n\t\t}", "public function run()\n { \n \n $data = [\n [\n 'name' => 'К выполнению',\n 'board_id' => 1,\n 'creator_id' => 1\n ],\n [\n 'name' => 'В работе',\n 'board_id' => 1,\n 'creator_id' => 1\n ],\n [\n 'name' => 'Готово',\n 'board_id' => 1,\n 'creator_id' => 1\n ]\n ];\n\n foreach($data as $item)\n Column::create($item);\n \n }", "protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }", "public function save() {\n\t\ttry {\n\t\t\t$sql = '';\n\n\t\t\tif($this->_state == self::STATE_CHANGED) {\n\t\t\t\t$sql = 'UPDATE ' . self::sanitize($this->_table->getProperty('name')) . ' SET ';\n\t\t\t\t\n\t\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t\t$sql .= $column->name . ' = ';\n\t\t\t\t\t\n\t\t\t\t\tswitch($column->type) {\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_INT:\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_FLOAT:\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DOUBLE:\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DECIMAL:\n\t\t\t\t\t\t\tif($this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t$sql .= $this->_data[$column->name] . ', ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$sql .= '\\'\\', ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_BOOL:\n\t\t\t\t\t\t\t$sql .= ($this->_data[$column->name] ? '1' : '0') . ', ';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DATETIME:\n\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$sql .= '\\'' . date('Y-m-d H:i:s', strtotime($this->_data[$column->name])) . '\\', ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DATE:\n\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$sql .= '\\'' . date('Y-m-d', strtotime($this->_data[$column->name])) . '\\', ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_TIME:\n\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$sql .= '\\'' . date('H:i:s', strtotime($this->_data[$column->name])) . '\\', ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$sql .= '\\'' . self::sanitize($this->_data[$column->name]) . '\\', ';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sql = substr($sql, 0, strlen($sql) - 2) . ' WHERE ' . self::sanitize($this->_key_primary->name) . ' = ' . self::sanitize($this->_data[$this->_key_primary->name]);\n\t\t\t}\n\t\t\telseif($this->_state == self::STATE_NEW) {\n\t\t\t\t$sql = 'INSERT INTO ' . self::sanitize($this->_table->getProperty('name')) . ' (';\n\t\t\t\t\n\t\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t\tif(!$column->primary_key) {\n\t\t\t\t\t\t$sql .= self::sanitize($column->name) . ', ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sql = substr($sql, 0, strlen($sql) - 2) . ') VALUES (';\n\t\t\t\t\n\t\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t\tif(!$column->primary_key) {\n\t\t\t\t\t\tswitch($column->type) {\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_INT:\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_FLOAT:\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DOUBLE:\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DECIMAL:\n\t\t\t\t\t\t\t\tif($this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t\t$sql .= $this->_data[$column->name] . ', ';\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$sql .= '\\'\\', ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_BOOL:\n\t\t\t\t\t\t\t\t$sql .= ($this->_data[$column->name] ? '1' : '0') . ', ';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DATETIME:\n\t\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\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$sql .= '\\'' . date('Y-m-d H:i:s', strtotime($this->_data[$column->name])) . '\\', ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DATE:\n\t\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\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$sql .= '\\'' . date('Y-m-d', strtotime($this->_data[$column->name])) . '\\', ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_TIME:\n\t\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\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$sql .= '\\'' . date('H:i:s', strtotime($this->_data[$column->name])) . '\\', ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$sql .= '\\'' . self::sanitize($this->_data[$column->name]) . '\\', ';\n\t\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\t\n\t\t\t\t$sql = substr($sql, 0, strlen($sql) -2) . ')';\n\t\t\t}\n\t\t\t\n\t\t\t\\Bedrock\\Common\\Logger::info('Saving record with query: ' . $sql);\n\t\t\t$this->_connection->exec($sql);\n\t\t\t$this->_state = self::STATE_UNCHANGED;\n\t\t}\n\t\tcatch(\\PDOException $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('There was a problem saving the record to the database.');\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('An error was encountered and the record could not be saved.');\n\t\t}\n\t}", "public function startPlay(){ \r\n\r\n $this->selectPlayer();\r\n $this->board->printBoard();\r\n\r\n while(!$this->gameOver){\r\n\r\n //check if board is full\r\n if($this->reachedMaxMoves() || $this->validateIsFullBoard()){\r\n noWinningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n break;\r\n }\r\n // set board with table\r\n $userMove = $this->selectMove();\r\n \r\n //in case that column is not full \r\n if(!$this->validateIsFullColumn($userMove)){\r\n $this->insertMoveToBoard($userMove);\r\n $this->winCheck($userMove);\r\n $this->switchPlayer();\r\n }\r\n }\r\n }", "public function addPreviewColumn($id);", "protected function updateColumns($value)\r\n {\r\n if ($this->_orientation == orVertical) \r\n { \r\n if ($value > 0)\r\n $this->_columns = $value;\r\n else\r\n $this->_columns = 1;\r\n }\r\n else\r\n {\r\n $columns = count($this->_items);\r\n \r\n if ($columns > 0)\r\n $this->_columns = $columns;\r\n else\r\n $this->_columns = 1;\r\n }\r\n \r\n }", "public function setNextPlayer($idPlayer)\n {\n if ($this->id_player6 == 0)\n {\n $this->id_player6 = $idPlayer;\n }\n else if ($this->id_player7 == 0)\n {\n $this->id_player7 = $idPlayer;\n }\n else if ($this->id_player8 == 0)\n {\n $this->id_player8 = $idPlayer;\n }\n else if ($this->id_player9 == 0)\n {\n $this->id_player9 = $idPlayer;\n }\n else if ($this->id_player10 == 0)\n {\n $this->id_player10 = $idPlayer;\n }\n else if ($this->id_player11 == 0)\n {\n $this->id_player11 = $idPlayer;\n }\n else if ($this->id_player12 == 0)\n {\n $this->id_player12 = $idPlayer;\n }\n else if ($this->id_player13 == 0)\n {\n $this->id_player13 = $idPlayer;\n }\n else if ($this->id_player14 == 0)\n {\n $this->id_player14 = $idPlayer;\n }\n else if ($this->id_player15 == 0)\n {\n $this->id_player15 = $idPlayer;\n }\n else if ($this->id_player16 == 0)\n {\n $this->id_player16 = $idPlayer;\n }\n else if ($this->id_player17 == 0)\n {\n $this->id_player17 = $idPlayer;\n }\n else if ($this->id_player18 == 0)\n {\n $this->id_player18 = $idPlayer;\n }\n else if ($this->id_player19 == 0)\n {\n $this->id_player19 = $idPlayer;\n }\n else if ($this->id_player20 == 0)\n {\n $this->id_player20 = $idPlayer;\n }\n return $this;\n }", "public function insert($gameid, $row, $col, $value) {\n $sql = <<<SQL\nINSERT INTO $this->tableName(gameid, row, col, val)\nVALUES(?, ?, ?, ?)\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n try {\n if($statement->execute([$gameid, $row, $col, $value]) === false) {\n return null;\n }\n } catch(\\PDOException $e) {\n return null;\n }\n\n return $pdo->lastInsertId();\n\n }", "function insertTwitter($twitterInfo,$differenceInFollowers){\n \n $sql = \"SELECT id FROM twitter WHERE display_name = '\".$twitterInfo->screen_name.\"';\"; \n echo $sql;\n\n $row = runQuery($sql, False);\n \n $id = $row['id'];\n echo $id;\nif($id = ' '){\n $sql = \"INSERT INTO twitter (name, display_name, followers, following, profile_image_url, profile_banner_url,followers_today_count) \"\n . \"VALUES ('$twitterInfo->name', '$twitterInfo->screen_name','$twitterInfo->followers_count','$twitterInfo->friends_count','$twitterInfo->profile_image_url','$twitterInfo->profile_banner_url','$differenceInFollowers')\";\n runQuery($sql, True);\n}\nelse{\n \n$sql = \"UPDATE twitter SET name ='\".$twitterInfo->name.\"', display_name = '\".$twitterInfo->screen_name.\"',followers ='\".$twitterInfo->followers_count.\"' , following ='\".$twitterInfo->friends_count.\"' , profile_image_url ='\".$twitterInfo->profile_image_url.\"' , profile_banner_url ='\".$twitterInfo->profile_banner_url.\"', followers_today_count ='\".$differenceInFollowers.\"' \nWHERE display_name = '\".$twitterInfo->screen_name.\";\";\n runQuery($sql, True);\n}\n}", "public function change()\n {\n $statistics = $this->table('vrchat');\n $statistics->addColumn('auth', 'string', ['limit' => 100])\n ->addColumn('apiKey', 'string', ['limit' => 100])\n ->addColumn('login', 'string', ['limit' => 100])\n ->addColumn('password', 'string', ['limit' => 100])\n ->create();\n\n // inserting only one row\n $singleRow = [\n 'id' => 1,\n 'auth' => '',\n 'apiKey' => 'JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26',\n 'login' => 'Loli E1ON',\n 'password' => ''\n ];\n\n $table = $this->table('vrchat');\n $table->insert($singleRow);\n $table->saveData();\n\n }", "function itstar_add_user_column_data( $val, $column_name, $user_id ) {\n \n\n switch ($column_name) {\n case 'viraclub' :\n return 'V'.get_user_meta($user_id,'viraclub',true);\n break;\n case 'phone' :\n return get_user_meta($user_id,'phone',true);\n break;\n case 'email' :\n return get_user_meta($user_id,'uemail',true);\n break;\n default:\n }\n return;\n}", "final private function sanitzeCol($i,$j){\n\t\tif(@$k = $this->checkCol($i,$j)and @!$this->markspan[$i][$j] ){\n\t\t\t@$move = $this->contents[$i]->contents[$j]->contents;\n\t\t\t$k =$k - 1;\n\n\t\t\tif (is_array($move))\n\t\t\t\tforeach($move as $v)\n\t\t\t\t$this->cellContent($i,$k,$v);\n\n\t\t\t$this->markspan[$i][$j] = true;\n\t\t\t$this->contents[$i]->contents[$j] = '';\n\n\n\t\t}else{\n\t\t\t$this->markspan[$i][$j] = false;\n\t\t}\n\n\t}", "public function run()\n {\n \n\n \\DB::table('boards')->delete();\n \n \\DB::table('boards')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => '공지사항',\n 'use_secret' => 0,\n 'use_captcha' => 0,\n 'use_comment' => 0,\n 'use_opinion' => 0,\n 'use_tag' => 0,\n 'use_category' => 0,\n 'use_upload' => 0,\n 'use_thumbnail' => 0,\n 'upload_max_filesize' => 0,\n 'upload_max_limit' => 0,\n 'status_cd' => 3,\n 'created_at' => '2017-06-01 22:55:12',\n 'updated_at' => NULL,\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'FAQ',\n 'use_secret' => 0,\n 'use_captcha' => 0,\n 'use_comment' => 0,\n 'use_opinion' => 0,\n 'use_tag' => 0,\n 'use_category' => 0,\n 'use_upload' => 0,\n 'use_thumbnail' => 0,\n 'upload_max_filesize' => 0,\n 'upload_max_limit' => 0,\n 'status_cd' => 3,\n 'created_at' => '2017-06-01 22:55:12',\n 'updated_at' => NULL,\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => '자유게시판',\n 'use_secret' => 0,\n 'use_captcha' => 0,\n 'use_comment' => 0,\n 'use_opinion' => 0,\n 'use_tag' => 0,\n 'use_category' => 0,\n 'use_upload' => 0,\n 'use_thumbnail' => 0,\n 'upload_max_filesize' => 0,\n 'upload_max_limit' => 0,\n 'status_cd' => 3,\n 'created_at' => '2017-06-01 22:55:12',\n 'updated_at' => NULL,\n ),\n ));\n \n \n }", "function get_player1_returning_row(){\n if(!$this->board->player_won(1)){\n return [];\n }\n\n if(count($this->board->winner_row) === 0){\n return [];\n }\n\n return $this->board->winner_row;\n }", "private function pad_grid() \n\t{\n\t\t// If more rows than cols we add columns to all rows\n\t\t// TODO: Has to be a better way to do this\n\t\t$numRows = count($this->clonedGrid);\n\t\t$numCols = count($this->clonedGrid[0]);\n\t\t\n\t\tif ($numRows > $numCols) \n\t\t{ \n\t\t\tfor ($i = 0; $i < $numRows; $i++) \n\t\t\t{\n\t\t\t\t$this->clonedGrid[$i] = array_pad($this->clonedGrid[$i], $numRows, 0);\n\t\t\t\t\n\t\t\t}\n\t\t} \n\t\telseif ($numCols > $numRows) { \n\t\t\t// If not check if COLS are > then rows, if so then add new rows.\n\t\t\tfor ($i = count($this->clonedGrid); $i < $numCols; $i++) \n\t\t\t{\n\t\t\t\t$this->clonedGrid[$i] = array_pad(array(), $numCols, 0);\n\t\t\t}\n\t\t}\n\t}", "function show_cell($which) {\r\n $token = $this->position[$which];\r\n if ($token <> '-') {\r\n return '<td>' . $token . '</td>';\r\n }\r\n $this->newposition = $this->position;\r\n $this->newposition[$which] = 'o';\r\n $move = implode($this->newposition);\r\n $link = '?board=' .$move;\r\n return '<td><a href=' . $link . '>-</a></td>';\r\n }", "function CreateImpostion()\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"INSERT INTO fishermenland.game (LakeFishesGame, LakeReproductionGame, PondReproductionGame, EatFishesGame, FirstPlayerGame, TourGame, SeasonTourGame, MaxPlayersGame, MaxReleaseGame, fkTypeGame) VALUES ((SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'DefaultLakeFishes'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'LakeReproduction'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'PondReproduction'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'EatenFishes'), NULL, NULL, (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'SeasonTour'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'MaxPlayers'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'ReleaseMax'), '2')\");\n}", "public function assignTeam($input,$id){\n\t\t\n\t\t$updateId = DB::table('assign_team')->insert(['team_id' => $input, 'member_id' => $id]);\n\t\treturn true;\n\t\n\t}", "public function putMatch(Request $request){\n $player1 = $request->get('player1');\n $player2 = $request->get('player2');\n $stage = $request->get('stage');\n $winner = null;\n $loser = null;\n\n if($player1['stocks'] >= $player2['stocks']){\n $winner = $player1;\n $loser = $player2;\n }\n else{\n $loser = $player1;\n $winner = $player2;\n }\n\n\t\t\t\t//I should add a addedBy playerId column to this table\n $match = new Matches;\n $match->winner = $winner['playerId'];\n $match->loser = $loser['playerId'];\n $match->winner_character = $winner['character'];\n $match->loser_character = $loser['character'];\n $match->winner_stocks = $winner['stocks'];\n $match->loser_stocks = $loser['stocks'];\n $match->stage = $stage;\n\n $match->save();\n\n }", "public static function addColumn1($newCol, $type, $require, $choices){\n\t\t//this allows us to add column.\n\t\t//self::$db_fields = array_slice($db_fields, 0, $col, true) + array($newCol)\n\t\t//\t\t+ array_slice($db_fields, $col, count($db_fields) -1, true); //incorporate after for now add to end.\n\t\t\n\t\t//assume $newCol must be typed like lower case and with underscore cant start with number etc. (can't contain number? safer)\n\t\t// or catch error and say, invalid column name... try again.\n\t\t\n\t\t$last_element = end(self::$db_fields);\n\t\t\n\t\t//adds new column to db fields\n\t\t$temp = self::$db_fields;\n\t\tarray_push($temp, $newCol);\n\t\tself::$db_fields = $temp;\n\t\t\n\t\t//adds new required to column\n\t\t$temp = self::$required;\n\t\tarray_push($temp, $newCol);\n\t\tself::$required = $temp;\n\t\t\n\t\t//adds new data type to column\n\t\t$temp = self::$data_types;\n\t\tarray_push($temp, $newCol);\n\t\tself::$data_types = $temp;\n\t\t\n\t\t//create new attribute on the fly for each member\n\t\t//do now and have to do for each member.\n\t\tglobal $database;\n\t\t$sql = \"SELECT 'members_id' FROM members1\";\n\t\t//$result = Member::find_by_sql($sql);\n\t\t$result = $database->query($sql);\n\t\t//foreach($result as $attribute=>$value){\n\t\t\n\t\twhile($row = $database->fetch_array($result)){\n\t\t\t$id = $row['members_id'];\n\t\t\t$select = Member::find_by_id($id);\n\t\t\t$select->addAttribute($newCol, \"\");\n\t\t}\n\t\t\n\t\t//change database\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_column` VARCHAR(45) NOT NULL DEFAULT \\'default\\' AFTER `additional_info`'; //[puts default value in\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_nonnull` VARCHAR(45) NOT NULL AFTER `test_null`'; leaves column blank\n\t\t//$sql = \"ALTER TABLE `members1` ADD `test_null` VARCHAR(45) NULL AFTER `test_column`\"; //null column puts Null as entry.\n\t\t\n\t\t$data_value;\n\t\tif($type == \"Enum\"){ //ALTER TABLE `members1` ADD `enum_test` ENUM('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `yep`;\n\t\t\t$temp = self::$enum_list;\n\t\t\tarray_push($temp, $newCol);\n\t\t\tself::$enum_list = $temp;\n\t\t\t\n\t\t\t$data_value = \"ENUM('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci \";\n\t\t}\n\t\telse if($type == \"Set\"){ //ALTER TABLE `members1` ADD `enum_test` SET('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `yep`;\n\t\t\t$temp = self::$set_list;\n\t\t\tarray_push($temp, $newCol);\n\t\t\tself::$set_list = $temp;\n\t\t\t\n\t\t\t$data_value = \"SET('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci \";\n\t\t}\n\t\telse{\n\t\t\techo \" error has definitely occured\";\n\t\t}\n\t\t//sql syntax would need to add values from choices array to database.\n\t\t$sql = \"ALTER TABLE \".self::$table_name.\" \"; \n\t\t$sql .= \" ADD '{$newCol}' {$data_value} \";\n\t\t\n\t\tif($database->query($sql)){\n\t\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t} \n\t\t\n\t\t\n\t}", "protected function setUpNewColumn()\n {\n $this->newColumn = clone $this->oldColumn;\n }", "public function add_championships($insert_data){\n\t\t$this->db->insert('championships',$insert_data);\n\t\tif ($this->db->affected_rows() > 0)\n\t\t\treturn true;\n\t\telse return false;\n\t}", "function insert_manage_column( $columns, $column, $value, $location = '', $before = false ) {\n\t\tif ( ! empty( $location ) && array_key_exists( $location, $columns ) ) {\n\t\t\t$new_columns = array();\n\t\t\tforeach ( $columns as $c => $v ) {\n\t\t\t\tif ( $before && $c == $location ) \n\t\t\t\t\t$new_columns[$column] = $value;\n\t\t\t\t$new_columns[$c] = $v;\n\t\t\t\tif ( ! $before && $c == $location ) \n\t\t\t\t\t$new_columns[$column] = $value;\n\t\t\t}\n\t\t\t$columns = $new_columns;\n\t\t} else {\n\t\t\t$columns[$column] = $value;\n\t\t}\n\t\treturn $columns;\n\t}", "protected function prependRowSelectorColumn()\n {\n if (!$this->option('useRowSelector')) {\n return;\n }\n\n $grid = $this;\n\n $column = new Column(Column::SELECT_COLUMN_NAME, ' ');\n $column->setGrid($this);\n\n $column->display(function ($value) use ($grid, $column) {\n $actions = new RowSelector($value, $grid, $column, $this);\n\n return $actions->display();\n });\n\n $this->columns->prepend($column);\n }", "public function execute()\n\t{\n\t\t$this->mutator = $this->mutator_open($this->ns, $this->table, NULL, 0);\n\t\t$insert = $this->mutator_set_cells($this->mutator, $this->cells); \n\t\t$this->mutator_flush($this->mutator);\n\t\t$this->mutator_close($this->mutator);\n\t\t$this->table = NULL;\n\t\t$this->cells = array();\n\t\treturn $insert;\n\t}", "public function setColumna($col){\n if($col>3 ){\n $this->columna = 3;\n }\n elseif ($col<0) {\n $this->columna = 0;\n }\n else{\n $this->columna = $col;\n }\n }", "public function onAfterInsert(){\n\t\t$this->player->setValue('entries', $this->player->entries + 1);\n\t\t$this->player->save();\n\t\t\n\t}", "public static function insert_one_staff()\n {\n return parent::insert_to_columns(func_get_args());\n }", "public function save()\r\n { \r\n $modelName=static::$modelName;\r\n $tableName = $modelName::table();\r\n $array = get_object_vars($this);\r\n //print_r($array);\r\n \r\n foreach ($array as $key =>$value){\r\n if (empty($value)){\r\n $array[$key] ='NULL';\r\n\r\n }\r\n }\r\n //echo\"<br><br>\";\r\n // print_r(array_flip($array));\r\n //echo\"<br><br>\";\r\n // $this->columnString = implode(',',$array); //another way to input \r\n\r\n //$columnString = implode(',', $array);\r\n //$columnString2 = implode(',', array_flip($array)); //try professor's code\r\n //print($columnString);\r\n //echo\"<br><br>\";\r\n //print($columnString2);\r\n //echo\"<br><br>\";\r\n //$valueString = \":\".implode(',:', $array);\r\n //$valueString2 = ':'.implode(',:', array_flip($array)); \r\n //print($valueString);\r\n //echo\"<br><br>\";\r\n //print($valueString2);\r\n //echo\"<br><br>\";\r\n if ($this->id != '') {\r\n $sql = $this->update($array,$tableName);\r\n } else {\r\n \r\n $sql = $this->insert($array,$tableName);\r\n }\r\n\r\n $db = dbConn::getConnection(); // try to find out whether there is error in bellow\r\n try {\r\n $statement = $db->prepare($sql);\r\n /*foreach($fliparray as $key => $value){\r\n $statement->bindParam(\":$value\",$this->value);\r\n }*/\r\n\r\n //print($sql);\r\n \r\n $statement->execute();\r\n\r\n $id = $db->lastInsertId();\r\n } catch (PDOException $e){\r\n echo 'SQL error is:' . $e->getMessage();\r\n } \r\n \r\n //$tableName = get_called_class();\r\n //$this->tableName;\r\n return $id;\r\n\r\n // echo \"INSERT INTO $tableName (\" . $columnString . \") VALUES (\" . $valueString . \")</br>\";\r\n // echo 'I just saved record: ' . $this->id;\r\n \r\n }", "function ivtModifier($table,$data,$id=null, $column = null,$value=null ){\n\n\t\t$primary_key_name = null;\n\t\t$col_data = $this->db->query(\"SHOW COLUMNS FROM \".$table);\n\n\t\tif ($col_data->num_rows()>0) {\n\t\t\tforeach ($col_data->result() as $col) {\n\t\t\t\tif ($col->Key!='') {\n\t\t\t\t\t$primary_key_name = $col->Field;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($id != null && $this->db->update($table,$data,array($primary_key_name=>$id))) {\n\t\t\t// récupérer l'enregistrement après mise à jour\n\t\t\treturn array(\"success\"=>true,\"code\"=>200,\"data\"=>$this->ivtObtenirElement($table,$id)['data']);\n\n\t\t}elseif ($column != null && $value != null && $id == null && \n\t\t \t\t\t$this->db->update($table,$data,array($column => $value))){\n\n\t\t\treturn array(\"success\"=>true,\"code\"=>200,\"data\"=>\"\");\n\n\t\t}else{\n\t\t\treturn array(\"success\"=>false,\"code\"=>500,\"data\"=>null);\n\t\t}\n\t\t\n\t}", "function dealHandToPlayer($gameId, $hand, $playerId){\n $playerPosition = getPositionFromPlayerId($gameId, $playerId);\n if($playerPosition === false)\n return false;\n \n $conn = getDB();\n $sql = \"UPDATE games SET player\".$playerPosition.\"hand='\".$hand.\"' WHERE id=\".$gameId;\n if(!$conn->query($sql)){\n closeDB($conn);\n echo \"\\nFailed to run query in dealHandToPlayer!\\n\";\n return false;\n }\n closeDB($conn);\n return true;\n}", "public function modifyTable()\n {\n // create columns if they are not already added to the table\n foreach ($this->getParameter('columns') as $column) {\n if (!$this->getTable()->containsColumn($column)) {\n $this->getTable()->addColumn(array(\n 'name' => $column,\n 'type' => 'INTEGER',\n ));\n }\n }\n }", "function CreateImpostionForfait()\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"INSERT INTO fishermenland.game (LakeFishesGame, LakeReproductionGame, PondReproductionGame, EatFishesGame, FirstPlayerGame, TourGame, SeasonTourGame, MaxPlayersGame, MaxReleaseGame, fkTypeGame) VALUES ((SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'DefaultLakeFishes'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'LakeReproduction'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'PondReproduction'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'EatenFishes'), NULL, NULL, (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'SeasonTour'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'MaxPlayers'), (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'ReleaseMax'), '3')\");\n}", "function getPlayer($board_num, $turn) {\n if ($turn == 1) { //player O\n $player = selectDB(\"SELECT PLAYERO FROM BOARD WHERE BOARD_NUM='$board_num'\");\n $player = $player['PLAYERO'];\n }\n else { //player X\n $player = selectDB(\"SELECT PLAYERX FROM BOARD WHERE BOARD_NUM='$board_num'\");\n $player = $player['PLAYERX'];\n }\n return $player;\n}", "public function run()\n {\n //\n DB::table('teams')->insert([\n ['profile_id'=>2],\n ['profile_id'=>3],\n ['profile_id'=>4],\n ['profile_id'=>5],\n ['profile_id'=>6],\n ['profile_id'=>7],\n\n \n ]);\n }", "public function run()\n {\n DB::table('stats_pitching')->insert([\n [\n 'player_id' => 11,\n 'game_id' => 1,\n 'w' => 1,\n 'l' => 0,\n 'gs' => 1,\n 'gf' => 1,\n 'sho' => 0,\n 'sv' => 0,\n 'ip' => 8.0,\n 'h' => 7,\n 'r' => 1,\n 'er' => 1,\n 'hr' => 0,\n 'bb' => 0,\n 'ibb' => 0,\n 'so' => 9,\n 'hbp' => 0,\n 'bk' => 0,\n 'wp' => 0,\n 'bf' => 31\n ],\n [\n 'player_id' => 21,\n 'game_id' => 1,\n 'w' => 0,\n 'l' => 0,\n 'gs' => 1,\n 'gf' => 0,\n 'sho' => 0,\n 'sv' => 0,\n 'ip' => 4.0,\n 'h' => 2,\n 'r' => 1,\n 'er' => 1,\n 'hr' => 0,\n 'bb' => 1,\n 'ibb' => 0,\n 'so' => 3,\n 'hbp' => 0,\n 'bk' => 0,\n 'wp' => 0,\n 'bf' => 15\n ],\n [\n 'player_id' => 22,\n 'game_id' => 1,\n 'w' => 0,\n 'l' => 0,\n 'gs' => 0,\n 'gf' => 0,\n 'sho' => 0,\n 'sv' => 0,\n 'ip' => 3.0,\n 'h' => 1,\n 'r' => 0,\n 'er' => 0,\n 'hr' => 0,\n 'bb' => 2,\n 'ibb' => 0,\n 'so' => 0,\n 'hbp' => 0,\n 'bk' => 0,\n 'wp' => 0,\n 'bf' => 12\n ],\n [\n 'player_id' => 23,\n 'game_id' => 1,\n 'w' => 0,\n 'l' => 1,\n 'gs' => 0,\n 'gf' => 1,\n 'sho' => 0,\n 'sv' => 0,\n 'ip' => 0.1,\n 'h' => 2,\n 'r' => 3,\n 'er' => 3,\n 'hr' => 1,\n 'bb' => 0,\n 'ibb' => 0,\n 'so' => 1,\n 'hbp' => 1,\n 'bk' => 0,\n 'wp' => 0,\n 'bf' => 4\n ]\n ]);\n }", "public function fillupDefault()\n {\n\n foreach (static::$cols as $key => $col) {\n if ('' != $col[self::COL_DEFAULT]) {\n $this->data[$key] = $col[self::COL_DEFAULT];\n }\n }\n\n }", "public function addColumns( $value){\n return $this->_add(3, $value);\n }", "function InsertDTR($sheetRow)\n{\n global $con;\n $inputs=array();\n $start_column=\"A\";\n for ($i=0; $i <= 7; $i++) {\n if (empty($sheetRow[$start_column])) {\n $inputs[$i]=\"\";\n } else {\n $inputs[$i]=$sheetRow[$start_column];\n }\n $start_column++;\n }\n $if_exists=$con->myQuery(\n \"SELECT COUNT(id) FROM acu_records WHERE ac_no=? AND action_time=? AND state=?\",\n array(\n $sheetRow[\"A\"],\n $sheetRow[\"D\"],\n $sheetRow[\"E\"]\n )\n )->fetchColumn();\n\n if (empty($if_exists)) {\n $con->myQuery(\"INSERT INTO acu_records(ac_no,acu_id,name,action_time,state,new_state,exception,operation) VALUES(?,?,?,?,?,?,?,?)\", $inputs);\n }\n}", "public function updatePlayer(Player $playerData){\n $sql = \"UPDATE jogador \n SET time_id_time = '{$playerData->__getIdTeam()}',\n nome = '{$playerData->__getPlayerName()}', \n data_nascimento = '{$playerData->__getBirthDatePlayer()}', \n cpf = '{$playerData->__getCpfPlayer()}', \n numero = '{$playerData->__getPlayerNumber()}' \n WHERE id_jogador='{$playerData->__getIdPlayer()}' \";\n $this->connection->dataBase->Execute($sql);\n return $playerData;\n\t}", "public function moveCell($cellToMove){\n // same row\n $cells = $_SESSION['GameView::cellNumbers'];\n $empty = 0;\n for ($i=0;$i<16;$i++){\n if ($_SESSION['GameView::cellNumbers'][$i] == 0){\n \n $empty = $i;\n }\n } \n \n $sameRow = false;\n $sameColumn = false;\n $neighbour = false;\n if (floor($cellToMove / 4) == floor($empty / 4)){\n $sameRow = true;\n if (($cellToMove + 1 == $empty) || ($empty + 1 == $cellToMove)){\n $neighbour = true;\n }\n }\n \n // check if directly above or below\n if ((($cellToMove + 4) == $empty) || (($empty + 4) == $cellToMove)){\n $neighbour = true;\n }\n \n if ($neighbour){\n // switch place\n $_SESSION['GameView::moves'] += 1;\n $temp = $cells[$cellToMove];\n $_SESSION['GameView::cellNumbers'][$cellToMove] = 0;\n $_SESSION['GameView::cellNumbers'][$empty] = $temp;\n\n }\n \n return $neighbour;\n \n }", "public function add_new_columns($columns){\n $column_meta = array( 'username' => __( 'Username', 'drophtml' ) );\n $columns = array_slice( $columns, 0, 6, true ) + $column_meta + array_slice( $columns, 6, NULL, true );\n return $columns;\n }", "public function updatecol4_data() {\n\t\t$sql=\"select rd.col1,rd.col4 from reestr_distinct rd where rd.col4 <> 'Бессрочно' ORDER BY rd.col1 desc\"; // limit 40\n\t\t$result = $this->get_data($sql);\n\t\t$col4=\"\";\n\t\t$col4_state=\"\";\n\t\t$col1=\"\";\n\t\t$stmt = parent::$mysqliPublic->stmt_init();\n\t\tif (!self::$mysqliPublic->set_charset(\"utf8\")) {printf(\"Ошибка при загрузке набора символов utf8: %s\\n\", self::$mysqliPublic->error);}\n\t\tif (!($stmt = parent::$mysqliPublic->prepare(\"UPDATE `\" . TableReestrDistinct. \"` SET col4_data= (?),col4_state=(?) WHERE col1=(?)\"))) {\n\t\t\techo \"Не удалось подготовить запрос: (\" . parent::$mysqliPublic->errno . \") \" . parent::$mysqliPublic->error;\n\t\t}\n\t\tif (!$stmt->bind_param(\"sss\", $col4, $col4_state, $col1)) {\n\t\t\techo \"Не удалось привязать параметры: (\" . $stmt->errno . \") \" . $stmt->error;\n\t\t}\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$cur_date=$this->StringToDate($row[col4]);\n\t\t\t$col1=$row[col1];\n\t\t\t$col4=$cur_date;\n\n\t\t\t$find='Отменено';\n\t\t\t$find_pos = strpos($row[col4], $find);\n\t\t\t$col4_state='Отменено';\n\t\t\tif ($find_pos === false) {\n\t\t\t\t$cur_date_now=date(\"Y-m-d\");\n\t\t\t\tif ($cur_date <=$cur_date_now) { \n\t\t\t\t\t$col4_state='Срок действия истек';\n\t\t\t\t} else {\n\t\t\t\t\t$col4_state='Действующий';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($cur_date != 'NULL') {\n\t\t\t\t$stmt->execute();\n\t\t\t\techo(sprintf(\"%s -> %s = '%s'\", $row[col1], $row[col4], $col4));\n\t\t\t\techo \"<br>\";\n\t\t\t}\n\t\t}\n\t}", "function insert_stmt(){\n\t\tglobal $in;\n\t\tif ($this->attributes['BYTB']!='' )$this->fields_value_bytb($this->attributes['BYTB']);\n\t\t\n\t\t\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\t\t\t\t\n\t\t\t\t$this->field_stmt[$i]=\"{$key}\";\n\t\t\t\t$this->value_stmt[$i]=\"{$in[$key]}\";\n\t\t\t\t\n\t\t\t\tif($in[$key]==1){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t#GC 20/04/2015 gestione popolamento decode\n\t\t\t\t\tif (isset($this->attributes['DECODE'][$key])) $this->value_stmt[$i]=\"{$this->attributes['DECODE'][$key]}\";\n\t\t\t\t\telse $this->value_stmt[$i]=$val;\n\t\t\t\t}\n\t\t\t\t#GC 20/04/2015 gestione sbiancamento decode\n\t\t\t\tif($in[$key]==0){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t$this->value_stmt[$i]=\"\";\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn;\n\t}", "function s_m_put_txt_data_insert($rows, $columnames, $store_data){\r\n // only the data in $store_data\r\n // (not index by column name but column number!)\r\n $row_nr = count($rows);\r\n for($i = 0; $i < count($columnames); $i++){\r\n $this_value = \"\";\r\n if(isset($store_data[$i])){\r\n $this_value = $store_data[$i];\r\n }\r\n $rows[$row_nr][$columnames[$i]] = $this_value;\r\n }\r\n return $rows;\r\n}", "protected function transferNestedColumnPosition()\n {\n $select_fields = 'tx_multicolumn_parentid, colPos';\n $where = 'tx_multicolumn_parentid > 0 AND deleted = 0';\n $resource = $this->execSelect($select_fields, $where);\n if ($resource === false) {\n $this->results['error'] = 'error_no_mc_contents';\n return false;\n }\n\n // Find colPos values used for elements in multicolum containers\n $mcColPosValsPerParent = array();\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $mcpid = $row['tx_multicolumn_parentid'];\n if (!isset($mcColPosValsPerParent[$mcpid])) {\n $mcColPosValsPerParent[$mcpid] = array(\n 'colPosVals' => array(),\n 'geLayout' => '',\n );\n }\n $mcColPosValsPerParent[$mcpid]['colPosVals'][] = $row['colPos'];\n }\n $GLOBALS[\"TYPO3_DB\"]->sql_free_result($resource);\n\n // Update colPos values\n foreach ($mcColPosValsPerParent as $mcpid => &$array) {\n $array['colPosVals'] = array_unique($array['colPosVals']);\n $select_fields = 'uid, tx_gridelements_backend_layout';\n $where = 'uid = ' . $mcpid;\n $resource = $this->execSelect($select_fields, $where);\n if ($resource === false) {\n continue; // Parent container doesn't exist anymore.\n }\n\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $array['geLayout'] = $row['tx_gridelements_backend_layout'];\n }\n $GLOBALS[\"TYPO3_DB\"]->sql_free_result($resource);\n }\n\n $layoutColPosVals = $this->getLayoutColPosVals();\n foreach ($mcColPosValsPerParent as $mcpid => $array) {\n $i = 0;\n foreach ($array['colPosVals'] as $colPos) {\n $where = 'tx_multicolumn_parentid = ' . $mcpid\n . ' AND colPos = ' . $colPos;\n $geColumn = $i + 100;\n $geColPos = -2; // Column NOT available in GE layout\n if (isset($layoutColPosVals[$array['geLayout']][$i])) {\n $geColumn = $layoutColPosVals[$array['geLayout']][$i];\n $geColPos = -1; // Column available in GE layout\n }\n $fields_values = array(\n 'colPos' => $geColPos,\n 'backupColPos' => $colPos,\n 'tx_gridelements_columns' => $geColumn,\n );\n $this->execUpdate($where, $fields_values);\n ++$i;\n }\n }\n $this->results['transferNestedColumnPosition'] = true;\n return true;\n }", "function gaMatch_addPlayerResult($kidPlayerId, $win, $draw, $lost) {\n //??????????????????? does record already exist - what if player change ?????????\n $match = array_search ( $kidPlayerId , $this->gamatch_gamePlayerMap);\n if ($match === FALSE) {\n $newGame = new stdData_gameUnit_extended;\n $newGame->stdRec_loadRow($row);\n $this->gamatch_gamePlayerMap[$newGame->game_kidPeriodId] = $newGame;\n ++$this->game_opponents_count;\n $this->game_opponents_kidPeriodId[] = $kidPlayerId;\n $this->game_opponents_wins[] = $win;\n $this->game_opponents_draws[] = $draw;\n $this->game_opponents_losts[] = $lost;\n $this->gagArrayGameId[] = 0;\n } else {\n $this->game_opponents_wins[$match] += $win;\n $this->game_opponents_draws[$match] += $draw;\n $this->game_opponents_losts[$match] += $lost;\n }\n}", "function insert_status_column_to_master_view(Array $visible_columns): Array {\n \n $status_name_field = $this->CI->grants->name_field('status');\n\n if($this->controller !== \"approval\"){\n if(\n in_array('status',$this->CI->grants->lookup_tables($this->controller)) && \n !in_array($status_name_field,$visible_columns) \n ){\n array_push($visible_columns,$status_name_field);\n } \n }\n\n return $visible_columns;\n }", "public function insert(array $columns);", "public function insert(array $columns);", "public function insertCol($column_start, $column_end) {\n\t}", "public function rejectIfInvalidRowAndColumn(Board $board, User $player, $row, $col);", "function insert_or_update($table, $idcol, $idnum = NULL /*, trios of column,template(%d,%i,%n,%s),substitute can follow here*/) {\r\n \t$num_args = func_num_args()-3;\r\n \tif ($num_args % 3 != 0)\r\n \t\tthrow new Exception('Number of arguments to insert_or_update must be a multiple of three.');\r\n \tif ($num_args < 3)\r\n \t\tthrow new Exception('Must pass at least one column name,type,value trio to insert_or_update');\r\n \t$set_str = '';\r\n \t$set_args = array();\r\n \t$update_str = '';\r\n \tfor ($i = 0; $i < $num_args; $i += 3) {\r\n \t\t$key = func_get_arg(3+$i);\r\n \t\t$template = func_get_arg(3+$i+1);\r\n \t\t$value = func_get_arg(3+$i+2);\r\n \t\t\r\n \t\tif ($template == '%s')\r\n \t\t\tthrow new Exception('Dangerous template %s is not allowed. Use %n or \"%s\" (in quotes).');\r\n \t\t\r\n \t\t$set_str .= ($i == 0 ? '':', ').\"`$key`=$template \";\r\n \t\t$update_str .= ($i == 0 ? '':', ').\"`$key`=VALUES(`$key`)\"; // for ON DUPLICATE KEY UPDATE\r\n \t\t$n_count = substr_count($template, '%');\r\n \t\tif ($n_count == 1)\r\n \t\t\t$set_args[] = $value;\r\n \t\telse if ($n_count > 1 || $value !== NULL)\r\n \t\t\tthrow new Exception('Invalid use of % or data passed unexpectedly for colum \"'.$key.'\"');\r\n \t}\r\n \t$set_str = self::parse_args($set_str, $set_args);\r\n \tif ($idnum)\r\n \t\treturn $this->run('INSERT INTO `'.$table.'` SET `'.$idcol.'`=%d, '.$set_str.' ON DUPLICATE KEY UPDATE '.$update_str, $idnum);\r\n \telse\r\n \t\treturn $this->run('INSERT INTO `'.$table.'` SET '.$set_str);\r\n }", "public function presetCamaraAlumnos1($posicion) {\n\n self::$alumnos1->preset($posicion);\n\n }", "public function run()\n {\n \n\n \\DB::table('selects')->delete();\n \n \\DB::table('selects')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'column' => 'Business Unit',\n 'option' => 'EAS',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 1 => \n array (\n 'id' => 2,\n 'column' => 'Business Unit',\n 'option' => 'EEC',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 2 => \n array (\n 'id' => 3,\n 'column' => 'Business Unit',\n 'option' => 'ENCOM',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 3 => \n array (\n 'id' => 4,\n 'column' => 'Business Unit',\n 'option' => 'NASIAM',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 4 => \n array (\n 'id' => 5,\n 'column' => 'Business Unit',\n 'option' => 'SFM',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 5 => \n array (\n 'id' => 6,\n 'column' => 'Business Unit',\n 'option' => 'SUMET',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 6 => \n array (\n 'id' => 7,\n 'column' => 'Business Unit',\n 'option' => 'WORAKORN',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 7 => \n array (\n 'id' => 8,\n 'column' => 'Business Unit',\n 'option' => 'มาบข่า',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 8 => \n array (\n 'id' => 9,\n 'column' => 'Fleet',\n 'option' => 'EAS',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 9 => \n array (\n 'id' => 10,\n 'column' => 'Fleet',\n 'option' => 'EAS (รอซ่อมที่มาบข่า)',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 10 => \n array (\n 'id' => 11,\n 'column' => 'Fleet',\n 'option' => 'จ๊ะโอ๋',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 11 => \n array (\n 'id' => 12,\n 'column' => 'Fleet',\n 'option' => 'จ๋ะโอ๋',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 12 => \n array (\n 'id' => 13,\n 'column' => 'Fleet',\n 'option' => 'ทะเลไทย 2/33',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 13 => \n array (\n 'id' => 14,\n 'column' => 'Fleet',\n 'option' => 'บุญมี',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 14 => \n array (\n 'id' => 15,\n 'column' => 'Fleet',\n 'option' => 'มาบข่า',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 15 => \n array (\n 'id' => 16,\n 'column' => 'Fleet',\n 'option' => 'ไม่มีตัวตน',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 16 => \n array (\n 'id' => 17,\n 'column' => 'Fleet',\n 'option' => 'รถส่วนตัว',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 17 => \n array (\n 'id' => 18,\n 'column' => 'Fleet',\n 'option' => 'สนง.อุตสาหกรรมเช่า',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 18 => \n array (\n 'id' => 19,\n 'column' => 'Fleet',\n 'option' => 'แหลมฉบัง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 19 => \n array (\n 'id' => 20,\n 'column' => 'Fleet',\n 'option' => 'อจ.ต้อม',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 20 => \n array (\n 'id' => 21,\n 'column' => 'จังหวัด',\n 'option' => 'กรุงเทพมหานคร',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 21 => \n array (\n 'id' => 22,\n 'column' => 'จังหวัด',\n 'option' => 'ฉะเชิงเทรา',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 22 => \n array (\n 'id' => 23,\n 'column' => 'จังหวัด',\n 'option' => 'ระยอง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 23 => \n array (\n 'id' => 24,\n 'column' => 'เชื้อเพลิง',\n 'option' => 'NGV',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 24 => \n array (\n 'id' => 25,\n 'column' => 'เชื้อเพลิง',\n 'option' => 'ดีเซล',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 25 => \n array (\n 'id' => 26,\n 'column' => 'เชื้อเพลิง',\n 'option' => 'ไม่ใช้เชื้อเพลิง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 26 => \n array (\n 'id' => 27,\n 'column' => 'ประเภทรถ',\n 'option' => 'tank',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 27 => \n array (\n 'id' => 28,\n 'column' => 'ประเภทรถ',\n 'option' => 'กึ่งพ่วง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 28 => \n array (\n 'id' => 29,\n 'column' => 'ประเภทรถ',\n 'option' => 'กึ่งพ่วงตู้คอนเทนเนอร์',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 29 => \n array (\n 'id' => 30,\n 'column' => 'ประเภทรถ',\n 'option' => 'กึ่งพ่วงน้ำมัน',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 30 => \n array (\n 'id' => 31,\n 'column' => 'ประเภทรถ',\n 'option' => 'กึ่งพ่วงบรรทุกเฮกเซน',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 31 => \n array (\n 'id' => 32,\n 'column' => 'ประเภทรถ',\n 'option' => 'กึ่งพ่วงเมทานอล',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 32 => \n array (\n 'id' => 33,\n 'column' => 'ประเภทรถ',\n 'option' => 'กึ่งพวงรับเบอร์โซลเว้นท์',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 33 => \n array (\n 'id' => 34,\n 'column' => 'ประเภทรถ',\n 'option' => 'เคมี',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 34 => \n array (\n 'id' => 35,\n 'column' => 'ประเภทรถ',\n 'option' => 'เต็ม',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 35 => \n array (\n 'id' => 36,\n 'column' => 'ประเภทรถ',\n 'option' => 'มอเตอร์ไซด์',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 36 => \n array (\n 'id' => 37,\n 'column' => 'ประเภทรถ',\n 'option' => 'โม',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 37 => \n array (\n 'id' => 38,\n 'column' => 'ประเภทรถ',\n 'option' => 'รถยนต์',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 38 => \n array (\n 'id' => 39,\n 'column' => 'ประเภทรถ',\n 'option' => 'ลากจูง (โม)',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 39 => \n array (\n 'id' => 40,\n 'column' => 'ประเภทรถ',\n 'option' => 'หัวลาก',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 40 => \n array (\n 'id' => 41,\n 'column' => 'ประเภทรถ',\n 'option' => 'หัวลากวัตถุอันตราย',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 41 => \n array (\n 'id' => 42,\n 'column' => 'ประเภทรถ',\n 'option' => 'หางพ่วงตู้บรรทุกแห้ง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 42 => \n array (\n 'id' => 43,\n 'column' => 'ยี่ห้อ',\n 'option' => 'HINO',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 43 => \n array (\n 'id' => 44,\n 'column' => 'ยี่ห้อ',\n 'option' => 'ISUZU',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 44 => \n array (\n 'id' => 45,\n 'column' => 'ยี่ห้อ',\n 'option' => 'SCANIA',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 45 => \n array (\n 'id' => 46,\n 'column' => 'ยี่ห้อ',\n 'option' => 'TOYOTA',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 46 => \n array (\n 'id' => 47,\n 'column' => 'ยี่ห้อ',\n 'option' => 'VOLVO',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 47 => \n array (\n 'id' => 48,\n 'column' => 'ตำแหน่งเลขตัวรถ',\n 'option' => 'กลางซ้าย',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 48 => \n array (\n 'id' => 49,\n 'column' => 'ตำแหน่งเลขตัวรถ',\n 'option' => 'หน้าขวา',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 49 => \n array (\n 'id' => 50,\n 'column' => 'ตำแหน่งเลขตัวรถ',\n 'option' => 'หน้าซ้าย',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 50 => \n array (\n 'id' => 51,\n 'column' => 'ตำแหน่งเลขตัวรถ',\n 'option' => 'หลังขวา',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 51 => \n array (\n 'id' => 52,\n 'column' => 'ตำแหน่งเลขเครื่องยนต์',\n 'option' => 'ขวาเครื่อง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 52 => \n array (\n 'id' => 53,\n 'column' => 'ตำแหน่งเลขเครื่องยนต์',\n 'option' => 'ซ้ายเครื่อง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 53 => \n array (\n 'id' => 54,\n 'column' => 'กรรมสิทธิ์',\n 'option' => 'EEC',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 54 => \n array (\n 'id' => 55,\n 'column' => 'กรรมสิทธิ์',\n 'option' => 'ENCOM',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 55 => \n array (\n 'id' => 56,\n 'column' => 'กรรมสิทธิ์',\n 'option' => 'NASIAM',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 56 => \n array (\n 'id' => 57,\n 'column' => 'กรรมสิทธิ์',\n 'option' => 'PATRAPORN',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 57 => \n array (\n 'id' => 58,\n 'column' => 'กรรมสิทธิ์',\n 'option' => 'SFM',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 58 => \n array (\n 'id' => 59,\n 'column' => 'กรรมสิทธิ์',\n 'option' => 'Sold',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 59 => \n array (\n 'id' => 60,\n 'column' => 'กรรมสิทธิ์',\n 'option' => 'WORAKORN',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 60 => \n array (\n 'id' => 61,\n 'column' => 'กรรมสิทธิ์',\n 'option' => 'ลิสซิ่ง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 61 => \n array (\n 'id' => 62,\n 'column' => 'กรรมสิทธิ์',\n 'option' => 'ลุงวุฒิ',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 62 => \n array (\n 'id' => 63,\n 'column' => 'สถานะ',\n 'option' => 'ขาย',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 63 => \n array (\n 'id' => 64,\n 'column' => 'สถานะ',\n 'option' => 'ปลดภาระ',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 64 => \n array (\n 'id' => 65,\n 'column' => 'สถานะ',\n 'option' => 'มีภาระ',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 65 => \n array (\n 'id' => 66,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'เกียรตินาคิน',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 66 => \n array (\n 'id' => 67,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'โตโยต้าลิสซิ่ง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 67 => \n array (\n 'id' => 68,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'ทิสโก้ ลิสซิ่ง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 68 => \n array (\n 'id' => 69,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'ไทยโอริกซ์ ลิสซิ่ง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 69 => \n array (\n 'id' => 70,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'ธนาคารธนชาติ',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 70 => \n array (\n 'id' => 71,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'ธนาคารแลนด์ แอนด์ เฮ้าส์ จำกัด (มหาชน)',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 71 => \n array (\n 'id' => 72,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'บริษัท เอสเอ็มเอฟแอล ลิสซิ่ง (ประเทศไทย) จำกัด',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 72 => \n array (\n 'id' => 73,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'ภัทรลิสซิ่ง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 73 => \n array (\n 'id' => 74,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'มิตรสยามมอเตอร์ส',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 74 => \n array (\n 'id' => 75,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'ราชธานีลิสซิ่ง',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 75 => \n array (\n 'id' => 76,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'ลิสซิ่งกสิกรไทย',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 76 => \n array (\n 'id' => 77,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'เอเชียเสริมกิจลิสซิ่ง (ซื้อต่อจากสหนคร)',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 77 => \n array (\n 'id' => 78,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'ฮิตาชิ แคปปิตอล',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n 78 => \n array (\n 'id' => 79,\n 'column' => 'บริษัทลิซซิ่ง',\n 'option' => 'ฮีโนสยามนคร',\n 'created_at' => '2018-08-13 20:01:43',\n 'updated_at' => '2018-08-13 20:01:43',\n ),\n ));\n \n \n }", "function updatedColumn()\n {\n $assignupdate_ = array();\n\n $dt=$this->input->post('dt');\n $checkedassign_id=$this->input->post('checkedassign_id');\n echo $col = $this->input->post('columnname');\n\n $this->db->where('assignment_checker_id', $checkedassign_id);\n $data = array(\n \t\t\t$col => $dt\n \t\t\t );\n\n $query = $this->db->update('assignment_checker', $data);\n return $query;\n }", "public function insert() {\n \n $sql = \"INSERT INTO $this->table(\"\n . \"tb_user_id,\"\n . \"tb_user_directors_id,\"\n . \"tb_boleto_venc_boleto,\"\n . \"tb_boleto_hash_boleto,\"\n . \"tb_boleto_hash_nfe,\"\n . \"tb_boleto_hash_sla,\"\n . \"tb_boleto_status_boleto,\"\n . \"tb_boleto_date,\"\n . \"tb_boleto_hour)\"\n . \"VALUES (?,?,?,?,?,?,?,?,?)\";\n \n $stmt = DB::prepare($sql);\n \n $stmt->bindParam(1, $this->tb_user_id);\n $stmt->bindParam(2, $this->tb_user_directors_id);\n $stmt->bindParam(3, $this->tb_boleto_venc_boleto);\n $stmt->bindParam(4, $this->tb_boleto_hash_boleto);\n $stmt->bindParam(5, $this->tb_boleto_hash_nfe);\n $stmt->bindParam(6, $this->tb_boleto_hash_sla);\n $stmt->bindParam(7, $this->tb_boleto_status_boleto);\n $stmt->bindParam(8, $this->tb_boleto_date);\n $stmt->bindParam(9, $this->tb_boleto_hour);\n \n $stmt->execute();\n }", "public function insertRow($row);", "protected function getNewColumn()\n {\n return $this->newColumn;\n }", "public function addColumn($value) {\n array_push($this->columns, $value);\n }", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }", "function update($table, $idcol, $idnum/*, trios of column,template(%d,%i,%n,%s),substitute can follow here*/) {\r\n \t$num_args = func_num_args()-3;\r\n \tif ($num_args % 3 != 0)\r\n \t\tthrow new Exception('Number of arguments to insert_or_update must be a multiple of three.');\r\n \tif ($num_args < 3)\r\n \t\tthrow new Exception('Must pass at least one column name,type,value trio to insert_or_update');\r\n \t$set_str = '';\r\n \t$set_args = array();\r\n \tfor ($i = 0; $i < $num_args; $i += 3) {\r\n \t\t$key = func_get_arg(3+$i);\r\n \t\t$template = func_get_arg(3+$i+1);\r\n \t\t$value = func_get_arg(3+$i+2);\r\n \t\t\r\n \t\tif ($template == '%s')\r\n \t\t\tthrow new Exception('Dangerous template %s is not allowed. Use %n or \"%s\" (in quotes).');\r\n \t\t\r\n \t\t$set_str .= ($i == 0 ? '':', ').\"`$key`=$template \";\r\n \t\t$n_count = substr_count($template, '%');\r\n \t\tif ($n_count == 1)\r\n \t\t\t$set_args[] = $value;\r\n \t\telse if ($n_count > 1 || $value !== NULL)\r\n \t\t\tthrow new Exception('Invalid use of % or data passed unexpectedly for colum \"'.$key.'\"');\r\n \t}\r\n \t$set_str = \"UPDATE `$table` SET $set_str WHERE `$idcol`=%d\";\r\n \t$set_args[] = $idnum;\r\n \t$set_str = self::parse_args($set_str, $set_args);\r\n \treturn $this->run($set_str);\r\n }", "function insertEquipe ($tab)\n{\n\t$con = connexion ();\n\tif($con != null)\n\t{\n\t\t$requete = \"insert into equipe values (null,'\".$tab['nomE'].\"','\".$tab['nomC'].\"','\".$tab['prenomC'].\"','\".$tab['numeroC'].\"','\".$tab['idcoach'].\"');\";\n\t\tmysqli_query($con, $requete);\n\t\tdeconnexion($con);\n\t}\n}", "public function run()\n {\n DB::table('points')->insert([\n [\n 'team_id' => 1,\n 'matches_played' => 8,\n 'win' =>1,\n 'loss' =>7,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ],[\n 'team_id' => 2,\n 'matches_played' => 8,\n 'win' =>7,\n 'loss' =>1,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ],[\n 'team_id' => 3,\n 'matches_played' => 10,\n 'win' =>4,\n 'loss' =>6,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ],[\n\n 'team_id' => 4,\n 'matches_played' => 8,\n 'win' =>5,\n 'loss' =>3,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ], [\n 'team_id' => 5,\n 'matches_played' => 7,\n 'win' =>6,\n 'loss' =>1,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ], [\n 'team_id' => 6,\n 'matches_played' => 8,\n 'win' =>5,\n 'loss' =>3,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ], [\n 'team_id' => 7,\n 'matches_played' => 8,\n 'win' =>4,\n 'loss' =>4,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ], [\n 'team_id' => 8,\n 'matches_played' => 8,\n 'win' =>2,\n 'loss' =>6,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ], [\n 'team_id' => 9,\n 'matches_played' => 7,\n 'win' =>3,\n 'loss' =>4,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ],[\n 'team_id' => 10,\n 'matches_played' => 7,\n 'win' =>2,\n 'loss' =>5,\n 'created_at'=>Carbon::now(),\n 'updated_at'=>Carbon::now()\n ],\n ]);\n }", "public function run()\n {\n DB\n ::table('friend_list')\n ->insert([\n ['player_id' => 1, 'friend_id' => 2],\n ['player_id' => 2, 'friend_id' => 1]\n ]);\n }", "public function switchActivePlayer()\n\t{\n\t\t$activeplayer = $this -> activePlayer;\n\t\t$playerX = $this -> playerX;\n\t\t$playerO = $this -> playerO;\n\t\tif ($activeplayer == $playerX)\n\t\t\t$this -> activePlayer = $playerO;\n\t\telse\n\t\t\t$this -> activePlayer = $playerX;\n\t\t\t\n\t\t$newactive = $this -> activePlayer;\n\t\t\n\t\t$query = \"UPDATE tttgame \n\t\t\t\t SET activeplayer = '$newactive' \n\t\t\t\t WHERE playerX = '$playerX' \n\t\t\t\t AND playerO = '$playerO';\";\n\t\t$this -> queryDB($query);\n\t}", "public function run()\n {\n \tDB::table('games')->insert([\n [\n 'start_time' => Carbon::now(),\n 'pX' => 1,\n 'pO' => 2,\n 'size' => 3,\n 'status' => 2\n ],[\n 'start_time' => Carbon::now(),\n 'pX' => 1,\n 'pO' => 2,\n 'size' => 3,\n 'status' => 2\n ]\n ]);\n }" ]
[ "0.59531695", "0.5458706", "0.54368246", "0.53920597", "0.53197265", "0.52322024", "0.5158589", "0.50014186", "0.49538615", "0.4883815", "0.48810536", "0.48696572", "0.4807459", "0.47927716", "0.47904843", "0.47486815", "0.47263956", "0.4722294", "0.47139347", "0.4698653", "0.46977934", "0.46833375", "0.46685663", "0.46655723", "0.4664651", "0.4648525", "0.46419778", "0.46366975", "0.46322185", "0.46253654", "0.4600513", "0.4581121", "0.45546272", "0.455353", "0.45431086", "0.45392397", "0.4538663", "0.45304036", "0.45294166", "0.4523648", "0.4517418", "0.45153365", "0.45152542", "0.45141602", "0.45051274", "0.45037755", "0.45030126", "0.45020807", "0.45008576", "0.44993684", "0.4496105", "0.4494757", "0.44919434", "0.4490016", "0.44873953", "0.44865683", "0.44848028", "0.44829342", "0.44777164", "0.44713157", "0.44648975", "0.44583172", "0.44537118", "0.44526047", "0.44518098", "0.44517294", "0.44489464", "0.4448375", "0.44431263", "0.4442453", "0.44387853", "0.44374752", "0.44369", "0.44356665", "0.4429589", "0.4428959", "0.44127172", "0.44119462", "0.44104227", "0.44051343", "0.4403534", "0.4402522", "0.4402522", "0.43854022", "0.43777236", "0.43666625", "0.43618426", "0.4358886", "0.435348", "0.4350502", "0.43455374", "0.43441948", "0.43385723", "0.4335287", "0.43348634", "0.4331493", "0.43310243", "0.4321578", "0.43124452", "0.4312181" ]
0.5218046
6
/ Validation Function validate the user selection input In case of invalid input Message print to user to make another selection
public function checkValidMove($userMove){ if(!is_numeric($userMove) ||$userMove < 1 || $userMove > Board::COLUMNS){ invalidInputMsg($this->currentPlayer); return false; } return true;; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function select_validate($select){\n // 'none' is the first option that is default \"-------Choose Country-------\"\n if($select==\"none\"){\n $this->form_validation->set_message('select_validate', 'Please Select Your Country.');\n return false;\n } else{\n // User picked something.\n return true;\n }\n }", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static function userBadChoice()\n {\n say('Invalid entry, please try again');\n }", "public function validate_user_input_outcome()\n {\n $passed_validation_tests = true;\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n $check_ap = has_presence($this->ap);\n $check_ap_numeric = has_number($this->ap);\n if (!$check_ap or !$check_ap_numeric) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"AP: \";\n $msg .= h($this->ap);\n $msg .= \" cannot be blank and must be a number.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_provider_id = has_presence($this->provider_id);\n $allowed_provider_ids = Provider::find_array_of_providers_ids();\n $check_provider_id_inclusion = has_inclusion_in($this->provider_id, $allowed_provider_ids);\n if (!$check_provider_id or !$check_provider_id_inclusion) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Provider: \";\n $msg .= h($this->provider_id);\n $msg .= \" cannot be blank and must be a valid choice: \";\n $msg .= \"</li>\";\n }\n $check_shift_id = has_presence($this->shift_id);\n $check_shift_id_inclusion = has_inclusion_in($this->shift_id, [1, 2]);\n if (!$check_shift_id or !$check_shift_id_inclusion) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Shift: \";\n $msg .= h($this->shift_id);\n $msg .= \" cannot be blank and must be a valid choice.\";\n $msg .= \"</li>\";\n }\n $check_outcome_id = has_presence($this->outcome_id);\n $allowed_outcome_ids = Outcome::find_array_of_outcome_ids();\n $check_outcome_id_inclusion = has_inclusion_in($this->outcome_id, $allowed_outcome_ids);\n if (!$check_outcome_id or !$check_outcome_id_inclusion) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Outcome: \";\n $msg .= h($this->outcome_id);\n $msg .= \" cannot be blank and must be a valid choice.\";\n $msg .= \"</li>\";\n }\n $check_price_paied = has_presence($this->price_paied);\n $check_price_paied_numeric = has_number($this->price_paied);\n if ($check_price_paied and !$check_price_paied_numeric) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Price paied: \";\n $msg .= h($this->price_paied);\n $msg .= \" by provider must be a number.\";\n $msg .= \"</li>\";\n } elseif (!$check_price_paied) {\n $price_paied = 0;\n }\n $check_reason_outcome_id = has_presence($this->reason_outcome_id);\n $check_reason_outcome_id_inclusion = has_inclusion_in($this->reason_outcome_id, [1, 2]);\n if (!$check_reason_outcome_id or !$check_reason_outcome_id_inclusion) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Reason for outcome: \";\n $msg .= h($this->reason_outcome_id);\n $msg .= \" cannot be blank and must be a valid choice.\";\n $msg .= \"</li>\";\n }\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "function combo_check($str)\r\n\t{\r\n\t\tif ($str == '-SELECT-')\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('combo_check', 'Valid %s Name is required');\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t}", "public function check_selection(){\n if (count($this->input->post())!==5){\n $this->form_validation->set_message('check_selection');\n $this->session->set_flashdata('error_msg', 'You must select not More or Less than 3 Additional Subjects');\n redirect('exam/content/question/subject/4/JAMB?simulator=simulator');\n return FALSE;\n }else{\n $this->set_jamb_in_session();\n return TRUE;\n }\n }", "function errorInput(){\r\n\t\tinclude 'define.php';\r\n\t\tif($_POST['hairstyle'] == \"\" and $_POST['maxprice'] == \"\" and $_POST['location'] == \"\" and $_POST['minprice'] == \"\"){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct one of the option\");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t}\r\n\t\telseif(isset($_POST['minprice']) and $_POST['hairstyle'] == \"\" and $_POST['location'] == \"\"and $_POST['maxprice'] == \"\"){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle or the combination of hairstyle and the minimum price you want to spend \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t}//end of if statement\r\n\t\telseif(isset($_POST['maxprice'])and $_POST['hairstyle'] == \"\" and $_POST['location'] == \"\" and $_POST['minprice'] == \"\"){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle or the combination of hairstyle and the maximum price you are willing to spend\");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t}\r\n\t\telseif(isset($_POST['minprice']) and isset($_POST['maxprice']) and $_POST['hairstyle'] == \"\" and $_POST['location'] == \"\" ){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t}\r\n\t\telseif(isset($_POST['minprice']) and isset($_POST['location']) and $_POST['hairstyle'] == \"\" and $_POST['maxprice'] == \"\" ){\r\n\t\t\t\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\telseif(isset($_POST['location']) and isset($_POST['maxprice']) and $_POST['hairstyle'] == \"\" and $_POST['minprice'] == \"\" ){\r\n\t\t\t\r\n\t\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t\t\r\n\t\t}\r\n\t\telseif(isset($_POST['minprice']) and isset($_POST['maxprice']) and isset($_POST['location']) and $_POST['hairstyle'] == \"\"){\r\n\t\t\techo '<script>\r\n\t\t\talert(\"Please selct your desired hairstyle \");\r\n\t\t\t</script>';\r\n\t\t\tprint \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=startbackup2.php\\\">\";\r\n\t\t}\r\n\t}", "function validate() {\n\t\t\t$this->field['msg'] = ( isset( $this->field['msg'] ) ) ? $this->field['msg'] : esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );\n\n\t\t\tif ( ! is_numeric( str_replace( ',', '', $this->value ) ) || strpos( $this->value, ',' ) == false ) {\n\t\t\t\t$this->value = ( isset( $this->current ) ) ? $this->current : '';\n\t\t\t\t$this->field['current'] = $this->value;\n\n\t\t\t\t$this->error = $this->field;\n\t\t\t}\n\t\t}", "function validateData($tID, $sID){\r\n\t\t\t\tglobal $error;\r\n\t\t\t\tglobal $count;\r\n\t\t\t\t\r\n\t\t\t\tif($tID==0 || $tID== null){\r\n\t\t\t\t\t$error.= \"<br/> You must select a tutor.\"; \r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($sID)==0){\r\n\t\t\t\t\t$error.= \"<br/> You must select a student to assign.\"; \r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "function form1()\r\n {\r\n global $f3;\r\n $isValid= true;\r\n if (!validString($f3->get('animal'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['animal']\", \"Please enter an animal \");\r\n }\r\n if (!validQty($f3->get('qty'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['qty']\", \"Please enter quantity\");\r\n }\r\n return $isValid;\r\n }", "function validate() : bool\n\t{\n\t\tif($this->isFillIn)\n\t\t{\n\t\t\tif($_SERVER['REQUEST_METHOD'] === \"POST\")\n\t\t\t{\n\t\t\t\t$this->inputAnswer = $_POST[$this->questionID.'_textarea'];\n\t\t\t}\n\t\t\tif($this->inputAnswer || $this->inputAnswer == \"\")\n\t\t\t{\n\t\t\t\t$this->error = \"\";\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->error = \"\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($_SERVER['REQUEST_METHOD'] === \"POST\")\n\t\t\t{\n\t\t\t\t$this->inputAnswer = $_POST[$this->questionID.'_option'];\n\t\t\t}\n\t\t\t$dropdownValues = array(1, 2, 3, 4, 5, 6, \"\");\n\t\t\tif(in_array($this->inputAnswer, $dropdownValues))\n\t\t\t{\n\t\t\t\t$this->error = \"\";\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->error = \"Invalid selection\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t}", "public function validate()\r\n {\r\n foreach ($this->_data as $data) {\r\n if (!in_array($data, $this->_validateAgainst)) $this->addError('Value is not a valid selection.');\r\n }\r\n \r\n return !sizeof($this->_errors);\r\n }", "function m_verifyEdit()\n\t{\n\t\t$this->errMsg=\"\";\n\t\tif(empty($this->request['subject']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg=MSG_SUBJECT_EMPTY.\"<br>\";\n\t\t}\n\t\tif(!empty($this->request['sid']))\n\t\t{\n\t\t\t#VALIDATING EXISTING OPTION TITLE\n\t\t\t$this->obDb->query = \"SELECT iMailid_PK FROM \".EMAILS.\" where vSid = '\".$this->request['sid'].\"'\";\n\t\t\t$row_code = $this->obDb->fetchQuery();\n\t\t\tif($this->obDb->record_count != 0)\n\t\t\t{\n\t\t\t\tif($row_code[0]->iMailid_PK !=$this->request['id'])\n\t\t\t\t{\n\t\t\t\t\t$this->err=1;\n\t\t\t\t\t$this->errMsg.=MSG_SID_EXIST.\"<br>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->err;\n\t}", "function validateGender($id){\n global $isValidSSWelcome;\n if (in_array($id, array(1,2,3,4))){\n return;\n }\n else{\n echo \"<p>Please select a Gender</p>\";\n $isValidSSWelcome = false;\n\n }\n}", "function _valInput() {\r\n\t\tswitch(TRUE) {\r\n\t\t\tcase (empty($_POST['lynkvp_name'])):\r\n\t\t\t\t$this->note .= __('Please enter a Name.', $this->textdomain_name);\r\n\t\t\t\treturn FALSE; break;\r\n\t\t\tcase (empty($_FILES['lynkvp_file']['size']) && empty($_POST['lynkvp_url'])):\r\n\t\t\t\t$this->note .= __('Please choose a Video or enter an URL.', $this->textdomain_name);\r\n\t\t\t\treturn FALSE; break;\r\n\t\t\tcase (empty($_POST['lynkvp_type'])):\r\n\t\t\t\t$this->note .= __('Please choose a Video Type.', $this->textdomain_name);\r\n\t\t\t\treturn FALSE; break;\r\n\t\t\tcase (empty($_POST['lynkvp_size']) || !isset($this->videosizes[$_POST['lynkvp_size']])):\r\n\t\t\t\tif (empty($_POST['lynkvp_size']) || $_POST['lynkvp_size'] == 0) {\r\n\t\t\t\t\t$this->note .= __('Please select a Size.', $this->textdomain_name);\r\n\t\t\t\t\treturn FALSE;\r\n\t\t\t\t} elseif (preg_match('/[^\\d]/', $_POST['lynkvp_width'])) {\r\n\t\t\t\t\t$this->note .= __('Please enter a Width.', $this->textdomain_name);\r\n\t\t\t\t\treturn FALSE;\r\n\t\t\t\t} elseif(preg_match('/[^\\d]/', $_POST['lynkvp_height'])) {\r\n\t\t\t\t\t$this->note .= __('Please enter a Height.', $this->textdomain_name);\r\n\t\t\t\t\treturn FALSE; break;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn TRUE;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn TRUE; break;\r\n\t\t}\r\n\t}", "function validate()\n{\n $check = true;\n\n $v_id_vehicle = $_POST['id_vehicle'];\n $v_marca = $_POST['marca'];\n $v_modelo = $_POST['modelo'];\n $v_HP = $_POST['HP'];\n $v_Km = $_POST['Km'];\n $v_Anyo_produccion = $_POST['Anyo_produccion'];\n $v_color = $_POST['color'];\n $v_precio = $_POST['precio'];\n\n\n $r_id_vehicle = validate_id_vehicle($v_id_vehicle);\n $r_marca = validate_marca($v_marca);\n $r_modelo = validate_modelo($v_modelo);\n $r_HP = validate_HP($v_HP);\n $r_Km = validate_Km($v_Km);\n $r_Anyo_produccion = validate_Anyo_produccion($v_Anyo_produccion);\n $r_color = validate_color($v_color);\n $r_precio = validate_precio($v_precio);\n\n if ($r_id_vehicle !== 1) {\n $error_id_vehicle = \" * El id_vehicle introducido no es valido\";\n $check = false;\n } else {\n $error_id_vehicle = \"\";\n }\n if ($r_marca !== 1) {\n $error_marca = \" * La marca introducida no es valida\";\n $check = false;\n } else {\n $error_marca = \"\";\n }\n if ($r_modelo !== 1) {\n $error_modelo = \" * El modelo introducido no es valido\";\n $check = false;\n } else {\n $error_modelo = \"\";\n }\n if ($r_HP !== 1) {\n $error_HP = \" * El HP introducido no es valido\";\n $check = false;\n } else {\n $error_HP = \"\";\n }\n if (!$r_Km) {\n $error_Km = \" * No has indicado kilometraje\";\n $check = false;\n } else {\n $error_Km = \"\";\n }\n if (!$r_Anyo_produccion) {\n $error_Anyo_produccion = \" * No has introducido ninguna Anyo_produccion\";\n $check = false;\n } else {\n $error_Anyo_produccion = \"\";\n }\n\n if (!$r_color) {\n $error_color = \" * No has seleccionado ningun color\";\n $check = false;\n } else {\n $error_color = \"\";\n }\n if (!$r_precio) {\n $error_precio = \" * El texto introducido no es valido\";\n $check = false;\n } else {\n $error_precio = \"\";\n }\n\n return $check;\n}", "function validateEthnicity($id){\n global $isValidSSWelcome;\n if (in_array($id, array(1,2,3,4,5,6,7,8,9,10,11))){\n return;\n }\n else{\n echo \"<p>Please select an Ethnicity Option</p>\";\n $isValidSSWelcome = false;\n\n }\n}", "function form_check() {\n\tglobal $admin_users_table;\n\t\n\t// required fields array\n\t$required_fields = array(\n\t\t\t\t\t\t\t'Username'=> $admin_users_table->username,\n\t\t\t\t\t\t\t'Password'=> $admin_users_table->password\n\t\t\t\t\t\t\t);\n\t\t\n\t// check error values and write error array\t\t\t\t\t\n\tforeach($required_fields as $field_name => $output) {\n\n\t\tif (empty($output)) {\n\t\t $errors_array[] = $field_name;\n\t\t}\n\t\n\t}\n\t\n\tif (!empty($errors_array)) {\n\t $error_message = 'You did not supply a value for these fields: ' . implode(', ',$errors_array);\n\t}\n\t\n\tif ($admin_users_table->username_check() > 0) {\n\t $error_message .= '<br>Username has already been assigned to another user. Please choose another.';\n\t}\n\t\n return $error_message;\n }", "public function _validate()\n {\n\t\t$data = array();\n\t\t$data['error_string'] = array();\n\t\t$data['inputerror'] = array();\n\t\t$data['status'] = TRUE;\n\n\t\tif($this->input->post('status') === 'SelecteerStatus')\n\t\t{\n $data['inputerror'][] = 'status';\n $data['error_string'][] = 'Status is verplicht!';\n $data['status'] = FALSE;\n\t\t}\n\t\t\n\t\tif($this->input->post('prioriteit') === 'SelecteerPrioriteit')\n\t\t{\n\t\t\t$data['inputerror'][] = 'prioriteit';\n\t\t\t$data['error_string'][] = 'Prioriteit is verplicht!';\n\t\t\t$data['status'] = FALSE;\n\t\t}\n\n\t\tif(empty($this->input->post('Categorie')))\n\t\t{\n\t\t\t$data['inputerror'][] = 'categorie';\n\t\t\t$data['error_string'][] = 'Categorie is verplicht!';\n\t\t\t$data['status'] = FALSE;\n\t\t}\n if($this->input->post('werkman') === 'Selecteer')\n {\n $data['inputerror'][] = 'werkman';\n $data['error_string'][] = 'Werkman toewijzen is verplicht!';\n $data['status'] = FALSE;\n }\n\n\t\tif($data['status'] === FALSE)\n\t\t{\n\t\t\techo json_encode($data);\n\t\t\texit();\n\t\t}\n }", "function checkInput()\n\t{\n\t\tglobal $lng;\n\t\t\n\t\tinclude_once \"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php\";\n\t\tif (is_array($_POST[$this->getPostVar()])) $_POST[$this->getPostVar()] = ilUtil::stripSlashesRecursive($_POST[$this->getPostVar()], false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString(\"assessment\"));\n\t\t$foundvalues = $_POST[$this->getPostVar()];\n\t\tif (is_array($foundvalues))\n\t\t{\n\t\t\t// check answers\n\t\t\tif (is_array($foundvalues['answer']))\n\t\t\t{\n\t\t\t\tforeach ($foundvalues['answer'] as $aidx => $answervalue)\n\t\t\t\t{\n\t\t\t\t\tif (((strlen($answervalue)) == 0) && (strlen($foundvalues['imagename'][$aidx]) == 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAlert($lng->txt(\"msg_input_is_required\"));\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check points\n\t\t\t$max = 0;\n\t\t\tif (is_array($foundvalues['points']))\n\t\t\t{\n\t\t\t\tforeach ($foundvalues['points'] as $points)\n\t\t\t\t{\n\t\t\t\t\tif ($points > $max) $max = $points;\n\t\t\t\t\tif (((strlen($points)) == 0) || (!is_numeric($points))) \n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_numeric_value_required\"));\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach ($foundvalues['points_unchecked'] as $points)\n\t\t\t\t{\n\t\t\t\t\tif ($points > $max) $max = $points;\n\t\t\t\t\tif (((strlen($points)) == 0) || (!is_numeric($points))) \n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_numeric_value_required\"));\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($max == 0)\n\t\t\t{\n\t\t\t\t$this->setAlert($lng->txt(\"enter_enough_positive_points\"));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (is_array($_FILES) && count($_FILES) && $this->getSingleline())\n\t\t\t{\n\t\t\t\tif (!$this->hideImages)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($_FILES[$this->getPostVar()]['error']['image']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($_FILES[$this->getPostVar()]['error']['image'] as $index => $error)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// error handling\n\t\t\t\t\t\t\tif ($error > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tswitch ($error)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\t\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_size_exceeds\"));\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_size_exceeds\"));\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase UPLOAD_ERR_PARTIAL:\n\t\t\t\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_partially_uploaded\"));\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\t\t\t\t\t\t\tif ($this->getRequired())\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ((!strlen($foundvalues['imagename'][$index])) && (!strlen($foundvalues['answer'][$index])))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_no_upload\"));\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase UPLOAD_ERR_NO_TMP_DIR:\n\t\t\t\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_missing_tmp_dir\"));\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase UPLOAD_ERR_CANT_WRITE:\n\t\t\t\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_cannot_write_to_disk\"));\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase UPLOAD_ERR_EXTENSION:\n\t\t\t\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_upload_stopped_ext\"));\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\tbreak;\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{\n\t\t\t\t\t\tif ($this->getRequired())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_no_upload\"));\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (is_array($_FILES[$this->getPostVar()]['tmp_name']['image']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$filename = $_FILES[$this->getPostVar()]['name']['image'][$index];\n\t\t\t\t\t\t\t$filename_arr = pathinfo($filename);\n\t\t\t\t\t\t\t$suffix = $filename_arr[\"extension\"];\n\t\t\t\t\t\t\t$mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];\n\t\t\t\t\t\t\t$size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];\n\t\t\t\t\t\t\t// check suffixes\n\t\t\t\t\t\t\tif (strlen($tmpname) && is_array($this->getSuffixes()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!in_array(strtolower($suffix), $this->getSuffixes()))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_wrong_file_type\"));\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (is_array($_FILES[$this->getPostVar()]['tmp_name']['image']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$filename = $_FILES[$this->getPostVar()]['name']['image'][$index];\n\t\t\t\t\t\t\t$filename_arr = pathinfo($filename);\n\t\t\t\t\t\t\t$suffix = $filename_arr[\"extension\"];\n\t\t\t\t\t\t\t$mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];\n\t\t\t\t\t\t\t$size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];\n\t\t\t\t\t\t\t// virus handling\n\t\t\t\t\t\t\tif (strlen($tmpname))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$vir = ilUtil::virusHandling($tmpname, $filename);\n\t\t\t\t\t\t\t\tif ($vir[0] == false)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_virus_found\").\"<br />\".$vir[1]);\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setAlert($lng->txt(\"msg_input_is_required\"));\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn $this->checkSubItemsInput();\n\t}", "public function message()\n {\n return 'Please select other date range.';\n }", "function depgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 216) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(3180);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('depgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('depgr_school_check_3180', 'Select a VCCS College/Agency', 3180);\n }\n /* Confirms Discipline is selected */\n $dis_check = $ninja_forms_processing->get_field_value(3176);\n if ($dis_check == 1 ) {\n $ninja_forms_processing->add_error('depgr_dis_check', 'Please select a Discipline');\n $ninja_forms_processing->add_error('depgr_dis_check_3176', 'Select a Discipline', 3176);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(3178);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('depgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('depgr_job_check_3178', 'Select a Job Type', 3178);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(3182);\n $email_check = $ninja_forms_processing->get_field_value(3183);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('depgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('depgr_email_check_3182', 'Email addresses must match', 3182);\n $ninja_forms_processing->add_error('depgr_email_check_3183', 'Email addresses must match', 3183);\n }\n }\n}", "public function combo_check($str)\n {\n if ($str == '-SELECT-') {\n $this->form_validation->set_message('combo_check', 'Valid %s Name is required');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function input_select($errors, $name, $label, $values, $required) {\n //create div belonging to the class 'required_field'\n echo '<div class=\"required_field\">';\n //create the label for the input\n label($name, $label);\n //get the value from previous post\n $value = posted_value($name);\n //Create select box\n echo \"<select name = \\\"$name\\\" onchange=\\\"hide_error_message('$name')\\\" $required>\";\n //input a starting option with the value of \"\"\n echo \"<option value = \\\"\\\"> Select an option below...</option>\";\n //Loop through the array of $values and create a new option for each\n foreach ($values as $value => $display) {\n //set the option value from previous post\n $selected = ($value==posted_value($name))?'selected=\"selected\"':'';\n //create new option with a value of $value and displaying text of $display\n echo \"<option $selected value=\\\"$value\\\">$display</option>\";\n }\n //close the select box\n echo '</select>';\n //create error message span\n error_label($errors, $name);\n //close the div\n echo '</div>';\n}", "function validate_fields($part){\r\n\tif($part == 1){\r\n\t\t$error_msg = array();\r\n\t\t// check that name is not empty or larger than database can hold\r\n\t\tif (!isset($_POST['fullName'])){\r\n\t\t\t$error_msg[] = \"Name field is blank.\";\r\n\t\t} else if (isset($_POST['fullName'])){\r\n\t\t\t$name = trim($_POST['fullName']);\r\n\t\t\tif (empty($name)){\r\n\t\t\t\t$error_msg[] = \"Name field is blank.\";\r\n\t\t\t} else {\r\n\t\t\t\tif (strlen($name) > 128){\r\n\t\t\t\t\t$error_msg[] = \"First Name field cannot contain more than 128 characters.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check that age is set and numeric \r\n\t\tif (!isset($_POST['age'])){\r\n\t\t\t$error_msg[] = \"Age field is blank.\";\r\n\t\t} else if (isset($_POST['age'])){\r\n\t\t\tif (!is_numeric($_POST['age'])) {\r\n\t\t\t\t$error_msg[] = \"Age: Please enter numbers only\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check that dropdown option has been chosen \r\n\t\tif (!isset($_POST['student'])){\r\n\t\t\t$error_msg[] = \"Are you a student? Please choose one.\";\r\n\t\t} else if (isset($_POST['student'])){\r\n\t\t\t$age = $_POST['student'];\r\n\t\t\tif(!($age == \"F\" || $age == \"P\" || $age == \"N\")){\r\n\t\t\t\t$error_msg[] = \"Inappropriate answer given. Please select one from dropdown.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n\tif($part == 2){\r\n\t\t$error_msg = array();\r\n\t\t// check that purchase method is chosen \r\n\t\tif (!isset($_POST['howPurchased'])){\r\n\t\t\t$error_msg[] = \"Please select method of purchase.\";\r\n\t\t} else if (isset($_POST['howPurchased'])){\r\n\t\t\t$purchased = $_POST['howPurchased']; \r\n\t\t\tif(!($purchased == \"Online\" || $purchased == \"By Phone\" || $purchased == \"Mobile App\" || $purchased == \"In Store\")){\r\n\t\t\t\t$error_msg[] = \"Inappropriate value for method of purchase. Please select one. \".$purchased;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// check that one or more products has been chosen\r\n\t\tif (!isset($_POST['purchases'])){\r\n\t\t\t$error_msg[] = \"Please select at least one product.\";\r\n\t\t} else if (isset($_POST['purchases'])){\r\n\t\t\t$purchases = $_POST['purchases'];\r\n\t\t\tif(count($purchases) < 1){\r\n\t\t\t\t$error_msg[] = \"Please select at least one product.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n\tif($part == 3){\r\n\t\t$error_msg = array();\r\n\t\tfor($x = 0; $x < count($_SESSION['purchases']); $x++){\r\n\t\t\t// check that satisfaction is chosen \r\n\t\t\tif (!isset($_POST['satisfaction'.$x])){\r\n\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Please select level of satisfaction\";\r\n\t\t\t} else if (isset($_POST['satisfaction'.$x])){\r\n\t\t\t\t$sat = $_POST['satisfaction'.$x];\r\n\t\t\t\tif(!is_numeric($sat) || $sat < 1 || $sat > 5){\r\n\t\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Inappropriate value for satisfaction.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// check that recommendation has been chosen\r\n\t\t\tif (!isset($_POST['recommend'.$x])){\r\n\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Please choose recommendation option.\";\r\n\t\t\t} else if (isset($_POST['recommend'.$x])){\r\n\t\t\t\t$rec = $_POST['recommend'.$x];\r\n\t\t\t\tif(!($rec == \"Yes\" || $rec == \"Maybe\" || $rec == \"No\")){\r\n\t\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Inappropriate answer given. Please select one from dropdown.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n}", "function form_check() {\n\tglobal $cert_amt_tbl;\n\t\n\t// required fields array\n\t$required_fields = array('Discount Amount'=> $cert_amt_tbl->discount_amount);\n\t\t\n\t// check error values and write error array\t\t\t\t\t\n\tforeach($required_fields as $field_name => $output) {\n\t if (empty($output)) {\n\t\t$errors_array[] = $field_name;\n\t }\n\t}\n\t\n\tif (!empty($errors_array)) {\n\t $error_message = 'You did not supply a value for these fields: ' . implode(', ',$errors_array);\n\t}\n\t\n return $error_message;\n }", "function validMet($selectedMet){\n// $validMetOptions = array(\"1\", \"2\", \"3\", \"4\");\n//\n// //Check each topping and return false if its not valid\n// foreach($validMetOptions as $validMetOption){\n// if(!in_array($validMetOption, $selectedMet)){\n// return false;\n// }\n// }\n//\n// //Option is valid\n// return true;\n if($selectedMet != \"choose\"){\n return true;\n }\n}", "function cvpapgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 194) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(2964);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('cvpapgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('cvpapgr_school_check_2964', 'Select a VCCS College/Agency', 2964);\n }\n /* Confirms Discipline is selected */\n $dis_check = $ninja_forms_processing->get_field_value(2960);\n if ($dis_check == 1 ) {\n $ninja_forms_processing->add_error('cvpapgr_dis_check', 'Please select a Discipline');\n $ninja_forms_processing->add_error('cvpapgr_dis_check_2960', 'Select a Discipline', 2960);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(2962);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('cvpapgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('cvpapgr_job_check_2962', 'Select a Job Type', 2962);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(2966);\n $email_check = $ninja_forms_processing->get_field_value(2967);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('cvpapgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('cvpapgr_email_check_2966', 'Email addresses must match', 2966);\n $ninja_forms_processing->add_error('cvpapgr_email_check_2967', 'Email addresses must match', 2967);\n }\n }\n}", "function test_function() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 17) {\n $email_main = $ninja_forms_processing->get_field_value(367);\n $email_check = $ninja_forms_processing->get_field_value(368);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('test_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('test_email_check_367', 'Email addresses must match', 367);\n $ninja_forms_processing->add_error('test_email_check_368', 'Email addresses must match', 368);\n }\n $school_name = $ninja_forms_processing->get_field_value(398);\n if ($school_name == 1) {\n $ninja_forms_processing->add_error('test_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('test_school_check_398', 'Select a VCCS College/Agency', 398);\n }\n $list_one = $ninja_forms_processing->get_field_value(399);\n if ($list_one == 1) {\n $ninja_forms_processing->add_error('test_one_check', 'Please select from List 1');\n $ninja_forms_processing->add_error('test_one_check_399', 'Select from List 1', 399);\n }\n $list_two = $ninja_forms_processing->get_field_value(400);\n if ($list_two == 1) {\n $ninja_forms_processing->add_error('test_two_check', 'Please select from List 2');\n $ninja_forms_processing->add_error('test_two_check_400', 'Select from List 2', 400);\n }\n $list_three = $ninja_forms_processing->get_field_value(401);\n if ($list_three == 1) {\n $ninja_forms_processing->add_error('test_three_check', 'Please select from List 3');\n $ninja_forms_processing->add_error('test_three_check_401', 'Select from List 3', 401);\n }\n $value_one = $ninja_forms_processing->get_field_value(409);\n $value_two = $ninja_forms_processing->get_field_value(410);\n $total_value = $value_one + $value_two;\n if ($total_value !== 100) {\n $ninja_forms_processing->add_error('test_value_check', 'Total must equal 100%');\n $ninja_forms_processing->add_error('test_value_check_408', 'Total must equal 100%', 408);\n }\n }\n}", "private function validInput()\n {\n if (is_numeric($this->course)) { //Checks that valid course was selected\n if ($this->lab_name !== \"\") //Checks if a lab name was entered\n if (!$this->labAlreadyExists($this->course, $this->lab_name)) {\n {\n foreach ($this->questions as $q) //Checks all questions have text in them\n if ($q === \"\")\n return false; //Returns false if question text is empty\n\n foreach ($this->max_marks as $mark) //Checks all questions have max mark set\n if (!is_numeric($mark))\n return false; //Returns false if a mark was not of type int\n\n if (sizeof($this->min_marks) > 0) {\n foreach ($this->min_marks as $mark) //Checks all questions have min mark set\n if (!is_numeric($mark))\n return false; //Returns false if a mark was not of type int\n }\n return true; //Returns true if all tests are passed\n }\n } else\n return false; //Returns false if a lab already exists with the inputted name\n }\n return false; //Returns false if course is not of type int\n }", "function pepgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 30) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1033);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('pepgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('pepgr_school_check_1033', 'Select a VCCS College/Agency', 1033);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(1031);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('pepgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('pepgr_job_check_1031', 'Select a Job Type', 1031);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1035);\n $email_check = $ninja_forms_processing->get_field_value(1036);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('pepgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('pepgr_email_check_1035', 'Email addresses must match', 1035);\n $ninja_forms_processing->add_error('pepgr_email_check_1036', 'Email addresses must match', 1036);\n }\n }\n}", "function validateInput() {\n $validationSuccessful = true;\n $errorMessage = \"\";\n\n\n //Validate title\n if (!preg_match(\"/^.{1,250}$/\", $_POST['title'])) {\n $validationSuccessful = false;\n $errorMessage .= \"Title is invalid.\". $_POST['title'];\n }\n\n //Validate date\n if (!preg_match(\"/^(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})$/\", $_POST['date'])) {\n $validationSuccessful = false;\n $errorMessage .= \"Date is invalid.\" . $_POST['date'];\n }\n\n //Validate location\n if (!preg_match(\"/^.{1,250}$/\", $_POST['location'])) {\n $validationSuccessful = false;\n $errorMessage .= \"Max_players is invalid.\" . $_POST['location'];\n }\n\n if($validationSuccessful == true) {\n return true;\n } else {\n echo $errorMessage;\n return false;\n }\n }", "function dupeoff_options_validate($input) {\n\treturn $input; // return validated input\n}", "function abepgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 46) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1734);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('abepgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('abepgr_school_check_1734', 'Select a VCCS College/Agency', 1734);\n }\n /* Confirms Discipline is selected */\n $dis_check = $ninja_forms_processing->get_field_value(1806);\n if ($dis_check == 1 ) {\n $ninja_forms_processing->add_error('abepgr_dis_check', 'Please select a Discipline');\n $ninja_forms_processing->add_error('abepgr_dis_check_1806', 'Select a Discipline', 1806);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(1732);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('abepgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('abepgr_job_check_1732', 'Select a Job Type', 1732);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1736);\n $email_check = $ninja_forms_processing->get_field_value(1737);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('abepgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('abepgr_email_check_1736', 'Email addresses must match', 1736);\n $ninja_forms_processing->add_error('abepgr_email_check_1737', 'Email addresses must match', 1737);\n }\n }\n}", "function validateUserInput($totWords,$totNumbers,$totSpChars,$useSeparator,$wordCase ) {\n if(trim($totWords == '')) {\n \t return \"ERROR: Please provide the total number of words to be used for the password.\";\n \t} else if(!ctype_digit($totWords)) {\n \t\treturn \"ERROR: Total number of words must be in numeric.\";\n \t} else if((int)$totWords < 2 || (int)$totWords > 6) {\n \t\treturn \"ERROR: Total number of words must be between 2 to 6.\";\n } else if(trim($totNumbers == '')) {\n \t return \"ERROR: Please provide the total number to be used.\";\n \t} else if(!ctype_digit($totNumbers)) {\n \t\treturn \"ERROR: Total numbers to be used must be in numeric and between 0 to 4.\";\n \t} else if((int)$totNumbers < 0 || (int)$totNumbers > 4) {\n \t\treturn \"ERROR: Total numbers to be used must be between 0 to 4.\";\n } else if(trim($totSpChars == '')) {\n \t return \"ERROR: Please provide the total special characters to be used.\";\n \t} else if(!ctype_digit($totSpChars)) {\n \t\treturn \"ERROR: Total special characters to be used must be in numeric and between 0 to 4.\";\n \t} else if((int)$totSpChars < 0 || (int)$totSpChars > 4) {\n \t\treturn \"ERROR: Total special characters to be used must be between 0 to 4.\";\n } else if(($useSeparator != \"!\") &&\n ($useSeparator != \"@\") &&\n ($useSeparator != \"#\") &&\n ($useSeparator != \"$\") &&\n ($useSeparator != \"%\") &&\n ($useSeparator != \"^\") &&\n ($useSeparator != \"&\") &&\n ($useSeparator != \"*\") &&\n ($useSeparator != \"-\") &&\n ($useSeparator != \"space\") &&\n ($useSeparator != \"none\")) {\n \treturn \"ERROR: Separator character must be from: -,!, @, #, $, %, ^, & or *.\";\n } else if((strtolower($wordCase) <> \"camel\") &&\n (strtolower($wordCase) != \"upper\") &&\n (strtolower($wordCase) != \"lower\")) {\n \t\treturn \"ERROR: Word case must be Upper, Lower or Camel.\";\n } else {\n return \"\";\n }\n }", "function gspgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 39) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1455);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('gspgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('gspgr_school_check_1455', 'Select a VCCS College/Agency', 1455);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(1453);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('gspgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('gspgr_job_check_1453', 'Select a Job Type', 1453);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1457);\n $email_check = $ninja_forms_processing->get_field_value(1458);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('gspgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('gspgr_email_check_1457', 'Email addresses must match', 1457);\n $ninja_forms_processing->add_error('gspgr_email_check_1458', 'Email addresses must match', 1458);\n }\n }\n}", "function input_review_select($errors, $name, $label, $values, $required) {\n echo '<span class = \"star_rating\">';\n //create div belonging to the class 'required_field'\n echo '<div class=\"required_field\">';\n //create the label for the input\n echo \"<label for = \\\"$name\\\">$label</label>\";\n //get the value from previous post\n $value = posted_value($name);\n //Create select box\n echo \" <select name = \\\"$name\\\" onchange=\\\"hide_error_message('$name')\\\" $required>\";\n //input a starting option with the value of \"\"\n echo \"<option value = \\\"\\\"> Select an option below...</option>\";\n //Loop through the array of $values and create a new option for each\n foreach ($values as $value => $display) {\n //set the option value from previous post\n $selected = ($value==posted_value($name))?'selected=\"selected\"':'';\n //create new option with a value of $value and displaying text of $display\n echo \"<option $selected value=\\\"$value\\\">$display</option>\";\n }\n //close the select box\n echo '</select>';\n //create error message span\n error_label($errors, $name);\n //close the div\n echo '</div>';\n echo '</span>';\n}", "function engpgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 32) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1117);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('engpgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('engpgr_school_check_1117', 'Select a VCCS College/Agency', 1117);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(1115);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('engpgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('engpgr_job_check_1115', 'Select a Job Type', 1115);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1119);\n $email_check = $ninja_forms_processing->get_field_value(1120);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('engpgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('engpgr_email_check_1119', 'Email addresses must match', 1119);\n $ninja_forms_processing->add_error('engpgr_email_check_1120', 'Email addresses must match', 1120);\n }\n }\n}", "function nahpgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 28) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(950);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('nahpgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('nahpgr_school_check_950', 'Select a VCCS College/Agency', 950);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(948);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('nahpgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('nahpgr_job_check_948', 'Select a Job Type', 948);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(952);\n $email_check = $ninja_forms_processing->get_field_value(953);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('nahpgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('nahpgr_email_check_952', 'Email addresses must match', 952);\n $ninja_forms_processing->add_error('nahpgr_email_check_953', 'Email addresses must match', 953);\n }\n }\n}", "function depgcfp_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 212) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(3122);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('depgcfp_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('depgcfp_school_check_3122', 'Select a VCCS College/Agency', 3122);\n }\n /* Confirms Category is selected \n $dis_check = $ninja_forms_processing->get_field_value(3111);\n if ($dis_check == 1 ) {\n $ninja_forms_processing->add_error('depgr_dis_check', 'Please select a Category');\n $ninja_forms_processing->add_error('depgr_dis_check_3111', 'Select a Category', 3111);\n }*/\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(3123);\n $email_check = $ninja_forms_processing->get_field_value(3124);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('depgcfp_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('depgcfp_email_check_3123', 'Email addresses must match', 3123);\n $ninja_forms_processing->add_error('depgcfp_email_check_3124', 'Email addresses must match', 3124);\n }\n }\n}", "function validateGraduatingClass($id){\n global $isValidSSWelcome;\n if ($id != \"none\"){\n return;\n }\n else{\n echo \"<p>Please select a Graduating Class</p>\";\n $isValidSSWelcome = false;\n\n }\n}", "public function validateSelection($attribute, $params)\n\t{\n\t\tif ($this->type === \"email\")\n\t\t{\n\t\t\tif (empty($this->emailContent))\n\t\t\t\t$this->addError('emailContent', \"An email message must be specified for the email\");\n\t\t\tif (empty($this->emailSubject))\n\t\t\t\t$this->addError('emailSubject', \"A subject must be specified for the email\");\n\t\t}\n\t}", "public function getInputErrors();", "function form_check() {\n\tglobal $dbh, $cust_cpns_tbl;\n\t\n\t// required fields array\n\t$required_fields = array(\n\t\t\t\t\t\t\t'Code'=> $cust_cpns_tbl->code,\n\t\t\t\t\t\t\t'Value'=> $cust_cpns_tbl->value,\n\t\t\t\t\t\t\t'Expires'=> $cust_cpns_tbl->expires\n\t\t\t\t\t\t\t);\n\t\t\n\t// check error values and write error array\t\t\t\t\t\n\tforeach($required_fields as $field_name => $output) {\n\t if (empty($output)) {\n\t\t$errors_array[] = $field_name;\n\t }\n\t}\n\t\n\tif (!empty($errors_array)) {\n\t $error_message = 'You did not supply a value for these fields: ' . implode(', ',$errors_array);\n\t}\n\t\n\tif ($cust_cpns_tbl->existing_code_check() > 0) {\n\t $error_message .= '<center>Coupon code already assigned. Please enter another.</center>'.LB;\n\t}\n\t\n return $error_message;\n }", "function m_verifyInsert()\n\t{\n\t\t$this->errMsg=\"\";\n\n\t\tif(empty($this->request['subject']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg=MSG_SUBJECT_EMPTY.\"<br>\";\n\t\t}\n\t\t\n\t\tif(!empty($this->request['sid']))\n\t\t{\n\t\t\t#VALIDATING EXISTING OPTION TITLE\n\t\t\t$this->obDb->query = \"SELECT iMailid_PK FROM \".EMAILS.\" where vSid = '\".$this->request['sid'].\"'\";\n\t\t\t$row_code = $this->obDb->fetchQuery();\n\t\t\tif($this->obDb->record_count != 0)\n\t\t\t{\n\t\t\t\t$this->err=1;\n\t\t\t\t$this->errMsg.=MSG_SID_EXIST.\"<br>\";\n\t\t\t}\n\t\t}\n\t\treturn $this->err;\n\t}", "function validaSelect($selectDestino)\n{\n\tglobal $listadoSelects;\n\tif(isset($listadoSelects[$selectDestino])) return true;\n\telse return false;\n}", "function scipgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 26) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(867);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('scipgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('scipgr_school_check_867', 'Select a VCCS College/Agency', 867);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(865);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('scipgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('scipgr_job_check_865', 'Select a Job Type', 865);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(869);\n $email_check = $ninja_forms_processing->get_field_value(870);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('scipgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('scipgr_email_check_869', 'Email addresses must match', 869);\n $ninja_forms_processing->add_error('scipgr_email_check_870', 'Email addresses must match', 870);\n }\n }\n}", "public abstract function validation();", "function pgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 23) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(756);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('pgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('pgr_school_check_756', 'Select a VCCS College/Agency', 756);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(758);\n $email_check = $ninja_forms_processing->get_field_value(759);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('pgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('pgr_email_check_758', 'Email addresses must match', 758);\n $ninja_forms_processing->add_error('pgr_email_check_759', 'Email addresses must match', 759);\n }\n }\n}", "function validaSelect($selectDestino)\r\n{\r\n\tglobal $listadoSelects;\r\n\tif(isset($listadoSelects[$selectDestino])) return true;\r\n\telse return false;\r\n}", "function check_selectbox($value)\n\t{\n\t if($value == '' || $value == 'select' || $value == 'default' || $value == '0') { // do your validations\n\t\t return FALSE;\n\t } else {\n\t\t return TRUE;\n\t }\n\t}", "public function validate()\n {\n if ($this->ingredient() || $this->upc()) {\n return;\n }\n\n throw new \\Exception('You must enter either an ingredient or UPC code to search for');\n }", "function theme_options_validate( $input ) {\n\tglobal $select_options, $radio_options;\n\n\t// [header]\n\t$input['gacode'] = wp_filter_nohtml_kses( $input['gacode'] );\n\n\t// [footer] Year(s) and sitename in the copyright\n\t$input['copyrightyear'] = wp_filter_nohtml_kses( $input['copyrightyear'] );\n\t$input['copyrightname'] = wp_filter_nohtml_kses( $input['copyrightname'] );\n\n\t// Our checkbox value is either 0 or 1\n\tif ( ! isset( $input['option1'] ) )\n\t\t$input['option1'] = null;\n\t$input['option1'] = ( $input['option1'] == 1 ? 1 : 0 );\n\n\t// Say our text option must be safe text with no HTML tags\n\t$input['sometext'] = wp_filter_nohtml_kses( $input['sometext'] );\n\n\t// Our select option must actually be in our array of select options\n\tif ( ! array_key_exists( $input['selectinput'], $select_options ) )\n\t\t$input['selectinput'] = null;\n\n\t// Our radio option must actually be in our array of radio options\n\tif ( ! isset( $input['radioinput'] ) )\n\t\t$input['radioinput'] = null;\n\tif ( ! array_key_exists( $input['radioinput'], $radio_options ) )\n\t\t$input['radioinput'] = null;\n\n\t// Say our textarea option must be safe text with the allowed tags for posts\n\t$input['sometextarea'] = wp_filter_post_kses( $input['sometextarea'] );\n\n\treturn $input;\n}", "private function input(){\n if($this->option('s')){\n $this->params['exceptions'] = '';\n return false;\n }\n $this->info('Set table names, that be excluded from CRUD generation');\n $this->params['exceptions'] = $this->ask('Excluded table names');\n }", "public function validation();", "function validGreet($selectedGreeting) {\r\n $validGreetings = array(\"new\", \"hiring\", \"meetup\", \"other\");\r\n\r\n //check each greeting and return false if not valid\r\n if(!in_array($selectedGreeting, $validGreetings)) {\r\n return false;\r\n }\r\n\r\n //ALL toppings valid\r\n return true;\r\n}", "private function addValidation($inData){\r\n // the size indicator -> if the size radio is not selected -> refuse\r\n $sizeIndicator = false;\r\n // if the quantity are all 0 -> refuse\r\n $quantityIndicator = false;\r\n // indicates the food's category for further price query\r\n $data['category'] = $inData['category'];\r\n // item array prepared in the return array $data for setting items\r\n $data['item'] = array();\r\n // first loop for striping useless $_GET entries and valid whether\r\n // Necessary fileds are being selected by user\r\n foreach($inData as $key => $value){\r\n // for finding size $key , and find which index it is \r\n if(preg_match('/s(\\d)(.*)/',$value,$match) ){\r\n $sizeIndicator = true;\r\n $data['item'][$match[1]]['size'] = $match[2];\r\n }\r\n // same as size $key, it fins out which index the item is\r\n if(preg_match('/q(\\d)/',$key,$match) && $value != 0){\r\n $quantityIndicator = true;\r\n $data['item'][$match[1]]['quantity'] = $value;\r\n }\r\n }\r\n // if the size or the quantity is not filled in by user, refuse him\r\n if(!($sizeIndicator && $quantityIndicator))\r\n return array('error' => 'You have to select at least 1) Size 2) Quantity for the SAME food~');\r\n // the indicator for seeing whether same food's both size and quantity\r\n // are correctly input by user\r\n $matchIndicator = true;\r\n // second foreach runs a size check on the data['item']'s each elements\r\n // it will refuse the user if the element is not sized two\r\n $outData = array();\r\n foreach($data['item'] as $key => $item){\r\n if((count($item))!= 1){\r\n $matchIndicator = false;\r\n }\r\n $name = $this -> model -> getName($data['category'])[$key - 1]; \r\n $size = $item['size'];\r\n $quantity = $item['quantity'];\r\n $price_for_one = $this -> model -> getPrice($data['category'],$name)[$size]; \r\n array_push($outData,compact('name','size','quantity','price_for_one'));\r\n }\r\n // if wrong filed is inserted by user, refuse him\r\n if($matchIndicator)\r\n return array('error' => 'You sure sure you input the correct thing?');\r\n // outdata that will be finally returned.\r\n // totally 4 fields are going to be included for each row\r\n // 1) name 2) size 3) quantity 4) price for one\r\n //return the data that should be passed to the controller method\r\n //that actually renders the views\r\n return $outData;\r\n }", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "public function colour_check(){\n\t\t\t$colour = $this->input->post('vehicle_colour');\n\t\t\tif ($colour == '' || $colour == '0'){\n\t\t\t\t$this->form_validation->set_message('colour_check', 'Please select a colour');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}", "function validForm()\n{\n global $f3;\n $isValid = true;\n\n if (!validFood($f3->get('food'))) {\n\n $isValid = false;\n $f3->set(\"errors['food']\", \"Please enter a food item\");\n }\n\n if (!validQty($f3->get('qty'))) {\n\n $isValid = false;\n $f3->set(\"errors['qty']\", \"Please enter 1 or more\");\n }\n\n if (!validMeal($f3->get('meal'))) {\n\n $isValid = false;\n $f3->set(\"errors['meal']\", \"Please select a meal\");\n }\n\n if (!validCondiments($f3->get('cond'))) {\n\n $isValid = false;\n $f3->set(\"errors['cond']\", \"Invalid selection\");\n }\n\n return $isValid;\n}", "public function Validate() {\n\t\t$blnToReturn = true;\n\t\tif (($this->txtUsername) && ($objLogin = Login::LoadByUsername($this->txtUsername->Text)) && ($objLogin->Id != $this->mctLogin->Login->Id )){\n\t\t\t\t$blnToReturn = false;\n\t\t\t\t$this->txtUsername->Warning = QApplication::Translate(\"This value is already in use.\");\n\t\t\t}\n\t\tif (($this->lstPerson) && ($objLogin = Login::LoadByPersonId($this->lstPerson->SelectedValue)) && ($objLogin->Id != $this->mctLogin->Login->Id )){\n\t\t\t\t$blnToReturn = false;\n\t\t\t\t$this->lstPerson->Warning = QApplication::Translate(\"This value is already in use.\");\n\t\t\t}\n\t\treturn $blnToReturn;\n\t}", "function engpgcfp_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 33) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1143);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('engpgcfp_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('engpgcfp_school_check_1143', 'Select a VCCS College/Agency', 1143);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1144);\n $email_check = $ninja_forms_processing->get_field_value(1145);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('engpgcfp_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('engpgcfp_email_check_1144', 'Email addresses must match', 1144);\n $ninja_forms_processing->add_error('engpgcfp_email_check_1145', 'Email addresses must match', 1145);\n }\n }\n}", "function istpgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 24) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(780);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('istpgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('istpgr_school_check_780', 'Select a VCCS College/Agency', 780);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(853);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('istpgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('istpgr_job_check_853', 'Select a Job Type', 853);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(782);\n $email_check = $ninja_forms_processing->get_field_value(783);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('istpgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('istpgr_email_check_782', 'Email addresses must match', 782);\n $ninja_forms_processing->add_error('istpgr_email_check_783', 'Email addresses must match', 783);\n }\n }\n}", "function radioError($radioBox)\n{\n\tif(!isset($_REQUEST[$radioBox]))\n\t\techo \"<p style=\\\"color:red;\\\">Please select a picture.</p>\\n\";\n}", "abstract public function runValidation();", "public function validate_customer_input_fields()\n {\n $passed_validation_tests = true;\n $check_name = has_presence($this->name);\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n if (!$check_name) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Customer name cannot be blank.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_telephone = has_presence($this->telephone);\n $check_telephone_numeric = has_number($this->telephone);\n $check_telephone_length = has_length($this->telephone, ['exact' => 10]);\n if (!$check_telephone or !$check_telephone_numeric or !$check_telephone_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Telephone: \";\n $msg .= h($this->telephone);\n $msg .= \" cannot be blank and must consists of 10 digits.\";\n $msg .= \"</li>\";\n }\n\n $check_barcode = has_presence($this->barcode);\n $check_barcode_numeric = has_number($this->barcode);\n $check_barcode_length = has_length($this->barcode, ['exact' => 6]);\n if (!$check_barcode or !$check_barcode_numeric or !$check_barcode_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Barcode: \";\n $msg .= h($this->barcode);\n $msg .= \" cannot be blank and must consists of 6 digits.\";\n $msg .= \"</li>\";\n }\n\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "function validar(){\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n\n if (empty($_POST[\"noEmpleado\"])) {\n $this->numEmpErr = \"El numero de empleado es requerido\";\n } else {\n $this->noEmpleado = $this->test_input($_POST[\"noEmpleado\"]);\n if (is_numeric($this->noEmpleado)) {\n $this->numEmpErr = \"Solo se permiten numeros\";\n }\n }\n\n if (empty($_POST[\"nombre\"])) {\n $this->nameErr = \"El nombre es requerido\";\n } else {\n $this->nombre = $this->test_input($_POST[\"nombre\"]);\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->nombre)) {\n $this->nameErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"carrera\"])) {\n $this->carreraErr = \"La carrera es requerida\";\n } else {\n $this->carrera = $this->test_input($_POST[\"carrera\"]);\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->carrera)) {\n $this->carreraErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"telefono\"])) {\n $this->telErr = \"El telefono es requerido\";\n } else {\n $this->telefono = $this->test_input($_POST[\"telefono\"]);\n if (is_numeric($this->telefono)) {\n $this->telErr = \"Solo se permiten numeros\";\n }\n }\n\n }\n }", "function socpgr_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 41) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1538);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('socpgr_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('socpgr_school_check_1538', 'Select a VCCS College/Agency', 1538);\n }\n /* Confirms Job Type is selected */\n $job_check = $ninja_forms_processing->get_field_value(1536);\n if ($job_check == 1) {\n $ninja_forms_processing->add_error('socpgr_job_check', 'Please select a Job Type');\n $ninja_forms_processing->add_error('socpgr_job_check_1536', 'Select a Job Type', 1536);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1540);\n $email_check = $ninja_forms_processing->get_field_value(1541);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('socpgr_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('socpgr_email_check_1540', 'Email addresses must match', 1540);\n $ninja_forms_processing->add_error('socpgr_email_check_1541', 'Email addresses must match', 1541);\n }\n }\n}", "function cvpapgcfp_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 190) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(2906);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('cvpapgcfp_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('cvpapgcfp_school_check_2906', 'Select a VCCS College/Agency', 2906);\n }\n /* Confirms Discipline is selected */\n $dis_check = $ninja_forms_processing->get_field_value(2896);\n if ($dis_check == 1 ) {\n $ninja_forms_processing->add_error('cvpapgr_dis_check', 'Please select a Discipline');\n $ninja_forms_processing->add_error('cvpapgr_dis_check_2896', 'Select a Discipline', 2896);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(2907);\n $email_check = $ninja_forms_processing->get_field_value(2908);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('cvpapgcfp_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('cvpapgcfp_email_check_2907', 'Email addresses must match', 2907);\n $ninja_forms_processing->add_error('cvpapgcfp_email_check_2908', 'Email addresses must match', 2908);\n }\n }\n}", "public function trader_check(){\n\t\t\t$str = $this->input->post('trader_email');\n\t\t\tif ($str == '' || $str == '0'){\n\t\t\t\t$this->form_validation->set_message('trader_check', 'Please select a trader');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}", "function eie_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 43) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1621);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('eie_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('eie_school_check_1621', 'Select a VCCS College/Agency', 1621);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1617);\n $email_check = $ninja_forms_processing->get_field_value(1618);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('eie_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('eie_email_check_1377', 'Email addresses must match', 1617);\n $ninja_forms_processing->add_error('eie_email_check_1378', 'Email addresses must match', 1618);\n }\n }\n}", "function abepgcfp_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 47) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1760);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('abepgcfp_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('abepgcfp_school_check_1760', 'Select a VCCS College/Agency', 1760);\n }\n /* Confirms Discipline is selected */\n $dis_check = $ninja_forms_processing->get_field_value(1807);\n if ($dis_check == 1 ) {\n $ninja_forms_processing->add_error('abepgr_dis_check', 'Please select a Discipline');\n $ninja_forms_processing->add_error('abepgr_dis_check_1807', 'Select a Discipline', 1807);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1761);\n $email_check = $ninja_forms_processing->get_field_value(1762);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('abepgcfp_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('abepgcfp_email_check_1565', 'Email addresses must match', 1761);\n $ninja_forms_processing->add_error('abepgcfp_email_check_1566', 'Email addresses must match', 1762);\n }\n }\n}", "function showOptions($option){\n $cover = \"\\nWhat do you want to do? Press the number matching your choice.\\n\";\n $options = \" 1 - Buy flight.\\n 2 - Book hotel.\\n 3 - Buy package.\\n\";\n $options1 = \"\\n**BUY FLIGHT**\\nEnter the flight ID to buy. Or press 0 to go back.\\n\";\n $options2 = \"\\n**BOOK HOTEL**\\nEnter the accomodation ID to buy. Or press 0 to go back.\\n\";\n $options3 = \"\\n**BUY PACKAGE**\\nEnter the flight ID and the accomodation ID you want buy. Or press 0 to go back.\\n\";\n\n if($option == 0){\n echo($cover);\n echo($options);\n }\n else if($option == 1)\n echo($options1);\n\n else if($option == 2)\n echo($options2);\n\n else if($option == 3)\n echo($options3);\n\n else\n echo (\"error in function showOptions\"); //test\n}", "function csla_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 13) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(365);\n if ($school_check == 1) {\n $ninja_forms_processing->add_error('csla_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('csla_school_check_365', 'Select a VCCS College/Agency', 365);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(248);\n $email_check = $ninja_forms_processing->get_field_value(370);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('csla_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('csla_email_check_248', 'Email addresses must match', 248);\n $ninja_forms_processing->add_error('csla_email_check_370', 'Email addresses must match', 370);\n }\n }\n}", "public function year_check(){\n\t\t\t$str = $this->input->post('year_of_manufacture');\n\t\t\tif ($str == '' || $str == '0'){\n\t\t\t\t$this->form_validation->set_message('year_check', 'Please select a year');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}", "abstract public function validate();", "abstract public function validate();", "function validaSelect($selectDestino) {\n global $listadoSelects;\n if (isset($listadoSelects[$selectDestino]))\n return true;\n else\n return false;\n}", "function nahpgcfp_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 29) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(976);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('nahpgcfp_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('nahpgcfp_school_check_893', 'Select a VCCS College/Agency', 976);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(977);\n $email_check = $ninja_forms_processing->get_field_value(978);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('nahpgcfp_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('nahpgcfp_email_check_977', 'Email addresses must match', 977);\n $ninja_forms_processing->add_error('nahpgcfp_email_check_978', 'Email addresses must match', 978);\n }\n }\n}", "function pgcfp_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 22) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(697);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('pgcfp_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('pgcfp_school_check_697', 'Select a VCCS College/Agency', 697);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(698);\n $email_check = $ninja_forms_processing->get_field_value(699);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('pgcfp_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('pgcfp_email_check_698', 'Email addresses must match', 698);\n $ninja_forms_processing->add_error('pgcfp_email_check_699', 'Email addresses must match', 699);\n }\n }\n}", "function gspgcfp_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 40) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1481);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('gspgcfp_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('gspgcfp_school_check_1481', 'Select a VCCS College/Agency', 1481);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1482);\n $email_check = $ninja_forms_processing->get_field_value(1483);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('gspgcfp_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('gspgcfp_email_check_1482', 'Email addresses must match', 1482);\n $ninja_forms_processing->add_error('gspgcfp_email_check_1483', 'Email addresses must match', 1483);\n }\n }\n}", "public function validate($data)\n {\n // Check that that a selection has been made\n if ($data != '') {\n // Query the database to see if selected member exists\n $q = ee()->db->get_where('exp_members', array('member_id' => $data), 1);\n\n if ($q->num_rows() === 1) {\n return true;\n } else {\n return \"The Member you have selected does not exist\";\n }\n }\n }", "function selectEntry($display,$name,$options,$errors,$selected=0)\n{\n\t$returnVal = \"<tr>\n\t\t<td>$display:</td>\n\t\t<td>\n\t\t\t<select name='$name'>\n\t\t\t<option value='0'>Choose one...</option>\";\n\t\t\tforeach ($options as $key=>$option)\n\t\t\t{\n\t\t\t\tif ($key == $selected)\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$key' selected>\n\t\t\t\t\t\t\t\t$option</option>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$key'>\n\t\t\t\t\t\t\t\t$option</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$returnVal .= \"</select>\n\t\t</td>\n\t\t</tr>\";\n\n\t\tif (array_key_exists($name,$errors))\n\t\t{\n\t\t\t$returnVal .= addErrorRow($name,$errors);\n\t\t}\n\treturn $returnVal;\n}", "function validation($data){\n\tif (empty($data['name']))\n\t\treturn \"Please enter your name\";\n\tif (empty($data['tel']))\n\t\treturn \"Please enter valid contact number\";\n\treturn 0;\n}", "function validate()\n\t{\n\t}", "abstract public function valid();", "function scipgcfp_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 27) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(893);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('scipgcfp_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('scipgcfp_school_check_893', 'Select a VCCS College/Agency', 893);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(894);\n $email_check = $ninja_forms_processing->get_field_value(895);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('scipgcfp_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('scipgcfp_email_check_894', 'Email addresses must match', 894);\n $ninja_forms_processing->add_error('scipgcfp_email_check_895', 'Email addresses must match', 895);\n }\n }\n}", "function validate_new_major($input){\n $errors = [];\n\n if(!isset($input['major_name']) || empty($input['major_name'])){\n $errors['major_name'] = \"Major Name is Required\";\n }else if(!ctype_alpha(str_replace(' ', '', $input[\"major_name\"]))){\n $errors[\"major_name\"] = \"Major Name can only contain characters\";\n }else if(strlen($input['major_name']) > 50){\n $errors['major_name'] = \"Max 50 characters for Major Name\";\n } else{\n $majors = get_majors_by_major_name($input['major_name']);\n if(!empty($majors)){\n $errors['major_name'] = \"Major name is taken\";\n }\n }\n\n if(!isset($input['short_name']) || empty($input['short_name'])){\n $errors['short_name'] = \"Short Name Required\";\n }else if(!ctype_alpha($input['short_name'])){\n $errors[\"short_name\"] = \"Short Name can only contain characters\";\n }else if(strlen($input['short_name']) > 4){\n $errors[\"short_name\"] = \"Max 4 characters for Abbreviation\";\n } else{\n $majors = get_majors_by_short_name($input['short_name']);\n if(!empty($majors)){\n $errors['short_name'] = \"Abbreviation is taken\";\n }\n }\n\n return $errors;\n}", "public function Valid();", "function fala_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 19) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(518);\n if ($school_check == 1) {\n $ninja_forms_processing->add_error('csla_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('csla_school_check_518', 'Select a VCCS College/Agency', 518);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(519);\n $email_check = $ninja_forms_processing->get_field_value(520);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('csla_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('csla_email_check_519', 'Email addresses must match', 519);\n $ninja_forms_processing->add_error('csla_email_check_520', 'Email addresses must match', 520);\n }\n }\n}", "public function validate_select_items($name, $data) {\n\t\tif (!$this->check_select_items($name, $data)) throw new Exception('Please stop hack us, evil haxor.');\n\t}", "function nhh_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 48) {\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1851);\n if ($school_check == 1 ) {\n $ninja_forms_processing->add_error('nhh_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('nhh_school_check_1851', 'Select a VCCS College/Agency', 1851);\n\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1852);\n $email_check = $ninja_forms_processing->get_field_value(1853);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('nhh_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('nhh_email_check_1852', 'Email addresses must match', 1852);\n $ninja_forms_processing->add_error('nhh_email_check_1853', 'Email addresses must match', 1853);\n }\n }\n}\n}", "public function vehicle_make_check(){\n\t\t\t$str = $this->input->post('vehicle_make');\n\t\t\tif ($str == '' || $str == '0'){\n\t\t\t\t$this->form_validation->set_message('vehicle_make_check', 'Please select a vehicle make');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "function nhcfpt_functions() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 35) {\n /* Confirms session type is selected */\n $session_check = $ninja_forms_processing->get_field_value(1273);\n if ($session_check == 1) {\n $ninja_forms_processing->add_error('nhcfpt_session_check', 'Please select a session type');\n $ninja_forms_processing->add_error('nhcfpt_session_check_1196', 'Select a session type', 1273);\n }\n /* Confirms VCCS College/Agency is selected */\n $school_check = $ninja_forms_processing->get_field_value(1280);\n if ($school_check == 1) {\n $ninja_forms_processing->add_error('nhcfpt_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('nhcfpt_school_check_1280', 'Select a VCCS College/Agency', 1280);\n }\n /* Confirms email addresses entered match */\n $email_main = $ninja_forms_processing->get_field_value(1281);\n $email_check = $ninja_forms_processing->get_field_value(1282);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('nhcfpt_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('nhcfpt_email_check_1281', 'Email addresses must match', 1281);\n $ninja_forms_processing->add_error('nhcfpt_email_check_1282', 'Email addresses must match', 1282);\n }\n /* Confirms intended audience level selected */\n $select_audience = $ninja_forms_processing->get_field_value(1314);\n if ($select_audience == 1) {\n $ninja_forms_processing->add_error('nhcfpt_audience_check', 'Please select an intended audience level');\n $ninja_forms_processing->add_error('nhcfpt_audience_check_1314', 'Select an intended audience level', 1314);\n }\n /* Confirms that selected Categories are not the same */\n $first_choice = $ninja_forms_processing->get_field_value(1354);\n $second_choice = $ninja_forms_processing->get_field_value(1356);\n $third_choice = $ninja_forms_processing->get_field_value(1357);\n if ($first_choice == 1 or $second_choice == 1 or $third_choice == 1) {\n $ninja_forms_processing->add_error('nhcfpt_category_select', 'Please select all three category choices');\n $ninja_forms_processing->add_error('nhcfpt_category_select_1357', 'Please select all three category choices', 1357);\n }\n if ($first_choice == $second_choice or $first_choice == $third_choice or $second_choice == $third_choice) {\n $ninja_forms_processing->add_error('nhcfpt_category_check', 'Please make sure your category choices are different');\n $ninja_forms_processing->add_error('nhcfpt_category_check_1357', 'Select different category choices', 1357);\n }\n }\n}", "function ting_visual_relation_slide_form_validate($form, &$form_state) {\n if (empty($form_state['values']['name'])) {\n form_set_error('name', t('Please enter a name for the slide'));\n }\n $type = $form_state['values']['type'];\n switch ($type) {\n case 'external':\n case 'circular':\n $datawell_pid = $form_state['values']['datawell_pid'];\n // TODO: use a regex to validate the datawell-PID.\n if (empty($datawell_pid)) {\n form_set_error('datawell_pid', t('Please enter a valid datawell-PID'));\n }\n break;\n case 'structural':\n if (empty($form_state['values']['search_query'])) {\n form_set_error('search_query', t('Please enter a search query'));\n }\n }\n}", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "public function _check_request_info() {\n\t\t$msg = '';\n\t\tif ($this->generate_invoice_request) {\n\t\t\tif (($this->generate_request_amount < 1) || ($this->generate_request_amount > 100)) {\n\t\t\t\t$msg .= \"Invoice request amount must be between 1 and 100.<br />\";\n\t\t\t}\n\t\t\tif (!$this->generate_request_recipients) {\n\t\t\t\t$msg .= \"You must select a user as a recipient for the invoice request.<br />\";\n\t\t\t}\n\t\t}\n\t\treturn $msg;\n\t}", "public function isValidSelection(int $selection): bool\n {\n return !($selection < 1 || $selection > \\count($this->getOptionsArr()));\n }", "protected function award_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('role_id', translate('role'), 'trim|required');\n $this->form_validation->set_rules('user_id', translate('winner'), 'trim|required');\n $this->form_validation->set_rules('award_name', translate('award_name'), 'trim|required');\n $this->form_validation->set_rules('gift_item', translate('gift_item'), 'trim|required');\n $this->form_validation->set_rules('award_reason', translate('award_reason'), 'trim|required');\n $this->form_validation->set_rules('given_date', translate('given_date'), 'trim|required');\n $roleID = $this->input->post('role_id');\n if ($roleID == 7) {\n $this->form_validation->set_rules('class_id', translate('class'), 'trim|required');\n }\n }", "function options_validate( $input ) {\n\t\t\t\t$active_tab_background = trim( $input['active_tab_background'] );\n\t\t\t\tif( empty( $active_tab_background ) ) {\n\t\t\t\t\t\tadd_settings_error( \"spat_active_tab_background\", '', __( \"Active Tab Background is required.\" ) );\n\t\t\t\t}\n\t\t\t\t$newinput['active_tab_background'] = $active_tab_background;\n\n\t\t\t\t$active_tab_foreground = trim( $input['active_tab_foreground'] );\n\t\t\t\tif( empty( $active_tab_foreground ) ) {\n\t\t\t\t\t\tadd_settings_error( \"spat_active_tab_foreground\", '', __( \"Active Tab Text is required.\" ) );\n\t\t\t\t}\n\t\t\t\t$newinput['active_tab_foreground'] = $active_tab_foreground;\n\n\t\t\t\t$inactive_tab_background = trim( $input['inactive_tab_background'] );\n\t\t\t\tif( empty( $inactive_tab_background ) ) {\n\t\t\t\t\t\tadd_settings_error( \"spat_inactive_tab_background\", '', __( \"Inactive Tab Background is required.\" ) );\n\t\t\t\t}\n\t\t\t\t$newinput['inactive_tab_background'] = $inactive_tab_background;\n\n\t\t\t\t$inactive_tab_foreground = trim( $input['inactive_tab_foreground'] );\n\t\t\t\tif( empty( $inactive_tab_foreground ) ) {\n\t\t\t\t\t\tadd_settings_error( \"spat_inactive_tab_foreground\", '', __( \"Inactive Tab Text is required.\" ) );\n\t\t\t\t}\n\t\t\t\t$newinput['inactive_tab_foreground'] = $inactive_tab_foreground;\n\n\t\t\t\t$border = trim( $input['border'] );\n\t\t\t\tif( empty( $border ) ) {\n\t\t\t\t\t\tadd_settings_error( \"spat_border\", '', __( \"Border is required.\" ) );\n\t\t\t\t}\n\t\t\t\t$newinput['border'] = $border;\n\n\t\t\t\treturn $newinput;\n\t\t}" ]
[ "0.6820797", "0.63468087", "0.62189853", "0.62019414", "0.6181274", "0.61739534", "0.61655366", "0.6112793", "0.601353", "0.60124606", "0.5978902", "0.5915387", "0.58788663", "0.5859464", "0.5842365", "0.5818096", "0.5795618", "0.57918936", "0.57836443", "0.5780141", "0.57263035", "0.5719743", "0.5717808", "0.5711774", "0.57055956", "0.56839496", "0.5682848", "0.5677166", "0.5662077", "0.56582814", "0.56450385", "0.5644174", "0.5617164", "0.56032443", "0.5589988", "0.5581473", "0.55705154", "0.55574113", "0.5552169", "0.55413204", "0.553279", "0.5530434", "0.5527036", "0.5524838", "0.552397", "0.5523797", "0.55195004", "0.55058753", "0.55051273", "0.5495025", "0.54769504", "0.54678214", "0.5447912", "0.5447633", "0.54424506", "0.5437367", "0.543542", "0.54353803", "0.54250836", "0.5420969", "0.54016614", "0.54002655", "0.5389908", "0.5381181", "0.53785574", "0.53734326", "0.53658783", "0.535171", "0.5340144", "0.53308785", "0.5329463", "0.5322785", "0.5319292", "0.53170043", "0.53140366", "0.5308926", "0.5308926", "0.5305518", "0.528775", "0.52805835", "0.52753437", "0.52742994", "0.52667874", "0.52575386", "0.5257076", "0.5253629", "0.524705", "0.5245914", "0.5244128", "0.52427924", "0.524242", "0.523448", "0.5231577", "0.52279025", "0.5216846", "0.5216489", "0.521308", "0.52119726", "0.520867", "0.52051604", "0.5192261" ]
0.0
-1
Function verify that the choosen column is not full in case of a full column user message print to user
public function validateIsFullColumn($selectedColumn){ //in case of a full Column if($this->board->gameBoard[0][$selectedColumn-1] != Board::CELL){ columnIsFullMsg($this->currentPlayer); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function takesTwoColumns() {\n return false;\n }", "private function validate_columns(){\n\n for($i=0;$i<9;$i++){\n $col = array_column($this->sudoku_array, $i);\n\n if(count($col) !=9 || count(array_unique($col)) !=9){\n return false;\n }\n }\n return true;\n }", "public function validateIsFullBoard(){\r\n //in case of a full Column\r\n for($index=0; $index < Board::COLUMNS; $index++){\r\n //if there is an empty cell\r\n if($this->board->gameBoard[0][$index] == Board::CELL){\r\n //board is not full\r\n return false;\r\n }\r\n }///board is full\r\n return true;\r\n }", "public function CheckExitColumn($table,$col){\n if(trim($col) == '') return array();\n $db_column= new db_query(\"SHOW COLUMNS FROM \" . $table . \" LIKE '\" . trim($col) . \"'\");\n //$result = mysqli_query();\n $exists = mysqli_fetch_assoc($db_column->result);\n unset($db_column);\n if(!empty($exists)){\n return $exists;\n }\n return array();\n }", "public function validate_column($column)\n {\n }", "private function hasNoColumns() {\n if (count($this->columns) === 0) return true;\n\n\n if (count($this->columns) === 1 && isset($this->columns['*'])) {\n return true;\n }\n\n return false;\n }", "public function checkThatColumnsWorkToo(): void\n {\n $name = 'fluent-field';\n $label = 'Fun stuff:';\n Column::make($name)->testAttribute($label);\n\n $columns = $this->crudPanel->column($name);\n $this->assertCount(1, $columns);\n $this->assertArrayHasKey($name, $columns);\n $columnToTest = $columns[$name];\n $this->assertEquals('text', $columnToTest['type']);\n $this->assertEquals($label, $columnToTest['testAttribute']);\n }", "public function testIsColumnAvailable()\n {\n /* ----------------------------------------------------\n * in below $csvData var we have faked the header data\n * -----------------------------------------------------*/\n $csvData = [['first_name','last_name','address']]; \n \n $column = 'first_name';\n\n /*\n |--------------------------------------------------------------------------\n | Success Scenario\n |--------------------------------------------------------------------------\n |\n | Let's test the success scenario\n |\n */\n\n $resp = $this->isColumnAvailable($column, $csvData);\n\n /* ------------------------------------------------------------------------------\n * we compare the response of isColumnAvailable in case when column is available\n * -------------------------------------------------------------------------------*/\n $this->assertEqualsCanonicalizing($resp,[\"key\"=>0,\"name\"=>\"first_name\"]);\n \n\n /*\n |--------------------------------------------------------------------------\n | Failure Scenario\n |--------------------------------------------------------------------------\n |\n | Let's test the failure scenario\n |\n */\n\n $resp = $this->isColumnAvailable('unknown_column', $csvData);\n\n /* ----------------------------------------------------------------------------------\n * we compare the response of isColumnAvailable method in case when column not found\n * -----------------------------------------------------------------------------------*/\n $this->assertFalse($resp);\n \n }", "function isColumnValid(array $grid, int $x, bool $verbose = false): bool;", "private function show_columns() {\n\t\tglobal $wpdb, $utils;\n\t\t$domain = $utils->text_domain;\n\t\t$tables = $wpdb->tables('all');\n\t\tif (!isset($_POST['table'])) {\n\t\t\t$message = __('Table name is not selected.', $domain);\n\t\t\treturn $message;\n\t\t} elseif (!in_array($_POST['table'], $tables)) {\n\t\t\t$message = __('There\\'s no such table.', $domain);\n\t\t\treturn $message;\n\t\t}\telse {\n\t\t\t$table_name = $_POST['table'];\n\t\t\t$results = $wpdb->get_results(\"SHOW COLUMNS FROM $table_name\");\n\t\t\treturn $results;\n\t\t}\n\t}", "protected function columnMatchCheck ( $lineColumns ) {\n }", "public function getValidColumns(array $columns);", "function validateColums($POST) {\n if (isset( $POST['sName'] ) )\n return true;\n\n if ( (!isset($POST['label'])) &&\n (!isset($POST['asset_no'])) &&\n (!isset($POST['has_problems'])) &&\n (!isset($POST['comment'])) &&\n (!isset($POST['runs8021Q'])) &&\n (!isset($POST['location'])) &&\n (!isset($POST['MACs'])) &&\n (!isset($POST['label'])) &&\n (!isset($POST['attributeIDs'])) ) {\n return true;\n }\n\n}", "protected function columnType()\n {\n $table = $this->ask('Enter the name of desired table');\n $this->checkInput($table);\n $column = $this->ask('Enter the desired column');\n $this->checkInput($column);\n $this->service->columnType($table, $column);\n }", "public function checkEnableColumnEdit()\n\t{\n\t\treturn false;\n\t}", "function verify_column( $column, $table, $db = null ) {\n\n\t\t$columns = $this->get_columns( $table, $db );\n\t\treturn in_array( $column, $columns );\n\n\t}", "private function check_column($column, $column_value)\n {\n $column_errors = [];\n\n check_empty($column_value, $column->title, $column_errors);\n\n if( empty( $column_errors ) )\n {\n $rules = $this->rules[$column->rules];\n if (isset($rules['regex']) && !preg_match($rules['regex'], $column_value)) {\n array_push($column_errors, $column->title . '格式錯誤');\n }\n if (isset($rules['validator'])) {\n $validator = \\Validator::make([$column->id => $column_value], [$column->id => $rules['validator']]);\n $validator->fails() && array_push($column_errors, $column->title . '格式錯誤');\n }\n if (isset($rules['function'])) {\n call_user_func_array($this->checker($rules['function']), array($column_value, $column, &$column_errors));\n }\n\n if (!$column->unique && isset($rules['menu'])) {\n if (!in_array($column_value, $column->answers->lists('value'), true)) {\n array_push($column_errors, $column->title . '未在選單中');\n }\n }\n }\n\n return $column_errors;\n }", "function other_cols($colname, $value) {\n // For security reasons we don't want to show the password hash.\n }", "private function isValidRowColumn(): bool {\n foreach ($this->board as $row => $cols) {\n $curRow = [];\n $curCol = [];\n foreach ($cols as $col => $cellValue) {\n // check if repeated in row\n if(in_array($this->board[$row][$col], $curRow)){\n return false;\n }\n array_push($curRow, $this->board[$row][$col]);\n\n // check if repeated in column \n if(in_array($this->board[$col][$row], $curCol)){\n return false;\n }\n array_push($curCol, $this->board[$col][$row]);\n }\n }\n return true;\n }", "function ae_check_db_fields( ) {\n\n $count = 0;\n $cols = ae_get_db_fields();\n $foo = ae_db_queries();\n if( $cols ){\n foreach($cols as $col) {\n\n if( isset($foo[$col->COLUMN_NAME]) ) {\n\n if(\n $col->DATA_TYPE != $foo[$col->COLUMN_NAME]['type'] ||\n $col->CHARACTER_MAXIMUM_LENGTH < $foo[$col->COLUMN_NAME]['numb']\n ) {\n $count++;\n }\n }\n }\n }\n\n return $count;\n}", "public function hasColumns(){\n return $this->_has(3);\n }", "function mf_mysql_column_exist($table_name, $column_name,$dbh) {\r\n\r\n\t\t$query = \"SHOW COLUMNS FROM $table_name LIKE '$column_name'\";\r\n\t\t$sth = mf_do_query($query,array(),$dbh);\r\n\t\t$row = mf_do_fetch_result($sth);\r\n\t\t\r\n\t\tif(!empty($row)){\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}", "function Pico_CheckTable($table_name, $column, $definition)\n{\n\tglobal $db;\n\t\n\t$fields = $db->assoc('SHOW COLUMNS FROM `'.$table_name.'`');\n\t$all_fields = array();\n\tforeach ($fields as $f)\n\t{\n\t\t$all_fields[] = $f['Field'];\n\t}\n\t\n\tif (!in_array($column, $all_fields))\n\t{\n\t\t$db->run('ALTER TABLE `'.$table_name.'` ADD COLUMN `'.$column.'` ' . $definition);\n\t}\n}", "public function checkcol($tbl, $col) \n {\n $this->connect();\n \n //connect to database\n if (!empty($tbl)) \n {\n try\n {\n $sql = \"SELECT count(*) \n FROM information_schema.COLUMNS \n WHERE \n TABLE_SCHEMA = '\" . DN . \"' \n AND TABLE_NAME = '\" . $tbl . \"' \n AND COLUMN_NAME = '\" . $col . \"'\";\n \n return $this->GetOne($sql);\n }\n catch(PDOException $e) \n {\n return $e->getMessage();\n }\n } else\n {\n return 'No query provided';\n die;\n }\n $this->disconnect();\n \n //disconnect from database\n \n \n }", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "public function checkInput($fields = '')\n {\n if($fields == '*') return false;\n $this->describeTable();\n\n //$fields = explode(', ', $fields);\n $fields = preg_split('/ ?[,|] ?/', $fields);\n\n $arr = [];\n foreach($fields as $f)\n {\n if(!in_array($f, $this->tableFields))\n {\n continue;//just remove unsafe fields\n }\n else\n {\n $arr[] = $f;\n }\n }\n return (!empty($arr)) ? implode(',' , $arr) : false;\n }", "public function checkColumns($table)\n\t{\n\t\tforeach($table->columns as $column)\n\t\t{\n\t\t\tif(!preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/',$column->name))\n\t\t\t\treturn $table->name.'.'.$column->name;\n\t\t}\n\t}", "private function invalid($row, $column) {\n $height = count($this->matrix);\n if ($row >= $height || $row < 0) {\n return true;\n }\n $length = count($this->matrix[$row]);\n if ($column >= $length || $column < 0) {\n return true;\n }\n return false;\n }", "function spr_exclude_column_found($column) {\nglobal $spr_exclude_db_debug;\n\n\t$rs = safe_query('SELECT * FROM '.safe_pfx('txp_section'),$spr_exclude_db_debug);\n\t$a = nextRow($rs);\n\treturn array_key_exists($column, $a);\n}", "public function validate ($columns = null)\n {\n return true;\n }", "public function rejectIfInvalidRowAndColumn(Board $board, User $player, $row, $col);", "public function message()\n {\n $mustBeUniqueColumns = $this->otherColumns\n ->map(function ($otherColumn) {\n return $otherColumn->name;\n })\n ->prepend($this->mainColumn)\n ->join(', ');\n\n return 'The following column combination must be unique: ' . $mustBeUniqueColumns;\n }", "public function hasColumnNumber(){\n return $this->_has(5);\n }", "public function firstCol() {\n\t}", "public function getInvalidColumns()\n {\n return $this->invalidColumns;\n }", "protected function removeColumns()\n {\n $table = $this->ask('Enter the name of desired table');\n $this->checkInput($table);\n $columns = $this->ask('Enter your desired columns separated by space');\n $this->checkInput($columns);\n $separatedColumns = explode(' ', $columns);\n $this->service->removeColumns($table, $separatedColumns);\n }", "abstract protected function doCols();", "private function validateColumns($columns) {\n\t\tif(is_object($columns)) {\n\t\t\tforeach($columns as $key => $val) {\n\t\t\t\tif(!is_string($val)) {\n\t\t\t\t\t$display = is_object($val) ? \"Object\" : \"$val\";\n\t\t\t\t\t$this->error(\"Expected a string description for column '$key', but got '$display'\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->error(\"Expected property 'columns' to be an object, but it was '$columns'\");\n\t\t}\n\t}", "function tableValidator( &$errors, &$warnings, &$excel, &$lang ){\n $valid = 0;\n for( $col = 1; $col <= $excel->numCols(); $col++ ) {\n if( empty($excel->valueAt( 1, $col )) ){\n for( $row = 2; $row <= $excel->numRows(); $row++ ){\n if( $excel->valueAt( $row, $col) !== '' ){\n array_push( $warnings, sprintf( $lang['xlsimport_warning_column_without_name'], chr( $col + 64 )) );\n $row = $excel->numRows();\n $valid = 1;\n }\n }\n }else{\n for( $comp_col = ($col + 1); $comp_col <= $excel->numCols(); $comp_col++ ) {\n if($excel->valueAt( 1, $col ) === $excel->valueAt( 1, $comp_col )){\n array_push( $errors, sprintf( $lang['xlsimport_warning_colname_duplicate'], chr( $col + 64 ), chr( $comp_col + 64 )));\n $valid = 2;\n }\n }\n }\n }\n return $valid;\n}", "public function checkRequired($cols)\n\t{\n\t\t$eav_attr=$this->tablename(\"eav_attribute\");\n\t\t$sql=\"SELECT attribute_code FROM $eav_attr WHERE is_required=1\n\t\tAND frontend_input!='' AND frontend_label!='' AND entity_type_id=?\";\n\t\t$required=$this->selectAll($sql,$this->prod_etype);\n\t\t$reqcols=array();\n\t\tforeach($required as $line)\n\t\t{\n\t\t\t$reqcols[]=$line[\"attribute_code\"];\n\t\t}\n\t\t$required=array_diff($reqcols,$cols);\n\t\treturn $required;\n\t}", "protected function validateQuery(): bool {\n\t\t$columnsCount = count($this->columns);\n\t\t$valuesCount = count($this->values);\n\t\tif ($columnsCount === 0 || $valuesCount === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($this->values as $valueRow) {\n\t\t\tif (count($valueRow) !== $columnsCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn parent::validateQuery();\n\t}", "public function testColumnaCompleta(CartonInterface $carton) {\n\t$flag = true;\t\n\tforeach( $carton->columnas() as $col ){\t\n\t\t$cant = 0;\t\n\t\tforeach( $col as $num ){\n\t\t\tif($num != 0){\n\t\t\t$cant++;\t\t\t\n\t\t\t}\n\t\t}\n\t\tif($cant == 3){\n\t\t$flag = false;\n\t\t}\n\t}\n $this->assertTrue($flag);\n }", "function validateSingleFitment($name) { \n\tglobal $pdo;\n\n\t$stmt = 'SELECT * FROM amasty_finder_value WHERE UPPER(name)=UPPER(:name)';\n\t$stmt = $pdo->prepare($stmt);\n\t$stmt->execute(['name' => $name]);\n\n\tif (sizeOf( $stmt->fetchAll(PDO::FETCH_COLUMN) ) > 0) return true;\n\telse return false;\n}", "function get_columns_name($name_table){\n \t$sql=\" SHOW FULL COLUMNS FROM \" . $name_table . \";\";\n\t $query = $this->db->query($sql);\n\t $result = $query->num_rows() >= 1 ? $query->result() : false;\n\t return $result;\n }", "protected function isBoardFull() {\n if ((count($this->_markers[self::X_MARK]) + count($this->_markers[self::O_MARK])) == 9) {\n echo $this->promptMessage('board_full') . PHP_EOL;\n return TRUE;\n }\n return FALSE;\n }", "public function checkRequired($cols)\n\t{\n\t\t$eav_attr=$this->tablename(\"eav_attribute\");\n\t\t$sql=\"SELECT attribute_code FROM $eav_attr WHERE is_required=1\n\t\tAND frontend_input!='' AND frontend_label!='' AND entity_type_id=?\";\n\t\t$required=$this->selectAll($sql,$this->cat_etype);\n\t\t$reqcols=array();\n\t\tforeach($required as $line)\n\t\t{\n\t\t\t$reqcols[]=$line[\"attribute_code\"];\n\t\t}\n\t\t$required=array_diff($reqcols,$cols);\n\t\treturn $required;\n\t}", "function tt_validate_upload_columns(csv_import_reader $cir, $stdfields, moodle_url $returnurl) {\n $columns = $cir->get_columns();\n\n if (empty($columns)) {\n $cir->close();\n $cir->cleanup();\n print_error('cannotreadtmpfile', 'error', $returnurl);\n }\n if (count($columns) < 2) {\n $cir->close();\n $cir->cleanup();\n print_error('csvfewcolumns', 'error', $returnurl);\n }\n\n // test columns\n $processed = array();\n foreach ($columns as $key=>$unused) {\n $field = $columns[$key];\n $lcfield = textlib::strtolower($field);\n if (in_array($field, $stdfields) or in_array($lcfield, $stdfields)) {\n // standard fields are only lowercase\n $newfield = $lcfield;\n } else {\n $cir->close();\n $cir->cleanup();\n print_error('invalidfieldname', 'error', $returnurl, $field);\n }\n if (in_array($newfield, $processed)) {\n $cir->close();\n $cir->cleanup();\n print_error('duplicatefieldname', 'error', $returnurl, $newfield);\n }\n $processed[$key] = $newfield;\n }\n return $processed;\n}", "public function testEmptyCols(): void\n {\n $file_path = base_path('tests/data/expenses_empty_rows.csv');\n $status = $this->importSvc->importExpenses($file_path);\n $this->assertCount(8, $status['success']);\n $this->assertCount(0, $status['errors']);\n }", "public static function checkTableColumnFormat($table, $column, $definition, $logger = null)\n {\n if (!$logger || !is_callable($logger)) {\n $logger = function () {\n };\n }\n \n // Get current definition\n $s = DBI::prepare('SELECT * FROM information_schema.columns WHERE table_name=:table AND column_name=:column');\n $s->execute(array(':table' => strtolower($table), ':column' => strtolower($column)));\n $column_dfn = $s->fetch();\n \n $non_respected = array();\n \n $typematcher = '';\n $length = null;\n\n // Build type matcher\n switch ($definition['type']) {\n case 'int':\n case 'uint':\n $size = array_key_exists('size', $definition) ? $definition['size'] : 'medium';\n if (!$size) {\n $size = 'medium';\n }\n $s2s = array('small' => 'smallint', 'medium' => 'integer', 'big' => 'bigint');\n $typematcher = $s2s[$size];\n break;\n\n case 'numeric':\n $typematcher = 'numeric';\n break;\n \n case 'string':\n $typematcher = 'character varying';\n $length = (int)$definition['size'];\n break;\n \n case 'bool':\n $typematcher = 'boolean';\n break;\n \n case 'text':\n $typematcher = 'text';\n break;\n\n case 'mediumtext':\n $typematcher = 'text';\n break;\n \n case 'date':\n $typematcher = 'date';\n break;\n \n case 'datetime':\n $typematcher = 'timestamp';\n break;\n \n case 'time':\n $typematcher = 'time';\n break;\n }\n \n // Check type\n if (!preg_match('`'.$typematcher.'`i', $column_dfn['data_type'])) {\n $logger($column.' type does not match '.$typematcher);\n $non_respected[] = 'type';\n }\n \n // Check length if any\n if (!is_null($length) && ((int)$column_dfn['character_maximum_length'] != $length)) {\n $logger($column.' max length does not match '.$length);\n $non_respected[] = 'type';\n }\n \n // Check default\n if (array_key_exists('default', $definition)) {\n if (is_null($definition['default'])) {\n if (!is_null($column_dfn['column_default'])) {\n $logger($column.' default is not null');\n $non_respected[] = 'default';\n }\n } elseif (is_bool($definition['default'])) {\n $expected = $definition['default'] ? 'true' : 'false';\n if ((bool)$column_dfn['column_default'] != $expected) {\n $logger($column.' default is not '.$expected);\n $non_respected[] = 'default';\n }\n } elseif ($definition['type'] == 'numeric' ) {\n $d = $column_dfn['column_default'];\n $d = preg_replace('/::numeric/i','', $d);\n $d = preg_replace(\"/'/i\",'', $d);\n if( $d != $definition['default'] ) {\n $logger($column.' have '.$column_dfn['column_default'].' CCC default is not \"'.$definition['default'].'\"');\n $non_respected[] = 'default';\n }\n } elseif ($column_dfn['column_default'] != $definition['default']\n && $column_dfn['column_default'] != self::quoteString($definition['default']).'::character varying') {\n $logger($column.' default is not \"'.$definition['default'].'\"');\n $non_respected[] = 'default';\n }\n }\n \n // Options defaults\n foreach (array('null', 'primary', 'unique', 'autoinc') as $k) {\n if (!array_key_exists($k, $definition)) {\n $definition[$k] = false;\n }\n }\n \n // Check nullable\n $is_null = (strtolower($column_dfn['is_nullable']) == 'yes');\n if ($definition['null'] && !$is_null) {\n $logger($column.' is not nullable');\n $non_respected[] = 'null';\n } elseif (!$definition['null'] && $is_null) {\n $logger($column.' should not be nullable');\n $non_respected[] = 'null';\n }\n \n // Check primary\n $is_primary = false;\n $s = DBI::prepare('SELECT pg_attribute.attname FROM pg_attribute JOIN pg_class ON pg_class.oid = pg_attribute.attrelid LEFT JOIN pg_constraint ON pg_constraint.conrelid = pg_class.oid AND pg_attribute.attnum = ANY (pg_constraint.conkey) WHERE pg_class.relkind = \\'r\\' AND pg_class.relname = :table AND pg_attribute.attname = :column AND pg_constraint.contype = \\'p\\'');\n $s->execute(array(':table' => strtolower($table), ':column' => strtolower($column)));\n if ($s->fetch()) {\n $is_primary = true;\n }\n if ($definition['primary'] && !$is_primary) {\n $logger($column.' is not primary');\n $non_respected[] = 'primary';\n } elseif (!$definition['primary'] && $is_primary) {\n $logger($column.' should not be primary');\n $non_respected[] = 'primary';\n }\n \n // Check unique\n $is_unique = false;\n $s = DBI::prepare('SELECT pg_attribute.attname FROM pg_attribute JOIN pg_class ON pg_class.oid = pg_attribute.attrelid LEFT JOIN pg_constraint ON pg_constraint.conrelid = pg_class.oid AND pg_attribute.attnum = ANY (pg_constraint.conkey) WHERE pg_class.relkind = \\'r\\' AND pg_class.relname = :table AND pg_attribute.attname = :column AND pg_constraint.contype = \\'u\\'');\n $s->execute(array(':table' => strtolower($table), ':column' => strtolower($column)));\n if ($s->fetch()) {\n $is_unique = true;\n }\n if ($definition['unique'] && !$is_unique) {\n $logger($column.' is not unique');\n $non_respected[] = 'unique';\n } elseif (!$definition['unique'] && $is_unique) {\n $logger($column.' should not be unique');\n $non_respected[] = 'unique';\n }\n \n // Check autoinc\n $is_autoinc = self::sequenceExists($table, $column);\n if ($definition['autoinc'] && (!$is_autoinc || ($column_dfn['column_default'] != 'nextval(\\''.$is_autoinc.'\\'::regclass)'))) {\n $logger($column.' is not autoinc');\n $non_respected[] = 'autoinc';\n } elseif (!$definition['autoinc'] && $is_autoinc) {\n $logger($column.' should not be autoinc');\n $non_respected[] = 'autoinc';\n }\n \n // Return any error\n return count($non_respected) ? $non_respected : false;\n }", "public function testQueryFetchColumn()\n {\n $column = $this->getConnection()->query()('SELECT \"Hello World\"')()('fetch-column')();\n return $this->assertTrue(count($column['rows']) < 1);\n }", "private function _isEmptyLine(array $columns): bool {\n\t\tforeach ($columns as $column) {\n\t\t\tif (trim($column) !== '') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function checkError_obligatory($field, $conf) {\n\t \tif ( is_array($this->piVars[$field]) ) {\n\t\t\treturn (count( $this->piVars[$field] ) == 0);\n\t\t} else {\n\t\t\treturn (strlen(trim( $this->piVars[$field] )) == 0);\n\t\t}\n\t}", "function get_columns_name($table) {\n $columns_name=null;\n $query = \"SHOW COLUMNS FROM $table\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result){\n $_SESSION['message'] = \"<br>Eroare la get_columns_name\".Database::getInstance()->getConnection()->error;\n $_SESSION['status'] = \"danger\";\n $_SESSION['icon'] = \"exclamation-sign\";\n echo status_baloon();\n die(\"mort!!\");\n }\n while ($row = $result->fetch_row()){\n $columns_name[] =$row[0];\n }\n $result->free_result();\n return $columns_name;\n}", "function issetTableColumn($table_name, $column_name)\n{\n global $wpdb;\n $columns = $wpdb->get_results(\"SHOW COLUMNS FROM \" . $table_name, ARRAY_A);\n foreach ($columns as $column) {\n if ($column['Field'] == $column_name) {\n return true;\n }\n }\n}", "function validate_any_field( $field ) {\n\t\t\n\t\t// width has changed\n\t\tif( isset($field['column_width']) ) {\n\t\t\t\n\t\t\t$field['wrapper']['width'] = acf_extract_var($field, 'column_width');\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// return\n\t\treturn $field;\n\t\t\n\t}", "function sql_check_null_or_empty($rs, $col_name) {\r\n\t\r\n\tif(trim($rs[\"$col_name\"])!=\"\"){\r\n\t\t$null_or_emoty_sql= $col_name .\"='$rs[$col_name]'\";\r\n\t}else{\r\n\t\t$null_or_emoty_sql=\"(\" . $col_name .\" is NULL OR \" . $col_name . \"='')\";\r\n\t}\r\n\t\r\n\treturn $null_or_emoty_sql;\r\n}", "public function check_import_match($table_name, $text_line) {\n $error = 0;\n $arr = explode(\",\",$text_line);\n $string_count = sizeof($arr);\n $cols = $this->data_driver->get_column_count($table_name);\n if ($cols != FALSE) {\n $col_count = sizeof($cols);\n }\n else\n {\n $error = \"Table name doesn't exist\";\n return $error;\n }\n if ($string_count == $col_count) {\n return $error;\n }\n else\n { \n $error = \"Column count does not match. Check selection or data format\";\n return $error;\n }\n }", "function isColumnSolved(array $grid, int $x): bool;", "public function column_default( $item, $column_name )\n\t{\n\t\treturn '<strong>ERROR:</strong><br/>'.$column_name;\n\t}", "function detectColumns($data) {\n global $colCount, $schema;\n $colCount = count($data); \n $schema = $data;\n}", "public function isAvailable($column, $value){\n\n $vars = $this->theHand->fetchWithConditions($this->table,$column, \"$column='$value'\");\n\n return count($vars)==0;\n\n\n }", "protected function printSqlCheck() {}", "function Ensuretable()\n {\n $result = mysqli_query(\"SHOW COLUMNS FROM $this->tablename\"); \n if(!$result || mysqli_num_rows($result) <= 0)\n {\n return $this->CreateTable();\n }\n return true;\n }", "public function checkForUniqueValue($table,$column,$value,$editId) \n{\n \n $value=trim($value);\n $editId=trim($editId);\n $returnVal='';\n \n \n if ($value !== '') {\n $sql=\"select id, $column from $table where $column = '\".$value.\"'\";\n if ($editId != '') {\n $sql=$sql.\" and id <> $editId\"; \n } \n \n $retArray=$this->getTableData($sql,false,true); \n \n if (count($retArray)) {\n $returnVal='This value is not unique. Please update with a unique value.';\n }\n }\n \n return $returnVal; \n}", "static public function hasColumn($table, $column)\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "private function checkSevenDayInCol():bool\n {\n $stmt = $this->pdo->query(\"SHOW COLUMNS FROM `distribution_municipalities` LIKE '%_sevendayin'\");\n return !is_bool($stmt->fetch());\n }", "public function isColumn($key)\n {\n return in_array(strtolower($key), $this->columns());\n }", "function edit_field_confirm()\n\t{\n\t\tif ( empty($_POST['type']) ) return FALSE;\n\n\t\t// -------------------------------------\n\t\t//\tField id\n\t\t// -------------------------------------\n\n\t\t$field_id\t= ee()->input->get_post('field_id');\n\n\t\t// -------------------------------------\n\t\t//\tField length tests\n\t\t// -------------------------------------\n\n\t\t$error\t= array();\n\t\t$sql\t= \"\";\n\n\t\tswitch ( $_POST['type'] )\n\t\t{\n\t\t\tcase 'character':\n\n\t\t\t\tif ( empty( $_POST['length'] ) OR ! is_numeric($_POST['length']) )\n\t\t\t\t{\n\t\t\t\t\t$error[]\t= lang('field_length_required');\n\t\t\t\t}\n\t\t\t\telseif ( $_POST['length'] < 1 OR $_POST['length'] > 255 )\n\t\t\t\t{\n\t\t\t\t\t$error[]\t= lang('char_length_incorrect');\n\t\t\t\t}\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" CHAR(\".round(ee()->db->escape_str($_POST['length'])).\") NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'varchar':\n\n\t\t\t\tif ( empty( $_POST['length'] ) OR ! is_numeric($_POST['length']) )\n\t\t\t\t{\n\t\t\t\t\t$error[]\t= lang('field_length_required');\n\t\t\t\t}\n\t\t\t\telseif ( $_POST['length'] < 1 OR $_POST['length'] > 255 )\n\t\t\t\t{\n\t\t\t\t\t$error[]\t= lang('varchar_length_incorrect');\n\t\t\t\t}\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" VARCHAR(\".round(ee()->db->escape_str($_POST['length'])).\") NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'decimal':\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$parens\t= ( is_numeric($_POST['length']) === TRUE AND is_numeric($_POST['precision']) === TRUE ) ? \"(\".round(ee()->db->escape_str($_POST['length'])).\",\".round(ee()->db->escape_str($_POST['precision'])).\")\": '';\n\t\t\t\t$sql\t.= \" DECIMAL\" . $parens . \" NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'float':\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$parens\t= ( is_numeric($_POST['length']) === TRUE AND is_numeric($_POST['precision']) === TRUE ) ? \"(\".round(ee()->db->escape_str($_POST['length'])).\",\".round(ee()->db->escape_str($_POST['precision'])).\")\": '';\n\t\t\t\t$sql\t.= \" FLOAT\" . $parens . \" NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'integer':\n\n\t\t\t\t$_POST['length']\t= 10;\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" INT(\".round(ee()->db->escape_str($_POST['length'])).\") unsigned NOT NULL\";\n\t\t\tbreak;\n\t\t\tcase 'small integer':\n\n\t\t\t\t$_POST['length']\t= 5;\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" SMALLINT(\".round(ee()->db->escape_str($_POST['length'])).\") unsigned NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tcase 'tiny integer':\n\n\t\t\t\t$_POST['length']\t= 3;\n\n\t\t\t\t$check_truncation\t= TRUE;\n\t\t\t\t$sql\t.= \" TINYINT(\".round(ee()->db->escape_str($_POST['length'])).\") unsigned NOT NULL\";\n\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$sql\t.= \" TEXT NOT NULL\";\n\t\t\tbreak;\n\t\t}\n\n\t\t$sql\t= \"ALTER TABLE `%table%` CHANGE `%field%` `%field%`\".$sql;\n\n\t\t$sql\t= str_replace( array( '%table%', '%field%' ), array( 'exp_channel_data', 'field_id_'.$field_id ), $sql );\n\n\t\t// -------------------------------------\n\t\t//\tAny errors?\n\t\t// -------------------------------------\n\n\t\tif ( count( $error ) > 0 )\n\t\t{\n\t\t\treturn $this->show_error($error);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tPrep vars\n\t\t// -------------------------------------\n\n\t\t$this->cached_vars['field_id']\t= $field_id;\n\t\t$this->cached_vars['sql']\t\t= base64_encode( $sql );\n\t\t$this->cached_vars['method']\t= 'edit_field';\n\n\t\t// -------------------------------------\n\t\t//\tWill this change truncate data?\n\t\t// -------------------------------------\n\n\t\t$this->cached_vars['question']\t= lang('edit_field_question');\n\n\t\tif ( isset( $check_truncation ) === TRUE )\n\t\t{\n\t\t\t$this->cached_vars['question']\t= lang('edit_field_question_truncate');\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tPrep message\n\t\t// -------------------------------------\n\n\t\t$this->_prep_message();\n\n\t\t// -------------------------------------\n\t\t//\tTitle and Crumbs\n\t\t// -------------------------------------\n\n\t\t$this->add_crumb( lang( 'edit_field' ) );\n\t\t$this->cached_vars['module_menu_highlight'] = 'module_fields';\n\n\t\t// -------------------------------------\n\t\t//\tLoad Homepage\n\t\t// -------------------------------------\n\n\t\treturn $this->ee_cp_view('edit_field_confirm.html');\n\t}", "function diy_check_table_columns($table_name, $field_name, $db_connection = 'mysql') {\n\t\t$connection = DB::connection($db_connection);\n\t\treturn $connection->getSchemaBuilder()->hasColumn($table_name, $field_name);\n\t}", "public function isValidColumnType($column);", "function f_fieldExists($link, $table, $column, $column_attr = \"VARCHAR( 255 ) NULL\") {\r\n $exists = false;\r\n $columns = mysqli_query($link, \"SHOW COLUMNS FROM $table LIKE '\".$column.\"'\");\r\n //ferror_log(\"SQL: $sql \". \"returns \". $num_rows . \" rows.\");\r\n $exists = ( mysqli_num_rows($columns) )?TRUE:FALSE;\r\n if (!$exists) {\r\n ferror_log(\"ALTER TABLE `$table` ADD `$column` $column_attr\");\r\n if (mysqli_query($link, \"ALTER TABLE `$table` ADD `$column` $column_attr\")) {\r\n return TRUE;\r\n }\r\n } else {\r\n return TRUE;\r\n }\r\n return FALSE;\r\n}", "function columnsSql($table = '')\n\t{\n\t\t// Not supported\n\t\treturn FALSE;\n\t}", "public function validarColumnas($lista)\n {\n foreach ($lista as $key => $campo)\n {\n $pos=$key+1;\n if($campo!=$this->excel->sheets[0]['cells'][2][$pos])\n {\n $this->error=self::ERROR_ESTRUC;\n $this->errorComment.=\"<h5 class='nocargados'> El archivo '\".$this->nombreArchivo.\"' tiene la columna \".$this->excel->sheets[0]['cells'][2][$pos].\" en lugar de \".$campo.\"</h5> <br/>\";\n return false;\n }\n }\n $this->error=self::ERROR_NONE;\n return true;\n }", "function gttn_tpps_file_validate_columns(array &$form_state, array $required_groups, array $file_element) {\n $cols = $file_element['#value']['columns'];\n\n $parents = $file_element['#parents'];\n $new_end_columns = end($parents) . \"-columns\";\n $new_end_no_header = end($parents) . \"-no-header\";\n $new_end_empty = end($parents) . \"-empty\";\n $group_path = array_pop($parents) . \"-groups\";\n $values = &$form_state['values'];\n foreach ($parents as $item) {\n $values = &$values[$item];\n }\n // Initialize form column values in form state.\n $values[$new_end_columns] = array();\n // Hold onto the location of the columns in form state.\n $state_column_values = &$values[$new_end_columns];\n $values[$new_end_no_header] = isset($file_element['#value']['no-header']) ? $file_element['#value']['no-header'] : NULL;\n $values[$new_end_empty] = isset($file_element['#value']['empty']) ? $file_element['#value']['empty'] : NULL;\n\n $title_parts = explode(':', $file_element['#title']);\n $error_prompt = $title_parts[0];\n\n $groups = array();\n $required_groups_flat = array();\n foreach ($required_groups as $group => $combinations) {\n $groups[$group] = array();\n $required_groups_flat[$group] = array();\n foreach ($combinations as $name => $combination) {\n $required_groups_flat[$group] = array_merge($required_groups_flat[$group], $combination);\n }\n }\n\n // dpm($required_groups_flat);\n // dpm($cols);\n // dpm($state_column_values);\n foreach ($cols as $name => $type) {\n $state_column_values[$name] = $type;\n foreach ($required_groups_flat as $group => $types) {\n if (in_array($type, $types)) {\n if (!isset($groups[$group][$type])) {\n $groups[$group][$type] = array($name);\n }\n else {\n $groups[$group][$type][] = $name;\n }\n break;\n }\n }\n }\n // dpm($groups);\n foreach ($required_groups as $group => $combinations) {\n $group_valid = FALSE;\n $groups[$group]['#type'] = array();\n foreach ($combinations as $name => $combination) {\n $combination_valid = TRUE;\n foreach ($combination as $type) {\n if (!isset($groups[$group][$type])) {\n $combination_valid = FALSE;\n break;\n }\n }\n if ($combination_valid) {\n $groups[$group]['#type'][] = $name;\n $group_valid = TRUE;\n }\n }\n\n if (!$group_valid) {\n form_set_error($file_element['#name'] . \"[columns][$group\", \"$error_prompt: Please specify a column or columns that hold $group.\");\n }\n }\n\n foreach ($groups as $key => $group) {\n foreach ($group as $opt_num => $col_names) {\n if (count($col_names) == 1) {\n $groups[$key][$opt_num] = $col_names[0];\n }\n }\n }\n\n $values[$group_path] = $groups;\n\n return $groups;\n}", "public function errorText()\n\t{\n\t\t$list = str_replace(',', ', ', str_replace(\"'\", '', $this->column->constraint));\n\t\t$last = strrpos($list, ', ');\n\t\t$replace = substr($list, $last, strlen($list)-$last);\n\t\t$list = str_replace($replace, str_replace(', ', ' or ', $replace), $list);\n\n\t\treturn \"%s may only be set to $list\";\n\t}", "private function isFilled(): bool {\n foreach ($this->board as $row => $cols) {\n foreach ($cols as $col => $cellValue) {\n if($this->board[$row][$col] == 0 || $this->board[$row][$col] > 9 || $this->board[$row][$col] < 1) {\n return false;\n }\n }\n }\n return true;\n }", "public function valid()\n {\n return $this->_position < ExcelCell::columnIndexFromString($this->_subject->getHighestColumn());\n }", "function show_columns ($table_name) {\n\tglobal $cxn;\n\t$columns_arr = NULL;\n\t\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"SHOW COLUMNS FROM \" . $cxn->real_escape_string($table_name) ;\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t$stmt->execute();\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$columns_arr[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error showing columns from table: \" . $table_name;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $columns_arr);\n}", "public function testValidateThrowMissingColumnException()\n {\n $this->job->setCsvData([['Id'], ['test', 'test2']]);\n\n try {\n $this->job->validate();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), EntityException::MGS_CSV_ROW_COUNT_MISMATCH);\n }\n }", "abstract protected function columns();", "function isCollision(string $row, int $currentColumn): bool\n{\n while (strlen($row) < $currentColumn + 1) {\n $row = $row . $row;\n }\n\n if ($row[$currentColumn] === '#') {\n return true;\n }\n\n return false;\n}", "public function testChallengeTableHasExpectedColumns()\n {\n $this->assertTrue(\n Schema::hasColumns('challenges',\n [\n \"id\", \"title\", \"description\", \"value\", \"session_id\",\n \"created_at\", \"updated_at\"\n ]\n ), 1\n );\n }", "private function checkImportEssentialField($type) {\n $mandatoryFields = EfrontImport::getMandatoryFields($type);\n $not_found = false;\n foreach ($mandatoryFields as $dbField => $columnName) {\n if (!isset($this -> mappings[$dbField])) {\n $not_found = true;\n break;\n }\n }\n if ($not_found) {\n $this -> log[\"failure\"][\"headerproblem\"] = _HEADERDOESNOTINCLUDEESSENTIALCOLUMN . \": \" . implode(\",\", $mandatoryFields);\n return false;\n } else {\n return true;\n }\n }", "static function all_Empty()\r\n {\r\n echo PageBuilder::printError(\"Please enter valid data in all the fields, nothing can not be empty.\");\r\n }", "function dev_echo_col_name($table_name,$col_name){\r\n\tif(LANG == 0){\r\n\t\techo $col_name;\r\n\t\treturn;\r\n\t}else{\r\n\t\t$str = file_get_contents('data.json');\r\n\t\t$col_name_array=json_decode($str, true);\r\n\r\n\t\tif(isset($col_name_array[$table_name][$col_name])){\r\n\t\t\techo $col_name_array[$table_name][$col_name];\r\n\t\t}else{\r\n\t\t\techo $col_name;\r\n\t\t\techoRed('check data.json file');\r\n\t\t}\r\n\r\n\t}\r\n}", "public function admin_table_columns($_columns)\n {\n }", "public function colWidth($column) {\n\t}", "public function displayColumn1()\r\n\t{\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t\tjQuery(document).ready(function() {\r\n\t\t\t\t\r\n\t\t\t\tjQuery(\".remove\").click(function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (confirm(\"<?php _e('You are about to permanently delete the selected items.\\n\\'Cancel\\' to stop, \\'OK\\' to delete.','framework');?>\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t</script>\r\n\t\t<?php\r\n\t}", "static public function hasColumns($table, array $columns)\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function checkForField( $field, $table );", "public function setColumna($col){\n if($col>3 ){\n $this->columna = 3;\n }\n elseif ($col<0) {\n $this->columna = 0;\n }\n else{\n $this->columna = $col;\n }\n }", "function string_taken($supplied_string, $column_name, $table) {\n //sanitize user strings\n $supplied_string = sanitizeString($supplied_string);\n\n //get mysql object\n $mysql = new my_mysql();\n //get column from table\n $query = \"SELECT * FROM $table WHERE $column_name='$supplied_string';\";\n $res = $mysql->readQuery($query);\n if (!$res) {\n die($mysql->connect_error);\n } else {\n $row = $res->fetch_assoc();\n if ($row[$column_name] == $supplied_string){\n echo 'taken';\n }else{\n echo 'free';\n }\n }\n}", "public function hasColumns($type = NULL)\n\t{\n\t\treturn count($type == NULL ? $this->getColumns() : $this->getColumns($type)) > 0;\n\t}", "public static function columns_data($table, $column) {\n $columns = static ::columns($table);\n foreach($columns as $_column) {\n if (strtolower($_column['Field']) == strtolower($column)) {\n return $_column;\n }\n }\n throw new Exception(\"No Column Found\");\n }", "public static function mla_manage_columns_filter( ) {\r\n\t\treturn apply_filters( 'mla_list_table_get_columns', self::$default_columns );\r\n\t}", "public function hasHeader() {\n return is_array($this->colName) && !empty($this->colName);\n }", "public function manageColumns( $column ){\n global $post; \n if( $this->fields_list[$column] == 'checkbox' && get_post_meta( $post->ID, $column, true) == 1):\n echo \"Yes\";\n else:\n echo __( get_post_meta($post->ID, $column, true) );\n endif;\n }", "private function validCells($cells){\n\n return $this->rowsGood($cells) && $this->columnsGood($cells);\n\n }", "function not_empty($tableau) {\n\tforeach ($tableau as $champ) {\n\t\tif(empty($_POST[$champ]) || trim($_POST[$champ])==\"\" ){\n\t\t\treturn false;\n\t\t# code.\n\t\t}\n\n\t}\n\treturn true;\n}", "function column_exists($column, $table)\n {\n $exists = false;\n $this->container->db->setQuery(\"SHOW columns FROM `{$table}`\");\n $columns = $this->contaner->db->loadAssocList();\n\n if (is_array($columns)) while (list ($key, $val) = each($columns)) {\n if ($val['Field'] == $column) {\n $exists = true;\n break;\n }\n }\n\n return $exists;\n }" ]
[ "0.63556224", "0.63001317", "0.61818135", "0.6166093", "0.61368483", "0.60902923", "0.6022151", "0.597522", "0.5947488", "0.59334356", "0.5822366", "0.5815296", "0.5812504", "0.5800726", "0.5780297", "0.5759884", "0.5736777", "0.5713075", "0.56630063", "0.56569", "0.564339", "0.5640562", "0.56205475", "0.5609068", "0.5584184", "0.55674756", "0.5567466", "0.5545837", "0.5493977", "0.5411029", "0.5390962", "0.5388412", "0.53817254", "0.53754634", "0.5361395", "0.535677", "0.5355839", "0.535136", "0.534641", "0.5341498", "0.533922", "0.53257275", "0.53031003", "0.5300285", "0.5294958", "0.52926826", "0.5291119", "0.52824783", "0.5242511", "0.5239471", "0.52249044", "0.5215507", "0.521156", "0.5173696", "0.5173672", "0.5168582", "0.5168238", "0.516807", "0.5167058", "0.5160202", "0.5158602", "0.51576746", "0.5157229", "0.51534504", "0.5148014", "0.51431227", "0.5143074", "0.5136684", "0.5134054", "0.51320726", "0.5121203", "0.51120305", "0.51109165", "0.51064867", "0.50989884", "0.50950265", "0.50940436", "0.5064504", "0.5047993", "0.5046789", "0.50464666", "0.5043906", "0.5041151", "0.5024325", "0.50137687", "0.5013257", "0.50066155", "0.49892867", "0.4988753", "0.49855408", "0.4978081", "0.49685493", "0.49616924", "0.4953744", "0.4945199", "0.4942558", "0.49387467", "0.49267393", "0.49263355", "0.49223062" ]
0.72448236
0
Function verify that the board is not full in case of a full Board message print to user
public function validateIsFullBoard(){ //in case of a full Column for($index=0; $index < Board::COLUMNS; $index++){ //if there is an empty cell if($this->board->gameBoard[0][$index] == Board::CELL){ //board is not full return false; } }///board is full return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isBoardFull() {\n if ((count($this->_markers[self::X_MARK]) + count($this->_markers[self::O_MARK])) == 9) {\n echo $this->promptMessage('board_full') . PHP_EOL;\n return TRUE;\n }\n return FALSE;\n }", "protected static function isBoardFull(array $gameBoard){\r\n\t\tforeach($gameBoard as $pos1=>$columns){\r\n\t\t\tforeach($columns as $pos2=>$player){\r\n\t\t\t\tif (false !== $player){\r\n\t\t\t\t\tcontinue ; \t\r\n\t\t\t\t}\r\n\t\t\t\t$blankPositions[] = array($pos1,$pos2);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn (!empty($blankPositions))? $blankPositions:true;\r\n\t}", "private function isFilled(): bool {\n foreach ($this->board as $row => $cols) {\n foreach ($cols as $col => $cellValue) {\n if($this->board[$row][$col] == 0 || $this->board[$row][$col] > 9 || $this->board[$row][$col] < 1) {\n return false;\n }\n }\n }\n return true;\n }", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}", "function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}", "public function emptyBoard()\n {\n $this->board = array_fill(0, $this->boardSize, array_fill(0, $this->boardSize, ''));\n }", "private function isValidBox(): bool {\n $boxCoordinates = [\n [0,0], [0,1], [0,2],\n [1,0], [1,1], [1,2],\n [2,0], [2,1], [2,2]\n ];\n for($y=0; $y<9; $y+=3) {\n for($x=0; $x<9; $x+=3) {\n $curBox = [];\n for($i=0; $i<9; $i++) {\n $coordinates = $boxCoordinates[$i];\n $coordinates[0] += $y;\n $coordinates[1] += $x;\n if(in_array($this->board[$coordinates[0]][$coordinates[1]], $curBox)){\n return false;\n }\n array_push($curBox, $this->board[$coordinates[0]][$coordinates[1]]);\n }\n }\n }\n return true;\n }", "function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}", "function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}", "public function validateIsFullColumn($selectedColumn){\r\n //in case of a full Column\r\n if($this->board->gameBoard[0][$selectedColumn-1] != Board::CELL){\r\n columnIsFullMsg($this->currentPlayer);\r\n return true;\r\n }\r\n return false;\r\n }", "function board_list(){\n\t\tglobal $print, $x7s, $x7c, $db, $prefix;\n\t\t$head = \"\";\n\t\t$body='';\n\t\t\n\t\t$indice = indice_board();\n\n\n\t\t$q_new = $db->DoQuery(\"SELECT count(*) AS cnt FROM {$prefix}boardunread WHERE user='{$x7s->username}'\");\n\t\t$new_msg = $db->Do_Fetch_Assoc($q_new);\n\n\t\t$body=\"<b>Ci sono $new_msg[cnt] messaggi nuovi</b>\";\n\t\t\n\t\t$print->board_window($head,$body,$indice);\n\t\t\n\t}", "public function is_full(){\t\t$full=false;\n\t\tif( count( $this->pile ) >= $this->taille )\n\t\t\t$full = true;\n\t\treturn $full;\n\t}", "public function setBoard(array $board): bool\n {\n if (sizeof($board) == $this->boardSize && sizeof($board[0]) == $this->boardSize) {\n $this->board = $board;\n return true;\n }\n $this->setMessage(\"Board size is wrong.\");\n return false;\n }", "public function rejectIfWrongMove(Board $board, User $player, $row, $col);", "function checkSudokuBoard(array $board)\n{\n if (empty($board)) {\n throw new \\InvalidArgumentException('The $board cannot be empty');\n }\n\n // Check the rows\n for ($i = 0; $i < count($board); $i++) {\n if (hasDuplicate($board, $i, $i + 1, 0, count($board), count($board))) {\n return false;\n }\n }\n\n // Check the columns\n for ($j = 0; $j < count($board); $j++) {\n if (hasDuplicate($board, 0, count($board), $j, $j + 1, count($board))) {\n return false;\n }\n }\n\n // Check the sub-grids\n $regionSize = (int) sqrt(count($board));\n for ($k = 0; $k < $regionSize; $k++) {\n for ($l = 0; $l < $regionSize; $l++) {\n if (hasDuplicate($board, $regionSize * $k, $regionSize * ($k + 1), $regionSize * $l, $regionSize * ($l + 1), count($board))) {\n return false;\n }\n }\n }\n\n return true;\n}", "function test_display_board()\r\n{\r\n $board = new Board;\r\n\r\n $board->addPiece(0, 0, 'O');\r\n $board->addPiece(1, 1, 'O');\r\n $board->addPiece(2, 2, 'O');\r\n\r\n $actual = (string)$board;\r\n\r\n $expected = \"O--\\n-O-\\n--O\\n\"; //Please note: I had to change this. It was not displaying the expect value after debug_board correctly.\r\n\r\n\r\n if ($actual !== $expected) {\r\n echo \"Expected:\\n\", debug_board($expected);\r\n echo \"\\nActual:\\n\", debug_board($actual), \"\\n\";\r\n throw new \\Exception('test_display_board: Board should render correctly');\r\n }\r\n}", "function show_board($bid){\n\t\tglobal $print, $x7s, $x7c, $db, $prefix;\n\t\t$indice=0;\n\t\t\n\t\t$query = $db->DoQuery(\"SELECT * FROM {$prefix}boards WHERE id='{$bid}'\");\n\t\t$row = $db->Do_Fetch_Assoc($query);\n\t\t\n\t\tif(!$row){\n\t\t\t$body=\"La board richiesta non esiste\n\t\t\t\t<A HREF=\\\"javascript:javascript:history.go(-1)\\\"> Torna indietro</a>\";\n\t\t\t\n\t\t\t$head=\"Errore\";\n\t\t\t$print->board_window($head,$body,$indice);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$board['name']=$row['name'];\n\t\t$board['id']=$row['id'];\n\t\t$board['user_group']=$row['user_group'];\n\t\t$board['readonly']=$row['readonly'];\n\t\t\n\t\t\n\t\t$head=\"Board \".$board['name'];\n\t\t\n\t\t\n\n\t\tif(!checkAuth($bid)){\n\t\t\t$body=\"Non sei autorizzato a vedere questa board\n\t\t\t\t<A HREF=\\\"javascript:javascript:history.go(-1)\\\"> Torna indietro</a>\";\n\t\t\t\n\t\t\t$print->board_window($head,$body,$indice);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(!isset($_GET['message'])){\n\t\t\tshow_all_messages($board);\n\t\t}\n\t\telse{\n\t\t\tshow_single_message($_GET['message'],$board);\n\t\t}\n\t\t\n\t\t\n\t}", "protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }", "function checkGameEnd(){\n\tglobal $roomid, $db;\n\t$q = $db -> prepare(\"SELECT * FROM game WHERE roomid = ? LIMIT 1\");\n\t$q->execute(array($roomid));\n\t$r = $q->fetch();\n\t// When one of the players played all cards\n\tif($r['cardnorth'] == null || $r['cardeast'] == null || $r['cardsouth'] == null || $r['cardwest'] == null){\n\t\treturn '1';\n\t}\n\treturn '0';\n}", "private function isValidRowColumn(): bool {\n foreach ($this->board as $row => $cols) {\n $curRow = [];\n $curCol = [];\n foreach ($cols as $col => $cellValue) {\n // check if repeated in row\n if(in_array($this->board[$row][$col], $curRow)){\n return false;\n }\n array_push($curRow, $this->board[$row][$col]);\n\n // check if repeated in column \n if(in_array($this->board[$col][$row], $curCol)){\n return false;\n }\n array_push($curCol, $this->board[$col][$row]);\n }\n }\n return true;\n }", "public function testRegisterMoveOnBoard()\n {\n $this->_board[0][8] = \"X\";\n $this->assertNotEmpty($this->_board[0][8]);\n }", "public function rejectIfInvalidRowAndColumn(Board $board, User $player, $row, $col);", "function initBoard()\n\t{\n\t\tglobal $board;\n\n\t\t/* clear board */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\tfor ($j = 0; $j < 8; $j++)\n\t\t\t{\n\t\t\t\t$board[$i][$j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/* setup white pieces */\n\t\t$board[0][0] = WHITE | ROOK;\n\t\t$board[0][7] = WHITE | ROOK;\n\t\t$board[0][1] = WHITE | KNIGHT;\n\t\t$board[0][6] = WHITE | KNIGHT;\n\t\t$board[0][2] = WHITE | BISHOP;\n\t\t$board[0][5] = WHITE | BISHOP;\n\t\t$board[0][3] = WHITE | QUEEN;\n\t\t$board[0][4] = WHITE | KING;\n\n\t\t/* setup black pieces */\n\t\t$board[7][0] = BLACK | ROOK;\n\t\t$board[7][7] = BLACK | ROOK;\n\t\t$board[7][1] = BLACK | KNIGHT;\n\t\t$board[7][6] = BLACK | KNIGHT;\n\t\t$board[7][2] = BLACK | BISHOP;\n\t\t$board[7][5] = BLACK | BISHOP;\n\t\t$board[7][3] = BLACK | QUEEN;\n\t\t$board[7][4] = BLACK | KING;\n\n\t\t/* setup pawns */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\t$board[1][$i] = WHITE | PAWN;\n\t\t\t$board[6][$i] = BLACK | PAWN;\n\t\t}\n\t}", "public function isValid()\n {\n $usedInRow = range(0, 8);\n $usedInColumn = range(0, 8);\n $usedInBox = range(0, 2);\n\n foreach ($usedInRow as $index) {\n $usedInRow[$index] = range(0, 8);\n foreach ($usedInRow[$index] as $i) {\n $usedInRow[$index][$i] = false;\n }\n }\n\n foreach ($usedInColumn as $index) {\n $usedInColumn[$index] = range(0, 8);\n foreach ($usedInColumn[$index] as $i) {\n $usedInColumn[$index][$i] = false;\n }\n }\n\n foreach ($usedInBox as $indexA) {\n $usedInBox[$indexA] = range(0, 2);\n foreach ($usedInBox[$indexA] as $indexB) {\n $usedInBox[$indexA][$indexB] = range(0, 8);\n foreach ($usedInBox[$indexA][$indexB] as $i) {\n $usedInBox[$indexA][$indexB][$i] = false;\n }\n }\n }\n\n for ($y = 0; $y < 9; $y++) {\n for ($x = 0; $x < 9; $x++) {\n if ($this->sudoku[$y][$x] === 0) {\n continue;\n }\n\n $value = $this->sudoku[$y][$x] - 1;\n if ($usedInRow[$y][$value] || $usedInColumn[$x][$value] || $usedInBox[floor($y / 3)][floor($x / 3)][$value]) {\n return false;\n }\n\n $usedInRow[$y][$value] = true;\n $usedInColumn[$x][$value] = true;\n $usedInBox[floor($y / 3)][floor($x / 3)][$value] = true;\n }\n }\n\n return true;\n }", "function isCellEmpty($xPos, $yPos){\r\n\t\t\tif($this->board[$xPos][$yPos] != 1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "public function isFull(): bool;", "function hasDuplicate($board, $startRow, $endRow, $startCol, $endCol, $numberOfElements)\n{\n $isPresent = array_fill(1, $numberOfElements + 1, false);\n\n for ($i = $startRow; $i < $endRow; $i++) {\n for ($j = $startCol; $j < $endCol; $j++) {\n if ($board[$i][$j] !== 0 && $isPresent[$board[$i][$j]]) {\n return true;\n }\n\n $isPresent[$board[$i][$j]] = true;\n }\n }\n\n return false;\n}", "public function onBoardingIsCompleted()\n {\n return !empty($this->getIdToken());\n // Commented out because psx form is no longer used\n // && $this->psxFormIsCompleted();\n }", "public function isFull() : bool;", "public function gameWon()\n {\n return $this->countStones() === 1;\n }", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "public static function checkIfTheRoomIsNotFull($users){\n \tif(count($users) < ROOM_MAX_AMOUNT_OF_USERS)\n \t\treturn true;\n \treturn false; \n }", "public function resetBoard()\n\t{\n\t\t$this->board = array();\n\t\t\n\t\t// Not available positions in the square.\n\t\t$this->board[3][-3] = false;\n\t\t$this->board[3][-2] = false;\n\t\t$this->board[2][-3] = false;\n\t\t$this->board[2][-2] = false;\n\t\t\n\t\t$this->board[-2][-3] = false;\n\t\t$this->board[-2][-2] = false;\n\t\t$this->board[-3][-3] = false;\n\t\t$this->board[-3][-2] = false;\n\t\t\n\t\t$this->board[3][2] = false;\n\t\t$this->board[3][3] = false;\n\t\t$this->board[2][2] = false;\n\t\t$this->board[2][3] = false;\n\t\t\n\t\t$this->board[-2][2] = false;\n\t\t$this->board[-2][3] = false;\n\t\t$this->board[-3][2] = false;\n\t\t$this->board[-3][3] = false;\n\t\t\n\t\t// Fill the available positions.\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\tif(!isset($this->board[$i][$j]))\n\t\t\t\t{\n\t\t\t\t\tif($i == 0 && $j == 0) // Center position empty\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function isFull() {\n if($this->rear-$this->front+1==$this->maxsize || $this->front-$this->rear==1){\n\n return true;\n }else{\n\n return false;\n\n }\n\n\n\n\n }", "private function _checkMessageFor()\n {\n return;\n \n $dbh = $this->_connectToDb();\n \n $stmt = $dbh->query(\"SELECT message, when, from FROM messages WHERE LOWER(nick) = '\". strtolower(trim($this->_data->nick)) .\"' AND seen = 0 ORDER BY id DESC LIMIT 1\");\n \n $row = $stmt->fetch(PDO::FETCH_OBJ);\n\n if (isset($row->when)) {\n\n $this->_privmessage(\n 'I have a message for you from '. $row->from,\n $this->_data->nick\n );\n $this->_privmessage(\n 'Message begin: '. $row->message .' :: Message End',\n $this->_data->nick\n );\n $this->_privmessage(\n 'Send: '. $row->when,\n $this->_data->nick\n );\n }\n }", "private function invalid($row, $column) {\n $height = count($this->matrix);\n if ($row >= $height || $row < 0) {\n return true;\n }\n $length = count($this->matrix[$row]);\n if ($column >= $length || $column < 0) {\n return true;\n }\n return false;\n }", "function printBoard(){\r\n\t\t\tfor ($i = 1; $i <= self::ROWS; $i++){\r\n\t\t\t\tfor ($j = 1; $j <= self::ROWS; $j++){\r\n\t\t\t\t\techo $this->board[$i][$j] . \" \";\r\n\t\t\t\t}\r\n\t\t\t\techo PHP_EOL;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo PHP_EOL;\r\n\t\t\t\t\r\n\t\t}", "protected function checkScreenAction() {}", "public function is_full()\n {\n return false;\n }", "function show_all_messages($board){\n\t\tglobal $print, $x7s, $x7c, $db, $prefix;\n\n\t\t$head=\"Board \".$board['name'];\n\t\t$body=\"<script language=\\\"javascript\\\" type=\\\"text/javascript\\\">\n function do_delete(url){\n if(!confirm('Vuoi davvero cancellare il messaggio?'))\n return;\n\n window.location.href=url;\n }\n </script>\n\t\t\";\n\t\t$indice = indice_board();\n\t\t\n\t\t$maxmsg=10;\n\t\t$navigator='<p style=\"text-align: center;\">';;\n\t\t\n\t\tif(isset($_GET['startfrom'])){\n\t\t\t$limit=$_GET['startfrom'];\n\t\t}\n\t\telse\n\t\t\t$limit=0;\n\t\t\n\t\t$query = $db->DoQuery(\"SELECT count(*) AS total FROM {$prefix}boardmsg WHERE board='{$board['id']}' AND father='0'\");\n\t\t$row = $db->Do_Fetch_Assoc($query);\n\t\t$total = $row['total'];\n\t\t\n\t\tif($total > $maxmsg){\n\t\t\t$i=0;\n\t\t\twhile($total > 0){\n\t\t\t\tif((isset($_GET['startfrom']) && $_GET['startfrom'] == $i) || (!isset($_GET['startfrom']) && $i == 0))\n\t\t\t\t\t$navigator .= \"<a href=\\\"index.php?act=boards&board=$board[id]&startfrom=$i\\\"><b>[\".($i+1).\"]</b></a> \";\n\t\t\t\telse\n\t\t\t\t\t$navigator .= \"<a href=\\\"index.php?act=boards&board=$board[id]&startfrom=$i\\\">\".($i+1).\"</a> \";\n\t\t\t\t$i++;\n\t\t\t\t$total -= $maxmsg;\n\t\t\t\t\n\t\t\t}\n\t\t\t$navigator.=\"</p>\";\n\t\t}\n\t\t\n\t\t\t\n\t\t$limit_min = $limit * $maxmsg;\n\t\t$limit_max = $maxmsg;\t\t\n\t\t\n\t\t$query = $db->DoQuery(\"SELECT * FROM {$prefix}boardmsg \n\t\t\t\tWHERE board='{$board['id']}' \n\t\t\t\tAND father='0' ORDER BY last_update DESC LIMIT $limit_min, $limit_max\");\n\n\t\t\n\t\tif(!$board['readonly'] || checkIfMaster()){\n\t\t\t$body .=\"<a href=./index.php?act=boards&send=\".$board['id'].\">Nuova comunicazione</a><br>\";\n\t\t}\n\t\t\n\t\t$body.=$navigator;\n\t\t$unreads = get_unread();\n\t\twhile($row = $db->Do_Fetch_Assoc($query)){\n\t\t\t$q_new = $db->DoQuery(\"SELECT count(*) AS cnt FROM {$prefix}boardmsg msg, {$prefix}boardunread un\n\t\t\t\t\t\tWHERE\tmsg.id=un.id\n\t\t\t\t\t\tAND un.user='{$x7s->username}'\n\t\t\t\t\t\tAND board='{$board['id']}' AND father='$row[id]'\");\n\t\t\t$new_replies = $db->Do_Fetch_Assoc($q_new);\n\t\t\t\n\t\t\t$unread='';\n\t\t\tif(isset($unreads[$row['id']]))\n\t\t\t\t$unread = \"<b>(Nuovo) </b>\";\n\n\t\t\tif($new_replies['cnt']>0){\n\t\t\t\t$unread .= \"<b>(Nuove repliche: $new_replies[cnt])</b>\";\n\t\t\t}\n\t\t\t\n\t\t\t$nb = board_msg_split($row['body']);\n\t\t\t$msg = $nb[0];\n\t\t\t$object = $nb[1];\n\t\t\t$msgid=$row['id'];\n\t\t\t$user=$row['user'];\n\n\t\t\tif ($row['anonymous']) {\n\t\t\t\tif (checkIfMaster()) {\n\t\t\t\t\t$user .= \" (anonimo)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$user = \"Anonimo\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$body.=\"<p>\".$user.\"<br><a href=./index.php?act=boards&board=\".$board['id'].\"&message=\".$row['id'].\">\n\t\t\t\t <b>\".$object.\"</b> \".$unread.\"</a>\";\n\t\t\t\t\n\t\t\tif(checkIfMaster()){\n\t\t\t\t$startfrom = \"\";\n\t\t\t\tif (isset($_GET['startfrom']))\n\t\t\t\t\t$startfrom = \"&startfrom=\".$_GET['startfrom'];\n\n\t\t\t\t$body.=\" <a href=\\\"#\\\" onClick=\\\"javascript: do_delete('./index.php?act=boards&delete=$msgid$startfrom')\\\">[Delete]</a>\";\n\t\t\t\t$body.=\" <a href=./index.php?act=boards&move=$msgid>[Sposta]</a>\";\n }\n\t\t\t\n\t\t\t$body.=\"</p><hr>\";\n\t\t\n\t\t}\n\t\t$body.=$navigator;\n\t\tif(!$board['readonly'] || checkIfMaster()){\n\t\t\t$body .=\"<br><br><a href=./index.php?act=boards&send=\".$board['id'].\">Nuova comunicazione</a><br>\";\n\t\t}\n\t\t\n\t\t$print->board_window($head,$body,$indice);\n\t\t\n\t}", "protected function changeStateCheck()\n {\n if (empty($this->boardNewMoves)) {\n throw new BoardException(Yii::t('app', 'No move detected.'));\n }\n // Make sure 1 move has been made.\n if (count($this->boardNewMoves) > 1) {\n throw new BoardException(Yii::t('app', 'Only one move per request allowed.'));\n }\n\n // Make sure proper character used.\n $allowedCharacter = $this->moveCharacterMap[($this->getTotalMoves() + 1) % 2];\n if (($moveCharacter = $this->getNewMoveCharacter()) != $allowedCharacter) {\n throw new BoardException(Yii::t('app', 'You have to use character \"{allowedCharacter}\" instead of \"{moveCharacter}\"', [\n 'allowedCharacter' => $allowedCharacter,\n 'moveCharacter' => $moveCharacter,\n ]));\n }\n\n // Make sure that character has been placed into the proper position (not overriding existing).\n if (in_array($this->boardArr[$this->getNewMovePosition()], $this->moveCharacterMap)) {\n throw new BoardException(Yii::t('app', 'You are not allowed to override existing moves.'));\n }\n }", "function isFull() {\n return ($this->rear+1)%$this->size==$this->front;\n }", "private function enablesQwirkle(Move $move, Board $board) {\n foreach ($move->lines($board) as $line) {\n if ($line->length() === count(Color::colors()) - 1) {\n $missingPiece = $this->missingPieces($line)[0];\n if ($this->notAccountedFor($missingPiece, $board)) {\n return true;\n }\n }\n }\n return false;\n }", "public function check() : bool\n { \n foreach($this->caller->numbersCalled as $key => $number)\n {\n \n foreach ($this->card->numbers as $key => $cardLine) \n {\n \n if(in_array($number, $cardLine)){\n $this->confirmations++;\n continue 2;\n }\n\n }\n }\n\n if($this->confirmations<24)\n {\n return false;\n }\n\n return true;\n }", "function isCollision(string $row, int $currentColumn): bool\n{\n while (strlen($row) < $currentColumn + 1) {\n $row = $row . $row;\n }\n\n if ($row[$currentColumn] === '#') {\n return true;\n }\n\n return false;\n}", "function board_main(){\n\t\tglobal $x7c, $x7s, $db, $prefix, $x7p, $print;\n\n\n\t\tif($x7c->settings['panic']) {\n\t\t\t$print->board_window(\"\",\"\",\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tudpate_unread();\n\t\t\n\t\tif(isset($_GET['newboard'])){\n\t\t\tcreate_board();\n\t\t}\n\t\telse if(isset($_GET['board'])){\n\t\t\tshow_board($_GET['board']);\n\t\t}\n\t\telse if(isset($_GET['send'])){\n\t\t\tnew_communication($_GET['send']);\n\t\t}\n\t\telse if(isset($_GET['delete'])){\n\t\t\tdelete_message($_GET['delete']);\n\t\t}\n\t\telse if(isset($_GET['delboard'])){\n\t\t\tdelete_board($_GET['delboard']);\n\t\t}\n\t\telse if(isset($_GET['readall'])){\n\t\t\tread_all();\n\t\t}\n\t\telse if(isset($_GET['move'])){\n move_msg();\n\t\t}\n\t\telse \n\t\t\tboard_list();\n\t}", "private function validate_columns(){\n\n for($i=0;$i<9;$i++){\n $col = array_column($this->sudoku_array, $i);\n\n if(count($col) !=9 || count(array_unique($col)) !=9){\n return false;\n }\n }\n return true;\n }", "public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }", "private function validateOnBoardingPercentage()\n {\n return is_numeric($this->onboarding_percentage) && (int)$this->onboarding_percentage >= 0 && (int)$this->onboarding_percentage <= 100;\n }", "public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }", "public function isWinnerCombinationPresent(array $boardState) : bool;", "public function testVerifyToNotWin()\n {\n\n $match = $this->createMatch();\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n $winner = new Winner();\n $winner->verify($match, 0, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(0, $matchFound->winner);\n\n }", "function drawChessBoard($x, $y){\n $flag = true; \n if($x <= 10 && $y <= 10 && $x >= 2 && $y >= 2){\n $sizeDiv = 80;\n $widthBlock = $x * $sizeDiv; \n $heightBlock = $y * $sizeDiv; \n $chessBoard = '<div class=\"displayChessBord\" style=\"height:' . $heightBlock . 'px; \n width:' . $widthBlock . 'px\">';\n for ($i = 0; $i < $y; $i++) { \n for ($r = 0; $r < $x; $r++) {\n if($flag){\n $chessBoard .= '<div class=\"black\"></div>';\n }else{\n $chessBoard .= '<div class=\"white\"></div>';\n }\n $flag = !$flag;\n }\n \n if($x % 2 == 0){\n $flag = !$flag;\n }\n }\n $chessBoard .= '</div>';\n }else{\n $chessBoard = '<span class=\"alertInfo\">Enter data according to the rules and format.</span';\n } \n\n return $chessBoard;\n }", "public function isValid(): bool\n {\n if ($this->getOnboardingPercentage() == \"\") {\n return false;\n }\n\n return true;\n }", "function getInitialBoard() {\n $board=array();\n $boardindex=array(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\");\n\n foreach($boardindex as $i) {\n $board[$i]=array(\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\");\n }\n\n $board['A'][1]=\"WR\";\n $board['B'][1]=\"WN\";\n $board['C'][1]=\"WB\";\n $board['D'][1]=\"WQ\";\n $board['E'][1]=\"WK\";\n $board['F'][1]=\"WB\";\n $board['G'][1]=\"WN\";\n $board['H'][1]=\"WR\";\n\n $board['A'][2]=\"WP\";\n $board['B'][2]=\"WP\";\n $board['C'][2]=\"WP\";\n $board['D'][2]=\"WP\";\n $board['E'][2]=\"WP\";\n $board['F'][2]=\"WP\";\n $board['G'][2]=\"WP\";\n $board['H'][2]=\"WP\";\n\n $board['A'][7]=\"BP\";\n $board['B'][7]=\"BP\";\n $board['C'][7]=\"BP\";\n $board['D'][7]=\"BP\";\n $board['E'][7]=\"BP\";\n $board['F'][7]=\"BP\";\n $board['G'][7]=\"BP\";\n $board['H'][7]=\"BP\";\n\n $board['A'][8]=\"BR\";\n $board['B'][8]=\"BN\";\n $board['C'][8]=\"BB\";\n $board['D'][8]=\"BQ\";\n $board['E'][8]=\"BK\";\n $board['F'][8]=\"BB\";\n $board['G'][8]=\"BN\";\n $board['H'][8]=\"BR\";\n\n return $board;\n }", "function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}", "public function testBuildCheckerBoard()\n {\n $this->markTestSkipped();\n }", "public function hasScreen(){\n return $this->_has(12);\n }", "public function isFull()\n {\n if($this->rear==(count($this->array))){\n return true;\n }\n else{\n return false;\n }\n }", "function checkCollision($shot){\r\n\t\t\t$hitCell = $this->board[$shot->getX()][$shot->getY()];\r\n\t\t\r\n\t\t\t// if cell is empty, the player didn't hit a ship\r\n\t\t\tif($hitCell == self::EMPTYCELL){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t//subtract one from the hit ship\r\n\t\t\t$this->ships[$hitCell]->reduceShipCounter();\r\n\t\t\r\n\t\t\t// if the counter is 0(ship has been destroyed), set sunk to true and check for winner\r\n\t\t\tif( $this->ships[$hitCell]->isShipSunk() ){\r\n\t\t\t\t$shot->setIsSunk(true);\r\n\t\t\t\t$this->checkWinner($shot);\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$shot->setIsHit(true);\r\n\t\t}", "protected function assertDump($dump)\n {\n $dump = \"\\n\".$dump.\"\\n\";\n $this->assertEquals($dump, $this->game->getBoard()->dump());\n }", "private function findRectangleMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\t// Top Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[3][-1]->hasMarble &&\n\t\t\t\t$this->board[3][0]->hasMarble &&\n\t\t\t\t$this->board[3][1]->hasMarble &&\n\t\t\t\t$this->board[2][-1]->hasMarble &&\n\t\t\t\t$this->board[2][0]->hasMarble &&\n\t\t\t\t$this->board[2][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[1][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t$moves[0][] = array('down', 3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('down', 3, 1);\n\t\t\t\t\t\t$moves[0][] = array('up', 0, 1);\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -1);\n\t\t\t\t\t\t$moves[0][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('down', 2, 1);\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -1);\n\t\t\t\t\t\t$moves[0][] = array('up', 0, 1);\n\t\t\t\t\t\t$moves[0][] = array('down', 3, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[1][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t$moves[1][] = array('down', 3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('down', 3, -1);\n\t\t\t\t\t\t$moves[1][] = array('up', 0, -1);\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 1);\n\t\t\t\t\t\t$moves[1][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('down', 2, -1);\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 1);\n\t\t\t\t\t\t$moves[1][] = array('up', 0, -1);\n\t\t\t\t\t\t$moves[1][] = array('down', 3, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble && !$this->board[1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[2][] = array('down', 3, -1);\n\t\t\t\t\t$moves[2][] = array('left', 1, 0);\n\t\t\t\t\t$moves[2][] = array('left', 3, 1);\n\t\t\t\t\t$moves[2][] = array('left', 2, 1);\n\t\t\t\t\t$moves[2][] = array('down', 3, -1);\n\t\t\t\t\t$moves[2][] = array('right', 1, -2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble && $this->board[1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[3][] = array('down', 3, -1);\n\t\t\t\t\t$moves[3][] = array('right', 1, -2);\n\t\t\t\t\t$moves[3][] = array('left', 3, 1);\n\t\t\t\t\t$moves[3][] = array('left', 2, 1);\n\t\t\t\t\t$moves[3][] = array('down', 3, -1);\n\t\t\t\t\t$moves[3][] = array('left', 1, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble && !$this->board[1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[4][] = array('down', 3, 1);\n\t\t\t\t\t$moves[4][] = array('right', 1, 0);\n\t\t\t\t\t$moves[4][] = array('right', 3, -1);\n\t\t\t\t\t$moves[4][] = array('right', 2, -1);\n\t\t\t\t\t$moves[4][] = array('down', 3, 1);\n\t\t\t\t\t$moves[4][] = array('left', 1, 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble && $this->board[1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[5][] = array('down', 3, 1);\n\t\t\t\t\t$moves[5][] = array('left', 1, 2);\n\t\t\t\t\t$moves[5][] = array('right', 3, -1);\n\t\t\t\t\t$moves[5][] = array('right', 2, -1);\n\t\t\t\t\t$moves[5][] = array('down', 3, 1);\n\t\t\t\t\t$moves[5][] = array('right', 1, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Down Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[-3][-1]->hasMarble &&\n\t\t\t\t$this->board[-3][0]->hasMarble &&\n\t\t\t\t$this->board[-3][1]->hasMarble &&\n\t\t\t\t$this->board[-2][-1]->hasMarble &&\n\t\t\t\t$this->board[-2][0]->hasMarble &&\n\t\t\t\t$this->board[-2][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[-1][0]->hasMarble && !$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[6][] = array('up', -3, -1);\n\t\t\t\t\t$moves[6][] = array('up', -3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', -3, 1);\n\t\t\t\t\t\t$moves[6][] = array('down', 0, 1);\n\t\t\t\t\t\t$moves[6][] = array('right', -1, -1);\n\t\t\t\t\t\t$moves[6][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', -2, 1);\n\t\t\t\t\t\t$moves[6][] = array('right', -1, -1);\n\t\t\t\t\t\t$moves[6][] = array('down', 0, 1);\n\t\t\t\t\t\t$moves[6][] = array('up', -3, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[7][] = array('up', -3, 1);\n\t\t\t\t\t$moves[7][] = array('up', -3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -3, -1);\n\t\t\t\t\t\t$moves[7][] = array('down', 0, -1);\n\t\t\t\t\t\t$moves[7][] = array('left', -1, 1);\n\t\t\t\t\t\t$moves[7][] = array('up', -2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, -1);\n\t\t\t\t\t\t$moves[7][] = array('left', -1, 1);\n\t\t\t\t\t\t$moves[7][] = array('down', 0, -1);\n\t\t\t\t\t\t$moves[7][] = array('up', -3, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[8] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[8][] = array('up', -3, -1);\n\t\t\t\t\t$moves[8][] = array('left', -1, 0);\n\t\t\t\t\t$moves[8][] = array('left', -3, 1);\n\t\t\t\t\t$moves[8][] = array('left', -2, 1);\n\t\t\t\t\t$moves[8][] = array('up', -3, -1);\n\t\t\t\t\t$moves[8][] = array('right', -1, -2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[9] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[9][] = array('up', -3, -1);\n\t\t\t\t\t$moves[9][] = array('right', -1, -2);\n\t\t\t\t\t$moves[9][] = array('left', -3, 1);\n\t\t\t\t\t$moves[9][] = array('left', -2, 1);\n\t\t\t\t\t$moves[9][] = array('up', -3, -1);\n\t\t\t\t\t$moves[9][] = array('left', -1, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[10] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[10][] = array('up', -3, 1);\n\t\t\t\t\t$moves[10][] = array('right', -1, 0);\n\t\t\t\t\t$moves[10][] = array('right', -3, -1);\n\t\t\t\t\t$moves[10][] = array('right', -2, -1);\n\t\t\t\t\t$moves[10][] = array('up', -3, 1);\n\t\t\t\t\t$moves[10][] = array('left', -1, 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[11] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[11][] = array('up', -3, 1);\n\t\t\t\t\t$moves[11][] = array('left', -1, 2);\n\t\t\t\t\t$moves[11][] = array('right', -3, -1);\n\t\t\t\t\t$moves[11][] = array('right', -2, -1);\n\t\t\t\t\t$moves[11][] = array('up', -3, 1);\n\t\t\t\t\t$moves[11][] = array('right', -1, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Left Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][-3]->hasMarble &&\n\t\t\t\t$this->board[1][-2]->hasMarble &&\n\t\t\t\t$this->board[0][-3]->hasMarble &&\n\t\t\t\t$this->board[0][-2]->hasMarble &&\n\t\t\t\t$this->board[-1][-3]->hasMarble &&\n\t\t\t\t$this->board[-1][-2]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[1][-1]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][-1]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[12] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[12][] = array('right', 0, -3);\n\t\t\t\t\t$moves[12][] = array('right', -1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -3);\n\t\t\t\t\t\t$moves[12][] = array('left', 1, 0);\n\t\t\t\t\t\t$moves[12][] = array('up', -1, -1);\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -2);\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$moves[12][] = array('right', 1, -2);\n\t\t\t\t\t\t$moves[12][] = array('up', -1, -1);\n\t\t\t\t\t\t$moves[12][] = array('left', 1, 0);\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][-1]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][-1]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[13] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[13][] = array('right', 0, -3);\n\t\t\t\t\t$moves[13][] = array('right', 1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -3);\n\t\t\t\t\t\t$moves[13][] = array('left', -1, 0);\n\t\t\t\t\t\t$moves[13][] = array('down', 1, -1);\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -2);\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$moves[13][] = array('right', -1, -2);\n\t\t\t\t\t\t$moves[13][] = array('down', 1, -1);\n\t\t\t\t\t\t$moves[13][] = array('left', -1, 0);\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble && !$this->board[2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[14] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[14][] = array('right', 1, -3);\n\t\t\t\t\t$moves[14][] = array('up', 0, -1);\n\t\t\t\t\t$moves[14][] = array('up', -1, -3);\n\t\t\t\t\t$moves[14][] = array('up', -1, -2);\n\t\t\t\t\t$moves[14][] = array('right', 1, -3);\n\t\t\t\t\t$moves[14][] = array('down', 2, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble && $this->board[2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[15] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[15][] = array('right', 1, -3);\n\t\t\t\t\t$moves[15][] = array('down', 2, -1);\n\t\t\t\t\t$moves[15][] = array('up', -1, -3);\n\t\t\t\t\t$moves[15][] = array('up', -1, -2);\n\t\t\t\t\t$moves[15][] = array('right', 1, -3);\n\t\t\t\t\t$moves[15][] = array('up', 0, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble && !$this->board[-2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[16] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[16][] = array('right', -1, -3);\n\t\t\t\t\t$moves[16][] = array('down', 0, -1);\n\t\t\t\t\t$moves[16][] = array('down', 1, -3);\n\t\t\t\t\t$moves[16][] = array('down', 1, -2);\n\t\t\t\t\t$moves[16][] = array('right', -1, -3);\n\t\t\t\t\t$moves[16][] = array('up', -2, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble && $this->board[-2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[17] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[17][] = array('right', -1, -3);\n\t\t\t\t\t$moves[17][] = array('up', -2, -1);\n\t\t\t\t\t$moves[17][] = array('down', 1, -3);\n\t\t\t\t\t$moves[17][] = array('down', 1, -2);\n\t\t\t\t\t$moves[17][] = array('right', -1, -3);\n\t\t\t\t\t$moves[17][] = array('down', 0, -1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Right Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][3]->hasMarble &&\n\t\t\t\t$this->board[1][2]->hasMarble &&\n\t\t\t\t$this->board[0][3]->hasMarble &&\n\t\t\t\t$this->board[0][2]->hasMarble &&\n\t\t\t\t$this->board[-1][3]->hasMarble &&\n\t\t\t\t$this->board[-1][2]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t($this->board[1][1]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][1]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[18] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[18][] = array('left', 0, 3);\n\t\t\t\t\t$moves[18][] = array('left', -1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 3);\n\t\t\t\t\t\t$moves[18][] = array('right', 1, 0);\n\t\t\t\t\t\t$moves[18][] = array('up', -1, 1);\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 2);\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$moves[18][] = array('left', 1, 2);\n\t\t\t\t\t\t$moves[18][] = array('up', -1, 1);\n\t\t\t\t\t\t$moves[18][] = array('right', 1, 0);\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][1]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][1]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[19] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[19][] = array('left', 0, 3);\n\t\t\t\t\t$moves[19][] = array('left', 1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 3);\n\t\t\t\t\t\t$moves[19][] = array('right', -1, 0);\n\t\t\t\t\t\t$moves[19][] = array('down', 1, 1);\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 2);\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$moves[19][] = array('left', -1, 2);\n\t\t\t\t\t\t$moves[19][] = array('down', 1, 1);\n\t\t\t\t\t\t$moves[19][] = array('right', -1, 0);\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble && !$this->board[2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[20] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[20][] = array('left', 1, 3);\n\t\t\t\t\t$moves[20][] = array('up', 0, 1);\n\t\t\t\t\t$moves[20][] = array('up', -1, 3);\n\t\t\t\t\t$moves[20][] = array('up', -1, 2);\n\t\t\t\t\t$moves[20][] = array('left', 1, 3);\n\t\t\t\t\t$moves[20][] = array('down', 2, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble && $this->board[2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[21] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[21][] = array('left', 1, 3);\n\t\t\t\t\t$moves[21][] = array('down', 2, 1);\n\t\t\t\t\t$moves[21][] = array('up', -1, 3);\n\t\t\t\t\t$moves[21][] = array('up', -1, 2);\n\t\t\t\t\t$moves[21][] = array('left', 1, 3);\n\t\t\t\t\t$moves[21][] = array('up', 0, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[22] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[22][] = array('left', -1, 3);\n\t\t\t\t\t$moves[22][] = array('down', 0, 1);\n\t\t\t\t\t$moves[22][] = array('down', 1, 3);\n\t\t\t\t\t$moves[22][] = array('down', 1, 2);\n\t\t\t\t\t$moves[22][] = array('left', -1, 3);\n\t\t\t\t\t$moves[22][] = array('up', -2, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[23] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[23][] = array('left', -1, 3);\n\t\t\t\t\t$moves[23][] = array('up', -2, 1);\n\t\t\t\t\t$moves[23][] = array('down', 1, 3);\n\t\t\t\t\t$moves[23][] = array('down', 1, 2);\n\t\t\t\t\t$moves[23][] = array('left', -1, 3);\n\t\t\t\t\t$moves[23][] = array('down', 0, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\treturn $moves;\n\t}", "function checkWinner($shot){\r\n\t\t\tforeach ( $this->ships as $shipNumber => $ship ) {\r\n\t\t\t\tif( !$ship->isShipSunk() ){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }", "function LUTB_BoardIndex()\n{\n\tglobal $context, $modSettings;\n\tBoardIndex();\n\t$context['users_online'] = !empty($context['users_online']) && allowedTo('who_view') && !empty($modSettings['who_enabled']);\n}", "function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\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$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}", "function board_offline()\n {\n \t$this->quick_init();\n \t\n \t//-----------------------------------------\n \t// Get offline message (not cached)\n \t//-----------------------------------------\n \t\n \t$row = $this->DB->simple_exec_query( array( 'select' => '*', 'from' => 'conf_settings', 'where' => \"conf_key='offline_msg'\" ) );\n \t\n \t$this->load_language(\"lang_error\");\n \t\n \t$msg = preg_replace( \"/\\n/\", \"<br />\", stripslashes( $row['conf_value'] ) );\n \t\n \t$html = $this->compiled_templates['skin_global']->board_offline( $msg );\n \t\n \t$print = new display();\n \t$print->ipsclass =& $this;\n \t$print->add_output($html);\n \t\t\n \t$print->do_output( array(\n\t\t\t\t\t\t\t\t 'OVERRIDE' => 1,\n\t\t\t\t\t\t\t\t 'TITLE' => $this->lang['offline_title'],\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t );\n }", "function fillBoard(Board $_board, GetOpt $_options)\n {\n }", "abstract protected function isGameOver();", "function displayChessboard ($pieces)\r\n{\r\n\r\n\t$alphaIndex = array ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h');\r\n\t\r\n\tprint (\"<table border=\\\"1\\\" cellpadding=\\\"10\\\">\");\r\n\tprint (\"<tr>\");\r\n\tprint (\"<td> </td>\");\r\n\tforeach ($alphaIndex as $aI)\r\n\t{\r\n\t\tprint (\"<td> $aI </td>\");\r\n\t} \r\n\tprint (\"<td> </td>\");\r\n\tprint (\"</tr>\");\r\n\t\r\n\tfor ($j = 8; $j > 0; $j--)\r\n\t{\r\n\t\tprint (\"<tr>\");\r\n\t\tprint (\"<td>$j</td>\");\r\n\t\tforeach ($alphaIndex as $aI)\r\n\t\t{\r\n\t\t\tif (!empty($pieces[$j][$aI]))\r\n\t\t\t{\r\n\t\t\t\t$abbrev \t= $pieces[$j][$aI]->getTypeAbbrev();\r\n\t\t\t\t$colorNote = $pieces[$j][$aI]->getColorAbbrev();\r\n\t\t\t\tprint (\"<td>\" . $colorNote . $abbrev . \"</td>\"); \r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<td> </td>\");\r\n\t\t}\r\n\t\tprint (\"<td>$j</td>\");\t\t\r\n\t}\t\r\n\r\n\tprint (\"<tr>\");\r\n\tprint (\"<td> </td>\");\r\n\tforeach ($alphaIndex as $aI)\r\n\t{\r\n\t\tprint (\"<td> $aI </td>\");\r\n\t} \r\n\tprint (\"<td> </td>\");\r\n\tprint (\"</tr>\");\r\n\t\r\n\tprint (\"</table>\");\r\n\r\n}", "public function isFull()\n {\n return $this->getFreeInMb() <= 0.0;\n }", "function updateBoard() {\n\tglobal $game, $message;\n\t$cellClicked = $game['clicked']; //identify which button was submitted \t\t\t\t\t\n\tif ($cellClicked !== 9 ) {\n\t\t$curPos = $cellClicked; // get the actual button clicked. 0 to 8 correspond to respective cell\n\t\t$game[\"board\"][$curPos] = $game[\"player\"]; // set our game's data with player mark\n\t\t$game[\"player\"] = ($game[\"player\"]+1)%2; // switch the player turn\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t} else {\n\t\t$game[\"player\"] = 0;\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t}\n\t$message = \"Player \".substr($game[\"playToken\"],$game[\"player\"],1).\" go!\";\n}", "abstract public function hasAvailableMoves(): bool;", "function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}", "public function renderBoard()\n\t{\n\t\t$render = '<div class=\"boardContainer\"><div class=\"board\"><table>';\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\t$render .= '<tr>';\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\tif( $this->board[$i][$j] )\n\t\t\t\t{\n\t\t\t\t\t$render .= $this->board[$i][$j]->render();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$render .= '<td>&nbsp;</td>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$render .= '</tr>';\n\t\t}\n\t\t\n\t\t$render .= '</table></div></div>';\n\t\t\n\t\treturn $render;\n\t}", "static function square_threatened_by_en_passant(\n ChessBoard $board,\n ChessSquare $square_to_check,\n $friendly_color,\n $enemy_color\n ): bool { if ( ! $board->en_passant_target_square ) {\n return FALSE;\n }\n \n // Does our square to check contain a pawn? (Only pawns can be captured en passant)\n $piece_on_square_to_check = self::get_piece($square_to_check->rank, $square_to_check->file, $board);\n if ( ! $piece_on_square_to_check ) {\n // Sometimes our square to check will contain nothing.\n // For example, when checking squares between the rook and king before castling.\n return FALSE;\n }\n if ( ! $piece_on_square_to_check->type == ChessPiece::PAWN ) {\n return FALSE;\n }\n \n // Is test square next to the en passant target square? Only one square north/south\n // of the en passant target square can be threatened.\n if ( $friendly_color == ChessPiece::WHITE ) {\n $test_square_to_target_square_direction = self::SOUTH;\n } elseif ( $friendly_color == ChessPiece::BLACK ) {\n $test_square_to_target_square_direction = self::NORTH;\n }\n $current_xy = self::DIRECTION_OFFSETS[$test_square_to_target_square_direction];\n $rank = $square_to_check->rank + $current_xy[0];\n $file = $square_to_check->file + $current_xy[1];\n if ( ! self::square_is_on_board($rank, $file) ) {\n // Potential en passant target square isn't even on the board. Can't be en passant.\n return FALSE;\n }\n $ep_target_square_rank = $board->en_passant_target_square->rank;\n $ep_target_square_file = $board->en_passant_target_square->file;\n if ( $board->en_passant_target_square->rank != $rank && $board->en_passant_target_square->file != $file ) {\n return FALSE;\n }\n \n // Finally, is there an enemy pawn to the east or west of our pawn?\n // If so, we are threatened by en passant!\n $enemy_pawn_directions = array(self::EAST, self::WEST);\n foreach ( $enemy_pawn_directions as $direction ) {\n $current_xy = self::DIRECTION_OFFSETS[$direction];\n $rank = $square_to_check->rank + $current_xy[0];\n $file = $square_to_check->file + $current_xy[1];\n \n if ( ! self::square_is_on_board($rank, $file) ) {\n // Square is off the board. On to the next check.\n continue;\n }\n \n $piece = self::get_piece($rank, $file, $board);\n \n if ( ! $piece ) {\n // Square is empty. On to the next check.\n continue;\n }\n \n if ( $piece->color == $enemy_color && $piece->type == ChessPiece::PAWN ) {\n return TRUE;\n }\n }\n \n return FALSE;\n }", "public function checkValidMove($userMove){\r\n if(!is_numeric($userMove) ||$userMove < 1 || $userMove > Board::COLUMNS){ \r\n invalidInputMsg($this->currentPlayer);\r\n return false;\r\n }\r\n return true;;\r\n }", "function isValid(array $grid, int $rowIndex, int $columnIndex): bool {//lolo\n $c = $grid[$rowIndex][$columnIndex];\n $xIndex = $rowIndex;\n $yIndex = $columnIndex;\n $rowIndex = 0;\n while ($rowIndex < 9)\n {\n if ($rowIndex != $xIndex) //verif diff de la case pour éviter la boucle inf\n if ($grid[$rowIndex][$columnIndex] == $c)\n return (false);\n $rowIndex++;\n }\n $columnIndex = 0;\n while ($columnIndex < 9)\n {\n if ($columnIndex != $yIndex)// idem avec la colonne\n if ($grid[$xIndex][$columnIndex] == $c)\n return (false);\n $columnIndex++;\n }\n $posY = floor($yIndex / 3) * 3; //verif la carré\n for ($i = 0; $i < 3; $i++)\n {\n $posX = floor($xIndex / 3) * 3; \n for($j = 0; $j < 3; $j++)\n {\n if ($grid[$posX][$posY] == $c && $posX != $xIndex && $posY != $yIndex)\n return false;\n $posX++;\n }\n $posY++;\n }\n return (true);\n}", "private function isKingInMate(int $color): bool\n {\n $board = $this->getBoard();\n $flattenBoard = array_merge(...$this->getBoard());\n $coords = $this->getKingCoords($color);\n\n for ($row = 0; $row <= 2; ++$row) {\n for ($col = 0; $col <= 2; ++$col) {\n $x = $coords[0] + (1 - $row);\n $y = $coords[1] + (1 - $col);\n if (\n ($x > 7 || $x < 0) ||\n ($y > 7 || $y < 0) ||\n ($y === $coords[1] && $x === $coords[0]) ||\n !$this->isReachable($coords, [$x, $y])\n ) {\n continue;\n }\n\n $this->board[$y][$x] = $this->board[$coords[1]][$coords[0]];\n $this->board[$coords[1]][$coords[0]] = null;\n if (!$this->isKingInCheck($color)) {\n $this->board = $board;\n return false;\n }\n }\n }\n $this->board = $board;\n\n foreach ($flattenBoard as $piece) {\n if (!($piece instanceof Piece) || $piece instanceof King) {\n continue;\n }\n if ($piece->getColor() !== $color) {\n continue;\n }\n\n $pieceCoords = $piece->getCoords();\n for ($y = 0; $y < 8; ++$y) {\n for ($x = 0; $x < 8; ++$x) {\n $this->board = $board;\n $move = $piece->checkMove($x, $y, $board, $this->getMoveNumber());\n if (!$move || !$this->isReachable($pieceCoords, [$x, $y])) {\n continue;\n }\n $this->board[$y][$x] = $this->board[$pieceCoords[1]][$pieceCoords[0]];\n $this->board[$pieceCoords[1]][$pieceCoords[0]] = null;\n if (!$this->isKingInCheck($color)) {\n $this->board = $board;\n return false;\n }\n }\n }\n }\n return true;\n }", "function isFull()\r\n\t\t{\r\n\t\t\treturn count($this->elements) >= $this->size;\r\n\t\t}", "protected function reachedMaxMoves(){\r\n if($this->totalMoves == $this->board->getMaxMoves()){\r\n return true;\r\n }\r\n return false;\r\n }", "function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}", "public function startPlay(){ \r\n\r\n $this->selectPlayer();\r\n $this->board->printBoard();\r\n\r\n while(!$this->gameOver){\r\n\r\n //check if board is full\r\n if($this->reachedMaxMoves() || $this->validateIsFullBoard()){\r\n noWinningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n break;\r\n }\r\n // set board with table\r\n $userMove = $this->selectMove();\r\n \r\n //in case that column is not full \r\n if(!$this->validateIsFullColumn($userMove)){\r\n $this->insertMoveToBoard($userMove);\r\n $this->winCheck($userMove);\r\n $this->switchPlayer();\r\n }\r\n }\r\n }", "public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }", "protected function bordered(): bool\n {\n return false;\n }", "public function moveIsValid($m, $n, $board)\n {\n // Guard against out of range m coordinate.\n if ($m < 0 || $m > count($board) - 1) {\n return false;\n }\n\n // Guard against out of range n coordinate.\n if ($n < 0) {\n return false;\n }\n\n return substr($board[$m], $n) != false;\n }", "function checkStructures($ar=NULL){\n $mess = XModEpassLibreWd::checkAllStructures();\n XShell::setNext($this->getMainAction());\n $mess = '<br>La fonction repairOneStructure table=<i>Le nom de la table</i> permet de faire un repair sur une seule table<br>'.$mess;\n setSessionVar('message', $mess);\n }", "function setPiece($col){\n\t\t$gameId = getCurrentGameIdFromPlayerId();\n\t\tif(!$gameId['currentGameId']){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting currentGameId of player\");\n\t\t}\n\t\n\t\t$gameId = $gameId['currentGameId'];\n\t\t$game = getCurrentGame($gameId);\n\t\tif(!$game){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting current game of player\");\n\t\t}\n\t\t\n\t\t//check if player is on turn\n\t\tif($game['nextTurn'] != $_SESSION['playerId']){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"its not your turn\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\t$board = json_decode($game['board']);\n\t\tfor($i = -1;$i<count($board)-1;$i++){\n\t\t\tif($board[$i+1][$col]!=0){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif($i==-1){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"column is full\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\tif($game['player1']==$_SESSION['playerId']){\n\t\t\t$nextTurnPlayer = $game['player2'];\n\t\t\t$playerNumber = 1;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}else{\n\t\t\t$nextTurnPlayer = $game['player1'];\n\t\t\t$playerNumber = 2;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}\n\t\t\n\t\t//save updated board\n\t\t$my_db = mysqli_connect($GLOBALS['servername'],$GLOBALS['username'],$GLOBALS['password'],$GLOBALS['db_name']) or die(\"db connection konnte nicht hergestellt werden\");\n\t\t$updateGameQuery = \"UPDATE games SET board='\".json_encode($board).\"',nextTurn=\".$nextTurnPlayer.\" WHERE gameId=\".$game['gameId'];\n\t\t$result = $my_db->query($updateGameQuery);\n\t\tif(!$result){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error udpating game in database\");\n\t\t}\t\t\n\t\t\n\t\t$gameOver = checkWin($board,$i,$col,$playerNumber);\n\t\tif($gameOver){\n\t\t\t$gameOverQuery = \"UPDATE games SET gameOver=1,nextTurn=0,winner=\".$_SESSION['playerId'].\" WHERE gameId=\".$game['gameId'];\n\t\t\t$result = $my_db->query($gameOverQuery);\n\t\t\t\n\t\t\tif(!$result){\n\t\t\t\thttp_response_code(500);\n\t\t\t\tdie(\"error updating gameOver field\");\n\t\t\t}\n\t\t}\n\t}", "public function testCheckWinner()\n {\n $gamestate = $this->game->getGamestate();\n $this->game->holdHand();\n $this->assertNull($gamestate[\"hasWon\"]);\n\n $gamestate[\"active\"]->addPoints(100);\n $exp = $gamestate[\"active\"];\n $this->game->holdHand();\n\n $gamestate = $this->game->getGamestate();\n $this->assertEquals($exp, $gamestate[\"hasWon\"]);\n }", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "public function valid()\n {\n return $this->_position <= $this->_subject->getHighestRow();\n }", "function checkSupRoom($supervisorRoom,$message){\r\n\t\tif ($supervisorRoom != NULL){\r\n\t\t\tif(strlen($supervisorRoom)<=10){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function process_board($card)\r\r\n{\r\r\n if($card['var']['themecolor']){\r\r\n $color = 'style=\"color:'.$card['var']['themecolor'].'\"';\r\r\n $bordercolor = 'style=\"border-top-color:'.$card['var']['themecolor'].'\"';\r\r\n }\r\r\n\r\r\n $title_link = $card['var']['title_link'] ? $card['var']['title_link'] : 'javascript:void(0);';\r\r\n $header = '<div class=\"news-t\" '.$bordercolor.'><h3>'.\r\r\n '<a '.$color.' href=\"'.$title_link.'\">'.$card['var']['title'].'</a></h3>';\r\r\n if($card['var']['subtitle']){\r\r\n $header .= '<nav class=\"tmore\">';\r\r\n foreach ($card['var']['subtitle'] as $i => $subtitle) {\r\r\n $header .= '<a '.$color.' href=\"'.$card['var']['subtitle_link'][$i].'\">'.$subtitle.'</a>';\r\r\n }\r\r\n $header .= '</nav>';\r\r\n }\r\r\n $header .= '</div>';\r\r\n\r\r\n include_once libfile('function/forumlist');\r\r\n $fids = dintval($card['var']['fids'], TRUE);\r\r\n $forums = C::t('forum_forum')->fetch_all_by_fid($fids);\r\r\n $forum_fields = C::t('forum_forumfield')->fetch_all($fids);\r\r\n foreach($forums as $forum) {\r\r\n\r\r\n if($forum_fields[$forum['fid']]['fid']) {\r\r\n $forum = array_merge($forum, $forum_fields[$forum['fid']]);\r\r\n }\r\r\n $forum['extra'] = empty($forum['extra']) ? array() : dunserialize($forum['extra']);\r\r\n if(!is_array($forum['extra'])) {\r\r\n $forum['extra'] = array();\r\r\n }\r\r\n\r\r\n if($forum['icon']) {\r\r\n $forum['icon'] = get_forumimg($forum['icon']);\r\r\n }\r\r\n $forumlist[ $forum['fid'] ] = $forum;\r\r\n }\r\r\n\r\r\n $list = '<ul class=\"b-l cl\">';\r\r\n foreach ($forumlist as $f) {\r\r\n\r\r\n $link = forum_link($f['fid']);\r\r\n\r\r\n $list .= ' <li><a href=\"'.$link.'\"><img src=\"'.$f['icon'].'\" onerror=\"this.error=null;this.src=\\'source/plugin/xigua_portal/template/cards/board/images/bg.png\\'\"><span class=\"b-tit\">'.$f['name'].'</span></a></li>';\r\r\n }\r\r\n $list .= '</ul>';\r\r\n\r\r\n $card['var']['html'] = $header . $list;\r\r\n\r\r\n return $card;\r\r\n}", "protected function validate()\r\n {\r\n return ( is_array( $this->bot ) && !empty( $this->channel ) );\r\n }", "public function GenerateLegalBishopMoves($chesspiece, $x, $y){\n\t\t//examine top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine top left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n \n return true;\n\t}", "function show_single_message($id, $board){\n\t\tglobal $print, $x7s, $x7c, $db, $prefix;\n\t\t$body=\"<script language=\\\"javascript\\\" type=\\\"text/javascript\\\">\n function do_delete(url){\n if(!confirm('Vuoi davvero cancellare il messaggio?'))\n return;\n\n window.location.href=url;\n }\n </script>\n\t\t\";\n\t\t$indice=indice_board();\n\t\t$maxmsg=10;\n\t\t$navigator='';\n\t\t\n\t\tif(isset($_GET['startfrom'])){\n\t\t\t$limit=$_GET['startfrom'];\n\t\t}\n\t\telse\n\t\t\t$limit=0;\n\t\t\n\t\t$query = $db->DoQuery(\"SELECT count(*) AS total FROM {$prefix}boardmsg WHERE id='{$id}' OR father='{$id}'\");\n\t\t$row = $db->Do_Fetch_Assoc($query);\n\t\t$total = $row['total'];\n\n\t\t\n\t\t\n\t\tif($total > $maxmsg){\n\t\t\t$i=0;\n\t\t\twhile($total > 0){\n\t\t\t\tif((isset($_GET['startfrom']) && $_GET['startfrom'] == $i) || (!isset($_GET['startfrom']) && $i == 0))\n\t\t\t\t\t$navigator .= \"<a href=\\\"index.php?act=boards&board=$board[id]&message=$id&startfrom=$i\\\"><b>[\".($i+1).\"]</b></a> \";\n\t\t\t\telse\n\t\t\t\t\t$navigator .= \"<a href=\\\"index.php?act=boards&board=$board[id]&message=$id&startfrom=$i\\\">\".($i+1).\"</a> \";\n\t\t\t\t$i++;\n\t\t\t\t$total -= $maxmsg;\n\t\t\t\t\n\t\t\t}\n\t\t\t$navigator.=\"<br>\";\n\t\t}\n\t\t\n\t\t\t\n\t\t$limit_min = $limit * $maxmsg;\n\t\t$limit_max = $maxmsg;\n\t\t\n\t\t$query = $db->DoQuery(\"SELECT \tb.id AS id,\n\t\t\t\t\t\tb.father AS father,\n\t\t\t\t\t\tb.user AS user,\n\t\t\t\t\t\tb.body AS body,\n\t\t\t\t\t\tb.board AS board,\n\t\t\t\t\t\tb.time AS time,\n\t\t\t\t\t\tb.replies AS replies,\n\t\t\t\t\t\tu.avatar AS avatar,\n\t\t\t\t\t\tb.anonymous as anonymous\n\t\t\t\t\tFROM {$prefix}boardmsg b, {$prefix}users u\n\t\t\t\t\tWHERE\tb.user = u.username AND\n\t\t\t\t\t\t(b.id='{$id}' OR father='{$id}')\n\t\t\t\t\t\tORDER BY time DESC LIMIT $limit_min, $maxmsg\");\n\t\t\n\t\t//Head message\n\t\t$unread='';\n\t\t$unreads = get_unread();\n\n\t\tif(!$board['readonly'] || checkIfMaster()){\n\t\t\t$body .=\"<a href=./index.php?act=boards&send=\".$board['id'].\"&reply=\".$id.\">Replica</a><br>\";\n\t\t}\n\t\t$body.=\"<a href=\\\"index.php?act=boards&board=\".$board['id'].\"\\\">Torna alla board</a><br>\";\n\t\t\n\t\t$body .= $navigator;\n\t\t$object = \"\";\n\t\t$url_regexp = \"/http(s)?:\\/\\/[^[:space:]]+/i\";\n\n\t\t$body .=\"<table width=\\\"100%\\\" cellspacing=0>\";\n\n\t\twhile($row = $db->Do_Fetch_Assoc($query)){\n\t\t\t$avatar=\"<br>\".date(\"j/n/Y G:i\", $row['time']);\n\t\t\tif($row['avatar']!=''){\n\t\t\t\t$avatar.=\"<br><img src=\\\"$row[avatar]\\\" width=\\\"100\\\" height=\\\"100\\\">\";\n\t\t\t}\n\t\t\t\n\t\t\t$unread='';\n\t\t\tif(isset($unreads[$row['id']])){\n\t\t\t\t$unread = \"<b>(Nuovo)</b>\";\n\t\t\t\t$db->DoQuery(\"DELETE FROM {$prefix}boardunread WHERE id='{$row['id']}' AND user='{$x7s->username}'\");\n\t\t\t}\n\t\t\t\n\t\t\t$nb = board_msg_split($row['body']);\n\t\t\t$msg = $nb[0];\n\t\t\t$object = $nb[1];\n\n\t\t\t$user = \"<a onClick=\\\"\".\n\t\t\t\tpopup_open(500, 680, \"index.php?act=sheet&pg={$row['user']}\",\n\t\t\t\t\t\t'sheet_other').\"\\\" >\".$row['user'].\"</a>\".$avatar;\n\n\t\t\tif ($row['anonymous']) {\n\t\t\t\tif (checkIfMaster()) {\n\t\t\t\t\t$user = \"<a onClick=\\\"\".\n\t\t\t\t\t\tpopup_open(500, 680, \"index.php?act=sheet&pg={$row['user']}\",\n\t\t\t\t\t\t\t\t'sheet_other').\"\\\" >\".$row['user'].\"</a><br>(anonimo)\".$avatar;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$user = \"Anonimo\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$body.=\"<tr><td class=\\\"msg_row\\\"><b>Utente:</b> $user</td><td class=\\\"msg_row\\\"><b>Oggetto:</b> \".$object.\" \".$unread;\n\t\t\t$msgid=$row['id'];\n\t\t\t$user=$row['user'];\n\t\t\t\n\t\t\tif(($user == $x7s->username && !$board['readonly']) || checkIfMaster()){\n\t\t\t\t$body .=\" <a href=./index.php?act=boards&send=\".$board['id'].\"&modify=\".$msgid.\">[Modify]</a>\";\n\t\t\t}\n\t\t\tif(checkIfMaster()){\n\t\t\t\t$body .=\" <a href=\\\"#\\\" onClick=\\\"javascript: do_delete('./index.php?act=boards&delete=\".$msgid.\"')\\\">[Delete]</a>\";\n\t\t\t}\n\n\t\t\t$msg = preg_replace($url_regexp, '<a href=\"\\\\0\" target=\"_blank\">\\\\0</a>', $msg);\t\n\t\t\t$body.= \"<br><br>\".$msg.\"<br><br><br><br></td></tr>\\n\";\n\t\t}\n\n\t\t$body .= \"</table>\";\n\t\t\n\t\tif(!$board['readonly'] || checkIfMaster()){\n\t\t\t$body .=\"<br><br><a href=./index.php?act=boards&send=\".$board['id'].\"&reply=\".$id.\">Replica</a><br>\";\n\t\t}\n\t\t\n\t\t$body.=\"<a href=\\\"index.php?act=boards&board=\".$board['id'].\"\\\">Torna alla board</a><br>\";\n\t\t\n\t\t$body.=$navigator;\n\t\t$head = \"Board \".$board['name'].\" messaggio: \".$object;\n\t\t\n\t\t$print->board_window($head,$body,$indice);\n\t\t\n\t}", "public function testShowEmptyMessages() \r\n {\r\n $render = $this->flash->show();\r\n $this->assertEquals(false, $render);\r\n }", "public function toString()\n {\n return \"GUI is display full\";\n }" ]
[ "0.7831933", "0.69444954", "0.68854916", "0.6503552", "0.63835657", "0.60957617", "0.60837924", "0.59440345", "0.5932222", "0.5927926", "0.58390486", "0.58316", "0.5805093", "0.5747443", "0.57416934", "0.5708741", "0.5684389", "0.56755435", "0.5658349", "0.56398714", "0.563952", "0.562841", "0.55904096", "0.557896", "0.55775", "0.5558635", "0.5558389", "0.55521804", "0.55292547", "0.5517049", "0.55157214", "0.5493408", "0.5490427", "0.5473529", "0.54726815", "0.5440376", "0.5429414", "0.5420632", "0.5410818", "0.5401071", "0.5391634", "0.53863215", "0.53699666", "0.5366243", "0.5352003", "0.5346851", "0.5322914", "0.52883816", "0.52875644", "0.5280098", "0.5266896", "0.5265351", "0.5258643", "0.5257906", "0.5257787", "0.52569056", "0.524899", "0.5247104", "0.5228581", "0.5224425", "0.5219545", "0.52139056", "0.52138835", "0.5213285", "0.52122366", "0.5211875", "0.52060574", "0.5195555", "0.51928794", "0.5183929", "0.5168934", "0.51452976", "0.51446134", "0.51386416", "0.5138082", "0.5130519", "0.51278615", "0.51239264", "0.50924987", "0.5080924", "0.50794387", "0.50787467", "0.50726426", "0.50628644", "0.50611657", "0.5058931", "0.504814", "0.5037904", "0.5036349", "0.50339484", "0.503024", "0.50257623", "0.5018172", "0.4997691", "0.49837303", "0.49789515", "0.4978518", "0.49710464", "0.49619323", "0.4951269" ]
0.7821319
1
function check if the board is full and no moves left In this case none of the players wins
protected function reachedMaxMoves(){ if($this->totalMoves == $this->board->getMaxMoves()){ return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function isBoardFull(array $gameBoard){\r\n\t\tforeach($gameBoard as $pos1=>$columns){\r\n\t\t\tforeach($columns as $pos2=>$player){\r\n\t\t\t\tif (false !== $player){\r\n\t\t\t\t\tcontinue ; \t\r\n\t\t\t\t}\r\n\t\t\t\t$blankPositions[] = array($pos1,$pos2);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn (!empty($blankPositions))? $blankPositions:true;\r\n\t}", "protected function isBoardFull() {\n if ((count($this->_markers[self::X_MARK]) + count($this->_markers[self::O_MARK])) == 9) {\n echo $this->promptMessage('board_full') . PHP_EOL;\n return TRUE;\n }\n return FALSE;\n }", "public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }", "public function validateIsFullBoard(){\r\n //in case of a full Column\r\n for($index=0; $index < Board::COLUMNS; $index++){\r\n //if there is an empty cell\r\n if($this->board->gameBoard[0][$index] == Board::CELL){\r\n //board is not full\r\n return false;\r\n }\r\n }///board is full\r\n return true;\r\n }", "function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}", "function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }", "public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }", "function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "public function gameWon()\n {\n return $this->countStones() === 1;\n }", "function checkWinner($shot){\r\n\t\t\tforeach ( $this->ships as $shipNumber => $ship ) {\r\n\t\t\t\tif( !$ship->isShipSunk() ){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "public function testCheckWinner()\n {\n $gamestate = $this->game->getGamestate();\n $this->game->holdHand();\n $this->assertNull($gamestate[\"hasWon\"]);\n\n $gamestate[\"active\"]->addPoints(100);\n $exp = $gamestate[\"active\"];\n $this->game->holdHand();\n\n $gamestate = $this->game->getGamestate();\n $this->assertEquals($exp, $gamestate[\"hasWon\"]);\n }", "public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }", "function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}", "abstract public function hasAvailableMoves(): bool;", "protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }", "public function gameOver() : bool\n {\n return $this->cpu->totalScore() >= 100 || $this->player->totalScore() >= 100;\n }", "public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }", "private function isFilled(): bool {\n foreach ($this->board as $row => $cols) {\n foreach ($cols as $col => $cellValue) {\n if($this->board[$row][$col] == 0 || $this->board[$row][$col] > 9 || $this->board[$row][$col] < 1) {\n return false;\n }\n }\n }\n return true;\n }", "public function playerHasWon() {\n foreach ($this->players as $player) {\n if ($player->score >= $this->game->winningScore) {\n return true;\n }\n }\n return false;\n }", "function checkGameEnd(){\n\tglobal $roomid, $db;\n\t$q = $db -> prepare(\"SELECT * FROM game WHERE roomid = ? LIMIT 1\");\n\t$q->execute(array($roomid));\n\t$r = $q->fetch();\n\t// When one of the players played all cards\n\tif($r['cardnorth'] == null || $r['cardeast'] == null || $r['cardsouth'] == null || $r['cardwest'] == null){\n\t\treturn '1';\n\t}\n\treturn '0';\n}", "function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}", "public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "abstract protected function isGameOver();", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "function checkCollision($shot){\r\n\t\t\t$hitCell = $this->board[$shot->getX()][$shot->getY()];\r\n\t\t\r\n\t\t\t// if cell is empty, the player didn't hit a ship\r\n\t\t\tif($hitCell == self::EMPTYCELL){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t//subtract one from the hit ship\r\n\t\t\t$this->ships[$hitCell]->reduceShipCounter();\r\n\t\t\r\n\t\t\t// if the counter is 0(ship has been destroyed), set sunk to true and check for winner\r\n\t\t\tif( $this->ships[$hitCell]->isShipSunk() ){\r\n\t\t\t\t$shot->setIsSunk(true);\r\n\t\t\t\t$this->checkWinner($shot);\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$shot->setIsHit(true);\r\n\t\t}", "function makePlayerMove($x,$y){\n if (!$this->board->isEmpty($x,$y)){\n return False;\n } else {\n $this->board[$x][$y] = 2;\n }\n }", "public function getWinner(){\n $this->game->UpdateStatus();\n if ($this->game->getWinner()!=$this->game->get_current_turn()){\n return false;\n }else{\n return true;\n }\n }", "function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\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$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}", "public function GenerateLegalPawnMoves($chesspiece, $x, $y){\n\t\t$from = array($x, $y);\n\t\t\n\t if ($chesspiece > 0){ // $chesspiece is a white pawn.\n\t \t$to = array($x, $y+1);\n\t \t\n\t \tif ($this->chessposition[$x][$y+1] == 0){\n\t \t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 1){\n \t$to = array($x, $y+2);\n \tif ($this->chessposition[$x][$y+2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \t}\n }\n \n if ($this->IsEnemyPiece(1, $x+1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x+1, $y+1));\n }\n if ($this->IsEnemyPiece(1, $x-1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x-1, $y+1));\n }\n }\n\n if ($chesspiece < 0){ // $chesspiece is a black pawn\n \t$to = array($x, $y-1);\n\t \t\n\t if($this->chessposition[$x][$y-1] == 0){\n\t \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 6){\n \t$to = array($x, $y-2);\n \tif ($this->chessposition[$x][$y-2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t }\n }\n \n if ($this->IsEnemyPiece(-1, $x+1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x+1, $y-1));\n if ($this->IsEnemyPiece(-1, $x-1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x-1, $y-1)); \n }\n \n //now do en-passant\n /***\n if ($LastMovePlayed[0] == ){ //if it is a pawn\n \t$fromsquare = $this->NumToCoordinate($LastMovePlayed[0]);\n \t$tosquare = $this->NumToCoordinate($LastMovePlayed[1]);\n \t\n \t$a = $tosquare[0] + 1;\n \tif ($this->IsEnemyPiece($this->chessposition[$tosquare[0]][$tosquare[1]]))\n }\n ***/\n \n return true;\n\t}", "public function startPlay(){ \r\n\r\n $this->selectPlayer();\r\n $this->board->printBoard();\r\n\r\n while(!$this->gameOver){\r\n\r\n //check if board is full\r\n if($this->reachedMaxMoves() || $this->validateIsFullBoard()){\r\n noWinningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n break;\r\n }\r\n // set board with table\r\n $userMove = $this->selectMove();\r\n \r\n //in case that column is not full \r\n if(!$this->validateIsFullColumn($userMove)){\r\n $this->insertMoveToBoard($userMove);\r\n $this->winCheck($userMove);\r\n $this->switchPlayer();\r\n }\r\n }\r\n }", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n if ($rightDiagonalSum == $this->boardSize || $leftDiagonalSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n if ($rightDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $column = array_column($this->board, $i);\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n if ($columnSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($columnSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($rowSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->secondMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "public function rejectIfWrongMove(Board $board, User $player, $row, $col);", "public function testVerifyToNotWin()\n {\n\n $match = $this->createMatch();\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n $winner = new Winner();\n $winner->verify($match, 0, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(0, $matchFound->winner);\n\n }", "public function checkHorizontalWin($userMove){\r\n $HorizontalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $row = $this->lastRowInsert;\r\n $current_player = \"[$this->currentPlayer]\";\r\n\r\n for($col = $userMove-1; $col > -1 ; $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break; \r\n }\r\n $HorizontalCounter++;\r\n }\r\n for($col= $userMove; $col < Board::COLUMNS ; $col++){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $HorizontalCounter++; \r\n }\r\n return $HorizontalCounter >= self::WIN ? true : false;\r\n \r\n }", "public function is_full(){\t\t$full=false;\n\t\tif( count( $this->pile ) >= $this->taille )\n\t\t\t$full = true;\n\t\treturn $full;\n\t}", "function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}", "function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}", "abstract protected function winnerExists();", "abstract public function winner();", "function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }", "function isOver()\n\t{\n\t\tif ($this->won)\n\t\t\treturn true;\n\t\t\t\n\t\tif ($this->over)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "public function isWin() {\n\t\tif ($_SESSION['game']->getState()==\"correct\") {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function makeMove($boardState, $playerUnit = 'X')\n {\n $opponentUnit = ($playerUnit == 'X' ? 'O' : 'X');\n $playerWinCases = array();\n $opponentWinCases = array();\n $choosePlayerWinCase = -1;\n $chooseOpponentWinCase = -1;\n foreach (self::$winningCases as $key => &$winCase) {\n\n $playerWinCase = new WinningCase($boardState, $winCase, $playerUnit);\n if (!$playerWinCase->isBlocked()) {\n if ($playerWinCase->countRemainingMoves() == 0) {\n $this->winner = $playerUnit;\n $this->winningCase = $winCase;\n return;\n } else if (!$choosePlayerWinCase instanceof WinningCase\n || (\n $choosePlayerWinCase instanceof WinningCase\n && $playerWinCase->countRemainingMoves() < $choosePlayerWinCase->countRemainingMoves()\n )\n ) {\n $choosePlayerWinCase = $playerWinCase;\n }\n }\n if ($playerWinCase->countRemainingMoves() > 0) {\n $playerWinCases[$playerWinCase->countRemainingMoves()] = $playerWinCase;\n// array_push($playerWinCases, $playerWinCase);\n }\n\n $opponentWinCase = new WinningCase($boardState, $winCase, $opponentUnit);\n if (!$opponentWinCase->isBlocked()) {\n if ($opponentWinCase->countRemainingMoves() == 0) {\n $this->winner = $opponentUnit;\n $this->winningCase = $winCase;\n return;\n } else if ($opponentWinCase->countRemainingMoves() == 1) {\n $chooseOpponentWinCase = $opponentWinCase;\n }\n }\n if ($opponentWinCase->countRemainingMoves() > 0) {\n $opponentWinCases[$opponentWinCase->countRemainingMoves()] = $opponentWinCase;\n// array_push($opponentWinCases, $opponentWinCase);\n }\n }\n\n // Winning case\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() == 1) {\n #if (DEBUG) echo 'Winning case:' . \"\\r\\n\";\n $this->winner = $playerUnit;\n $this->winningCase = $choosePlayerWinCase->winCase;\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n // Block opponent winning case (to avoid loss)\n if ($chooseOpponentWinCase instanceof WinningCase && $chooseOpponentWinCase->countRemainingMoves() > 0) {\n #if (DEBUG) echo 'Block opponent winning case -> Avoid loss:' . \"\\r\\n\";\n return array_merge($chooseOpponentWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n #if (DEBUG) echo 'No immediate winnning move found -> Best move:' . \"\\r\\n\";\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() > 0) {\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n $this->winner = 'Draw';\n return;\n }", "function is_attacked($i, $opponent_color = null, $try_move = array()) {\n\n if ($opponent_color != null) {\n $opponent_color = 1 - $this->to_move;\n }\n \n # check pawns\n # _debug(\"... checking opponent pawns\");\n if ($opponent_color) {\n if ($this->_test_attack('p', $i - 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i - 11, $opponent_color, $try_move) === -1) return TRUE;\n } \n else {\n if ($this->_test_attack('p', $i + 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i + 11, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check knights\n # _debug(\"... checking opponent knights\");\n foreach (array(19, 21, 8, 12, -19, -21, -8, -12) as $step) {\n if ($this->_test_attack('n', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check bishops or queens\n # _debug(\"... checking opponent bishops\");\n foreach (array(11, 9, -11, -9) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('bq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n # check rooks or queens\n # _debug(\"... checking opponent rooks or queens\");\n foreach (array(1, 10, -1, -10) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('rq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n foreach (array(9, 10, 11, -1, 1, -9, -10, -11) as $step) {\n if ($this->_test_attack('k', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n return FALSE;\n }", "public function isWinnerCombinationPresent(array $boardState) : bool;", "function getMovesForMatch ()\r\n{\r\n\t//array of chess moves assuming a few things:\r\n\t/* \t- light/dark take turns \r\n\t\t- the moves are set up to take a piece and move it to another,\r\n\t\t\tso moving pawn e2 -> e4 would be stored as the first 2 elements in a multidimensional array.\r\n\t\t- there are many things that would need to be done to support algebraic chess notation, \r\n\t\t\tI didn't go into that here.\t\t\r\n\t\t\r\n\t*/\r\n\t$matchMoves = array();\r\n\t\r\n\t/*\r\n\t$matchMoves [0]['from'] = \"e2\";\r\n\t$matchMoves [0]['to'] \t= \"e4\";\r\n\t$matchMoves [1]['from'] = \"c7\";\r\n\t$matchMoves [1]['to']\t= \"c5\";\r\n\t\r\n\t$matchMoves [2]['from'] = \"g1\";\r\n\t$matchMoves\t[2]['to']\t= \"f3\";\r\n\t$matchMoves [3]['from'] = \"b8\";\r\n\t$matchMoves [3]['to']\t= \"c6\";\r\n\t\r\n\t//begin invalid off board examples\r\n\t$matchMoves [4]['from'] = \"c6\";\r\n\t$matchMoves [4]['to'] \t= \"c9\";\r\n\t\r\n\t$matchMoves [5]['from'] = \"c6\";\r\n\t$matchMoves [5]['to'] \t= \"c0\";\r\n\t\r\n\t$matchMoves [6]['from'] = \"c6\";\r\n\t$matchMoves [6]['to'] \t= \"z9\";\r\n\t*/\r\n\t//begin invalid examples for particular pieces\r\n\t\r\n\t//king =======================\r\n\t//bad move\r\n\t$matchMoves [7]['from'] = \"e8\";\r\n\t$matchMoves [7]['to'] \t= \"g7\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [8]['from'] = \"e8\";\r\n\t$matchMoves [8]['to'] \t= \"f7\";\r\n\t\r\n\t//rook =========================\r\n\t//bad move\r\n\t$matchMoves [9]['from'] = \"h8\";\r\n\t$matchMoves [9]['to'] \t= \"h5\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [10]['from'] = \"h7\";\r\n\t$matchMoves [10]['to'] \t = \"h6\";\t\r\n\t$matchMoves [11]['from'] = \"h6\";\r\n\t$matchMoves [11]['to'] \t = \"h5\";\r\n\t$matchMoves [12]['from'] = \"h5\";\r\n\t$matchMoves [12]['to'] \t = \"h4\";\r\n\t$matchMoves [13]['from'] = \"h8\";\r\n\t$matchMoves [13]['to'] \t = \"h5\";\r\n\t\r\n\t//bishop ========================\r\n\t//bad move\r\n\t$matchMoves [14]['from'] \t= \"c8\";\r\n\t$matchMoves [14]['to'] \t\t= \"b8\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [15]['from'] \t= \"c8\";\r\n\t$matchMoves [15]['to'] \t\t= \"c7\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [16]['from'] \t= \"b7\";\r\n\t$matchMoves [16]['to'] \t\t= \"b6\";\r\n\t$matchMoves [17]['from'] \t= \"c8\";\r\n\t$matchMoves [17]['to'] \t\t= \"a6\";\r\n\t\r\n\t//queen ==========================\r\n\t$matchMoves [18]['from'] \t= \"d8\";\r\n\t$matchMoves [18]['to'] \t\t= \"c8\";\r\n\t\r\n\t\t\r\n\t//setting up a check for between functions - rook\r\n\t$matchMoves [19]['from'] \t= \"f2\";\r\n\t$matchMoves [19]['to'] \t\t= \"f3\";\r\n\t$matchMoves [20]['from'] \t= \"f3\";\r\n\t$matchMoves [20]['to'] \t\t= \"f4\";\r\n\t$matchMoves [21]['from'] \t= \"f4\";\r\n\t$matchMoves [21]['to'] \t\t= \"f5\";\r\n\t\r\n\t$matchMoves [22]['from'] \t= \"h5\";\r\n\t$matchMoves [22]['to'] \t\t= \"e5\";\r\n\t\r\n\t//demonstrating capture move a pawn to capture\r\n\t$matchMoves [23]['from'] \t= \"f7\";\r\n\t$matchMoves [23]['to'] \t\t= \"f6\";\r\n\t$matchMoves [24]['from'] \t= \"g7\";\r\n\t$matchMoves [24]['to'] \t\t= \"g6\";\r\n\t$matchMoves [25]['from'] \t= \"f5\";\r\n\t$matchMoves [25]['to'] \t\t= \"g6\";\r\n\t\r\n\r\n\treturn ($matchMoves);\r\n}", "function no_double_moves(int $spareMoves, int $movesX, int $movesO): bool\n{\n return [\n [5, 4],\n [4, 4],\n [4, 3],\n [3, 3],\n [3, 2],\n [2, 2],\n [2, 1],\n [1, 1],\n [1, 0],\n [0, 0],\n ][$spareMoves] === [$movesX, $movesO];\n}", "function initBoard()\n\t{\n\t\tglobal $board;\n\n\t\t/* clear board */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\tfor ($j = 0; $j < 8; $j++)\n\t\t\t{\n\t\t\t\t$board[$i][$j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/* setup white pieces */\n\t\t$board[0][0] = WHITE | ROOK;\n\t\t$board[0][7] = WHITE | ROOK;\n\t\t$board[0][1] = WHITE | KNIGHT;\n\t\t$board[0][6] = WHITE | KNIGHT;\n\t\t$board[0][2] = WHITE | BISHOP;\n\t\t$board[0][5] = WHITE | BISHOP;\n\t\t$board[0][3] = WHITE | QUEEN;\n\t\t$board[0][4] = WHITE | KING;\n\n\t\t/* setup black pieces */\n\t\t$board[7][0] = BLACK | ROOK;\n\t\t$board[7][7] = BLACK | ROOK;\n\t\t$board[7][1] = BLACK | KNIGHT;\n\t\t$board[7][6] = BLACK | KNIGHT;\n\t\t$board[7][2] = BLACK | BISHOP;\n\t\t$board[7][5] = BLACK | BISHOP;\n\t\t$board[7][3] = BLACK | QUEEN;\n\t\t$board[7][4] = BLACK | KING;\n\n\t\t/* setup pawns */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\t$board[1][$i] = WHITE | PAWN;\n\t\t\t$board[6][$i] = BLACK | PAWN;\n\t\t}\n\t}", "protected function changeStateCheck()\n {\n if (empty($this->boardNewMoves)) {\n throw new BoardException(Yii::t('app', 'No move detected.'));\n }\n // Make sure 1 move has been made.\n if (count($this->boardNewMoves) > 1) {\n throw new BoardException(Yii::t('app', 'Only one move per request allowed.'));\n }\n\n // Make sure proper character used.\n $allowedCharacter = $this->moveCharacterMap[($this->getTotalMoves() + 1) % 2];\n if (($moveCharacter = $this->getNewMoveCharacter()) != $allowedCharacter) {\n throw new BoardException(Yii::t('app', 'You have to use character \"{allowedCharacter}\" instead of \"{moveCharacter}\"', [\n 'allowedCharacter' => $allowedCharacter,\n 'moveCharacter' => $moveCharacter,\n ]));\n }\n\n // Make sure that character has been placed into the proper position (not overriding existing).\n if (in_array($this->boardArr[$this->getNewMovePosition()], $this->moveCharacterMap)) {\n throw new BoardException(Yii::t('app', 'You are not allowed to override existing moves.'));\n }\n }", "public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }", "function _checkGame($game, $team) {\n global $_SYS;\n\n $game = intval($game);\n $team = intval($team);\n\n /* fetch game from db */\n\n $query = 'SELECT g.away AS away,\n na.team AS away_team,\n na.nick AS away_nick,\n na.acro AS away_acro,\n ta.user AS away_hc,\n g.away_sub AS away_sub,\n ta.conference AS away_conference,\n ta.division AS away_division,\n g.home AS home,\n nh.team AS home_team,\n nh.nick AS home_nick,\n nh.acro AS home_acro,\n th.user AS home_hc,\n g.home_sub AS home_sub,\n th.conference AS home_conference,\n th.division AS home_division,\n g.site AS site,\n g.week AS week,\n g.season AS season,\n s.name AS season_name\n FROM '.$_SYS['table']['game'].' AS g\n LEFT JOIN '.$_SYS['table']['team'].' AS ta ON g.away = ta.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS na ON ta.team = na.id\n LEFT JOIN '.$_SYS['table']['team'].' AS th ON g.home = th.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS nh ON th.team = nh.id\n LEFT JOIN '.$_SYS['table']['season'].' AS s ON g.season = s.id\n WHERE g.id = '.$game;\n\n $result = $_SYS['dbh']->query($query) or die($_SYS['dbh']->error());\n\n /* check if game exists */\n\n if ($result->rows() == 0) {\n return $_SYS['html']->fehler('1', 'Game does not exist.');\n }\n\n /* check if game was already played */\n\n $row = $result->fetch_assoc();\n\n if ($row['site'] != 0) {\n return $_SYS['html']->fehler('2', 'Game was already played.');\n }\n\n /* allow if user is admin OR user is hc or sub of the team */\n\n if (!(($team == 0 && $_SYS['user']['admin'])\n || ($team == $row['away'] && ($_SYS['user']['id'] == $row['away_hc'] || $_SYS['user']['id'] == $row['away_sub']))\n || ($team == $row['home'] && ($_SYS['user']['id'] == $row['home_hc'] || $_SYS['user']['id'] == $row['home_sub'])))) {\n return $_SYS['html']->fehler('3', 'You cannot upload a log for this game.');\n }\n\n $this->_game = $row;\n\n return '';\n }", "public static function checkIfTheRoomIsNotFull($users){\n \tif(count($users) < ROOM_MAX_AMOUNT_OF_USERS)\n \t\treturn true;\n \treturn false; \n }", "public function resetBoard()\n\t{\n\t\t$this->board = array();\n\t\t\n\t\t// Not available positions in the square.\n\t\t$this->board[3][-3] = false;\n\t\t$this->board[3][-2] = false;\n\t\t$this->board[2][-3] = false;\n\t\t$this->board[2][-2] = false;\n\t\t\n\t\t$this->board[-2][-3] = false;\n\t\t$this->board[-2][-2] = false;\n\t\t$this->board[-3][-3] = false;\n\t\t$this->board[-3][-2] = false;\n\t\t\n\t\t$this->board[3][2] = false;\n\t\t$this->board[3][3] = false;\n\t\t$this->board[2][2] = false;\n\t\t$this->board[2][3] = false;\n\t\t\n\t\t$this->board[-2][2] = false;\n\t\t$this->board[-2][3] = false;\n\t\t$this->board[-3][2] = false;\n\t\t$this->board[-3][3] = false;\n\t\t\n\t\t// Fill the available positions.\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\tif(!isset($this->board[$i][$j]))\n\t\t\t\t{\n\t\t\t\t\tif($i == 0 && $j == 0) // Center position empty\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function checkForWinner($playerOne, $playerTwo){\n if(($playerOne == 1 && $playerTwo == 2) || ($playerOne == 2 && $playerTwo == 3 || ($playerOne == 3 && $playerTwo == 1))){\n $this->printResult($playerOne, $playerTwo, 1);\n return 1;\n }elseif(($playerOne == 1 && $playerTwo == 1) || ($playerOne == 2 && $playerTwo == 2) || ($playerOne == 3 && $playerTwo == 3)){\n $this->printResult($playerOne, $playerTwo, 2);\n return 2;\n }else{\n $this->printResult($playerOne, $playerTwo, 3);\n return 3;\n }\n}", "function setPiece($col){\n\t\t$gameId = getCurrentGameIdFromPlayerId();\n\t\tif(!$gameId['currentGameId']){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting currentGameId of player\");\n\t\t}\n\t\n\t\t$gameId = $gameId['currentGameId'];\n\t\t$game = getCurrentGame($gameId);\n\t\tif(!$game){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting current game of player\");\n\t\t}\n\t\t\n\t\t//check if player is on turn\n\t\tif($game['nextTurn'] != $_SESSION['playerId']){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"its not your turn\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\t$board = json_decode($game['board']);\n\t\tfor($i = -1;$i<count($board)-1;$i++){\n\t\t\tif($board[$i+1][$col]!=0){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif($i==-1){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"column is full\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\tif($game['player1']==$_SESSION['playerId']){\n\t\t\t$nextTurnPlayer = $game['player2'];\n\t\t\t$playerNumber = 1;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}else{\n\t\t\t$nextTurnPlayer = $game['player1'];\n\t\t\t$playerNumber = 2;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}\n\t\t\n\t\t//save updated board\n\t\t$my_db = mysqli_connect($GLOBALS['servername'],$GLOBALS['username'],$GLOBALS['password'],$GLOBALS['db_name']) or die(\"db connection konnte nicht hergestellt werden\");\n\t\t$updateGameQuery = \"UPDATE games SET board='\".json_encode($board).\"',nextTurn=\".$nextTurnPlayer.\" WHERE gameId=\".$game['gameId'];\n\t\t$result = $my_db->query($updateGameQuery);\n\t\tif(!$result){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error udpating game in database\");\n\t\t}\t\t\n\t\t\n\t\t$gameOver = checkWin($board,$i,$col,$playerNumber);\n\t\tif($gameOver){\n\t\t\t$gameOverQuery = \"UPDATE games SET gameOver=1,nextTurn=0,winner=\".$_SESSION['playerId'].\" WHERE gameId=\".$game['gameId'];\n\t\t\t$result = $my_db->query($gameOverQuery);\n\t\t\t\n\t\t\tif(!$result){\n\t\t\t\thttp_response_code(500);\n\t\t\t\tdie(\"error updating gameOver field\");\n\t\t\t}\n\t\t}\n\t}", "private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "function play($game) {\t\n\tif($game[\"gameOver\"] == -1) {\n\t\tif ($game[\"clicked\"] !== 9 )\n\t\t\tupdateBoard(); //print_r($game); \n\t\tdisplayBoard();\t\t\n\t\tupdateSession();\t\t\n\t} \n}", "private function findBigLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\t// Top\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[3][-1]->hasMarble &&\n\t\t\t\t$this->board[3][0]->hasMarble &&\n\t\t\t\t$this->board[3][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Left\n\t\t\t\tif(\t$this->board[2][-1]->hasMarble &&\n\t\t\t\t\t$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[0][-1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[1][-2]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -2);\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$moves[0][] = array('left', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t$moves[0][] = array('left', 3, 1);\n\t\t\t\t\t$moves[0][] = array('up', 0, -1);\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -2);\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$moves[0][] = array('left', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Right\n\t\t\t\tif(\t$this->board[2][1]->hasMarble &&\n\t\t\t\t\t$this->board[1][1]->hasMarble &&\n\t\t\t\t\t$this->board[0][1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[1][2]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 2);\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$moves[1][] = array('right', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t$moves[1][] = array('right', 3, -1);\n\t\t\t\t\t$moves[1][] = array('up', 0, 1);\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 2);\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$moves[1][] = array('right', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Down\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[-3][-1]->hasMarble &&\n\t\t\t\t$this->board[-3][0]->hasMarble &&\n\t\t\t\t$this->board[-3][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Left\n\t\t\t\tif(\t$this->board[-2][-1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[0][-1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-1][-2]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('right', -1, -2);\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$moves[2][] = array('left', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[2][] = array('up', -3, -1);\n\t\t\t\t\t$moves[2][] = array('left', -3, 1);\n\t\t\t\t\t$moves[2][] = array('down', 0, -1);\n\t\t\t\t\t$moves[2][] = array('up', -3, -1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('right', -1, -2);\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$moves[2][] = array('left', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Right\n\t\t\t\tif(\t$this->board[-2][1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t$this->board[0][1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-1][2]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('left', -1, 2);\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$moves[3][] = array('right', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[3][] = array('up', -3, 1);\n\t\t\t\t\t$moves[3][] = array('right', -3, -1);\n\t\t\t\t\t$moves[3][] = array('down', 0, 1);\n\t\t\t\t\t$moves[3][] = array('up', -3, 1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('left', -1, 2);\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$moves[3][] = array('right', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Left\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][-3]->hasMarble &&\n\t\t\t\t$this->board[0][-3]->hasMarble &&\n\t\t\t\t$this->board[-1][-3]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Up\n\t\t\t\tif(\t$this->board[1][-2]->hasMarble &&\n\t\t\t\t\t$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[2][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('up', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[4][] = array('right', 1, -3);\n\t\t\t\t\t$moves[4][] = array('up', -1, -3);\n\t\t\t\t\t$moves[4][] = array('left', 1, 0);\n\t\t\t\t\t$moves[4][] = array('right', 1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('up', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Down\n\t\t\t\tif(\t$this->board[-1][-2]->hasMarble &&\n\t\t\t\t\t$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-2][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('up', -2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('down', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[5][] = array('right', -1, -3);\n\t\t\t\t\t$moves[5][] = array('down', 1, -3);\n\t\t\t\t\t$moves[5][] = array('left', 1, 0);\n\t\t\t\t\t$moves[5][] = array('right', -1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('up', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('down', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Right\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][3]->hasMarble &&\n\t\t\t\t$this->board[0][3]->hasMarble &&\n\t\t\t\t$this->board[-1][3]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Up\n\t\t\t\tif(\t$this->board[1][2]->hasMarble &&\n\t\t\t\t\t$this->board[1][1]->hasMarble &&\n\t\t\t\t\t$this->board[1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[2][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[6][] = array('left', 1, 3);\n\t\t\t\t\t$moves[6][] = array('up', -1, 3);\n\t\t\t\t\t$moves[6][] = array('right', 1, 0);\n\t\t\t\t\t$moves[6][] = array('left', 1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Down\n\t\t\t\tif(\t$this->board[-1][2]->hasMarble &&\n\t\t\t\t\t$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-2][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('down', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[7][] = array('left', -1, 3);\n\t\t\t\t\t$moves[7][] = array('down', 1, 3);\n\t\t\t\t\t$moves[7][] = array('right', -1, 0);\n\t\t\t\t\t$moves[7][] = array('left', -1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('down', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\treturn $moves;\n\t}", "public function isDraw()\n {\n return !$this->hasAvailableMoves() &&\n !$this->isWinner('X') &&\n !$this->isWinner('O');\n }", "public function checkForWin() \n\t{\n\n\t\t$score = array_intersect($this->phrase->selected, $this->phrase->getLetters());\n\n\t\tif (count($score) == count($this->phrase->getLetters())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function updateBoard() {\n\tglobal $game, $message;\n\t$cellClicked = $game['clicked']; //identify which button was submitted \t\t\t\t\t\n\tif ($cellClicked !== 9 ) {\n\t\t$curPos = $cellClicked; // get the actual button clicked. 0 to 8 correspond to respective cell\n\t\t$game[\"board\"][$curPos] = $game[\"player\"]; // set our game's data with player mark\n\t\t$game[\"player\"] = ($game[\"player\"]+1)%2; // switch the player turn\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t} else {\n\t\t$game[\"player\"] = 0;\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t}\n\t$message = \"Player \".substr($game[\"playToken\"],$game[\"player\"],1).\" go!\";\n}", "public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }", "function canReach($hops)\n{\n $left = 1;\n\n for ($i = 0 ; $i < count($hops)-1; $i++) {\n $left = max($left-1, $hops[$i]);\n if ($left === 0) {\n return false;\n }\n }\n\n return true;\n}", "public function GenerateLegalBishopMoves($chesspiece, $x, $y){\n\t\t//examine top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine top left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n \n return true;\n\t}", "public function GenerateLegalKnightMoves($chesspiece, $x, $y){\n\t\t$from = array($x, $y);\n\t\t\n\t\t$to1 = array($x+1, $y+2);\n\t\t$to2 = array($x-1, $y+2);\n\t\t$to3 = array($x+1, $y-2);\n\t\t$to4 = array($x-1, $y-2);\n\t\t$to5 = array($x+2, $y+1);\n\t\t$to6 = array($x-2, $y+1);\n\t\t$to7 = array($x+2, $y-1);\n\t\t$to8 = array($x-2, $y-1);\n\t\t\n\t\t$this->AddChessSquare($chesspiece, $from, $to1);\n $this->AddChessSquare($chesspiece, $from, $to2);\n $this->AddChessSquare($chesspiece, $from, $to3);\n $this->AddChessSquare($chesspiece, $from, $to4);\n $this->AddChessSquare($chesspiece, $from, $to5);\n $this->AddChessSquare($chesspiece, $from, $to6);\n $this->AddChessSquare($chesspiece, $from, $to7);\n $this->AddChessSquare($chesspiece, $from, $to8);\n \n return true;\n\t}", "public function emptyBoard()\n {\n $this->board = array_fill(0, $this->boardSize, array_fill(0, $this->boardSize, ''));\n }", "function isCellEmpty($xPos, $yPos){\r\n\t\t\tif($this->board[$xPos][$yPos] != 1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "public function isKingSafeIfPieceMoved($firstsquare,$lastsquare){\n\t\t$firstsquare_piececode = $this->chessposition[$firstsquare[0]][$firstsquare[1]];\n\t\t$lastsquare_piececode = $this->chessposition[$lastsquare[0]][$lastsquare[1]];\n\t\t$this->chessposition[$firstsquare[0]][$firstsquare[1]] = 0;\n\t\t$this->chessposition[$lastsquare[0]][$lastsquare[1]] = $firstsquare_piececode;\n\t\tif (abs($firstsquare_piececode) == 6)\n\t\t\t$result = $this->IsKingAllowedOnSquare($lastsquare[0], $lastsquare[1]);\n\t\telse\n\t\t\t$result = $this->IsKingAllowedOnSquare($this->kingindex[0], $this->kingindex[1]);\n\t\t$this->chessposition[$firstsquare[0]][$firstsquare[1]] = $firstsquare_piececode;\n\t\t$this->chessposition[$lastsquare[0]][$lastsquare[1]] = $lastsquare_piececode;\n\t\treturn $result;\n\t}", "function CheckTurn($n)\r\n {\r\n $turn_1=CheckSquare(5 * $n * $n + 4);\r\n $turn_2=CheckSquare(5 * $n * $n - 4);\r\n //check if any of the value was already \r\n if($turn_1||$turn_2)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }", "private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function getGame($username)\n\t{\n\t\t$query = \"SELECT * \n\t\t\t\t FROM tttgame \n\t\t\t\t WHERE playerX = '$username' \n\t\t\t\t OR playerO = '$username';\";\n\t\t$result = $this -> queryDB($query);\n\t\t\n\t\t$game = mysql_fetch_row($result);\n\t\t\n\t\tif ($game != false && count($game) == 7)\n\t\t{\n\t\t\t$this -> playerX = $game[0];\n\t\t\t$this -> playerO = $game[1];\n\t\t\t$this -> moves = $game[2];\n\t\t\t$this -> gametype = $game[3];\n\t\t\t$this -> score = $game[4];\n\t\t\t$this -> activePlayer = $game[5];\n\t\t\t$this -> notice = $game[6];\n\t\t\t$this -> populated = true;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function isWinner() {\n\t\t$winner = null;\n\t\t$rule = $this->getRule(); // note: rule is required for matches\n\t\tif($rule->rule_type == Rule::TYPE_MATCHPLAY) {\n\t\t\t// Get opponent scorecard\n\t\t\tif($opponent = $this->getOpponent()) {\n\t\t\t\tif($opponent_scorecard = $opponent->getScorecard()) {\n\t\t\t\t\t$this_total = $this->points_total($rule->handicap);\n\t\t\t\t\t$opponent_total = $opponent_scorecard->points_total($rule->handicap);\n\t\t\t\t\t//Yii::trace('tie:'.$this->tie_break.'vs.'.$opponent_scorecard->tie_break, 'Scorecard::isWinner');\n\t\t\t\t\t$winner = ($this_total > $opponent_total) ?\n\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t($opponent_total > $this_total ?\n\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t($this->tie_break > $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t\t\t($this->tie_break < $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t\t\tnull)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Yii::trace('return:'.($winner ? 't' : 'f'), 'Scorecard::isWinner');\n\t\treturn $winner;\n\t}", "public function GenerateLegalRookMoves($chesspiece, $x, $y){\n\t //examine forward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n \tbreak; //stop examining this file.\n }\n }\n\n //examine backward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this file.\n }\n }\n\n //examine right-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this rank.\n }\n }\n\n //examine left-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this rank.\n }\n }\n \n return true;\n\t}", "private function isKingInMate(int $color): bool\n {\n $board = $this->getBoard();\n $flattenBoard = array_merge(...$this->getBoard());\n $coords = $this->getKingCoords($color);\n\n for ($row = 0; $row <= 2; ++$row) {\n for ($col = 0; $col <= 2; ++$col) {\n $x = $coords[0] + (1 - $row);\n $y = $coords[1] + (1 - $col);\n if (\n ($x > 7 || $x < 0) ||\n ($y > 7 || $y < 0) ||\n ($y === $coords[1] && $x === $coords[0]) ||\n !$this->isReachable($coords, [$x, $y])\n ) {\n continue;\n }\n\n $this->board[$y][$x] = $this->board[$coords[1]][$coords[0]];\n $this->board[$coords[1]][$coords[0]] = null;\n if (!$this->isKingInCheck($color)) {\n $this->board = $board;\n return false;\n }\n }\n }\n $this->board = $board;\n\n foreach ($flattenBoard as $piece) {\n if (!($piece instanceof Piece) || $piece instanceof King) {\n continue;\n }\n if ($piece->getColor() !== $color) {\n continue;\n }\n\n $pieceCoords = $piece->getCoords();\n for ($y = 0; $y < 8; ++$y) {\n for ($x = 0; $x < 8; ++$x) {\n $this->board = $board;\n $move = $piece->checkMove($x, $y, $board, $this->getMoveNumber());\n if (!$move || !$this->isReachable($pieceCoords, [$x, $y])) {\n continue;\n }\n $this->board[$y][$x] = $this->board[$pieceCoords[1]][$pieceCoords[0]];\n $this->board[$pieceCoords[1]][$pieceCoords[0]] = null;\n if (!$this->isKingInCheck($color)) {\n $this->board = $board;\n return false;\n }\n }\n }\n }\n return true;\n }", "protected function computeAllowed() {\n\t\tif($this->tees) {\n\t\t\t$this->exact_handicap = $this->player->handicap;\n\t\t\t$a = $this->player->allowed($this->tees);\n\t\t\t$this->handicap = array_sum($a); // playing handicap\n\t\t\t$this->save();\n\t\t\tif($this->hasDetails()) {\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($this->getScoreWithHoles()->each() as $score) {\n\t\t\t\t\t$score->allowed = $a[$i++];\n\t\t\t\t\t$score->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChecker = [4, 3];\n $game->gameState->possibleGoChoices = [array(\"row\"=>2, \"col\"=>5), array(\"row\"=>4, \"col\"=>3)];\n $game->gameState->boardState = $this->getMultipleBeat();\n\n $gm->userMove(2, 5, 1, $game );\n $gm->userMove(0, 3, 1, $game );\n $gm->userMove(3, 0, 1, $game );\n $result = $gm->userMove(7, 4, 1, $game );\n\n\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][3]);//initial\n $this->assertEquals(0, $result[\"gameState\"]->boardState[3][4]);//beaten\n $this->assertEquals(-1, $result[\"gameState\"]->boardState[1][6]);//still there due to turkish turn rule\n $this->assertEquals(0, $result[\"gameState\"]->boardState[1][4]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[2][1]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][1]);//beaten\n $this->assertEquals(2, $result[\"gameState\"]->boardState[7][4]);//end position of the hero checker\n\n }", "public abstract function hasWaitingLobby(): bool;", "private function managePlayersPresence()\n {\n if($this->isNewRecord) {\n return;\n }\n\n if( $player = Player::findIdentity($this->join_player) ){\n $presence = 1;\n }elseif( $player = Player::findIdentity($this->reject_player) ){\n $presence = 0;\n } else {\n return;\n }\n\n $sql = \"INSERT INTO `game_has_player` (`game_id`, `player_id`, `presence`)\n VALUES ('{$this->id}', '{$player->id}', '{$presence}')\n ON DUPLICATE KEY UPDATE `presence` = '{$presence}'\";\n\n return Yii::$app->db->createCommand($sql)->execute();\n }", "function isDraw($winningspots, $spots) {\n\t\t$impossibleStates = 0;\n\t\tforeach($winningspots as $winstate) {\n\t\t\t$countX = 0;\n\t\t\t$countO = 0;\n\t\t\tforeach ($winstate as $wincell) {\n\t\t\t\tif($spots[$wincell] == \"x\") {\n\t\t\t\t\t$countX++;\n\t\t\t\t} else if($spots[$wincell] == \"o\") {\n\t\t\t\t\t$countO++;\n\t\t\t\t}\n\t\t\t\tif ($countX > 0 && $countO > 0) {\n\t\t\t\t\t$impossibleStates++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ($impossibleStates == count($winningspots));\n\t}", "public function GenerateLegalMoves($chessposition){\n\t\t$this->SetAsPosition($chessposition);\n\t\t$this->ResetLegalMovesArr();\n\t\n\t\t//loop through the entire board\n\t\t//possible candidates are (x,y)\n\t\tfor ($x=0; $x<8; $x++){\n for ($y=0; $y<8; $y++){\n $chesspiece = $this->chessposition[$x][$y];\n \n //if nothing is there\n if ($chesspiece == 0){\n continue;\n }\n \n if (($this->IsWhiteToMove && ($chesspiece < 0)) ||\n \t\t(!$this->IsWhiteToMove && ($chesspiece > 0))){\n \t\tcontinue;\n \t\t}\n \n //if chesspiece is a pawn\n if (($chesspiece == 1) || ($chesspiece == -1)){ // chesspiece = pawn\n $this->GenerateLegalPawnMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n \n //if $chesspiece is a knight\n if (($chesspiece == 2) || ($chesspiece == -2)){\n $this->GenerateLegalKnightMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }//end of examining legal moves for knight\n \n //if $chesspiece is a bishop\n if (($chesspiece == 3) || ($chesspiece == -3)){ //$chesspiece is a bishop\n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for bishop\n \n //if $chesspiece is a rook\n if (($chesspiece == 4) || ($chesspiece == -4)){\n $this->GenerateLegalRookMoves($chesspiece, $x, $y); \n \n continue; //move on to the next iteration\n }//end of generating legal moves for the rook\n \n //if $chesspiece is a queen\n if (($chesspiece == 5) || ($chesspiece == -5)){\n \n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n $this->GenerateLegalRookMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for the queen\n \n //if chesspiece is a king\n if (($chesspiece == 6) || ($chesspiece == -6)){\n $this->GenerateLegalKingMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n }\n }\n\t}", "private function findRectangleMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\t// Top Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[3][-1]->hasMarble &&\n\t\t\t\t$this->board[3][0]->hasMarble &&\n\t\t\t\t$this->board[3][1]->hasMarble &&\n\t\t\t\t$this->board[2][-1]->hasMarble &&\n\t\t\t\t$this->board[2][0]->hasMarble &&\n\t\t\t\t$this->board[2][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[1][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t$moves[0][] = array('down', 3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('down', 3, 1);\n\t\t\t\t\t\t$moves[0][] = array('up', 0, 1);\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -1);\n\t\t\t\t\t\t$moves[0][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('down', 2, 1);\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -1);\n\t\t\t\t\t\t$moves[0][] = array('up', 0, 1);\n\t\t\t\t\t\t$moves[0][] = array('down', 3, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[1][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t$moves[1][] = array('down', 3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('down', 3, -1);\n\t\t\t\t\t\t$moves[1][] = array('up', 0, -1);\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 1);\n\t\t\t\t\t\t$moves[1][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('down', 2, -1);\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 1);\n\t\t\t\t\t\t$moves[1][] = array('up', 0, -1);\n\t\t\t\t\t\t$moves[1][] = array('down', 3, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble && !$this->board[1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[2][] = array('down', 3, -1);\n\t\t\t\t\t$moves[2][] = array('left', 1, 0);\n\t\t\t\t\t$moves[2][] = array('left', 3, 1);\n\t\t\t\t\t$moves[2][] = array('left', 2, 1);\n\t\t\t\t\t$moves[2][] = array('down', 3, -1);\n\t\t\t\t\t$moves[2][] = array('right', 1, -2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble && $this->board[1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[3][] = array('down', 3, -1);\n\t\t\t\t\t$moves[3][] = array('right', 1, -2);\n\t\t\t\t\t$moves[3][] = array('left', 3, 1);\n\t\t\t\t\t$moves[3][] = array('left', 2, 1);\n\t\t\t\t\t$moves[3][] = array('down', 3, -1);\n\t\t\t\t\t$moves[3][] = array('left', 1, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble && !$this->board[1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[4][] = array('down', 3, 1);\n\t\t\t\t\t$moves[4][] = array('right', 1, 0);\n\t\t\t\t\t$moves[4][] = array('right', 3, -1);\n\t\t\t\t\t$moves[4][] = array('right', 2, -1);\n\t\t\t\t\t$moves[4][] = array('down', 3, 1);\n\t\t\t\t\t$moves[4][] = array('left', 1, 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble && $this->board[1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[5][] = array('down', 3, 1);\n\t\t\t\t\t$moves[5][] = array('left', 1, 2);\n\t\t\t\t\t$moves[5][] = array('right', 3, -1);\n\t\t\t\t\t$moves[5][] = array('right', 2, -1);\n\t\t\t\t\t$moves[5][] = array('down', 3, 1);\n\t\t\t\t\t$moves[5][] = array('right', 1, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Down Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[-3][-1]->hasMarble &&\n\t\t\t\t$this->board[-3][0]->hasMarble &&\n\t\t\t\t$this->board[-3][1]->hasMarble &&\n\t\t\t\t$this->board[-2][-1]->hasMarble &&\n\t\t\t\t$this->board[-2][0]->hasMarble &&\n\t\t\t\t$this->board[-2][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[-1][0]->hasMarble && !$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[6][] = array('up', -3, -1);\n\t\t\t\t\t$moves[6][] = array('up', -3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', -3, 1);\n\t\t\t\t\t\t$moves[6][] = array('down', 0, 1);\n\t\t\t\t\t\t$moves[6][] = array('right', -1, -1);\n\t\t\t\t\t\t$moves[6][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', -2, 1);\n\t\t\t\t\t\t$moves[6][] = array('right', -1, -1);\n\t\t\t\t\t\t$moves[6][] = array('down', 0, 1);\n\t\t\t\t\t\t$moves[6][] = array('up', -3, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[7][] = array('up', -3, 1);\n\t\t\t\t\t$moves[7][] = array('up', -3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -3, -1);\n\t\t\t\t\t\t$moves[7][] = array('down', 0, -1);\n\t\t\t\t\t\t$moves[7][] = array('left', -1, 1);\n\t\t\t\t\t\t$moves[7][] = array('up', -2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, -1);\n\t\t\t\t\t\t$moves[7][] = array('left', -1, 1);\n\t\t\t\t\t\t$moves[7][] = array('down', 0, -1);\n\t\t\t\t\t\t$moves[7][] = array('up', -3, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[8] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[8][] = array('up', -3, -1);\n\t\t\t\t\t$moves[8][] = array('left', -1, 0);\n\t\t\t\t\t$moves[8][] = array('left', -3, 1);\n\t\t\t\t\t$moves[8][] = array('left', -2, 1);\n\t\t\t\t\t$moves[8][] = array('up', -3, -1);\n\t\t\t\t\t$moves[8][] = array('right', -1, -2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[9] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[9][] = array('up', -3, -1);\n\t\t\t\t\t$moves[9][] = array('right', -1, -2);\n\t\t\t\t\t$moves[9][] = array('left', -3, 1);\n\t\t\t\t\t$moves[9][] = array('left', -2, 1);\n\t\t\t\t\t$moves[9][] = array('up', -3, -1);\n\t\t\t\t\t$moves[9][] = array('left', -1, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[10] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[10][] = array('up', -3, 1);\n\t\t\t\t\t$moves[10][] = array('right', -1, 0);\n\t\t\t\t\t$moves[10][] = array('right', -3, -1);\n\t\t\t\t\t$moves[10][] = array('right', -2, -1);\n\t\t\t\t\t$moves[10][] = array('up', -3, 1);\n\t\t\t\t\t$moves[10][] = array('left', -1, 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[11] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[11][] = array('up', -3, 1);\n\t\t\t\t\t$moves[11][] = array('left', -1, 2);\n\t\t\t\t\t$moves[11][] = array('right', -3, -1);\n\t\t\t\t\t$moves[11][] = array('right', -2, -1);\n\t\t\t\t\t$moves[11][] = array('up', -3, 1);\n\t\t\t\t\t$moves[11][] = array('right', -1, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Left Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][-3]->hasMarble &&\n\t\t\t\t$this->board[1][-2]->hasMarble &&\n\t\t\t\t$this->board[0][-3]->hasMarble &&\n\t\t\t\t$this->board[0][-2]->hasMarble &&\n\t\t\t\t$this->board[-1][-3]->hasMarble &&\n\t\t\t\t$this->board[-1][-2]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[1][-1]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][-1]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[12] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[12][] = array('right', 0, -3);\n\t\t\t\t\t$moves[12][] = array('right', -1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -3);\n\t\t\t\t\t\t$moves[12][] = array('left', 1, 0);\n\t\t\t\t\t\t$moves[12][] = array('up', -1, -1);\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -2);\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$moves[12][] = array('right', 1, -2);\n\t\t\t\t\t\t$moves[12][] = array('up', -1, -1);\n\t\t\t\t\t\t$moves[12][] = array('left', 1, 0);\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][-1]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][-1]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[13] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[13][] = array('right', 0, -3);\n\t\t\t\t\t$moves[13][] = array('right', 1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -3);\n\t\t\t\t\t\t$moves[13][] = array('left', -1, 0);\n\t\t\t\t\t\t$moves[13][] = array('down', 1, -1);\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -2);\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$moves[13][] = array('right', -1, -2);\n\t\t\t\t\t\t$moves[13][] = array('down', 1, -1);\n\t\t\t\t\t\t$moves[13][] = array('left', -1, 0);\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble && !$this->board[2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[14] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[14][] = array('right', 1, -3);\n\t\t\t\t\t$moves[14][] = array('up', 0, -1);\n\t\t\t\t\t$moves[14][] = array('up', -1, -3);\n\t\t\t\t\t$moves[14][] = array('up', -1, -2);\n\t\t\t\t\t$moves[14][] = array('right', 1, -3);\n\t\t\t\t\t$moves[14][] = array('down', 2, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble && $this->board[2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[15] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[15][] = array('right', 1, -3);\n\t\t\t\t\t$moves[15][] = array('down', 2, -1);\n\t\t\t\t\t$moves[15][] = array('up', -1, -3);\n\t\t\t\t\t$moves[15][] = array('up', -1, -2);\n\t\t\t\t\t$moves[15][] = array('right', 1, -3);\n\t\t\t\t\t$moves[15][] = array('up', 0, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble && !$this->board[-2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[16] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[16][] = array('right', -1, -3);\n\t\t\t\t\t$moves[16][] = array('down', 0, -1);\n\t\t\t\t\t$moves[16][] = array('down', 1, -3);\n\t\t\t\t\t$moves[16][] = array('down', 1, -2);\n\t\t\t\t\t$moves[16][] = array('right', -1, -3);\n\t\t\t\t\t$moves[16][] = array('up', -2, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble && $this->board[-2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[17] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[17][] = array('right', -1, -3);\n\t\t\t\t\t$moves[17][] = array('up', -2, -1);\n\t\t\t\t\t$moves[17][] = array('down', 1, -3);\n\t\t\t\t\t$moves[17][] = array('down', 1, -2);\n\t\t\t\t\t$moves[17][] = array('right', -1, -3);\n\t\t\t\t\t$moves[17][] = array('down', 0, -1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Right Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][3]->hasMarble &&\n\t\t\t\t$this->board[1][2]->hasMarble &&\n\t\t\t\t$this->board[0][3]->hasMarble &&\n\t\t\t\t$this->board[0][2]->hasMarble &&\n\t\t\t\t$this->board[-1][3]->hasMarble &&\n\t\t\t\t$this->board[-1][2]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t($this->board[1][1]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][1]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[18] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[18][] = array('left', 0, 3);\n\t\t\t\t\t$moves[18][] = array('left', -1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 3);\n\t\t\t\t\t\t$moves[18][] = array('right', 1, 0);\n\t\t\t\t\t\t$moves[18][] = array('up', -1, 1);\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 2);\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$moves[18][] = array('left', 1, 2);\n\t\t\t\t\t\t$moves[18][] = array('up', -1, 1);\n\t\t\t\t\t\t$moves[18][] = array('right', 1, 0);\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][1]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][1]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[19] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[19][] = array('left', 0, 3);\n\t\t\t\t\t$moves[19][] = array('left', 1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 3);\n\t\t\t\t\t\t$moves[19][] = array('right', -1, 0);\n\t\t\t\t\t\t$moves[19][] = array('down', 1, 1);\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 2);\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$moves[19][] = array('left', -1, 2);\n\t\t\t\t\t\t$moves[19][] = array('down', 1, 1);\n\t\t\t\t\t\t$moves[19][] = array('right', -1, 0);\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble && !$this->board[2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[20] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[20][] = array('left', 1, 3);\n\t\t\t\t\t$moves[20][] = array('up', 0, 1);\n\t\t\t\t\t$moves[20][] = array('up', -1, 3);\n\t\t\t\t\t$moves[20][] = array('up', -1, 2);\n\t\t\t\t\t$moves[20][] = array('left', 1, 3);\n\t\t\t\t\t$moves[20][] = array('down', 2, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble && $this->board[2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[21] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[21][] = array('left', 1, 3);\n\t\t\t\t\t$moves[21][] = array('down', 2, 1);\n\t\t\t\t\t$moves[21][] = array('up', -1, 3);\n\t\t\t\t\t$moves[21][] = array('up', -1, 2);\n\t\t\t\t\t$moves[21][] = array('left', 1, 3);\n\t\t\t\t\t$moves[21][] = array('up', 0, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[22] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[22][] = array('left', -1, 3);\n\t\t\t\t\t$moves[22][] = array('down', 0, 1);\n\t\t\t\t\t$moves[22][] = array('down', 1, 3);\n\t\t\t\t\t$moves[22][] = array('down', 1, 2);\n\t\t\t\t\t$moves[22][] = array('left', -1, 3);\n\t\t\t\t\t$moves[22][] = array('up', -2, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[23] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[23][] = array('left', -1, 3);\n\t\t\t\t\t$moves[23][] = array('up', -2, 1);\n\t\t\t\t\t$moves[23][] = array('down', 1, 3);\n\t\t\t\t\t$moves[23][] = array('down', 1, 2);\n\t\t\t\t\t$moves[23][] = array('left', -1, 3);\n\t\t\t\t\t$moves[23][] = array('down', 0, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\treturn $moves;\n\t}", "private function enablesQwirkle(Move $move, Board $board) {\n foreach ($move->lines($board) as $line) {\n if ($line->length() === count(Color::colors()) - 1) {\n $missingPiece = $this->missingPieces($line)[0];\n if ($this->notAccountedFor($missingPiece, $board)) {\n return true;\n }\n }\n }\n return false;\n }", "public function isGameOver(): bool\n {\n return $this->getGameState() === SELF::STATE_GAMEOVER;\n }", "function checkForSpecialAchievements($player_id, $wonder_included) {\n $achievements_to_test = $wonder_included ? array(105, 106, 107, 108, 109) : array(105, 106, 108, 109);\n $end_of_game = false;\n \n \n foreach ($achievements_to_test as $achievement_id) {\n $achievement = self::getCardInfo($achievement_id);\n if ($achievement['owner'] != 0) { // Somebody has already claimed that achievement\n // So it's not claimable anymore\n continue;\n }\n \n switch ($achievement_id) {\n case 105: // Empire: three or more icons of all six types\n $eligible = true;\n $ressource_counts = self::getPlayerRessourceCounts($player_id);\n foreach ($ressource_counts as $icon => $count) {\n if ($count < 3) { // There are less than 3 icons\n $eligible = false;\n break;\n }\n }\n break;\n case 106: // Monument: tuck 6 cards or score 6 cards\n $flags = self::getFlagsForMonument($player_id);\n $eligible = $flags['number_of_tucked_cards'] >= 6 || $flags['number_of_scored_cards'] >= 6;\n break;\n case 107: // Wonder: 5 colors, each being splayed right or up\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) < 2) { // This color is missing, unsplayed or splayed left\n $eligible = false;\n };\n }\n break;\n case 108: // World: 12 or more visible clocks (icon 6) on the board \n $eligible = self::getPlayerSingleRessourceCount($player_id, 6) >= 12;\n break;\n case 109: // Universe: Five top cards, each being of value 8 or more\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card === null || $top_card['age'] < 8) { // This color is missing or its top card has value less than 8\n $eligible = false;\n }\n }\n break;\n default:\n break;\n }\n \n if ($eligible) { // The player meet the conditions to achieve\n try {\n self::transferCardFromTo($achievement, $player_id, 'achievements');\n }\n catch (EndOfGame $e) { // End of game has been detected\n self::trace('EOG bubbled but suspended from self::checkForSpecialAchievements');\n $end_of_game = true;\n continue; // But the other achievements must be checked as well before ending\n }\n }\n }\n // All special achievements have been checked\n if ($end_of_game) { // End of game has been detected\n self::trace('EOG bubbled from self::checkForSpecialAchievements');\n throw $e; // Re-throw the flag\n }\n }", "public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "public function checkNegativeDiagonalWin($userMove){\r\n $diagonalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = $this->lastRowInsert-1 ,$col = $userMove; $row > -1 && $col < Board::COLUMNS ; $row--, $col++ ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n for($row = $this->lastRowInsert ,$col = $userMove-1; $row < Board::ROWS && $col > -1 ; $row++, $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n return $diagonalCounter >= self::WIN ? true : false;\r\n }", "public function GenerateLegalKingMoves($chesspiece, $x, $y){\n\t\n\t\t$from = array($x, $y);\n\t\n\t\t/**\n\t\t * Determine the legality of the usual king moves\n\t\t */\n\t\tif ($this->IsKingAllowedOnSquare($x+1, $y)){\n\t\t\t$to = array($x+1, $y);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x+1, $y+1)){\n\t\t\t$to = array($x+1, $y+1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x+1, $y-1)){\n\t\t\t$to = array($x+1, $y-1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\n\t\tif ($this->IsKingAllowedOnSquare($x-1, $y)){\n\t\t\t$to = array($x-1, $y);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x-1, $y+1)){\n\t\t\t$to = array($x-1, $y+1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x-1, $y-1)){\n\t\t\t$to = array($x-1, $y-1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x, $y-1)){\n\t\t\t$to = array($x, $y-1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x, $y+1)){\n\t\t\t$to = array($x, $y+1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\t/**\n\t\t * Determine whether the king can castle kingside\n\t\t */\n\t\tif ($chesspiece > 0){\n\t\t if (!$this->IsWhiteKingMoved && !$this->IsWhiteKRMoved){\n if ($this->IsKingAllowedOnSquare(5, 0) && \n $this->IsKingAllowedOnSquare(6, 0) &&\n $this->chessposition[5][0] == 0 &&\n $this->chessposition[6][0] == 0){\n // note: this function never got called.\n // therefore, the problem must be in the IsKingAllowedOnSquare function\n // not sure what the problem is exactly thoughf\n $to = array(6, 0);\n $this->AddChessSquare($chesspiece, $from, $to);\n }\n }\n \n if (!$this->IsWhiteKingMoved && !$this->IsWhiteQRMoved){\n \tif ($this->IsKingAllowedOnSquare(2, 0) && \n \t\t\t$this->IsKingAllowedOnSquare(3, 0) &&\n \t\t\t$this->chessposition[3][0] == 0 && \n \t\t\t$this->chessposition[2][0] == 0 &&\n \t\t\t$this->chessposition[1][0] == 0){\n \t\t\n \t\t$to = array(2, 0);\n \t\t$this->AddChessSquare($chesspiece, $from, $to);\n \t}\n }\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){\n\t\t\tif (!$this->IsBlackKingMoved && !$this->IsBlackKRMoved){\n if ($this->IsKingAllowedOnSquare(5, 7) && \n $this->IsKingAllowedOnSquare(6, 7) && \n $this->chessposition[5][7] == 0 &&\n $this->chessposition[6][7] == 0){\n \n $to = array(6, 7);\n $this->AddChessSquare($chesspiece, $from, $to);\n }\n }\n \n\t\t\tif (!$this->IsBlackKingMoved && !$this->IsBlackQRMoved){\n \tif ($this->IsKingAllowedOnSquare(2, 7) && \n \t\t\t$this->IsKingAllowedOnSquare(3, 7) &&\n \t\t\t$this->chessposition[1][7] == 0 &&\n \t\t\t$this->chessposition[2][7] == 0 &&\n \t\t\t$this->chessposition[3][7] == 0){\n \t\t\n \t\t$to = array(2, 7);\n \t\t$this->AddChessSquare($chesspiece, $from, $to);\n \t}\n }\n\t\t}\n \n return true;\n\t}", "public function rejectIfInvalidRowAndColumn(Board $board, User $player, $row, $col);", "function LUTB_BoardIndex()\n{\n\tglobal $context, $modSettings;\n\tBoardIndex();\n\t$context['users_online'] = !empty($context['users_online']) && allowedTo('who_view') && !empty($modSettings['who_enabled']);\n}", "function hasWon($winningspots, $spots, $size) {\n\t\tforeach($winningspots as $winspot) {\n\t\t\t$countX = 0;\n\t\t\t$countO = 0;\n\t\t\tforeach($winspot as $ws) {\n\t\t\t\tif($spots[$ws] == \"x\") {\n\t\t\t\t\t$countX++;\n\t\t\t\t} elseif($spots[$ws] == \"o\") {\n\t\t\t\t\t$countO++;\n\t\t\t\t}\n\t\t\t\tif ($countX > 0 && $countO > 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else if ($countX == $size || $countO == $size) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function testRegisterMoveOnBoard()\n {\n $this->_board[0][8] = \"X\";\n $this->assertNotEmpty($this->_board[0][8]);\n }", "public function play(int $y, int $x, string $playerUnit = 'X') : bool\n {\n if ($this->checkIfEmpty($this->board, $y, $x)) {\n $this->board[$y][$x] = $playerUnit;\n return true;\n }\n $this->setMessage(\"Position is full.\");\n return false;\n }", "public function winRound() {\n\n\t\t$this->points++;\n\n\t\t$this->output($this->name.' has won this round');\n\t}", "public function test4BallsInARow($player)\n {\n $match = $this->getNewMatch();\n\n for ($i = 0 ; $i <4 ; $i++) {\n $match->score($player);\n }\n\n $this->assertEquals(1, $match->getWonGame($player));\n }" ]
[ "0.7175621", "0.7150335", "0.7149885", "0.71423006", "0.70996666", "0.70236486", "0.6929972", "0.6881545", "0.68630135", "0.680688", "0.67174953", "0.6688703", "0.66729945", "0.66495216", "0.66465324", "0.66456854", "0.6506291", "0.647298", "0.6469579", "0.6425344", "0.6404466", "0.6375068", "0.6355418", "0.6348376", "0.63364357", "0.63252866", "0.63193", "0.62412745", "0.62330633", "0.6230287", "0.62006474", "0.6190333", "0.61795694", "0.61665475", "0.6157823", "0.61081696", "0.60413426", "0.60398096", "0.60172296", "0.601327", "0.59722483", "0.5972106", "0.5955277", "0.59452325", "0.59122705", "0.5909342", "0.5897576", "0.5856705", "0.585066", "0.5835202", "0.57904035", "0.57679874", "0.5725447", "0.5722937", "0.5717923", "0.5700471", "0.569471", "0.5692382", "0.5677857", "0.56749797", "0.5663452", "0.5653265", "0.56476355", "0.5637025", "0.56286776", "0.5624782", "0.5607869", "0.56015134", "0.55889225", "0.558568", "0.55761987", "0.55752015", "0.5558459", "0.55559593", "0.5537302", "0.5525484", "0.5522641", "0.549537", "0.547741", "0.5474405", "0.54743403", "0.54667884", "0.5453856", "0.545171", "0.5444453", "0.543536", "0.5412974", "0.54041946", "0.5401319", "0.5399699", "0.537329", "0.5372097", "0.5370249", "0.53616494", "0.53519946", "0.5348893", "0.53303796", "0.5322336", "0.53079957", "0.5304694" ]
0.5896913
47
/ Check Options to Win Main function that call to all function that check if a player win In case of a winnig function Print winning message and asked if you want to have another game
protected function winCheck($userMove){ // Check if we have reached the minimum steps to have a win if($this->totalMoves < Board::COLUMNS){ return false; } //check vertical Horizontal Positive Diagonal Negative Diagona win if(($this->checkVerticalWin($userMove)) || ($this->checkHorizontalWin($userMove)) || ($this->checkPositiveDiagonalWin($userMove)) || ($this->checkNegativeDiagonalWin($userMove)) ){ //winning message winningMsg($this->currentPlayer); $this->gameOver = true; return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}", "public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "public function openValve(){\n if ($this->game->get_current_turn()->WinStatus($this->game->getSize())){\n $this->game->set_winner();\n }else{\n $this->game->update_turn();\n $this->game->set_winner();\n }\n }", "public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }", "public function isWin() {\n\t\tif ($_SESSION['game']->getState()==\"correct\") {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function checkForWinner($playerOne, $playerTwo){\n if(($playerOne == 1 && $playerTwo == 2) || ($playerOne == 2 && $playerTwo == 3 || ($playerOne == 3 && $playerTwo == 1))){\n $this->printResult($playerOne, $playerTwo, 1);\n return 1;\n }elseif(($playerOne == 1 && $playerTwo == 1) || ($playerOne == 2 && $playerTwo == 2) || ($playerOne == 3 && $playerTwo == 3)){\n $this->printResult($playerOne, $playerTwo, 2);\n return 2;\n }else{\n $this->printResult($playerOne, $playerTwo, 3);\n return 3;\n }\n}", "public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }", "function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }", "abstract public function winner();", "public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }", "function _checkSetupPossibility($scenario_id, $player_id){ \r\n \r\n // this array is filled by the checks below!\r\n // it is returned to the calling function playScenario which evaluates what to do next! \r\n $returnData = array(\r\n 'Systemaccount' => array(\r\n 'user'=>null,\r\n 'passwd'=>null,\r\n 'id'=>false\r\n ),\r\n 'envSetupNeeded' => false,\r\n 'error' => null,\r\n 'scripts'=>array() //this will be filled with scenario data\r\n );\r\n \r\n // each player can only setup and play one scenario at a time!\r\n $other = $this->Scenariosetup->find('Scenariosetup.player_id='.$player_id, false);\r\n if(!empty($other)){\r\n $this->redirect('/game/evaluateScenario/'.$other['Scenario']['id'].'/'.$player_id);\r\n exit;\r\n }\r\n \r\n $scenario = $this->Scenario->read(null, $scenario_id);\r\n $player = $this->Player->read(null, $player_id);\r\n \r\n // check scenario/player data ---------------------------------------\r\n if (empty($scenario) || empty($player)){\r\n $returnData['error'] = 'scenario/player not found.';\r\n return $returnData;\r\n }\r\n \r\n // check if player is active ---------------------------------------\r\n if ($player['Player']['active']!=1){\r\n $returnData['error'] = 'Not allowed, Player is disabled!';\r\n return $returnData;\r\n }\r\n \r\n // check if player meets the required skills ---------------------------\r\n if (!$this->_playerHasRequiredSkills($scenario['Skill'], $player['Skill'])){\r\n $returnData['error'] = 'You do not have enough skills!';\r\n return $returnData;\r\n }\r\n \r\n // do the most important scenario checks here: (IF-Monster) ===============================================\r\n $singleScenario = $this->_isSingleScenarioRunning();\r\n if (!empty($singleScenario)){ // a single scenario is running:\r\n if ($singleScenario['id'] == $scenario_id){ // running same as requested? -----------\r\n if ($singleScenario['is_multiplayer_scenario']==1){\r\n // OKAY up to here, continue below this IF-Monster\r\n } else { // the running single scenario is not multiplayer: ------------------------------------------\r\n $returnData['error'] = 'Not allowed!<br />Someone else is doing this scenario already.';\r\n }\r\n } else { // running single scenario is not the same as requested: ---------------------------------\r\n $returnData['error'] = 'Not allowed!<br />A different single scenario is running.';\r\n }\r\n \r\n } else { // =================== NO single scenario is running: ======================================\r\n \r\n if ($scenario['Scenario']['is_multiplayer_scenario']){ // requested scenario is multi-player:\r\n $running = $this->Scenariosetup->find('scenario_id='.$scenario_id);\r\n if (!empty($running)){ // same multiplayer scenario is already running: --------------------\r\n // envSetupNeeded = false; //this is default already!\r\n } else { // the same multiplayer scenario is NOT running: -------------------------------------\r\n $returnData['envSetupNeeded'] = true; // IMPORTANT!\r\n $availableResources = $this->_getAvailableResources($scenario_id);\r\n if (!$availableResources){\r\n $returnData['error'] = 'Not allowed!<br />The resources are not available.';\r\n }\r\n }\r\n // OKAY!\r\n \r\n } else { // requested scenario is a single player scenario: ----------------------------------------\r\n \r\n $running = $this->Scenariosetup->find('scenario_id='.$scenario_id);\r\n if (empty($running)){ // single player is possible, because scenario is not running: ------------\r\n $returnData['envSetupNeeded'] = true; // IMPORTANT!\r\n $availableResources = $this->_getAvailableResources($scenario_id);\r\n if (!$availableResources){\r\n $returnData['error'] = 'All resources are in use, scenario setup impossible.';\r\n }\r\n // OKAY!\r\n } else { // single player is not possible somebody else has set it up already -----\r\n $returnData['error'] = 'Scenario setup not possible.<br />Somebody else plays this scenario already.';\r\n } \r\n }\r\n } // end of IF-Monster: ======================================================\r\n \r\n \r\n // When you get HERE, all checks have been successful until now.\r\n // now check for precompiled/player Systemaccount:\r\n if ($scenario['Scenario']['use_player']==0){ // the requested scenario uses system accounts: -------\r\n $possibleAccounts = $this->_getAvailableSystemaccounts($scenario_id);\r\n if (!empty($possibleAccounts)){ // player max is not reached (not all systemaccounts are in use):-------\r\n $rand = rand(0,(sizeof($possibleAccounts)-1)); // get a random id between 0 and size-1\r\n $returnData['Systemaccount'] = $possibleAccounts[$rand];\r\n // OKAY\r\n } else { // all Systemaccounts are in use! ---------------------------------------\r\n $returnData['error'] = 'Not allowed!<br />Someone else is playing this scenario already.';\r\n }\r\n } else {// the player user/password is used for scenario: --------------------------\r\n $returnData['Systemaccount']['user'] = $player['Player']['nick'];\r\n $returnData['Systemaccount']['passwd'] = $this->Session->read('Player.passwd_clear');\r\n }\r\n \r\n $returnData['Script'] = $scenario['Script'];\r\n return $returnData;\r\n }", "public function winGame(array $winner){\r\n\t\tFreedomDive::getInstance()->notifyGameEnded($this->serverId, $winner);\r\n\r\n\t\t$this->finishGame();\r\n\t}", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "function _checkGame($game, $team) {\n global $_SYS;\n\n $game = intval($game);\n $team = intval($team);\n\n /* fetch game from db */\n\n $query = 'SELECT g.away AS away,\n na.team AS away_team,\n na.nick AS away_nick,\n na.acro AS away_acro,\n ta.user AS away_hc,\n g.away_sub AS away_sub,\n ta.conference AS away_conference,\n ta.division AS away_division,\n g.home AS home,\n nh.team AS home_team,\n nh.nick AS home_nick,\n nh.acro AS home_acro,\n th.user AS home_hc,\n g.home_sub AS home_sub,\n th.conference AS home_conference,\n th.division AS home_division,\n g.site AS site,\n g.week AS week,\n g.season AS season,\n s.name AS season_name\n FROM '.$_SYS['table']['game'].' AS g\n LEFT JOIN '.$_SYS['table']['team'].' AS ta ON g.away = ta.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS na ON ta.team = na.id\n LEFT JOIN '.$_SYS['table']['team'].' AS th ON g.home = th.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS nh ON th.team = nh.id\n LEFT JOIN '.$_SYS['table']['season'].' AS s ON g.season = s.id\n WHERE g.id = '.$game;\n\n $result = $_SYS['dbh']->query($query) or die($_SYS['dbh']->error());\n\n /* check if game exists */\n\n if ($result->rows() == 0) {\n return $_SYS['html']->fehler('1', 'Game does not exist.');\n }\n\n /* check if game was already played */\n\n $row = $result->fetch_assoc();\n\n if ($row['site'] != 0) {\n return $_SYS['html']->fehler('2', 'Game was already played.');\n }\n\n /* allow if user is admin OR user is hc or sub of the team */\n\n if (!(($team == 0 && $_SYS['user']['admin'])\n || ($team == $row['away'] && ($_SYS['user']['id'] == $row['away_hc'] || $_SYS['user']['id'] == $row['away_sub']))\n || ($team == $row['home'] && ($_SYS['user']['id'] == $row['home_hc'] || $_SYS['user']['id'] == $row['home_sub'])))) {\n return $_SYS['html']->fehler('3', 'You cannot upload a log for this game.');\n }\n\n $this->_game = $row;\n\n return '';\n }", "public function winRound() {\n\n\t\t$this->points++;\n\n\t\t$this->output($this->name.' has won this round');\n\t}", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "public function checkForWin() \n\t{\n\n\t\t$score = array_intersect($this->phrase->selected, $this->phrase->getLetters());\n\n\t\tif (count($score) == count($this->phrase->getLetters())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "abstract protected function isGameOver();", "function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}", "abstract protected function winnerExists();", "function paperSiccorsRockChooseWinner($gameList){\n\t\t$movesArray = explode(\",\",$gameList);\n\t\t//printf(\"El gamelist es: \" . $gameList . \"<br>\");\n\t\t//printf(\"La jugada1 es: \" . substr($movesArray[1],1,1) . \"<br>\");\n\t\t$player1move = substr($movesArray[1],1,1);\n\t\t$player2move = substr($movesArray[3],1,1);\n\t\t$gameResult = \"\";\n\n\t\t//console.log(\" \");\n\t\t//console.log(\" \");\n\t\t\n\n\t\t//Se pregunta si la cantidad de jugadores es valida\n\t\tif(validateQuantityOfPlayers($movesArray) == false){\n\t\t\t//console.log(\"Error Cantidad de jugadores\");\n\t\t\t//throw \"Error with number of players\"; \n\t\t}\n\n\t\t//Se preguntan si las jugadas son validas\n\t\tif(validateMove($player1move) == false || validateMove($player2move) == false){\n\t\t\t//console.log(\"Error Jugada no valida\");\n\t\t\t//throw \"Error not valid move\";\n\t\t}\n\n\t\t//Se averigua cual jugador gano\n\t\t$winner = paperSiccorsRockRules($player2move, $player1move);\n\t\tif($winner == true){\n\t\t\t////printf(\"1 El gamelist es: \" .$movesArray[2] . ',' . substr($movesArray[3],0,-1). \"<br>\");\n\t\t\t$gameResult = $movesArray[2] . ',' . substr($movesArray[3],0,-1);\n\t\t}else{\n\t\t\t////printf(\"2 El gamelist es: \" . substr($movesArray[0],1). ',' .$movesArray[1] . \"<br>\");\n\t\t\t$gameResult = substr($movesArray[0],1). ',' .$movesArray[1]; //Se puede caer\n\t\t}\n\n\t\t//printf(\"El juego es \" . $gameList . \"<br>\");\n\t\t//printf(\"Jugada player 1 \" . $player1move .\"<br>\");\n\t\t//printf(\"Jugada player 2 \" . $player2move .\"<br>\");\n\t\t//printf(\"El ganadore es player2 \" . $winner .\"<br>\");\n\n\t\t//console.log(\" \");\n\t\t//console.log(\" \");\n\t\treturn $gameResult;\n\t}", "public function gameOver()\n\t{\n\n\t\tif($this->checkForWin() == true) {\n\n\t\t\t$gameover = '<div id=\"overlay\" class=\"win\"><div>';\n\t\t\t$gameover .= '<h1 id=\"game-over-message\">Congratulations on guessing: ' . $this->phrase->activePhrase . '</h1>';\n\t\t\t$gameover .= '<form action=\"play.php\" method=\"POST\"><input type=\"submit\" value=\"Play again\" class=\"btn__reset\"></form>';\n\t\t\t$gameover .= '</div></div>';\n\n\t\t} elseif ($this->checkForLose() == true) {\n\n\t\t\t$gameover = '<div id=\"overlay\" class=\"lose\"><div>';\n\t\t\t$gameover .= '<h1 id=\"game-over-message\">The phrase was: ' . $this->phrase->activePhrase . '. Better luck next time!</h1>';\n\t\t\t$gameover .= '<form action=\"play.php\" method=\"POST\"><input type=\"submit\" value=\"Try again\" class=\"btn__reset\"></form>';\n\t\t\t$gameover .= '</div></div>';\n\t\n\t\t} else {\n\t\t\t$gameover = false;\n\t\t}\n\n\t\treturn $gameover;\n\n\t}", "private function decideVictory()\n {\n echo 'Jugador ';\n if (!$this->human->isOver() &&\n (\n ($this->human->getPoints() == $this->machine->getPoints() && $this->human->getPoints() != PLAYER_WIN_POINTS)\n || $this->human->getPoints() > $this->machine->getPoints()\n || $this->machine->isOver()\n )\n ) echo 'Humano';\n else echo 'Máquina';\n echo ' gana la partida. ';\n }", "function chooseSpecialOption($choice) {\n self::checkAction('choose');\n $player_id = self::getActivePlayerId();\n \n $special_type_of_choice = self::getGameStateValue('special_type_of_choice');\n \n if ($special_type_of_choice == 0) { // This is not a special choice\n // The player is cheating...\n throw new BgaUserException(self::_(\"You cannot choose a special option; you have to choose a card [Press F5 in case of troubles]\"));\n }\n \n switch(self::decodeSpecialTypeOfChoice($special_type_of_choice)) {\n case 'choose_opponent':\n case 'choose_opponent_with_fewer_points':\n // Player choice\n // Check if the choice is a opponent\n if ($choice == $player_id) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You cannot choose yourself [Press F5 in case of troubles]\"));\n }\n else if ($choice == self::getPlayerTeammate($player_id)) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You cannot choose your teammate [Press F5 in case of troubles]\"));\n }\n $players = self::loadPlayersBasicInfos();\n if (!array_key_exists($choice, $players)) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You must choose an opponent [Press F5 in case of troubles]\"));\n }\n if ($choice == 'choose_opponent_with_fewer_points' && self::getPlayerScore($choice) >= self::getPlayerScore($player_id)) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You must choose an opponent with fewer points than you [Press F5 in case of troubles]\"));\n }\n break;\n case 'choose_value':\n // Values choice\n if (!ctype_digit($choice) || $choice < 1 || $choice > 10) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"Your choice must be a value from 1 to 10 [Press F5 in case of troubles]\"));\n }\n break;\n case 'choose_color':\n // Color choice\n if (!ctype_digit($choice) || $choice < 0 || $choice > 4) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"Your choice must be a color [Press F5 in case of troubles]\"));\n }\n break;\n case 'choose_two_colors':\n // Two color choice\n if (!ctype_digit($choice) || $choice < 0) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"Your choice must be two colors [Press F5 in case of troubles]\"));\n }\n $colors = self::getValueAsArray($choice);\n if (count($colors) <> 2 || $colors[0] == $colors[1] || $colors[0] < 0 || $colors[0] > 4 || $colors[1] < 0 || $colors[1] > 4) {\n // The player is cheating... \n throw new BgaUserException(self::_(\"Your choice must be two colors [Press F5 in case of troubles]\"));\n }\n break;\n case 'choose_rearrange':\n $exception = self::_(\"Ill formated permutation info [Press F5 in case of troubles]\");\n // Choice contains the color and the permutations made\n if (!is_array($choice) || !array_key_exists('color', $choice)) {\n throw new BgaUserException($exception);\n }\n $color = $choice['color'];\n if (!ctype_digit($color) || $color < 0 || $color > 4) {\n // The player is cheating...\n throw new BgaUserException($exception);\n }\n if (!array_key_exists('permutations_done', $choice)) {\n throw new BgaUserException($exception);\n }\n $permutations_done = $choice['permutations_done'];\n if (!is_array($permutations_done) || count($permutations_done) == 0) {\n throw new BgaUserException($exception);\n }\n $n = self::countCardsInLocation($player_id, 'board', false, true);\n $n = $n[$color];\n \n foreach($permutations_done as $permutation) {\n if (!array_key_exists('position', $permutation)) {\n throw new BgaUserException($exception);\n }\n $position = $permutation['position'];\n if (!array_key_exists('delta', $permutation)) {\n throw new BgaUserException($exception);\n }\n $delta = $permutation['delta'];\n if ($delta <> 1 && $delta <> -1) {\n throw new BgaUserException($exception);\n }\n if (!ctype_digit($position) || $position >= $n || $position + $delta >= $n) {\n throw new BgaUserException($exception);\n }\n }\n \n // Do the rearrangement now\n $actual_change = self::rearrange($player_id, $color, $permutations_done);\n \n if (!$actual_change) {\n throw new BgaUserException(self::_(\"Your choice does not make any change in the rearrangement [Press F5 in case of troubles]\"));\n }\n \n // This move was legal\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} rearrange your ${color} pile.'), array('i18n' => array('color'), 'You' => 'You', 'color' => self::getColorInClear($color)));\n self::notifyAllPlayersBut($player_id, 'rearrangedPile', clienttranslate('${player_name} rearranges his ${color} pile.'), array('i18n' => array('color'), 'player_id' => $player_id, 'rearrangement' => $choice, 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'color' => self::getColorInClear($color)));\n try {\n self::checkForSpecialAchievements($player_id, false); // Check all except Wonder\n }\n catch (EndOfGame $e) {\n // End of the game: the exception has reached the highest level of code\n self::trace('EOG bubbled from self::chooseSpecialOption');\n self::trace('selectionMove->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n \n $choice = 1;\n break;\n case 'choose_yes_or_no':\n // Yes/no choice\n if ($choice != 0 && $choice != 1) {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You have to choose between yes or no [Press F5 in case of troubles]\"));\n }\n break;\n default:\n break;\n }\n // No cheating here\n self::setGameStateValue('choice', $choice);\n \n // Return to the resolution of the effect\n self::trace('selectionMove->interSelectionMove (chooseSpecialOption)');\n $this->gamestate->nextState('interSelectionMove');\n }", "public function pickWinner($reset = FALSE, $bypass_used_info = FALSE)\n\t{\n\t\t//Blackbox_Data\n\t\tif ($bypass_used_info)\n\t\t{\n\t\t\t$this->debug->setFlag(OLPBlackbox_DebugConf::USED_INFO, FALSE);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$this->winner = $this->blackbox->pickWinner($this->data);\n\t\t}\n\t\tcatch (OLPBlackbox_ReworkException $e)\n\t\t{\n\t\t\t// olp uses this session variable to know that it must reprocess\n\t\t\t// the application.\n\t\t\t$_SESSION['process_rework'] = TRUE;\n\t\t\t$this->winner = FALSE;\n\t\t}\n\t\t\n\t\tif ($this->winnerExists())\n\t\t{\n\t\t\t$this->winners[] = array(\n\t\t\t\t'campaign_name' => $this->winner->getStateData()->campaign_name,\n\t\t\t\t'target_name' => $this->winner->getStateData()->target_name\n\t\t\t);\n\t\t\t$this->winner->getCampaign()->getTarget()->setInvalid();\n\t\t\t\n\t\t\tif ($this->winner->getStateData()->partner_weekly_vetting_lead)\n\t\t\t{\n\t\t\t\t// gforge 9922, make sure that pw is the first look [DO]\n\t\t\t\tif ($this->winners[0] != 'pw')\n\t\t\t\t{\n\t\t\t\t\tarray_unshift($this->winners, 'pw');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tOLPBlackbox_Config::getInstance()->event_log->Log_Event(\n\t\t\t\t'PICK_WINNER',\n\t\t\t\t'PASS',\n\t\t\t\t$this->winner->getStateData()->campaign_name\n\t\t\t);\n\n\t\t\t// do all session-related updates\n\t\t\t$this->updateSession($this->winner);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->blackbox->getStateData()->legacy_state_fail == TRUE)\n\t\t\t{\n\t\t\t\t// used by GForge #6972 [DY]\n\t\t\t\t$_SESSION['failure_reason'] = 'WVVAGA_CHECK';\n\t\t\t}\n\t\t\t\n//\t\t\t// We need to store the suppresion list failures for denial reasons sent to eCash\n//\t\t\tif (!empty($this->blackbox->getStateData()->suppression_list_failure))\n//\t\t\t{\n//\t\t\t\t$failure_list_obj = $this->blackbox->getStateData()->suppression_list_failure;\n//\t\t\t\t$failure_list = $failure_list_obj->get();\n//\t\t\t\t\n//\t\t\t\tforeach ($failure_list as $failure)\n//\t\t\t\t{\n//\t\t\t\t\t Currently OLP is looking for this array type in the session. Once we feel\n//\t\t\t\t\t more comfortable moving this out of the adapter, OLP can work with this directly\n//\t\t\t\t\t$_SESSION['SUPPRESSION_LIST_FAILURE'][$failure->field] = $failure->type;\n//\t\t\t\t}\n//\t\t\t}\n\t\t\t\n\t\t\tOLPBlackbox_Config::getInstance()->event_log->Log_Event(\n\t\t\t\t'PICK_WINNER',\n\t\t\t\t'FAIL'\n\t\t\t);\n\t\t}\n\n\t\treturn $this->winner;\n\t}", "public function displayWinner()\n {\n // Search in array scores, for the username with the highest score.\n $nameWinner = array_search(max($this->scores), $this->scores);\n $scoreWinner = max($this->scores);\n\n $this->console->stdInput(1);\n $this->console->getInpunt(\"De winnaar met \" . $scoreWinner[\"scoreTotal\"] . \" punten is: \" . $nameWinner . \"\\nPress enter to end the game!\");\n $this->console->stdInput(1);\n }", "public function testCheckWinner()\n {\n $gamestate = $this->game->getGamestate();\n $this->game->holdHand();\n $this->assertNull($gamestate[\"hasWon\"]);\n\n $gamestate[\"active\"]->addPoints(100);\n $exp = $gamestate[\"active\"];\n $this->game->holdHand();\n\n $gamestate = $this->game->getGamestate();\n $this->assertEquals($exp, $gamestate[\"hasWon\"]);\n }", "function playGame($config)\n{\n showWelcome();\n $userName = getUserName();\n showRules($config[\"ruleGame\"]);\n\n for ($countRightRounds = 0; $countRightRounds < $config[\"countRounds\"]; $countRightRounds++) {\n [$Question, $rightAnswer] = $config[\"getRound\"]();\n $userAnswer = showQuestion($Question);\n\n if (!checkAnswer($userAnswer, $config[\"checkAnswer\"])) {\n err('Error answer format!');\n exit;\n }\n if (!checkResult($userAnswer, $rightAnswer)) {\n showResult($userAnswer, $userName, $rightAnswer, 'WrongAnswer');\n exit;\n }\n showResult($userAnswer, $userName, $rightAnswer, 'RightAnswer');\n if ($countRightRounds === $config[\"countRounds\"]) {\n showResult($userAnswer, $userName, $rightAnswer, 'EndGame');\n }\n }\n}", "function playLottery($fname, $email, $number, $code, $mailing, $playerChoise, $conn)\n{\n $prizesAmount = amountOfAvailablePrizesToday($conn);\n $result = array();\n if ($prizesAmount > 0) {\n $lastWin = whenWasTheLastWin($conn);\n $chance = chanceToWin($lastWin);\n //decide if used wins\n if ($chance != 0 && rand(1, 100) < $chance) {\n // changing the code status and full fill the user data to it\n updateCode($fname, $email, $number, $code, $mailing, 'won', $conn);\n $result[9] = \"true\";\n // take all the available prizes (not given to other users)\n $list = getAvailablePrizes($conn);\n // take one prize\n $prizeOpt = $list[rand(0, count($list) - 1)];\n $prizeName = $prizeOpt[0];\n $prizeValue = $prizeOpt[1];\n $prizeVoucher = getRandomVoucher($prizeName, $prizeValue, $conn);\n $price = $prizeOpt[1];\n $result[$playerChoise - 1] = [$prizeName, $price];\n // change prize's status as given\n updatePrize($prizeName, $prizeValue, $prizeVoucher, $email, $conn);\n // HERE YOU CONNECT SEDNING EMAILS\n sendEmail($email, $code, $fname, $prizeName, $prizeValue);\n } else {\n // changing the code status and full fill the user data to it\n updateCode($fname, $email, $number, $code, $mailing, 'loose', $conn);\n $result[9] = \"false\";\n $result[$playerChoise - 1] = ['loose'];\n }\n } else {\n $result[9] = \"false\";\n $result[$playerChoise - 1] = ['loose'];\n }\n if ($result[9] == \"false\") {\n }\n\n $result = generateOthersPrizes($result, $playerChoise);\n for ($i = 0; $i < 9; $i++) {\n if (is_null($result[$i])) {\n $result[$i] = ['loose'];\n }\n }\n $conn->close();\n echo json_encode($result);\n}", "function gamePlay($deck, $player, $dealer, $name, $bankroll, $bet) {\n\tif (blackjackCheck($player)) {\n\t\t$bankroll += ($bet * 1.50);\n\t\techo 'Blackjack!! ' . $name . ' wins $' . ($bet * 1.50) . '!' . PHP_EOL;\n\t\techoBankroll($bankroll);\n\t\techo '---------------------------------------------------' . PHP_EOL;\n\t\tplayAgain($name, $bankroll);\n\t} \n\n\t//insurance bet?\n\t$insuranceBet = playerInsurance($name, $dealer, $bet, $bankroll);\n\n\t//split option here\n\tsplitCards($player, $dealer, $name, $insuranceBet, $bankroll, $bet, $deck);\n\n\t//double down option\n\tdoubleDown($name, $deck, $player, $dealer, $insuranceBet, $deck, $bet, $bankroll);\n\n\t//player must select (H)it or (S)tay\n\thitOrStay($name, $deck, $player, $dealer, $bet, $insuranceBet, $bankroll);\n\tplayAgain($name, $bankroll);\n}", "function spar() {\r\n\tglobal $system;\r\n\r\n\tglobal $player;\r\n\r\n\tglobal $self_link;\r\n\r\n\tif($player->battle_id) {\r\n\t\ttry {\r\n $battle = new Battle($system, $player, $player->battle_id);\r\n\r\n $battle->checkTurn();\r\n\r\n $battle->renderBattle();\r\n\r\n if($battle->isComplete()) {\r\n echo \"<table class='table'><tr><th>Battle complete</th></tr>\r\n\t\t\t <tr><td style='text-align:center;'>\";\r\n if($battle->isPlayerWinner()) {\r\n echo \"You win!<br />\";\r\n }\r\n else if($battle->isOpponentWinner()) {\r\n echo \"You lose.<br />\";\r\n $player->health = 5;\r\n }\r\n else if($battle->isDraw()) {\r\n echo \"You both knocked each other out.<br />\";\r\n $player->health = 5;\r\n }\r\n echo \"</td></tr></table>\";\r\n\r\n $player->battle_id = 0;\r\n }\r\n }\r\n catch (Exception $e) {\r\n $system->printMessage($e->getMessage());\r\n $player->battle_id = 0;\r\n return false;\r\n }\r\n\t}\r\n\telse if(isset($_GET['challenge'])) {\r\n\t\ttry {\r\n\t\t\t$challenge = (int)$system->clean($_GET['challenge']);\r\n\t\t\t$result = $system->query(\"SELECT `user_id`, `user_name`, `village`, `location`, `challenge`, `battle_id`, `last_active`\r\n\t\t\t\tFROM `users` WHERE `user_id`='$challenge' LIMIT 1\");\r\n\t\t\tif($system->db_last_num_rows == 0) {\r\n\t\t\t\tthrow new Exception(\"Invalid user!\");\r\n\t\t\t}\r\n\t\t\t$user = $system->db_fetch($result);\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\tif($user['village'] != $player->village) {\r\n\t\t\t\tthrow new Exception(\"You cannot spar ninja from enemy villages!\");\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t\tif($user['location'] != $player->location) {\r\n\t\t\t\tthrow new Exception(\"Target is not at your location!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($user['challenge']) {\r\n\t\t\t\tthrow new Exception(\"Target has already been challenged!\");\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif($user['battle_id']) {\r\n\t\t\t\tthrow new Exception(\"Target is in battle!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($user['last_active'] < time() - 120) {\r\n\t\t\t\tthrow new Exception(\"Target is inactive/offline!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$system->query(\"UPDATE `users` SET `challenge`='$player->user_id' WHERE `user_id`='$challenge' LIMIT 1\");\r\n\t\t\t$system->message(\"Challenge sent!\");\r\n\t\t\t$system->printMessage();\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$system->message($e->getMessage());\r\n\t\t\t$system->printMessage();\r\n\t\t\trequire(\"scoutArea.php\");\r\n\t\t\tscoutArea();\r\n\t\t}\r\n\t}\r\n\telse if(isset($_GET['accept_challenge'])) {\r\n\t\ttry {\r\n\t\t\t$challenge = (int)$system->clean($_GET['accept_challenge']);\r\n\t\t\t\r\n\t\t\tif($challenge != $player->challenge) {\r\n\t\t\t\tthrow new Exception(\"Invalid challenge!\");\r\n\t\t\t}\r\n\r\n try {\r\n $user = new User($challenge);\r\n $user->loadData(User::UPDATE_NOTHING, true);\r\n } catch(Exception $e) {\r\n throw new Exception(\"Invalid user! \" . $e->getMessage());\r\n }\r\n\t\t\t\r\n\t\t\tif($user->location != $player->location) {\r\n\t\t\t\tthrow new Exception(\"Target is not at your location!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($user->battle_id) {\r\n\t\t\t\tthrow new Exception(\"User is in battle!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($user->last_active < time() - 120) {\r\n\t\t\t\tthrow new Exception(\"Target is inactive/offline!\");\r\n\t\t\t}\r\n\r\n $player->challenge = 0;\r\n Battle::start($system, $player, $user, Battle::TYPE_SPAR);\r\n\r\n\t\t\t$system->message(\"You have accepted the challenge!<br />\r\n\t\t\t\t<a class='link' href='$self_link'>To Battle</a>\");\r\n\t\t\t$system->printMessage();\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$player->challenge = 0;\r\n\t\t\t\r\n\t\t\t$system->message($e->getMessage());\r\n\t\t\t$system->printMessage();\r\n\t\t\trequire(\"scoutArea.php\");\r\n\t\t\tscoutArea();\r\n\t\t}\r\n\t}\r\n\telse if(isset($_GET['decline_challenge'])) {\r\n\t\t$player->challenge = 0;\r\n\t\t$system->message(\"Challenge declined.\");\r\n\t\t$system->printMessage();\r\n\t\t\r\n\t\trequire(\"scoutArea.php\");\r\n\t\tscoutArea();\r\n\t}\r\n\telse if(isset($_GET['cancel_challenge'])) {\r\n\t\t$challenge = $system->clean($_GET['cancel_challenge']);\r\n\t\t// Load user challenges sent\r\n\t\t$result = $system->query(\"UPDATE `users` SET `challenge`=0 WHERE `user_id`='$challenge' AND `challenge`='$player->user_id' LIMIT 1\");\r\n\t\t$system->message(\"Challenge cancelled!\");\r\n\t\t$system->printMessage();\r\n\t\t\t\r\n\t\trequire(\"scoutArea.php\");\r\n\t\tscoutArea();\r\n\t}\r\n\telse {\r\n\t\t// Load user challenges sent\r\n\t\t$result = $system->query(\"SELECT `user_id`, `user_name` FROM `users` WHERE `challenge`='$player->user_id'\");\r\n\t\tif($system->db_last_num_rows > 0) {\r\n\t\t\t$user_challenges = array();\r\n\t\t\twhile($row = $system->db_fetch($result)) {\r\n\t\t\t\t$user_challenges[$row['user_id']] = $row['user_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($player->challenge or isset($user_challenges)) {\r\n\t\t\techo \"<table class='table'><tr><th>Challenges</th></tr>\";\r\n\t\t\t\t\r\n\t\t\t// Challenge received\r\n\t\t\tif($player->challenge) {\r\n\t\t\t\t$result = $system->query(\"SELECT `user_name` FROM `users` WHERE `user_id`='$player->challenge' LIMIT 1\");\r\n\t\t\t\tif($system->db_last_num_rows == 0) {\r\n\t\t\t\t\t$player->challenge = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$challenger_data = $system->db_fetch($result);\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"<tr><td>\r\n\t\t\t\t\t<p style='display:inline-block;margin:0px;margin-left:20px;'>\r\n\t\t\t\t\t\tChallenged by <span style='font-weight:bold;'>\" . $challenger_data['user_name'] . \"</span></p>\r\n\t\t\t\t\t<p style='display:inline-block;margin:0px;margin-right:40px;float:right;'>\r\n\t\t\t\t\t\t<a href='$self_link&accept_challenge=$player->challenge'>Accept</a> | \r\n\t\t\t\t\t\t<a href='$self_link&decline_challenge=$player->challenge'>Decline</a>\r\n\t\t\t\t\t</p></td></tr>\";\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($user_challenges) {\r\n\t\t\t\tforeach($user_challenges as $id=>$name) {\r\n\t\t\t\t\techo \"<tr><td>\r\n\t\t\t\t\t<p style='display:inline-block;margin:0px;margin-left:20px;'>\r\n\t\t\t\t\t\tChallenge sent to <span style='font-weight:bold;'>\" . $name . \"</span></p>\r\n\t\t\t\t\t<p style='display:inline-block;margin:0px;margin-right:40px;float:right;'>\r\n\t\t\t\t\t\t<a href='$self_link&cancel_challenge=$id'>Cancel</a></p>\r\n\t\t\t\t\t</td></tr>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"</table>\";\r\n\t\t}\r\n\t\t\r\n\t\trequire(\"scoutArea.php\");\r\n\t\tscoutArea();\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "function checkForSpecialAchievements($player_id, $wonder_included) {\n $achievements_to_test = $wonder_included ? array(105, 106, 107, 108, 109) : array(105, 106, 108, 109);\n $end_of_game = false;\n \n \n foreach ($achievements_to_test as $achievement_id) {\n $achievement = self::getCardInfo($achievement_id);\n if ($achievement['owner'] != 0) { // Somebody has already claimed that achievement\n // So it's not claimable anymore\n continue;\n }\n \n switch ($achievement_id) {\n case 105: // Empire: three or more icons of all six types\n $eligible = true;\n $ressource_counts = self::getPlayerRessourceCounts($player_id);\n foreach ($ressource_counts as $icon => $count) {\n if ($count < 3) { // There are less than 3 icons\n $eligible = false;\n break;\n }\n }\n break;\n case 106: // Monument: tuck 6 cards or score 6 cards\n $flags = self::getFlagsForMonument($player_id);\n $eligible = $flags['number_of_tucked_cards'] >= 6 || $flags['number_of_scored_cards'] >= 6;\n break;\n case 107: // Wonder: 5 colors, each being splayed right or up\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) < 2) { // This color is missing, unsplayed or splayed left\n $eligible = false;\n };\n }\n break;\n case 108: // World: 12 or more visible clocks (icon 6) on the board \n $eligible = self::getPlayerSingleRessourceCount($player_id, 6) >= 12;\n break;\n case 109: // Universe: Five top cards, each being of value 8 or more\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card === null || $top_card['age'] < 8) { // This color is missing or its top card has value less than 8\n $eligible = false;\n }\n }\n break;\n default:\n break;\n }\n \n if ($eligible) { // The player meet the conditions to achieve\n try {\n self::transferCardFromTo($achievement, $player_id, 'achievements');\n }\n catch (EndOfGame $e) { // End of game has been detected\n self::trace('EOG bubbled but suspended from self::checkForSpecialAchievements');\n $end_of_game = true;\n continue; // But the other achievements must be checked as well before ending\n }\n }\n }\n // All special achievements have been checked\n if ($end_of_game) { // End of game has been detected\n self::trace('EOG bubbled from self::checkForSpecialAchievements');\n throw $e; // Re-throw the flag\n }\n }", "function compete2($a,$b){\n $p = intval(100 * getWinProb($a['elo']-$b['elo']));\n $expected = ($a['elo']>=$b['elo']) ? $a['name'] : $b['name'];\n $percent = ($a['elo']>=$b['elo']) ? $p.'%' : (100-$p).'%';\n $tempo = round(($a['tempo']+$b['tempo'])/2);\n $a_score = 0;\n $b_score = 0;\n echo sprintf(\"Now Playing: %s (%s) vs. %s (%s) \\n\", $a['name'], $a['elo'], $b['name'], $b['elo']);\n echo sprintf(\"Expected winner: %s (%s)\\n\", $expected, $percent);\n \n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"| Game Log |\\n\");\n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"Playing %s possessions\\n\\n\",$tempo);\n for($i=0;$i<$tempo;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n while($a_score==$b_score){\n $ot = round($tempo/8);\n //echo sprintf(\"Overtime\\n\");\n //echo sprintf(\"Playing %s possessions\\n\", $ot);\n for($i=0;$i<$ot;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n }\n $winner = ($a_score>$b_score) ? $a['name'] : $b['name'];\n $a_ppp = number_format($a_score/$tempo,3);\n $b_ppp = number_format($b_score/$tempo,3);\n echo sprintf(\"Final score is %s-%s, %s wins\\n\\n\", max($a_score,$b_score), min($a_score,$b_score), $winner);\n //echo sprintf(\"Points per Possession: %s: %s %s: %s\\n\\n\", $a['name'], $a_ppp, $b['name'], $b_ppp);\n return ($a_score>$b_score) ? $a : $b;\n}", "public function play($choice){\n $yourChoice = trim(strtoupper($choice));\n if($yourChoice == 'ROCK'){\n $playerOne = 1;\n $playerTwo = rand(1,3);\n $this->checkForWinner($playerOne,$playerTwo);\n }elseif($yourChoice == 'PAPER'){\n $playerOne = 2;\n $playerTwo = rand(1,3);\n $this->checkForWinner($playerOne,$playerTwo);\n }elseif($yourChoice == 'SCISSOR'){\n $playerOne = 3;\n $playerTwo = rand(1,3);\n $this->checkForWinner($playerOne,$playerTwo);\n }else{\n throw new Exception(\"You need to make right choice!\");\n }\n }", "function showOptions($option){\n $cover = \"\\nWhat do you want to do? Press the number matching your choice.\\n\";\n $options = \" 1 - Buy flight.\\n 2 - Book hotel.\\n 3 - Buy package.\\n\";\n $options1 = \"\\n**BUY FLIGHT**\\nEnter the flight ID to buy. Or press 0 to go back.\\n\";\n $options2 = \"\\n**BOOK HOTEL**\\nEnter the accomodation ID to buy. Or press 0 to go back.\\n\";\n $options3 = \"\\n**BUY PACKAGE**\\nEnter the flight ID and the accomodation ID you want buy. Or press 0 to go back.\\n\";\n\n if($option == 0){\n echo($cover);\n echo($options);\n }\n else if($option == 1)\n echo($options1);\n\n else if($option == 2)\n echo($options2);\n\n else if($option == 3)\n echo($options3);\n\n else\n echo (\"error in function showOptions\"); //test\n}", "public function startGameSession() {\n if(!isset($_SESSION['wrongGuesses'])) {\n $_SESSION['wrongGuesses'] = 0;\n }\n $_SESSION['activeGame'] = true;\n }", "function stInterPlayerTurn() {\n \n // Give him extra time for his actions to come\n self::giveExtraTime(self::getActivePlayerId());\n \n // Does he plays again?\n if (self::getGameStateValue('first_player_with_only_one_action')) {\n // First turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('first_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('second_player_with_only_one_action')) {\n // 4 players at least and this is the second turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('second_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('has_second_action')) {\n // The player took his first action and has another one\n $next_player = false;\n self::setGameStateValue('has_second_action', 0);\n }\n else {\n // The player took his second action\n $next_player = true;\n self::setGameStateValue('has_second_action', 1);\n }\n if ($next_player) { // The turn for the current player is over\n // Reset the flags for Monument special achievement\n self::resetFlagsForMonument();\n \n // Activate the next player in turn\n $this->activeNextPlayer();\n $player_id = self::getActivePlayerId();\n self::setGameStateValue('active_player', $player_id);\n }\n self::notifyGeneralInfo('<!--empty-->');\n self::trace('interPlayerTurn->playerTurn');\n $this->gamestate->nextState();\n }", "function check()\n {\n /* Call common method to give check the hook */\n $message= plugin::check();\n $message = array_merge($message,$this->gotoLpdEnable_dialog->check());\n\n if($this->gotoXMethod != \"default\"){\n $xdmcp_types = $this->config->data['SERVERS']['TERMINAL_SESSION_TYPES'];\n $available_servers = array();\n foreach($xdmcp_types as $servername =>$supported_types){\n if(in_array_strict(strtoupper($this->gotoXMethod),$supported_types)){\n $available_servers[] = $servername;\n }\n }\n foreach($this->selected_xdmcp_servers as $server){\n if(!in_array_strict($server,$available_servers)){\n $message[] = _(\"Remote desktop settings contains servers that do not support the selected connection method.\");\n break;\n }\n }\n }\n\n return ($message);\n }", "function verif_battle($menu = false)\n\t{\n\t\tglobal $path;\n\t\t\n\t\tif(isset($_SESSION['Battle']))\n\t\t{\n\t\t\tif ($_SESSION['Battle'] == 1)\n\t\t\t{\n\t\t\t\treturn true ;\n\t\t\t}\n\t\t\tif(!$menu)\n\t\t\t{\n\t\t\t\techo \"Vous n'êtes dans aucun affrontement\";\n\t\t\t\trequire_once($path.\"HTML/Footer.php\");\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\t\treturn false ;\n\t}", "protected function shouldPrompt()\n {\n return !$this->rocketeer->isLocal();\n }", "public function startPlay(){ \r\n\r\n $this->selectPlayer();\r\n $this->board->printBoard();\r\n\r\n while(!$this->gameOver){\r\n\r\n //check if board is full\r\n if($this->reachedMaxMoves() || $this->validateIsFullBoard()){\r\n noWinningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n break;\r\n }\r\n // set board with table\r\n $userMove = $this->selectMove();\r\n \r\n //in case that column is not full \r\n if(!$this->validateIsFullColumn($userMove)){\r\n $this->insertMoveToBoard($userMove);\r\n $this->winCheck($userMove);\r\n $this->switchPlayer();\r\n }\r\n }\r\n }", "private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function getWinner(){\n $this->game->UpdateStatus();\n if ($this->game->getWinner()!=$this->game->get_current_turn()){\n return false;\n }else{\n return true;\n }\n }", "function notifyEndOfGameByAchievements() {\n // Display who won and with how many achievements\n // (There can be weird cases when two players tie or one player get more achievements than needed if two or more special achievements are claimed at the same time)\n $players = self::getCollectionFromDb(\"SELECT player_id, player_score FROM player\");\n $number_of_achievements_needed_to_win = self::getGameStateValue('number_of_achievements_needed_to_win');\n $number_of_achievements_winner = $number_of_achievements_needed_to_win;\n $winners = array();\n \n foreach($players as $player_id => $player) {\n if ($player['player_score'] == $number_of_achievements_winner) {\n $winners[] = $player_id; // Far most frequent case: $winners has only one element, but who knows... (extremely unlikely but still possible)\n }\n else if ($player['player_score'] > $number_of_achievements_winner) { // One player got more achievements than necessary... (extremely unlikely but still possible)\n $number_of_achievements_winner = $player['player_score'];\n $winners = array($player_id);\n }\n }\n \n foreach ($winners as $player_id) {\n if ($number_of_achievements_winner == $number_of_achievements_needed_to_win) { // Far most frequent case\n if (self::decodeGameType(self::getGameStateValue('game_type')) == 'individual') {\n self::notifyAllPlayersBut($player_id, \"log\", clienttranslate('END OF GAME BY ACHIEVEMENTS: ${player_name} has got ${n} achievements. He wins!'), array(\n 'n' => $number_of_achievements_winner,\n 'player_name' => self::getPlayerNameFromId($player_id)\n ));\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('END OF GAME BY ACHIEVEMENTS: ${You} have got ${n} achievements. You win!'), array(\n 'n' => $number_of_achievements_winner,\n 'You' => 'You'\n ));\n }\n else { // Team game\n $teammate_id = self::getPlayerTeammate($player_id);\n $winning_team = array($player_id, $teammate_id);\n self::notifyAllPlayersBut($winning_team, \"log\", clienttranslate('END OF GAME BY ACHIEVEMENTS: The other team has got ${n} achievements. They win!'), array(\n 'n' => $number_of_achievements_winner\n ));\n \n foreach($winning_team as $player_id) {\n self::notifyPlayer($player_id, \"log\", clienttranslate('END OF GAME BY ACHIEVEMENTS: Your team has got ${n} achievements. You win!'), array(\n 'n' => $number_of_achievements_winner\n ));\n }\n }\n }\n else { // Extremely unlikely\n if (self::decodeGameType(self::getGameStateValue('game_type')) == 'individual') {\n self::notifyAllPlayersBut($player_id, \"log\", clienttranslate('END OF GAME BY ACHIEVEMENTS: ${player_name} has got ${n} achievements (more than necessary!!!). He wins!'), \n array(\n 'n' => $number_of_achievements_winner,\n 'player_name' => self::getPlayerNameFromId($player_id)\n ));\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('END OF GAME BY ACHIEVEMENTS: ${You} have got ${n} achievements (more than necessary!!!). You win!'), array(\n 'n' => $number_of_achievements_winner,\n 'You' => 'You'\n ));\n }\n else { // Team game\n $teammate_id = self::getPlayerTeammate($player_id);\n $winning_team = array($player_id, $teammate_id);\n self::notifyAllPlayersBut($winning_team, \"log\", clienttranslate('END OF GAME BY ACHIEVEMENTS: The other team has got ${n} achievements (more than necessary!!!). They win!'), array(\n 'n' => $number_of_achievements_winner\n ));\n \n foreach($winning_team as $player_id) {\n self::notifyPlayer($player_id, \"log\", clienttranslate('END OF GAME BY ACHIEVEMENTS: Your team has got ${n} achievements (more than necessary!!!). You win!'), array(\n 'n' => $number_of_achievements_winner\n ));\n }\n }\n }\n }\n }", "function play($game) {\t\n\tif($game[\"gameOver\"] == -1) {\n\t\tif ($game[\"clicked\"] !== 9 )\n\t\t\tupdateBoard(); //print_r($game); \n\t\tdisplayBoard();\t\t\n\t\tupdateSession();\t\t\n\t} \n}", "public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }", "public function playRound()\n {\n $this->checkFirstAttack();\n\n // Orderus attacks\n if ($this->orderus_attacks) {\n $attacks = $this->orderus->rapidStrike();\n if ($attacks > 1) {\n $this->ui->display($this->narration->orderusRapidStrike());\n $this->ui->displayBlank();\n }\n while ($attacks > 0) {\n $this->ui->display($this->narration->orderusAttacks());\n if ($this->orderus->attack($this->beast)) {\n $this->ui->display($this->narration->orderusHits());\n } else {\n $this->ui->display($this->narration->orderusMisses());\n }\n $attacks--;\n if ($attacks > 0) {\n $this->displayStats();\n $this->ui->displayBlank();\n }\n }\n\n // the wild beast attacks\n } else {\n $this->ui->display($this->narration->beastAttacks());\n $damage_divider = $this->orderus->magicShield();\n if ($damage_divider > 1) {\n $this->ui->displayBlank();\n $this->ui->display($this->narration->orderusMagicShield());\n $this->ui->displayBlank();\n }\n if ($this->beast->attack($this->orderus, $damage_divider)) {\n $this->ui->display($this->narration->beastHits());\n } else {\n $this->ui->display($this->narration->beastMisses());\n }\n }\n\n // take turns attacking\n $this->orderus_attacks = !$this->orderus_attacks;\n\n // prevent endless battles\n $this->turns--;\n $this->is_running = ($this->turns > 0);\n\n // check health stats\n if (($this->orderus->health() <= 0) || ($this->beast->health() <= 0)) {\n $this->is_running = false;\n }\n\n // Orderus wins\n if ($this->beast->health() <= 0) {\n $this->winner->is_orderus = true;\n }\n\n // the wild beast wins\n if ($this->orderus->health() <= 0) {\n $this->winner->is_beast = true;\n }\n }", "protected function welcome() {\n echo \"*****************\" . PHP_EOL .\n \"*** TicTacToe ***\" . PHP_EOL .\n \"*****************\" . PHP_EOL;\n $this->drawBoard(array(), true);\n echo \"[\" . self::QUIT_BUTTON . \"] - End game\" . PHP_EOL . PHP_EOL;\n }", "public function outcome()\n {\n $gameOutcome = array(\"win\", \"lose\");\n $this->shuffle = $gameOutcome[array_rand($gameOutcome)];\n\n if ($this->shuffle === \"win\") {\n\n $bet = new confirmBet(db::getConnection());\n $arg = $bet->getBetId();\n $explode = explode(',', $arg, -1);\n $lastBetId = end($explode);\n\n $mysqli = db::getConnection();\n $saveOutcome = \"INSERT INTO outcome (outcome_status,score,bet_id) VALUES('win',10,$lastBetId)\";\n mysqli_query($mysqli, $saveOutcome);\n\n\n $this->win();\n\n } else {\n $bet = new confirmBet(db::getConnection());\n $arg = $bet->getBetId();\n $explode = explode(',', $arg, -1);\n $lastBetId = end($explode);\n\n $mysqli = db::getConnection();\n $saveOutcome = \"INSERT INTO outcome (outcome_status,score,bet_id) VALUES('lose',0,$lastBetId)\";\n mysqli_query($mysqli, $saveOutcome);\n\n\n $this->lose();\n\n }\n }", "public function play(){\n\t\t$gameId = $this->input->post('gameId');\n $utoken = $this->input->post('utoken');\n\t\t$word = $this->input->post('word');\n\t\t$game = $this->setRedis_info($gameId);\n\t\tif(!in_array($utoken, $game['players'])){\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'You are not a player in this game or game session expired!'], 202);\n\t\t}\n\t\tif($game['status'] == 'waiting'){\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'Wait for game to begin...Hold tight!'], 202);\n\t\t}\n\t\tif($game['status'] == 'completed'){\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'Game has been completed!'], 202);\n\t\t}\n\t\tif($utoken != $game['current_player']){\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'Wait for your turn!'], 202);\n\t\t}\n\t\tif($word=='#'){\n\t\t\t$game = $this->nextPlayer($game, $utoken);\n\t\t\t$this->setRedis_set($gameId, $game);\n\t\t\t$this->setHeader(['success'=>0, 'msg'=>'You have passed your chance!'], 202);\n\t\t}else{\n\t\t\t$obj = new algo();\n\t\t\t$result = $obj->checkWord($game, $word, $utoken);\n\t\t\tif($result['status']){\n\t\t\t\t$game = $result['game'];\n\t\t\t\t$game = $this->nextPlayer($game, $utoken);\n\t\t\t\t$game = $this->gameStatus($game);\n\t\t\t\t$this->setRedis_set($gameId, $game);\n\t\t\t\t$this->setHeader(['success'=>1, 'msg'=>'Congratulations...Successfully matched the word!'], 200);\n\t\t\t}else{\n\t\t\t\t$game = $this->nextPlayer($game, $utoken);\n\t\t\t\t$this->setRedis_set($gameId, $game);\n\t\t\t\t$this->setHeader(['success'=>0, 'msg'=>$result['msg']], 202);\n\t\t\t}\n\t\t}\n }", "public function startGame($options);", "public function rewardWinners(& $wins,& $table){\n\t\t$pots=& $table->game_pots;\n\t\t$leftOvers=$pots[\"left_overs\"]->amount;\n\t\t$x.=print_r($wins,true);\n\t\t$x.=\"\\n\\n\";\n\t\tforeach ($wins as $points=>$winners){// loop through winners by highest points , search for elegible pot then add that pot to the users'amount'\n\t\t\t$pot_on=count($winners); // how many winners for single pot ?\n\t\t\t$x.= \"got $pot_on winners with score of $points\\n\";\n\t\t\tif ($pon_on=='1'){\n\t\t\t\t$table->dealerChat($pot_on.' winner .');\n\t\t\t}elseif($pon_on>'1'){\n\t\t\t\t$table->dealerChat($pot_on.' winners .');\n\t\t\t}\n\t\t\t$winName=$this->getWinName($points);\n\t\t\t//generate win text\n\t\t\t$winText=' With <label class=\"hand_name\">'.$winName->handName.'</label>' ;\n\t\t\tif ($winName->handName=='High Card'){\n\t\t\t\t$winText.=' '.$winName->normalKicker ;\n\t\t\t}else{\n\t\t\t\tif (isset($winName->doubleKicker)){\n\t\t\t\t\t$winText.=' of '.$winName->doubleKicker ;\n\t\t\t\t}\n\t\t\t\tif ((isset($winName->normalKicker) && !isset($winName->doubleKicker)) || isset($winName->normalKicker) && isset($winName->doubleKicker) && $winName->doubleKicker!=$winName->normalKicker){\n\t\t\t\t\t$winText.=' and '.$winName->normalKicker.' kicker' ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($winners as $winnerId){\n\t\t\t\t$x.= \" - checking winner $winnerId :\\n\";\n\t\t\t\t//search for pots who has this player id\n\t\t\t\t$winPlayer=new Player($winnerId);\n\t\t\t\t\t$x.= \" - Winner is $winPlayer->display_name $winPlayer->seat_id has $ $winPlayer->amount :\\n\";\n\t\t\t\t\tforeach ($pots as $id=>$pot){\n\t\t\t\t\t\tif ($pot->amount>0 && $id!=='left_overs'){\n\t\t\t\t\t\t\t$pot->amount+=$leftOvers;\n\t\t\t\t\t\t\t$leftOvers=0;\n\t\t\t\t\t\t\tif (!isset($pot->original_amount)){$pot->original_amount=$pot->amount;}\n\t\t\t\t\t\t\t$winAmount=round($pot->original_amount/$pot_on);\n\t\t\t\t\t\t\tif (in_array($winnerId,$pot->eligible)!==false){\n\t\t\t\t\t\t\t\t$pots[$id]->amount-=$winAmount;\n\t\t\t\t\t\t\t\t$winPlayer->amount+=$winAmount;\n\t\t\t\t\t\t\t\t$table->dealerChat($winPlayer->profile_link.' has won the pot <label class=\"cash_win\">($'.$winAmount.')</label> '.$winText.' .');\n\t\t\t\t\t\t\t\tif ($winAmount>0){$winPlayer->won=5;}else{$winPlayer->won=0;}\n\t\t\t\t\t\t\t\tif (substr($winPlayer->bet_name,0,6)=='<label'){\n\t\t\t\t\t\t\t\t\t$oldAmount=substr($winPlayer->bet_name,26,strpos($winPlayer->bet_name,'</label>')-26);\n\t\t\t\t\t\t\t\t\t$oldAmount+=$winAmount;\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$oldAmount.'</label>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$winAmount.'</label>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$winPlayer->saveBetData();\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\n\t\t\t}//\n\t\t\t\n\t\t}//\n\t\tfile_put_contents('wins.txt',$x);\n\t\n\t}", "public function makeMove($boardState, $playerUnit = 'X')\n {\n $opponentUnit = ($playerUnit == 'X' ? 'O' : 'X');\n $playerWinCases = array();\n $opponentWinCases = array();\n $choosePlayerWinCase = -1;\n $chooseOpponentWinCase = -1;\n foreach (self::$winningCases as $key => &$winCase) {\n\n $playerWinCase = new WinningCase($boardState, $winCase, $playerUnit);\n if (!$playerWinCase->isBlocked()) {\n if ($playerWinCase->countRemainingMoves() == 0) {\n $this->winner = $playerUnit;\n $this->winningCase = $winCase;\n return;\n } else if (!$choosePlayerWinCase instanceof WinningCase\n || (\n $choosePlayerWinCase instanceof WinningCase\n && $playerWinCase->countRemainingMoves() < $choosePlayerWinCase->countRemainingMoves()\n )\n ) {\n $choosePlayerWinCase = $playerWinCase;\n }\n }\n if ($playerWinCase->countRemainingMoves() > 0) {\n $playerWinCases[$playerWinCase->countRemainingMoves()] = $playerWinCase;\n// array_push($playerWinCases, $playerWinCase);\n }\n\n $opponentWinCase = new WinningCase($boardState, $winCase, $opponentUnit);\n if (!$opponentWinCase->isBlocked()) {\n if ($opponentWinCase->countRemainingMoves() == 0) {\n $this->winner = $opponentUnit;\n $this->winningCase = $winCase;\n return;\n } else if ($opponentWinCase->countRemainingMoves() == 1) {\n $chooseOpponentWinCase = $opponentWinCase;\n }\n }\n if ($opponentWinCase->countRemainingMoves() > 0) {\n $opponentWinCases[$opponentWinCase->countRemainingMoves()] = $opponentWinCase;\n// array_push($opponentWinCases, $opponentWinCase);\n }\n }\n\n // Winning case\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() == 1) {\n #if (DEBUG) echo 'Winning case:' . \"\\r\\n\";\n $this->winner = $playerUnit;\n $this->winningCase = $choosePlayerWinCase->winCase;\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n // Block opponent winning case (to avoid loss)\n if ($chooseOpponentWinCase instanceof WinningCase && $chooseOpponentWinCase->countRemainingMoves() > 0) {\n #if (DEBUG) echo 'Block opponent winning case -> Avoid loss:' . \"\\r\\n\";\n return array_merge($chooseOpponentWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n #if (DEBUG) echo 'No immediate winnning move found -> Best move:' . \"\\r\\n\";\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() > 0) {\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n $this->winner = 'Draw';\n return;\n }", "function main(){\n while(1){\n // show initial options\n $user_input = readline(showOptions(0));\n\n /* Buy flight ticket */\n if($user_input == \"1\"){\n $user_input = readline(showOptions(1));\n if($user_input == \"0\")\n continue;\n buyTicket();\n }\n\n /* Book accomodation */\n else if($user_input == \"2\"){\n $user_input = readline(showOptions(2));\n if( $user_input == \"0\")\n continue;\n bookRoom();\n }\n\n /* Buy package */\n else if($user_input == \"3\"){\n $user_input = readline(showOptions(3));\n if( $user_input == \"0\")\n continue;\n buyPackage();\n }\n }\n}", "function ShowTeamShowPlayers($team_id,$team_sub_id,$game_id,$mode = 1,$allowed_player_id = 0){\n\t\n\tglobal $db_league_players,$db_admin,$db_admin_guids,$db_clan_games;\n\t\n\tif ($mode == 2){\n\t\t$admin_guids = \"\";\n\t\t$sub_team = \"\";\n\t} else {\n\t\t$res_game = mysql_query(\"SELECT clan_games_game FROM $db_clan_games WHERE clan_games_id = \".(integer)$game_id) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t$ar_game = mysql_fetch_array($res_game);\n\t\t$sub_team = \"<tr style=\\\"background: #DCE3F1;\\\">\\n\";\n\t\t$sub_team .= \"\t<td colspan=\\\"5\\\" class=\\\"eden_title_middle\\\">Sub Team - \".$ar_game['clan_games_game'].\"</td>\\n\";\n\t \t$sub_team .= \"</tr>\\n\";\n\t}\n\t$output = $sub_team;\n\t$res_player = mysql_query(\"\n\tSELECT a.admin_id, a.admin_nick, a.admin_team_own_id, ag.admin_guid_guid, lp.league_player_id, lp.league_player_position_captain, lp.league_player_position_assistant, lp.league_player_position_player \n\tFROM $db_league_players AS lp \n\tJOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id \n\tLEFT JOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_game_id=\".(integer)$game_id.\" \n\tWHERE lp.league_player_team_id=\".(integer)$team_id.\" AND lp.league_player_game_id=\".(integer)$game_id) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$num = mysql_num_rows($res_player);\n\t$output .= \"<tr style=\\\"background: #ff8080;\\\">\\n\";\n\tif ($num > 0){\n\t\t$output .= \"\t<td width=\\\"120\\\" valign=\\\"middle\\\" class=\\\"eden_title_middle\\\">ID</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_PLAYER_POSITION.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_GUID.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\"></td>\\n\";\n\t} else {\n\t\t$output .= \"\t<td colspan=\\\"5\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_TEAM_NO_PLAYER_IN_SUB.\"</td>\\n\";\n\t}\n\t$output .= \"</tr>\\n\";\n\t$cislo = 0;\n\twhile ($ar_player = mysql_fetch_array($res_player)){\n\t\tif ($cislo % 2 == 0){ $cat_class = \"cat_level2_even\";} else { $cat_class = \"cat_level2_odd\";}\n\t\t$output .= \"<tr class=\\\"\".$cat_class.\"\\\">\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\".$ar_player['admin_id'].\"</td>\\n\";\n\t\t$output .= \"\t<td width=\\\"120\\\" valign=\\\"middle\\\">\";\n\t\t\t\t\t\tif ($mode == 2){\n\t\t\t\t\t\t\t$output .= \"<img src=\\\"./images/sys_\"; \n\t\t\t\t\t\t\tif (in_array($ar_player['league_player_id'],$allowed_player_id)){\n\t\t\t\t\t\t\t\t$output .= \"yes\"; $alt = _LEAGUE_PLAYER_PLAY;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$output .= \"no\"; $alt = _LEAGUE_PLAYER_NO_PLAY;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t$output .= \".gif\\\" width=\\\"15\\\" height=\\\"15\\\" alt=\\\"\".$alt.\"\\\" title=\\\"\".$alt.\"\\\"> \"; \n\t\t\t\t\t\t} \n\t\t\t\t\t\t$output .= \"<strong>\".stripslashes($ar_player['admin_nick']).\"</strong>\";\n\t\t$output .= \"\t</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; \n\t\t\t\t\tif (LeagueCheckPrivileges(\"O\",$ar_player['admin_id'],$team_id,\"\") == $team_id){$output .= _LEAGUE_PLAYER_POSITION_O; $comma = \", \";} else {$comma = \"\";}\n\t\t\t\t\tif (LeagueCheckPrivileges(\"C\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_C;} \n\t\t\t\t\tif (LeagueCheckPrivileges(\"A\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_A;} \n\t\t\t\t\tif (LeagueCheckPrivileges(\"P\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_P;} \n\t\t$output .= \"\t</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; if ($ar_player['admin_guid_guid'] != \"\"){ $output .= stripslashes($ar_player['admin_guid_guid']);} else {$output .= \"<span class=\\\"red\\\">\"._LEAGUE_PLAYER_NO_GUID.\"</span>\";} $output .= \"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\"></td>\\n\";\n\t\t$output .= \"</tr>\\n\";\n\t\t$cislo++;\n\t}\n\t\n\treturn $output;\n}", "public function testWinWhenHasAdvantageAndScore($player, $otherPlayer)\n {\n $match = $this->getMatchWithAdvantage($player);\n\n $match->score($player);\n\n $this->assertEquals(1, $match->getWonGame($player));\n }", "public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }", "function wpachievements_play_game() {\r\n if( is_user_logged_in() ) {\r\n $type='playedgame'; $uid=''; $postid='';\r\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $points = (int)get_blog_option(1, 'wpachievements_play_points');\r\n } else{\r\n $points = (int)get_option('wpachievements_play_points');\r\n }\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, $points);\r\n }\r\n }", "function getTurn ($board_num) {\n //get database info on player turn and player user ids\n $result = selectDB(\"SELECT PLAYERX, PLAYERO, TURN FROM BOARD WHERE BOARD_NUM='$board_num'\");\n\n //separate results into variables\n $playerx = $result['PLAYERX'];\n $playero = $result['PLAYERO'];\n $turnUser = $result['TURN'];\n \n //return 0 or 1\n if (strcmp($playerx, $turnUser) == 0) {\n return 0; //playerx's turn\n }\n else if (strcmp($playero, $turnUser) == 0) {\n return 1; //playero's turn\n }\n}", "public function testIntegrationSelectBlockOverWin()\n {\n $state = GameState::CreateFromString('X OX O ', 'O');\n $winMove = [2, 2, 'O'];\n $blockMove = [0, 2, 'O'];\n $validMoves = $state->getValidMoves();\n\n $this->assertContains($winMove, $this->movesToArray($validMoves));\n $this->assertContains($blockMove, $this->movesToArray($validMoves));\n\n $engine = new Blocker($state);\n $consideredMoves = $engine->getConsideredMoves();\n\n $this->assertNotContains($winMove, $this->movesToArray($consideredMoves));\n $this->assertContains($blockMove, $this->movesToArray($consideredMoves));\n }", "public function gameOver() : bool\n {\n return $this->cpu->totalScore() >= 100 || $this->player->totalScore() >= 100;\n }", "public function PracticeLobbySelector(Player $player){\n $form = new SimpleForm(function (Player $player, ?int $data){\n if (!is_null($data)){\n $prefix = \"§l§a» §fConnecting to the server...\";\n switch ($data){\n\n case 0:\n $player->sendMessage($prefix);\n $this->plugin->getScheduler()->scheduleRepeatingTask(new LP1($this->plugin, $player), 20);\n break;\n case 1:\n $player->sendMessage($prefix);\n $this->plugin->getScheduler()->scheduleRepeatingTask(new LP2($this->plugin, $player), 20);\n break;\n case 2:\n self::navigatorForm($player);\n break;\n default:\n return;\n }\n }\n });\n $form->setTitle(\"§l§cEndGames §7| §fPractice\");\n $images = [\n \"return\" => \"textures/ui/refresh_light\",\n \"lobby\" => \"textures/gui/newgui/mob_effects/strength_effect\"\n ];\n try {\n $lobby1 = PMQuery::query(\"207.244.228.121\", 19122);\n $lobby2 = PMQuery::query(\"207.244.228.121\", 19123);\n $lp1 = (int)$lobby1['Players'].\"§7/§a60\";\n $lp2 = (int)$lobby2['Players'].\"§7/§a60\";\n } catch (PmQueryException $e){\n $lp1 = \"§cOFFLINE\";\n $lp2 = \"§cOFFLINE\";\n }\n $form->addButton(\"§l§6LOBBY 1\\n§r§7Players Connected: §a\".$lp1, 0, $images[\"lobby\"]);\n $form->addButton(\"§l§6LOBBY 2\\n§r§7Players Connected: §a\".$lp2, 0, $images[\"lobby\"]);\n $form->addButton(\"§cReturn\", 0, $images[\"return\"]);\n\n $player->sendForm($form);\n\n }", "function rpc ($p1, $p2) {\n if ($p1 === $p2) {\n \t$result = 'Draw!';\n } elseif (($p1 == 'scissors' && $p2 == 'paper') || ($p1 == 'paper' && $p2 == 'rock') || ($p1 == 'rock' && $p2 == 'scissors')) {\n \t$result = 'Player 1 won!';\n } elseif (($p2 == 'scissors' && $p1 == 'paper') || ($p2 == 'paper' && $p1 == 'rock') || ($p2 == 'rock' && $p1 == 'scissors')) {\n \t$result = 'Player 2 won!';\n }\n return $result;\n}", "public function index()\r\n\t{\r\n\r\n\t\t$this->FarmGameModel->InitGame();\r\n\r\n\t\t$game_array = $this->FarmGameModel->GetGameInfo(true);\r\n\r\n\t\t// Check after init, turns are 0\t\t\t\t\t\t\r\n\t\t$expected_result = 0;\r\n\t\t$test = $game_array['turns'];\r\n\t\t$this->unit->run($test, $expected_result, 'init turns test');\r\n\r\n\t\t// Check after init, game over is 0\t\t\t\t\t\t\r\n\t\t$expected_result = 0;\r\n\t\t$test = $game_array['gameOver'];\r\n\t\t$this->unit->run($test, $expected_result, 'gameOver test');\r\n\r\n\t\t// Check after init, winStatus is 0\t\t\t\t\t\t\r\n\t\t$expected_result = 0;\r\n\t\t$test = $game_array['winStatus'];\r\n\t\t$this->unit->run($test, $expected_result, 'win test');\r\n\r\n\t\techo $this->unit->report();\r\n\t}", "public function onRun(): void\n {\n foreach (Server::getInstance()->getOnlinePlayers() as $player){\n $session = SessionManager::getSession($player->getXuid());\n if ($session !== null && $session->getTogglesModule()->scoreboards()){\n ScoreboardHandler::sendAppropriateScoreboard($session);\n }\n }\n }", "function playerConnect(){\n\t return true;\n\t}", "public function check_wipers() {\r\n echo PHP_EOL;\r\n $this->action(\"checking wipers\");\r\n $this->action($this->wipers_on ? \"windshield wipers are on\" : \"windshield wipers are off\");\r\n }", "protected function isWon($marker) {\n $markedBox = $this->_markers[$marker];\n foreach ($this->_winningCombination AS $box) {\n $lineBoxes = explode(\",\", $box); //separate the winning combination to 3\n if (in_array($lineBoxes[0], $markedBox) && in_array($lineBoxes[1], $markedBox) && in_array($lineBoxes[2], $markedBox)) {\n echo \"Player $marker won!\" . PHP_EOL;\n return TRUE;\n }\n }\n return FALSE;\n }", "function _assignMatchesDo() {\n\t\tdefined('_JEXEC') or die( 'Invalid Token' );\n\n\t\t// Turnierdaten!\n\t\t$tournament = new CLMTournament($this->id, true);\n\t\t// $tournament->data->typ\n\n\t\tif (($tournament->data->tl != clm_core::$access->getJid() AND $clmAccess->access('BE_tournament_edit_round') !== true) OR $clmAccess->access('BE_tournament_edit_round') === false) {\n\t\t\t$this->app->enqueueMessage( JText::_('TOURNAMENT_NO_ACCESS'),'warning' );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($tournament->data->typ == 2) {\n\t\t\t// Vollturnier nur via Rundenerstellung!\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'IMPOSSIBLE' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t} elseif ($tournament->data->typ == 3) { // KO\n\t\t\t// maximal bestätige Runde holen - ist hier MIN(nr)\n\t\t\t$query = 'SELECT MIN(nr) FROM #__clm_turniere_rnd_termine'\n\t\t\t\t. ' WHERE turnier = '.$this->id.' AND tl_ok = 1';\n\t\t\t$this->_db->setQuery( $query );\n\t\t\tif ($tlokMin = $this->_db->loadResult()) {\n\t \t\t\t$roundToDraw = $tlokMin-1;\n\t \t\t} else {\n\t \t\t\t$roundToDraw = $tournament->data->runden;\n\t\t\t}\n\t\t\t// nächste zu vervollständigende Runde ermittelt\n\t\t\tif ($roundToDraw == 0) { // dann gibt es nichts mehr zu tun\n\t\t\t\t$this->app->enqueueMessage( JText::_('NO_ROUND_LEFT'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Frage: sind in dieser Runde schon Partien angesetzt?\n\t\t\t$query = 'SELECT COUNT(*)'\n\t\t\t\t\t. ' FROM #__clm_turniere_rnd_spl'\n\t\t\t\t\t. ' WHERE turnier = '.$this->id.' AND runde = '.$roundToDraw.' AND ((spieler >= 1 AND gegner >= 1) OR ergebnis = 8)';\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$matchesAssigned = $this->_db->loadResult();\n\t\t\t\n\t\t\tif ($matchesAssigned > 0) { // bereits Matches angelegt\n\t\t\t\t$this->app->enqueueMessage( JText::_('MATCHES_ASSIGNED_ALREADY'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// OKay, jetzt kann angesetzt werden\n\t\t\t// alle Spieler, die 'in' sind holen\n\t\t\t$query = \"SELECT snr \"\n\t\t\t\t\t. \" FROM #__clm_turniere_tlnr\"\n\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND koStatus = '1'\";\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$playersIn = $this->_db->loadAssocList('snr');\n\t\t\t\n\t\t\t// wieviele Matches werden benötigt? \n\t\t\t// Spielerzahl - (maximale Matches der Runde / 2)\n\t\t\t// maximale Matches der Runde: 2^Runde\n\t\t\t$neededMatches = (count($playersIn) - pow(2, $roundToDraw)/2);\n\t\t\t\n\t\t\t// TODO: Sicherheitscheck, ob diese Boards wirklich vorhanden!\n\t\t\t\n\t\t\t// jetzt setzen wir an jedes Board eine Zufallspaarung\n\t\t\t\n\t\t\t// Matches zusammenstellen\n\t\t\t$sid = $tournament->data->sid;\n\t\t\tfor ($m=1; $m<=$neededMatches; $m++) {\n\t\t\t\t// Spieler 1\n\t\t\t\t$player1 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player1]);\n\t\t\t\t// Spieler 2\n\t\t\t\t$player2 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player2]);\n\t\t\t\t// SQL\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player1.\", spieler = \".$player1.\", gegner = \".$player2\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '1'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player2.\", spieler = \".$player2.\", gegner = \".$player1\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '0'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$this->app->enqueueMessage( JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED') );\n\t\n\t\t\t// Log\n\t\t\t$clmLog = new CLMLog();\n\t\t\t$clmLog->aktion = JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED');\n\t\t\t$clmLog->params = array('sid' => $tournament->data->sid, 'tid' => $this->id, 'rnd' => $roundToDraw); // TurnierID wird als LigaID gespeichert\n\t\t\t$clmLog->write();\n\t\n\t\n\t\t} elseif ($tournament->data->typ == 1) { // CH\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'NOTIMPLEMENTED' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\n\t}", "function checks() {\n\t// Check login\n\tif (isset($_COOKIE['id']) AND isset($_COOKIE['authkey'])) {\n\t\t$pdo=new PDO('mysql:host=gtogame.db.9808275.hostedresource.com;dbname=gtogame', 'gtogame', 'D7Awthkp2946!');\n\t\t$stmt=$pdo->prepare('SELECT banned, banreason, dead, health, sessauth FROM Players WHERE id = :id LIMIT 1');\n\t\t$stmt->bindParam(':id', $_COOKIE['id'], PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$row=$stmt->fetch(PDO::FETCH_ASSOC);\n\t\t// Verify player logged in legitimately\n\t\tif ($row['sessauth'] != $_COOKIE['authkey']) {\n\t\t\tsetcookie ('id', '0', time()-300, '/', '', 0);\n\t\t\tsetcookie ('authkey', '0', time()-300, '/', '', 0);\n\t\t\theader(\"Location: index.php\");\n\t\t\texit();\n\t\t}\n\t\t// Check health\n\t\tif ($row['health'] == 0 OR $row['dead'] > 0) {\n\t\t\theader(\"Location: dead.php\");\n\t\t\texit();\n\t\t}\n\t\t// Check ban status\n\t\tif($row['banned'] == 1) {\n\t\t\techo \"<h1>You have been banned!</h1>If you have any questions, please contact a staff member.<br><br><strong>Reason:</strong> \".$row['banreason'];\n\t\t\texit();\t \n\t\t}\n\t} else {\n\t\theader(\"Location: index.php\");\n\t\texit();\n\t}\n}", "function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}", "public function checkGuess()\n\t\t{\n\t\t\tif(isset($_GET['action']))\n\t\t\t{\n\t\t\t\tif($_GET['action']=='login' || $_GET['action']=='lugares')\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['control']=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_SESSION['control']=0;\n\t\t\t}\n\t\t}", "public function testComputerWin()\n {\n session_start();\n\n $mockDiceHand = $this->createMock(DiceHand::class);\n $mockDiceHand->method('getSum')\n ->willReturn(21);\n $mockDiceHand->method('graphicLastRoll')\n ->willReturn([\"die die-5\", \"die die-5\"]);\n\n $game = new Game($mockDiceHand);\n\n $_SESSION = [\n \"playerBitcoin\" => 10,\n \"computerBitcoin\" => 100,\n \"currentBet\" => 0,\n \"playerScore\" => 15,\n \"numDice\" => 2,\n ];\n\n $_POST = [];\n\n $_GET = [\n \"turn\" => \"computer\",\n ];\n\n $result = $game->playGame();\n\n $expected = [\n \"title\" => \"21\",\n \"header\" => \"Result this round\",\n \"pageToRender\" => \"layout/dice-winner.php\"\n ];\n\n renderView($result[\"pageToRender\"], $result);\n\n $this->assertIsArray($result);\n $this->assertEquals(1, $_SESSION[\"computerWins\"]);\n $this->assertEquals($expected[\"header\"], $result[\"header\"]);\n $this->assertEquals($expected[\"pageToRender\"], $result[\"pageToRender\"]);\n }", "public function winner($resultOne, $resultTwo){\n if($resultOne > $resultTwo){\n echo 'You are Winner';\n }else{\n echo 'You are Loser';\n }\n }", "function displayWinner($total1, $total2, $total3, $total4, $person, $person2, $person3, $person4)\n {\n echo \"Winner: \";\n \n if($total1 > $total2 && $total1 > $total3 && $total1 > $total4)\n {\n echo \"<img src='\".$person[\"profilePicUrl\"].\"'>\";\n }\n else if ($total2 > $total1 && $total2 > $total3 && $total2 > $total4)\n {\n echo \"<img src='\".$person2[\"profilePicUrl\"].\"'>\";\n }\n else if($total3 > $total1 && $total3 > $total2 && $total3 > $total4)\n {\n echo \"<img src='\".$person3[\"profilePicUrl\"].\"'>\";\n }\n else if($total4 > $total1 && $total4 > $total2 && $total4 > $total3)\n {\n echo \"<img src='\".$person4[\"profilePicUrl\"].\"'>\";\n }\n else {\n echo \"More than one winner\";\n }\n \n }", "function determineNextGame( $gameID, $teamID, $winnerOrLoser ) {\n\n/* ... get the details for the game just played */\n $gameDetails = $this->getGameDetails( $gameID );\n \n/* ... get the details for the next game using the proper flow */\n if ($winnerOrLoser == \"WINNER\") {\n $nextGameDetails = $this->findGameByTournamentID( $gameDetails['WinnerNextGame'] );\n }\n else {\n if ($gameDetails['LoserNextGame'] != \"\") {\n $nextGameDetails = $this->findGameByTournamentID( $gameDetails['LoserNextGame'] );\n }\n else {\n return( -1 );\n }\n }\n \n/* ... if we have a game to update, then figure out what to change and do it */\n if (count( $nextGameDetails ) > 0) {\n $dbData = array();\n $division = substr( $gameDetails['TournamentID'], 0, 1 );\n \n/* ... if the Home Team hasn't been set, then put the winner in as the home team for now */ \n if ($nextGameDetails['HomeTeamID'] == NULL) {\n $dbData = array(\n \"GameID\" => $nextGameDetails['GameID'],\n \"HomeTeamID\" => $teamID\n );\n }\n else {\n\n/* ... determine who should be the home team from the 2 teams now known for the game */\n if ($this->_whoIsBetterSeed( $teamID, $nextGameDetails['HomeTeamID'], $division ) == $teamID) {\n $dbData = array( \n \"GameID\" => $nextGameDetails['GameID'],\n \"VisitTeamID\" => $nextGameDetails['HomeTeamID'],\n \"HomeTeamID\" => $teamID\n );\n }\n else {\n $dbData = array( \n \"GameID\" => $nextGameDetails['GameID'],\n \"VisitTeamID\" => $teamID\n );\n }\n }\n\n/* ... time to update the database */\n $this->saveGameResult( $nextGameDetails['GameID'], $dbData );\n\n }\n\n/* ... time to go */\n return( $dbData['GameID'] );\n }", "abstract public function pickWinner($reset = FALSE, $bypass_used_info = FALSE);", "public function chooseOption($gameId, $playerId, $options);", "function getActions($user, $opponent, $type) {\n\tglobal $dbUser, $dbPass, $dbTable, $con;\n\n\t$playerResult = mysqli_query($con,\"SELECT PlayerID FROM Players WHERE Email = '$user' LIMIT 1\");\n\t$row = mysqli_fetch_assoc($playerResult);\n\t$player = $row['PlayerID'];\n\n\t// If we are trying to compare the logged in user with themselves on the list kill this function\n\tif ($player == $opponent) {\n\t\treturn false;\n\t}\n\n\t// Find any matches these two have\n\t$matchups = array();\n\n\t$matchResult = mysqli_query($con,\"SELECT MatchID, ChallengerID, DefenderID, Status FROM Games WHERE (ChallengerID = '$player' OR DefenderID = '$player') AND (ChallengerID = '$opponent' OR DefenderID = '$opponent') AND (Status = 'Pending' OR Status = 'Issued')\");\n\twhile($row = mysqli_fetch_assoc($matchResult)) {\n\t\t$matchups[] = $row;\n\t}\n\n\tif (count($matchups) > 0) {\n\t\tforeach ($matchups as $key => $value) {\n\t\t\tif ($value['Status'] == 'Pending') {\n\t\t\t\tif ($value['ChallengerID'] == $player) {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"reportMatch(' . $value['MatchID'] . ',' . $value['ChallengerID'] . ',' . $value['DefenderID'] . ',\\'' . getName($opponent) . '\\',\\'Ladder\\',\\'Challenge\\')\">Report Match</button>';\n\t\t\t\t} else {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"reportMatch(' . $value['MatchID'] . ',' . $value['DefenderID'] . ',' . $value['ChallengerID'] . ',\\'' . getName($opponent) . '\\',\\'Ladder\\',\\'Defend\\')\">Report Match</button>';\n\t\t\t\t}\n\t\t\t} else if ($value['Status'] == 'Issued') {\n\t\t\t\tif ($value['ChallengerID'] == $player) {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"withdrawChallenge(' . $value['MatchID'] . ')\">Withdraw</button>';\n\t\t\t\t} else {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"acceptChallenge(' . $value['MatchID'] . ')\">Accept</button><button class=\"btn\" onclick=\"refuseChallenge(' . $value['MatchID'] . ')\">Refuse</button>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$actions = '<button class=\"btn\" onclick=\"issueChallenge(' . $player . ',' . $opponent . ',\\'' . getName($opponent) . '\\',\\'Ladder\\')\">Issue Challenge</button>';\n\t}\n\t\n\treturn $actions;\n}", "public function selectLeagueWinner($league, $team);", "function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}", "public function SkywarsLobbySelector(Player $player){\n try {\n $sw1 = PMQuery::query(\"sw1\", 19135);\n $sw2 = PMQuery::query(\"sw2\", 19135);\n $sw3 = PMQuery::query(\"sw2\", 19135);\n $plsw1 = (int)$sw1['Players'].\"§7/§a50\";\n $plsw2 = (int)$sw2['Players'].\"§7/§a50\";\n $plsw3 = (int)$sw3['Players'].\"§7/§a50\";\n } catch (PmQueryException $e){\n $plsw1 = \"§cOFFLINE\";\n $plsw2 = \"§cOFFLINE\";\n $plsw3 = \"§cOFFLINE\";\n }\n $form = new SimpleForm(function (Player $player, ?int $data){\n if (!is_null($data)){\n switch ($data){\n\n case 0:\n $player->sendMessage(self::EXEPCION);\n //$this->plugin->getScheduler()->scheduleRepeatingTask(new LP1($this->plugin, $player), 20);\n break;\n case 1:\n $player->sendMessage(self::EXEPCION);\n break;\n case 2:\n $player->sendMessage(self::EXEPCION);\n break;\n case 3:\n self::navigatorForm($player);\n break;\n default:\n return;\n }\n }\n });\n $form->setTitle(\"§l§cEndGames §7| §6SkyWars\");\n $images = [\n \"return\" => \"textures/ui/refresh_light\",\n \"sw\" => \"textures/items/bow_pulling_0\"\n ];\n $form->addButton(\"§l§6LOBBY 1\\n§r§7Players Connected: §a\".$plsw1, 0, $images[\"sw\"]);\n $form->addButton(\"§l§6LOBBY 2\\n§r§7Players Connected: §a\".$plsw2, 0, $images[\"sw\"]);\n $form->addButton(\"§l§6LOBBY 3\\n§r§7Players Connected: §a\".$plsw3, 0, $images[\"sw\"]);\n $form->addButton(\"§cReturn\", 0, $images[\"return\"]);\n\n $player->sendForm($form);\n\n }", "public function startBattle()\n {\n echo \"Starting battle.. <br />\";\n echo \"Type of this battle is: <i>\" . $this->_type . \"</i>.<br />\";\n echo \"\\t\\t<i>\" . $this->getTypeDescription() . \"</i><br/>\";\n \n $round = 0;\n while(!$this->battleFinished())\n {\n // prints information about current round:\n echo \"<br /><br />ROUND \" . $round++ . \" Attacker: <i>\";\n echo $this->getAttacker()->getName();\n echo \"</i>\\tDefender: <i>\";\n echo $this->getDefender()->getName() . \"</i>\";\n $this->status();\n \n $this->getAttacker()->fight($this, $this->getDefender());\n \n $this->changeTurn(); \n }\n \n // battle is over, print status and declare winner (if there is any) \n $this->status(); \n echo \"<br/><br/>The winner is: <b>\";\n echo $this->getWinner() . \"</b>!\" . PHP_EOL;\n }", "public function playerHasWon() {\n foreach ($this->players as $player) {\n if ($player->score >= $this->game->winningScore) {\n return true;\n }\n }\n return false;\n }", "public function testVerifyToNotWin()\n {\n\n $match = $this->createMatch();\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n $winner = new Winner();\n $winner->verify($match, 0, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(0, $matchFound->winner);\n\n }", "function buttons($instance, $owner, $doc, $dom) {\n\n $move = $dom->getElementsByTagName('currentMove');\n $currentPlayer = $move[0]->nodeValue;\n\n $sql = \"SELECT `USER`, `Move` FROM `TableCreatedBy_\" . $owner . \"`;\";\n $retval = $instance->sendRequest($sql);\n\n if ($_SESSION[\"user\"] === $currentPlayer) {\n while ($row = mysql_fetch_row($retval)) {\n if ($row[0] === $currentPlayer) {\n if ($row[1] === \"none\") {\n printCall($doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printPlayerButtons(\"Check\", \"Check\", \"checkFunction()\", $doc);\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n } else if ($row[1] !== \"fold\") {\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printCall($doc);\n }\n }\n }\n }\n}", "function game_is_broken($game) {\n\tif ($game->is_tie()) {\n\t\techo \"\\n\\n****ERROR: Broken Game. Tie! in game_is_broken()\";\n\t\tpause(\"\");\n\t\treturn true;\n\t}\n\treturn false;\n}", "function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\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$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}", "function tictactoe_Game($Game){\n\t\t$predicate = \n\t\t\":-include('Minigames/TicTacToe.pl').\n\n\t\tgo :-\n\t\t\ttictactoe($Game,Return),\n\t\t\twrite(Return).\";\n $prolog = new Prolog;\n return $prolog->executePredicate($predicate);\n\t}", "public function play()\n {\n $this->spin();\n foreach ($this->bets as $bet_type => $wager)\n {\n if (method_exists(Game, $bet_type))\n {\n if ($payoff = $this->$bet_type())\n {\n $this->win = true;\n $money_won = ($wager * $payoff);\n $this->increment_money_won($money_won);\n $this->increment_money($money_won);\n }\n else\n {\n $this->increment_money_lost($wager);\n $this->decrement_money($wager);\n }\n }\n }\n return $this->win;\n }", "public abstract function onPlayerSelect();", "function compete($a,$b){\n $p = intval(100 * getWinProb($a['elo']-$b['elo']));\n $expected = ($a['elo']>=$b['elo']) ? $a['name'] : $b['name'];\n $percent = ($a['elo']>=$b['elo']) ? $p.'%' : (100-$p).'%';\n $n = mt_rand(1,100);\n $winner = ($n<=$p) ? $a['name'] : $b['name'];\n \n //echo sprintf(\"Now Playing: %s (%s) vs. %s (%s) \\n\", $a['name'], $a['elo'], $b['name'], $b['elo']);\n //echo sprintf(\"Expected winner: %s (%s)\\n\", $expected, $percent);\n //echo sprintf(\"Actual winner: %s\\n\\n\", $winner);\n return ($n<=$p) ? $a : $b;\n}", "public abstract function hasWaitingLobby(): bool;", "protected function thinkBot() {\n $cellReturn = '';\n $markers = array($this->_botMark, $this->_userMark); //offense first, then defense\n while ($this->isValidMove($cellReturn) === FALSE) {\n //defense and offense\n foreach ($markers AS $marker) {\n foreach ($this->_winningCombination AS $cells) {\n $lineCells = explode(\",\", $cells); //separate the winning combination to 3\n $marked = 0;\n $noMark = 0;\n for ($x = 0; $x < 3; $x++) {\n if (in_array($lineCells[$x], $this->_markers[$marker]))\n $marked++;\n else\n $noMark = $lineCells[$x];\n }\n if ($marked == 2 && $this->isValidMove($noMark)) {\n $cellReturn = $noMark;\n break;\n }\n }\n if ($cellReturn != '')\n break;\n }\n //plan\n if ($cellReturn == '') {\n while (!$this->isValidMove($cellReturn)) {\n $combinationRandKey = rand(0, 7);\n //separate the winning combination to 3 elements\n $lineCells = explode(\",\", $this->_winningCombination[$combinationRandKey]);\n if ($this->isValidMove($lineCells[0]))\n $cellReturn = $lineCells[0];\n elseif ($this->isValidMove($lineCells[1]))\n $cellReturn = $lineCells[1];\n else\n $cellReturn = $lineCells[2];\n }\n }\n }\n return $cellReturn;\n }", "function feedback() {\n\n\t$correctFeedback = array('Good job!', 'Such a champion!', 'What a genius!', );\n \tshuffle($correctFeedback);\n\n \t$incorrectFeedback = array('Nice try', 'Better luck next time', 'Practice my friend', );\n \tshuffle($incorrectFeedback);\n\n if ($_SESSION['answer'] == $_SESSION['correct'] AND isset($_POST['answer'])){\n\t\n\t\techo \"<p class='' style='color: green;'>\" . $correctFeedback[0] . \" Keep going.</p>\";\n\n \t} elseif ($_SESSION['answer'] != $_SESSION['correct'] AND isset($_POST['answer'])){\n\n\t\techo \"<p class='' style='color: red;'>\" . $incorrectFeedback[0] . \"</p>\";\n\n\t}\n\n}", "public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }", "function sendWinner($gamestate){\n\tsend([\n\t\t'function' => 'winner',\n\t\t'data' => $gamestate,\n\t\t'me' => getSessionVar(\"playernum\"),\n\t\t'winner' => $gamestate['winner'],\n\t]);\n\treset_player();\n}" ]
[ "0.6589166", "0.6433877", "0.64217716", "0.63819706", "0.63748604", "0.6328731", "0.6206049", "0.6187922", "0.6138559", "0.6135243", "0.6121035", "0.6108813", "0.6054958", "0.6048036", "0.6024792", "0.6010392", "0.59892184", "0.59780717", "0.59224045", "0.58602285", "0.5823664", "0.5811094", "0.5770725", "0.57366997", "0.5647493", "0.56201625", "0.56166226", "0.55758345", "0.55599296", "0.5556948", "0.5547577", "0.55389106", "0.549712", "0.54911435", "0.5482806", "0.54716116", "0.5469536", "0.5464691", "0.54600364", "0.5443593", "0.5430964", "0.5424708", "0.540693", "0.540633", "0.53825223", "0.53790486", "0.5374329", "0.5337779", "0.53340673", "0.53238916", "0.53173965", "0.530215", "0.5296234", "0.52960205", "0.5271623", "0.527078", "0.52668804", "0.52489054", "0.52352494", "0.5232156", "0.5230752", "0.52187335", "0.5193292", "0.518295", "0.51651394", "0.5154678", "0.51442295", "0.5139718", "0.51370716", "0.5129498", "0.5117029", "0.51157695", "0.51118255", "0.5105704", "0.51000166", "0.50977856", "0.5094999", "0.5085638", "0.5083028", "0.5082957", "0.5080823", "0.507697", "0.5070531", "0.5064613", "0.5057716", "0.50547814", "0.5047006", "0.5043056", "0.5029224", "0.50186056", "0.5001464", "0.49979278", "0.49951985", "0.497849", "0.49705645", "0.49688548", "0.49666345", "0.49587646", "0.49525225", "0.49501437" ]
0.5954841
18
Function check vartical winning [X] [X] [X] [X] function run from the point the user choose to type his discs check : first search below the userMove, then search above the userMove In case of sequence 4 of the current player in a column player won
public function checkVerticalWin($userMove){ $varticalCounter = self::ZERO; $gameBoards = $this->board->gameBoard; $current_player = "[$this->currentPlayer]"; for($row = ($this->board->getRows() - 1) ; $row > -1 ; $row-- ){ if($varticalCounter == self::WIN){ return true; } elseif($gameBoards[$row][$userMove-1] == $current_player){ $varticalCounter++; } elseif($row < 2 && $varticalCounter < 1 ){ return false; } elseif($gameBoards[$row][$userMove-1] == Board::CELL){ $varticalCounter = self::ZERO; continue; } else{ $varticalCounter = self::ZERO; } } return $varticalCounter >= self::WIN ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }", "function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}", "public function checkHorizontalWin($userMove){\r\n $HorizontalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $row = $this->lastRowInsert;\r\n $current_player = \"[$this->currentPlayer]\";\r\n\r\n for($col = $userMove-1; $col > -1 ; $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break; \r\n }\r\n $HorizontalCounter++;\r\n }\r\n for($col= $userMove; $col < Board::COLUMNS ; $col++){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $HorizontalCounter++; \r\n }\r\n return $HorizontalCounter >= self::WIN ? true : false;\r\n \r\n }", "public function checkNegativeDiagonalWin($userMove){\r\n $diagonalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = $this->lastRowInsert-1 ,$col = $userMove; $row > -1 && $col < Board::COLUMNS ; $row--, $col++ ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n for($row = $this->lastRowInsert ,$col = $userMove-1; $row < Board::ROWS && $col > -1 ; $row++, $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n return $diagonalCounter >= self::WIN ? true : false;\r\n }", "function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }", "function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}", "public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }", "protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }", "public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n if ($rightDiagonalSum == $this->boardSize || $leftDiagonalSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n if ($rightDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $column = array_column($this->board, $i);\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n if ($columnSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($columnSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($rowSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->secondMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }", "public function checkForWinner($playerOne, $playerTwo){\n if(($playerOne == 1 && $playerTwo == 2) || ($playerOne == 2 && $playerTwo == 3 || ($playerOne == 3 && $playerTwo == 1))){\n $this->printResult($playerOne, $playerTwo, 1);\n return 1;\n }elseif(($playerOne == 1 && $playerTwo == 1) || ($playerOne == 2 && $playerTwo == 2) || ($playerOne == 3 && $playerTwo == 3)){\n $this->printResult($playerOne, $playerTwo, 2);\n return 2;\n }else{\n $this->printResult($playerOne, $playerTwo, 3);\n return 3;\n }\n}", "function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}", "public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }", "abstract protected function winnerExists();", "function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}", "function buttons($instance, $owner, $doc, $dom) {\n\n $move = $dom->getElementsByTagName('currentMove');\n $currentPlayer = $move[0]->nodeValue;\n\n $sql = \"SELECT `USER`, `Move` FROM `TableCreatedBy_\" . $owner . \"`;\";\n $retval = $instance->sendRequest($sql);\n\n if ($_SESSION[\"user\"] === $currentPlayer) {\n while ($row = mysql_fetch_row($retval)) {\n if ($row[0] === $currentPlayer) {\n if ($row[1] === \"none\") {\n printCall($doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printPlayerButtons(\"Check\", \"Check\", \"checkFunction()\", $doc);\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n } else if ($row[1] !== \"fold\") {\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printCall($doc);\n }\n }\n }\n }\n}", "abstract public function winner();", "function getMovesForMatch ()\r\n{\r\n\t//array of chess moves assuming a few things:\r\n\t/* \t- light/dark take turns \r\n\t\t- the moves are set up to take a piece and move it to another,\r\n\t\t\tso moving pawn e2 -> e4 would be stored as the first 2 elements in a multidimensional array.\r\n\t\t- there are many things that would need to be done to support algebraic chess notation, \r\n\t\t\tI didn't go into that here.\t\t\r\n\t\t\r\n\t*/\r\n\t$matchMoves = array();\r\n\t\r\n\t/*\r\n\t$matchMoves [0]['from'] = \"e2\";\r\n\t$matchMoves [0]['to'] \t= \"e4\";\r\n\t$matchMoves [1]['from'] = \"c7\";\r\n\t$matchMoves [1]['to']\t= \"c5\";\r\n\t\r\n\t$matchMoves [2]['from'] = \"g1\";\r\n\t$matchMoves\t[2]['to']\t= \"f3\";\r\n\t$matchMoves [3]['from'] = \"b8\";\r\n\t$matchMoves [3]['to']\t= \"c6\";\r\n\t\r\n\t//begin invalid off board examples\r\n\t$matchMoves [4]['from'] = \"c6\";\r\n\t$matchMoves [4]['to'] \t= \"c9\";\r\n\t\r\n\t$matchMoves [5]['from'] = \"c6\";\r\n\t$matchMoves [5]['to'] \t= \"c0\";\r\n\t\r\n\t$matchMoves [6]['from'] = \"c6\";\r\n\t$matchMoves [6]['to'] \t= \"z9\";\r\n\t*/\r\n\t//begin invalid examples for particular pieces\r\n\t\r\n\t//king =======================\r\n\t//bad move\r\n\t$matchMoves [7]['from'] = \"e8\";\r\n\t$matchMoves [7]['to'] \t= \"g7\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [8]['from'] = \"e8\";\r\n\t$matchMoves [8]['to'] \t= \"f7\";\r\n\t\r\n\t//rook =========================\r\n\t//bad move\r\n\t$matchMoves [9]['from'] = \"h8\";\r\n\t$matchMoves [9]['to'] \t= \"h5\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [10]['from'] = \"h7\";\r\n\t$matchMoves [10]['to'] \t = \"h6\";\t\r\n\t$matchMoves [11]['from'] = \"h6\";\r\n\t$matchMoves [11]['to'] \t = \"h5\";\r\n\t$matchMoves [12]['from'] = \"h5\";\r\n\t$matchMoves [12]['to'] \t = \"h4\";\r\n\t$matchMoves [13]['from'] = \"h8\";\r\n\t$matchMoves [13]['to'] \t = \"h5\";\r\n\t\r\n\t//bishop ========================\r\n\t//bad move\r\n\t$matchMoves [14]['from'] \t= \"c8\";\r\n\t$matchMoves [14]['to'] \t\t= \"b8\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [15]['from'] \t= \"c8\";\r\n\t$matchMoves [15]['to'] \t\t= \"c7\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [16]['from'] \t= \"b7\";\r\n\t$matchMoves [16]['to'] \t\t= \"b6\";\r\n\t$matchMoves [17]['from'] \t= \"c8\";\r\n\t$matchMoves [17]['to'] \t\t= \"a6\";\r\n\t\r\n\t//queen ==========================\r\n\t$matchMoves [18]['from'] \t= \"d8\";\r\n\t$matchMoves [18]['to'] \t\t= \"c8\";\r\n\t\r\n\t\t\r\n\t//setting up a check for between functions - rook\r\n\t$matchMoves [19]['from'] \t= \"f2\";\r\n\t$matchMoves [19]['to'] \t\t= \"f3\";\r\n\t$matchMoves [20]['from'] \t= \"f3\";\r\n\t$matchMoves [20]['to'] \t\t= \"f4\";\r\n\t$matchMoves [21]['from'] \t= \"f4\";\r\n\t$matchMoves [21]['to'] \t\t= \"f5\";\r\n\t\r\n\t$matchMoves [22]['from'] \t= \"h5\";\r\n\t$matchMoves [22]['to'] \t\t= \"e5\";\r\n\t\r\n\t//demonstrating capture move a pawn to capture\r\n\t$matchMoves [23]['from'] \t= \"f7\";\r\n\t$matchMoves [23]['to'] \t\t= \"f6\";\r\n\t$matchMoves [24]['from'] \t= \"g7\";\r\n\t$matchMoves [24]['to'] \t\t= \"g6\";\r\n\t$matchMoves [25]['from'] \t= \"f5\";\r\n\t$matchMoves [25]['to'] \t\t= \"g6\";\r\n\t\r\n\r\n\treturn ($matchMoves);\r\n}", "function getTurn ($board_num) {\n //get database info on player turn and player user ids\n $result = selectDB(\"SELECT PLAYERX, PLAYERO, TURN FROM BOARD WHERE BOARD_NUM='$board_num'\");\n\n //separate results into variables\n $playerx = $result['PLAYERX'];\n $playero = $result['PLAYERO'];\n $turnUser = $result['TURN'];\n \n //return 0 or 1\n if (strcmp($playerx, $turnUser) == 0) {\n return 0; //playerx's turn\n }\n else if (strcmp($playero, $turnUser) == 0) {\n return 1; //playero's turn\n }\n}", "function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\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$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}", "public static function diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, &$boardRows, $direction, &$removedPawnIds, &$errorMsg)\n\t{\n\t\tswitch($direction)\n\t\t{\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_UP_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_UP_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_DOWN_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_DOWN_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null; \n\t\t}\n\n\t\tfor($possiblePosition = self::MIN_POSITION; $possiblePosition <= self::MAX_POSITION; $possiblePosition++)\n\t\t{\n\t\t\tif($prevX+($diffX*$possiblePosition) === $newX && $prevY+($diffY*$possiblePosition) === $newY)\n\t\t\t{\n\t\t\t\tif(($possiblePosition % 2) !== 0)\n\t\t\t\t{\n\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\tif(\t$prevY+$diffY < 0 || \n\t\t\t\t\t\t$prevX+$diffX < 0 || \n\t\t\t\t\t\t$prevY+$diffY > count($boardRows)-1 || \n\t\t\t\t\t\t$prevX+$diffX > count($boardRows)-1)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t//it should not search further if previous and new positions are the same\n\t\t\t\t\tif($prevX === $newX && $prevY === $newY)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t$posEvaluation = $playerNumber === FIRST_PLAYER ? \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > PLAYER_PAWNS_AMOUNT) : \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > 0 && $boardRows[$prevY+$diffY][$prevX+$diffX] <= PLAYER_PAWNS_AMOUNT);\n\n\t\t\t\t\t//checking if an opponent pawn had been spotted\n\t\t\t\t\tif($posEvaluation)\n\t\t\t\t\t{\n\t\t\t\t\t\t$removedPawnIds[] = intval($boardRows[$prevY+$diffY][$prevX+$diffX]);\n\t\t\t\t\t\t$boardRows[$prevY+$diffY][$prevX+$diffX] = 0;\n\t\t\t\t\t\t$prevX+=$diffX*2;\n\t\t\t\t\t\t$prevY+=$diffY*2;\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//if the algorithm didn't reach the end that means that the chosen position is \n\t\t\t\t\t\t//illegal since newX and newY and the last opponent are too far apart\n\t\t\t\t\t\tif($prevX !== $newX && $prevY !== $newY)\n\t\t\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }", "public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }", "public function rejectIfWrongMove(Board $board, User $player, $row, $col);", "private function findLineMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('up', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i + 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i + 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i, $j);\n\t\t\t\t\t\t\t$moves[0][] = array('down', $i + 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('right', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j + 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j + 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('left', $i, $j + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('down', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i - 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i - 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('top', $i - 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('left', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j - 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j - 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t$moves[3][] = array('left', $i, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i, $j - 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }", "public function checkValidMove($userMove){\r\n if(!is_numeric($userMove) ||$userMove < 1 || $userMove > Board::COLUMNS){ \r\n invalidInputMsg($this->currentPlayer);\r\n return false;\r\n }\r\n return true;;\r\n }", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "public function makeMove($boardState, $playerUnit = 'X')\n {\n $opponentUnit = ($playerUnit == 'X' ? 'O' : 'X');\n $playerWinCases = array();\n $opponentWinCases = array();\n $choosePlayerWinCase = -1;\n $chooseOpponentWinCase = -1;\n foreach (self::$winningCases as $key => &$winCase) {\n\n $playerWinCase = new WinningCase($boardState, $winCase, $playerUnit);\n if (!$playerWinCase->isBlocked()) {\n if ($playerWinCase->countRemainingMoves() == 0) {\n $this->winner = $playerUnit;\n $this->winningCase = $winCase;\n return;\n } else if (!$choosePlayerWinCase instanceof WinningCase\n || (\n $choosePlayerWinCase instanceof WinningCase\n && $playerWinCase->countRemainingMoves() < $choosePlayerWinCase->countRemainingMoves()\n )\n ) {\n $choosePlayerWinCase = $playerWinCase;\n }\n }\n if ($playerWinCase->countRemainingMoves() > 0) {\n $playerWinCases[$playerWinCase->countRemainingMoves()] = $playerWinCase;\n// array_push($playerWinCases, $playerWinCase);\n }\n\n $opponentWinCase = new WinningCase($boardState, $winCase, $opponentUnit);\n if (!$opponentWinCase->isBlocked()) {\n if ($opponentWinCase->countRemainingMoves() == 0) {\n $this->winner = $opponentUnit;\n $this->winningCase = $winCase;\n return;\n } else if ($opponentWinCase->countRemainingMoves() == 1) {\n $chooseOpponentWinCase = $opponentWinCase;\n }\n }\n if ($opponentWinCase->countRemainingMoves() > 0) {\n $opponentWinCases[$opponentWinCase->countRemainingMoves()] = $opponentWinCase;\n// array_push($opponentWinCases, $opponentWinCase);\n }\n }\n\n // Winning case\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() == 1) {\n #if (DEBUG) echo 'Winning case:' . \"\\r\\n\";\n $this->winner = $playerUnit;\n $this->winningCase = $choosePlayerWinCase->winCase;\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n // Block opponent winning case (to avoid loss)\n if ($chooseOpponentWinCase instanceof WinningCase && $chooseOpponentWinCase->countRemainingMoves() > 0) {\n #if (DEBUG) echo 'Block opponent winning case -> Avoid loss:' . \"\\r\\n\";\n return array_merge($chooseOpponentWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n #if (DEBUG) echo 'No immediate winnning move found -> Best move:' . \"\\r\\n\";\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() > 0) {\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n $this->winner = 'Draw';\n return;\n }", "private function decideVictory()\n {\n echo 'Jugador ';\n if (!$this->human->isOver() &&\n (\n ($this->human->getPoints() == $this->machine->getPoints() && $this->human->getPoints() != PLAYER_WIN_POINTS)\n || $this->human->getPoints() > $this->machine->getPoints()\n || $this->machine->isOver()\n )\n ) echo 'Humano';\n else echo 'Máquina';\n echo ' gana la partida. ';\n }", "protected function thinkBot() {\n $cellReturn = '';\n $markers = array($this->_botMark, $this->_userMark); //offense first, then defense\n while ($this->isValidMove($cellReturn) === FALSE) {\n //defense and offense\n foreach ($markers AS $marker) {\n foreach ($this->_winningCombination AS $cells) {\n $lineCells = explode(\",\", $cells); //separate the winning combination to 3\n $marked = 0;\n $noMark = 0;\n for ($x = 0; $x < 3; $x++) {\n if (in_array($lineCells[$x], $this->_markers[$marker]))\n $marked++;\n else\n $noMark = $lineCells[$x];\n }\n if ($marked == 2 && $this->isValidMove($noMark)) {\n $cellReturn = $noMark;\n break;\n }\n }\n if ($cellReturn != '')\n break;\n }\n //plan\n if ($cellReturn == '') {\n while (!$this->isValidMove($cellReturn)) {\n $combinationRandKey = rand(0, 7);\n //separate the winning combination to 3 elements\n $lineCells = explode(\",\", $this->_winningCombination[$combinationRandKey]);\n if ($this->isValidMove($lineCells[0]))\n $cellReturn = $lineCells[0];\n elseif ($this->isValidMove($lineCells[1]))\n $cellReturn = $lineCells[1];\n else\n $cellReturn = $lineCells[2];\n }\n }\n }\n return $cellReturn;\n }", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}", "function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}", "public function checkIfOpponentIsFinishedWithPlacement($matchID, $userID)\n {\n $sql = new Sql($this->dbAdapter);\n \n //Check if Opponent has inserted Ships into the Table\n $where = new \\Zend\\Db\\Sql\\Where();\n $where\n ->nest()\n ->notEqualTo('tblshipposition.spUserID', $userID)\n ->and\n ->equalTo('tblshipposition.spMatchID', $matchID)\n ->unnest();\n $select = $sql->select('tblshipposition')\n ->where($where); \n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute(); \n \n //If I got affected Rows he has inserted so the Match can start\n if ($result->getAffectedRows() > 0)\n {\n return array('OpponentReady' => true,\n 'OpponentWon' => false);\n }\n //Else you should wait\n return array('OpponentReady' => false,\n 'OpponentWon' => false);\n }", "function is_attacked($i, $opponent_color = null, $try_move = array()) {\n\n if ($opponent_color != null) {\n $opponent_color = 1 - $this->to_move;\n }\n \n # check pawns\n # _debug(\"... checking opponent pawns\");\n if ($opponent_color) {\n if ($this->_test_attack('p', $i - 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i - 11, $opponent_color, $try_move) === -1) return TRUE;\n } \n else {\n if ($this->_test_attack('p', $i + 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i + 11, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check knights\n # _debug(\"... checking opponent knights\");\n foreach (array(19, 21, 8, 12, -19, -21, -8, -12) as $step) {\n if ($this->_test_attack('n', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check bishops or queens\n # _debug(\"... checking opponent bishops\");\n foreach (array(11, 9, -11, -9) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('bq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n # check rooks or queens\n # _debug(\"... checking opponent rooks or queens\");\n foreach (array(1, 10, -1, -10) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('rq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n foreach (array(9, 10, 11, -1, 1, -9, -10, -11) as $step) {\n if ($this->_test_attack('k', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n return FALSE;\n }", "public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }", "public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChecker = [4, 3];\n $game->gameState->possibleGoChoices = [array(\"row\"=>2, \"col\"=>5), array(\"row\"=>4, \"col\"=>3)];\n $game->gameState->boardState = $this->getMultipleBeat();\n\n $gm->userMove(2, 5, 1, $game );\n $gm->userMove(0, 3, 1, $game );\n $gm->userMove(3, 0, 1, $game );\n $result = $gm->userMove(7, 4, 1, $game );\n\n\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][3]);//initial\n $this->assertEquals(0, $result[\"gameState\"]->boardState[3][4]);//beaten\n $this->assertEquals(-1, $result[\"gameState\"]->boardState[1][6]);//still there due to turkish turn rule\n $this->assertEquals(0, $result[\"gameState\"]->boardState[1][4]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[2][1]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][1]);//beaten\n $this->assertEquals(2, $result[\"gameState\"]->boardState[7][4]);//end position of the hero checker\n\n }", "protected function checkForWin($matchID, $userID)\n {\n $sql = new Sql($this->dbAdapter);\n \n $where = new \\Zend\\Db\\Sql\\Where();\n $where->nest()\n ->equalTo('tblmatchsteps.mUserID', $userID)\n ->and->equalTo('tblmatchsteps.mMatchID', $matchID)\n ->and->equalTo('tblmatchsteps.mState', 1)\n ->unnest();\n $select = $sql->select('tblmatchsteps')->columns(array('countState' => new Expression('COUNT(mState)')))\n ->where($where);\n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute();\n $count = $result->current();\n \n //If he hit 20 times\n if ($count[\"countState\"] == 20)\n {\n return true;\n }\n \n return false;\n \n }", "function check_looted_current_player($id_partie, $byTeam = false, $position = false) {\n global $wpdb;\n if ($byTeam == false AND $position == false) {\n\n try {\n $resultats = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT * FROM looted WHERE position = %s AND id_partie = %d\", get_position_by_id($id_partie, get_current_user_id()), $id_partie\n )\n );\n\n return count($resultats);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n } else {\n try {\n \n $equipe= get_team(get_current_user_id(), $id_partie);\n if($equipe == 1){\n $resultats = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT * FROM looted WHERE position = %s AND id_partie = %d AND equipe_1 = %d\", $position, $id_partie, 1\n )\n );}else {\n $resultats = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT * FROM looted WHERE position = %s AND id_partie = %d AND equipe_2 = %d\", $position, $id_partie, 1\n )\n );\n }\n\n return count($resultats);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }\n}", "function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}", "function no_double_moves(int $spareMoves, int $movesX, int $movesO): bool\n{\n return [\n [5, 4],\n [4, 4],\n [4, 3],\n [3, 3],\n [3, 2],\n [2, 2],\n [2, 1],\n [1, 1],\n [1, 0],\n [0, 0],\n ][$spareMoves] === [$movesX, $movesO];\n}", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "private function checkWiningRowColumn($playerUnit, $row = false, $checkRowColumn = false)\n {\n /**\n * check row/column winning for player unit\n */\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n //get array of row/column\n $array = ($row === true) ? $this->ticTacToeBoard[$i] : array_column($this->ticTacToeBoard, $i);\n\n $row_column = array_filter($array, function ($val) use ($playerUnit) {\n return ($val === $playerUnit);\n });\n\n if ($checkRowColumn === true && count($row_column) == $this->maxIndex) {\n return [true, $i];\n }\n if (count($row_column) == $this->boardSize) {\n return true;\n }\n }\n }", "private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function GenerateLegalRookMoves($chesspiece, $x, $y){\n\t //examine forward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n \tbreak; //stop examining this file.\n }\n }\n\n //examine backward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this file.\n }\n }\n\n //examine right-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this rank.\n }\n }\n\n //examine left-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this rank.\n }\n }\n \n return true;\n\t}", "private function determineWhoseTurn()\n {\n $query = \"SELECT player, event_value FROM events\n WHERE game_id = ? AND event_type = 'shot' ORDER BY id DESC LIMIT 1\";\n $result = $this->oDB->getFirst($query, array($this->oData->getIdGames()));\n\n if (empty($result)) {\n $whoseTurn = 1;\n } elseif ($result['player'] == $this->oData->getPlayerNumber()) {\n $whoseTurn = in_array($result['event_value'], $this->oData->getOtherShips())\n ? $this->oData->getPlayerNumber() : $this->oData->getOtherNumber();\n } else {\n $whoseTurn = in_array($result['event_value'], $this->oData->getPlayerShips())\n ? $this->oData->getOtherNumber() : $this->oData->getPlayerNumber();\n }\n\n $this->oData->setWhoseTurn($whoseTurn);\n }", "protected function insertMoveToBoard($userMove){\r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = ($this->board->getRows() - 1) ; $row >-1 ; $row-- ){\r\n //check if cell is empty\r\n if($this->board->gameBoard[$row][$userMove-1] == Board::CELL){\r\n $this->board->gameBoard[$row][$userMove-1] = $current_player;\r\n $this->lastRowInsert =$row;\r\n $this->totalMoves++;\r\n break;\r\n }\r\n else{\r\n continue;\r\n }\r\n }\r\n echo $this->board->printBoard();\r\n }", "public function GenerateLegalKingMoves($chesspiece, $x, $y){\n\t\n\t\t$from = array($x, $y);\n\t\n\t\t/**\n\t\t * Determine the legality of the usual king moves\n\t\t */\n\t\tif ($this->IsKingAllowedOnSquare($x+1, $y)){\n\t\t\t$to = array($x+1, $y);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x+1, $y+1)){\n\t\t\t$to = array($x+1, $y+1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x+1, $y-1)){\n\t\t\t$to = array($x+1, $y-1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\n\t\tif ($this->IsKingAllowedOnSquare($x-1, $y)){\n\t\t\t$to = array($x-1, $y);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x-1, $y+1)){\n\t\t\t$to = array($x-1, $y+1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x-1, $y-1)){\n\t\t\t$to = array($x-1, $y-1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x, $y-1)){\n\t\t\t$to = array($x, $y-1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x, $y+1)){\n\t\t\t$to = array($x, $y+1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\t/**\n\t\t * Determine whether the king can castle kingside\n\t\t */\n\t\tif ($chesspiece > 0){\n\t\t if (!$this->IsWhiteKingMoved && !$this->IsWhiteKRMoved){\n if ($this->IsKingAllowedOnSquare(5, 0) && \n $this->IsKingAllowedOnSquare(6, 0) &&\n $this->chessposition[5][0] == 0 &&\n $this->chessposition[6][0] == 0){\n // note: this function never got called.\n // therefore, the problem must be in the IsKingAllowedOnSquare function\n // not sure what the problem is exactly thoughf\n $to = array(6, 0);\n $this->AddChessSquare($chesspiece, $from, $to);\n }\n }\n \n if (!$this->IsWhiteKingMoved && !$this->IsWhiteQRMoved){\n \tif ($this->IsKingAllowedOnSquare(2, 0) && \n \t\t\t$this->IsKingAllowedOnSquare(3, 0) &&\n \t\t\t$this->chessposition[3][0] == 0 && \n \t\t\t$this->chessposition[2][0] == 0 &&\n \t\t\t$this->chessposition[1][0] == 0){\n \t\t\n \t\t$to = array(2, 0);\n \t\t$this->AddChessSquare($chesspiece, $from, $to);\n \t}\n }\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){\n\t\t\tif (!$this->IsBlackKingMoved && !$this->IsBlackKRMoved){\n if ($this->IsKingAllowedOnSquare(5, 7) && \n $this->IsKingAllowedOnSquare(6, 7) && \n $this->chessposition[5][7] == 0 &&\n $this->chessposition[6][7] == 0){\n \n $to = array(6, 7);\n $this->AddChessSquare($chesspiece, $from, $to);\n }\n }\n \n\t\t\tif (!$this->IsBlackKingMoved && !$this->IsBlackQRMoved){\n \tif ($this->IsKingAllowedOnSquare(2, 7) && \n \t\t\t$this->IsKingAllowedOnSquare(3, 7) &&\n \t\t\t$this->chessposition[1][7] == 0 &&\n \t\t\t$this->chessposition[2][7] == 0 &&\n \t\t\t$this->chessposition[3][7] == 0){\n \t\t\n \t\t$to = array(2, 7);\n \t\t$this->AddChessSquare($chesspiece, $from, $to);\n \t}\n }\n\t\t}\n \n return true;\n\t}", "public function openValve(){\n if ($this->game->get_current_turn()->WinStatus($this->game->getSize())){\n $this->game->set_winner();\n }else{\n $this->game->update_turn();\n $this->game->set_winner();\n }\n }", "public function rewardWinners(& $wins,& $table){\n\t\t$pots=& $table->game_pots;\n\t\t$leftOvers=$pots[\"left_overs\"]->amount;\n\t\t$x.=print_r($wins,true);\n\t\t$x.=\"\\n\\n\";\n\t\tforeach ($wins as $points=>$winners){// loop through winners by highest points , search for elegible pot then add that pot to the users'amount'\n\t\t\t$pot_on=count($winners); // how many winners for single pot ?\n\t\t\t$x.= \"got $pot_on winners with score of $points\\n\";\n\t\t\tif ($pon_on=='1'){\n\t\t\t\t$table->dealerChat($pot_on.' winner .');\n\t\t\t}elseif($pon_on>'1'){\n\t\t\t\t$table->dealerChat($pot_on.' winners .');\n\t\t\t}\n\t\t\t$winName=$this->getWinName($points);\n\t\t\t//generate win text\n\t\t\t$winText=' With <label class=\"hand_name\">'.$winName->handName.'</label>' ;\n\t\t\tif ($winName->handName=='High Card'){\n\t\t\t\t$winText.=' '.$winName->normalKicker ;\n\t\t\t}else{\n\t\t\t\tif (isset($winName->doubleKicker)){\n\t\t\t\t\t$winText.=' of '.$winName->doubleKicker ;\n\t\t\t\t}\n\t\t\t\tif ((isset($winName->normalKicker) && !isset($winName->doubleKicker)) || isset($winName->normalKicker) && isset($winName->doubleKicker) && $winName->doubleKicker!=$winName->normalKicker){\n\t\t\t\t\t$winText.=' and '.$winName->normalKicker.' kicker' ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($winners as $winnerId){\n\t\t\t\t$x.= \" - checking winner $winnerId :\\n\";\n\t\t\t\t//search for pots who has this player id\n\t\t\t\t$winPlayer=new Player($winnerId);\n\t\t\t\t\t$x.= \" - Winner is $winPlayer->display_name $winPlayer->seat_id has $ $winPlayer->amount :\\n\";\n\t\t\t\t\tforeach ($pots as $id=>$pot){\n\t\t\t\t\t\tif ($pot->amount>0 && $id!=='left_overs'){\n\t\t\t\t\t\t\t$pot->amount+=$leftOvers;\n\t\t\t\t\t\t\t$leftOvers=0;\n\t\t\t\t\t\t\tif (!isset($pot->original_amount)){$pot->original_amount=$pot->amount;}\n\t\t\t\t\t\t\t$winAmount=round($pot->original_amount/$pot_on);\n\t\t\t\t\t\t\tif (in_array($winnerId,$pot->eligible)!==false){\n\t\t\t\t\t\t\t\t$pots[$id]->amount-=$winAmount;\n\t\t\t\t\t\t\t\t$winPlayer->amount+=$winAmount;\n\t\t\t\t\t\t\t\t$table->dealerChat($winPlayer->profile_link.' has won the pot <label class=\"cash_win\">($'.$winAmount.')</label> '.$winText.' .');\n\t\t\t\t\t\t\t\tif ($winAmount>0){$winPlayer->won=5;}else{$winPlayer->won=0;}\n\t\t\t\t\t\t\t\tif (substr($winPlayer->bet_name,0,6)=='<label'){\n\t\t\t\t\t\t\t\t\t$oldAmount=substr($winPlayer->bet_name,26,strpos($winPlayer->bet_name,'</label>')-26);\n\t\t\t\t\t\t\t\t\t$oldAmount+=$winAmount;\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$oldAmount.'</label>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$winAmount.'</label>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$winPlayer->saveBetData();\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\n\t\t\t}//\n\t\t\t\n\t\t}//\n\t\tfile_put_contents('wins.txt',$x);\n\t\n\t}", "function _test_attack($type, $i, $opponent_color, $try_move) {\n/*\nprintf(\"try_move['from']: %s\\n\", $try_move['from']);\nprintf(\"try_move['to']: %s\\n\", $try_move['to']);\nprintf(\"try_move['piece']: %s\\n\", $try_move['piece']);\nprintf(\"this->enpa: %s\\n\", $this->enpa);\n*/\n $p = null;\n if ($try_move) {\n\n if ($i === $try_move['from']) {\n $p = 0;\n } \n elseif ($i === $try_move['to']) {\n // The trial move takes the piece being considered\n $p = $try_move['piece'];\n } \n elseif ( $try_move['piece'] === 'p' \n && intval($this->enpa) === intval($try_move['to'])\n && intval($i) === intval($this->enpa) + 10\n ) {\n $p = 0;\n }\n elseif ( $try_move['piece'] === 'P' \n && intval($this->enpa) === intval($try_move['to'])\n && intval($i) === intval($this->enpa) - 10\n ) {\n $p = 0;\n }\n else {\n $p = $this->pos[$i];\n }\n } \n else {\n $p = $this->pos[$i];\n }\n \n if ($p === null) {\n//print(\"A\\n\");\n return 1;\n }\n\n if ($p && $this->piece_color($p) === $opponent_color && strpos($type, strtolower($p)) !== FALSE) {\n//printf(\"p:%s\\n\", $p);\n//print(\"B\\n\");\n return -1;\n }\n//print(\"C\\n\");\n return $p;\n }", "public function testVerifyToNotWin()\n {\n\n $match = $this->createMatch();\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n $winner = new Winner();\n $winner->verify($match, 0, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(0, $matchFound->winner);\n\n }", "function paperSiccorsRockChooseWinner($gameList){\n\t\t$movesArray = explode(\",\",$gameList);\n\t\t//printf(\"El gamelist es: \" . $gameList . \"<br>\");\n\t\t//printf(\"La jugada1 es: \" . substr($movesArray[1],1,1) . \"<br>\");\n\t\t$player1move = substr($movesArray[1],1,1);\n\t\t$player2move = substr($movesArray[3],1,1);\n\t\t$gameResult = \"\";\n\n\t\t//console.log(\" \");\n\t\t//console.log(\" \");\n\t\t\n\n\t\t//Se pregunta si la cantidad de jugadores es valida\n\t\tif(validateQuantityOfPlayers($movesArray) == false){\n\t\t\t//console.log(\"Error Cantidad de jugadores\");\n\t\t\t//throw \"Error with number of players\"; \n\t\t}\n\n\t\t//Se preguntan si las jugadas son validas\n\t\tif(validateMove($player1move) == false || validateMove($player2move) == false){\n\t\t\t//console.log(\"Error Jugada no valida\");\n\t\t\t//throw \"Error not valid move\";\n\t\t}\n\n\t\t//Se averigua cual jugador gano\n\t\t$winner = paperSiccorsRockRules($player2move, $player1move);\n\t\tif($winner == true){\n\t\t\t////printf(\"1 El gamelist es: \" .$movesArray[2] . ',' . substr($movesArray[3],0,-1). \"<br>\");\n\t\t\t$gameResult = $movesArray[2] . ',' . substr($movesArray[3],0,-1);\n\t\t}else{\n\t\t\t////printf(\"2 El gamelist es: \" . substr($movesArray[0],1). ',' .$movesArray[1] . \"<br>\");\n\t\t\t$gameResult = substr($movesArray[0],1). ',' .$movesArray[1]; //Se puede caer\n\t\t}\n\n\t\t//printf(\"El juego es \" . $gameList . \"<br>\");\n\t\t//printf(\"Jugada player 1 \" . $player1move .\"<br>\");\n\t\t//printf(\"Jugada player 2 \" . $player2move .\"<br>\");\n\t\t//printf(\"El ganadore es player2 \" . $winner .\"<br>\");\n\n\t\t//console.log(\" \");\n\t\t//console.log(\" \");\n\t\treturn $gameResult;\n\t}", "public function checkIfOpponentIsFinishedWithMatchStep($matchID, $userID)\n {\n $lastMSID = $this->getLastMatchStepID($userID, $matchID);\n $oppID = $this->getOpponentID($matchID, $userID);\n \n $sql = new Sql($this->dbAdapter);\n \n //Check if Opponent has inserted a MatchStep that is finished\n $where = new \\Zend\\Db\\Sql\\Where();\n $where\n ->nest()\n ->notEqualTo('tblmatchsteps.mUserID', $userID)\n ->and->equalTo('tblmatchsteps.mMatchID', $matchID)\n ->and->greaterThan('tblmatchsteps.msID', $lastMSID)\n ->and->equalTo('tblmatchsteps.mRoundFinished', 1)\n ->unnest();\n $select = $sql->select('tblmatchsteps')\n ->where($where); \n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute();\n //If I got affected Rows he has inserted so the Match can start\n if ($result->getAffectedRows() > 0)\n {\n\n if ($this->checkForWin($matchID, $oppID) == true)\n {\n $hits = $this->getAllHitShips($matchID, $oppID, $lastMSID);\n \n return array('OpponentReady' => true,\n 'OpponentWon' => true,\n 'Hits' => $hits);\n }\n \n $hits = $this->getAllHitShips($matchID, $oppID, $lastMSID);\n $miss = $this->getLastMiss($matchID, $oppID, $lastMSID);\n return array('OpponentReady' => true,\n 'OpponentWon' => false,\n 'Hits' => $hits,\n 'Miss' => $miss);\n }\n $hits = $this->getAllHitShips($matchID, $oppID, $lastMSID);\n $miss = $this->getLastMiss($matchID, $oppID, $lastMSID);\n \n if($miss[\"x\"] == null )\n {\n //Else you should wait\n return array('OpponentReady' => false,\n 'OpponentWon' => false,\n 'Hits' => $hits,\n 'Miss' => $miss);\n }\n //Else you should wait\n return array('OpponentReady' => true,\n 'OpponentWon' => false,\n 'Hits' => $hits,\n 'Miss' => $miss); \n }", "public function GenerateLegalPawnMoves($chesspiece, $x, $y){\n\t\t$from = array($x, $y);\n\t\t\n\t if ($chesspiece > 0){ // $chesspiece is a white pawn.\n\t \t$to = array($x, $y+1);\n\t \t\n\t \tif ($this->chessposition[$x][$y+1] == 0){\n\t \t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 1){\n \t$to = array($x, $y+2);\n \tif ($this->chessposition[$x][$y+2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \t}\n }\n \n if ($this->IsEnemyPiece(1, $x+1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x+1, $y+1));\n }\n if ($this->IsEnemyPiece(1, $x-1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x-1, $y+1));\n }\n }\n\n if ($chesspiece < 0){ // $chesspiece is a black pawn\n \t$to = array($x, $y-1);\n\t \t\n\t if($this->chessposition[$x][$y-1] == 0){\n\t \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 6){\n \t$to = array($x, $y-2);\n \tif ($this->chessposition[$x][$y-2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t }\n }\n \n if ($this->IsEnemyPiece(-1, $x+1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x+1, $y-1));\n if ($this->IsEnemyPiece(-1, $x-1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x-1, $y-1)); \n }\n \n //now do en-passant\n /***\n if ($LastMovePlayed[0] == ){ //if it is a pawn\n \t$fromsquare = $this->NumToCoordinate($LastMovePlayed[0]);\n \t$tosquare = $this->NumToCoordinate($LastMovePlayed[1]);\n \t\n \t$a = $tosquare[0] + 1;\n \tif ($this->IsEnemyPiece($this->chessposition[$tosquare[0]][$tosquare[1]]))\n }\n ***/\n \n return true;\n\t}", "function statusAfterNonPenalizedPlayerMove($currentPlayer, $currentPlace, $currentCategory) {\n\t}", "function checkForSpecialAchievements($player_id, $wonder_included) {\n $achievements_to_test = $wonder_included ? array(105, 106, 107, 108, 109) : array(105, 106, 108, 109);\n $end_of_game = false;\n \n \n foreach ($achievements_to_test as $achievement_id) {\n $achievement = self::getCardInfo($achievement_id);\n if ($achievement['owner'] != 0) { // Somebody has already claimed that achievement\n // So it's not claimable anymore\n continue;\n }\n \n switch ($achievement_id) {\n case 105: // Empire: three or more icons of all six types\n $eligible = true;\n $ressource_counts = self::getPlayerRessourceCounts($player_id);\n foreach ($ressource_counts as $icon => $count) {\n if ($count < 3) { // There are less than 3 icons\n $eligible = false;\n break;\n }\n }\n break;\n case 106: // Monument: tuck 6 cards or score 6 cards\n $flags = self::getFlagsForMonument($player_id);\n $eligible = $flags['number_of_tucked_cards'] >= 6 || $flags['number_of_scored_cards'] >= 6;\n break;\n case 107: // Wonder: 5 colors, each being splayed right or up\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) < 2) { // This color is missing, unsplayed or splayed left\n $eligible = false;\n };\n }\n break;\n case 108: // World: 12 or more visible clocks (icon 6) on the board \n $eligible = self::getPlayerSingleRessourceCount($player_id, 6) >= 12;\n break;\n case 109: // Universe: Five top cards, each being of value 8 or more\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card === null || $top_card['age'] < 8) { // This color is missing or its top card has value less than 8\n $eligible = false;\n }\n }\n break;\n default:\n break;\n }\n \n if ($eligible) { // The player meet the conditions to achieve\n try {\n self::transferCardFromTo($achievement, $player_id, 'achievements');\n }\n catch (EndOfGame $e) { // End of game has been detected\n self::trace('EOG bubbled but suspended from self::checkForSpecialAchievements');\n $end_of_game = true;\n continue; // But the other achievements must be checked as well before ending\n }\n }\n }\n // All special achievements have been checked\n if ($end_of_game) { // End of game has been detected\n self::trace('EOG bubbled from self::checkForSpecialAchievements');\n throw $e; // Re-throw the flag\n }\n }", "function pokerWinner($player1Hand){\n $pairCount = 0;\n $twoPairCount = 0;\n $threeOfAKind = 0;\n $fourOfAKindCount = 0;\n $straightCount = 0;\n $flushCount = 0;\n $fullHouseCount = 0;\n $fourOfAKindCount = 0;\n $straightFlushCount = 0;\n $royalFlushCount = 0;\n $consecutive = 0;\n $value = 10;\n\n $matchingCardCount = pairFinder($player1Hand);\n\n if($matchingCardCount == 3){\n \n $fourOfAKindCount = 1;\n $threeOfAKind = 1;\n $pairCount = 2;\n }\n\n if($matchingCardCount == 2){\n $threeOfAKind = 1;\n $pairCount = 1;\n }\n\n if($matchingCardCount == 1){\n $pairCount = 1;\n\n }\n\n //check for two pairs\n if(twoPairFinder($player1Hand)){\n $pairCount = 2;\n $twoPairCount = 1;\n }\n\n\n\n if(straightFinder($player1Hand)){\n $straightCount = 1;\n\n\n }\n\n //check for flush\n if(flushFinder($player1Hand)){\n $flushCount = 1;\n\n }\n\n //check for straight flush\n if($flushCount == 1 && $straightCount == 1){\n $straightFlushCount = 1;\n }\n\n //check for royal flush\n if($straightFlushCount == 1){\n if(royalFlushFinder($player1Hand)){\n $royalFlushCount = 1;\n }\n }\n\n //Testing area\n\n // echo 'The $pairCount is: ' . $pairCount . \"\\n\" . \"\\n\";\n // echo 'The $twoPairCount is: ' . $twoPairCount . \"\\n\" . \"\\n\";\n // echo 'The $threeOfAKind is: ' . $threeOfAKind . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightCount is: ' . $straightCount . \"\\n\" . \"\\n\";\n // echo 'The $flushCount is: ' . $flushCount . \"\\n\" . \"\\n\";\n // echo 'The $fullHouseCount is: ' . $fullHouseCount . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightFlushCount is: ' . $straightFlushCount . \"\\n\" . \"\\n\";\n // echo 'The $royalFlushCount is: ' . $royalFlushCount . \"\\n\" . \"\\n\";\n\n\n //Give out points\n if($royalFlushCount == 1){\n $value = 10;\n return $value;\n }\n\n if($straightFlushCount == 1){\n $value = 9;\n return $value;\n }\n\n if($fourOfAKindCount == 1){\n $value = 8;\n return $value;\n }\n\n if($fullHouseCount == 1){\n $value = 7;\n return $value;\n }\n\n if($flushCount == 1){\n $value = 6;\n return $value;\n }\n\n if($straightCount == 1){\n $value = 5;\n return $value;\n }\n\n if($threeOfAKind == 1){\n $value = 4;\n return $value;\n }\n\n if($twoPairCount == 1){\n $value = 3;\n return $value;\n }\n\n if($pairCount == 1){\n $value = 2;\n return $value;\n }\n\n else{\n $value = 1;\n return $value;\n }\n\n\n}", "function compete2($a,$b){\n $p = intval(100 * getWinProb($a['elo']-$b['elo']));\n $expected = ($a['elo']>=$b['elo']) ? $a['name'] : $b['name'];\n $percent = ($a['elo']>=$b['elo']) ? $p.'%' : (100-$p).'%';\n $tempo = round(($a['tempo']+$b['tempo'])/2);\n $a_score = 0;\n $b_score = 0;\n echo sprintf(\"Now Playing: %s (%s) vs. %s (%s) \\n\", $a['name'], $a['elo'], $b['name'], $b['elo']);\n echo sprintf(\"Expected winner: %s (%s)\\n\", $expected, $percent);\n \n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"| Game Log |\\n\");\n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"Playing %s possessions\\n\\n\",$tempo);\n for($i=0;$i<$tempo;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n while($a_score==$b_score){\n $ot = round($tempo/8);\n //echo sprintf(\"Overtime\\n\");\n //echo sprintf(\"Playing %s possessions\\n\", $ot);\n for($i=0;$i<$ot;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n }\n $winner = ($a_score>$b_score) ? $a['name'] : $b['name'];\n $a_ppp = number_format($a_score/$tempo,3);\n $b_ppp = number_format($b_score/$tempo,3);\n echo sprintf(\"Final score is %s-%s, %s wins\\n\\n\", max($a_score,$b_score), min($a_score,$b_score), $winner);\n //echo sprintf(\"Points per Possession: %s: %s %s: %s\\n\\n\", $a['name'], $a_ppp, $b['name'], $b_ppp);\n return ($a_score>$b_score) ? $a : $b;\n}", "abstract public function hasAvailableMoves(): bool;", "private function getMovePosition(Board $board)\r\n {\r\n $position = null;\r\n\r\n// todo\r\n for($i=0;$i<Board::ROWS;$i++)\r\n {\r\n if(!($board->hasPieceAtPosition($i, 0)) && $board->getPieceAtPosition($i, 1)==self::PIECE && $board->getPieceAtPosition($i, 2)== self::PIECE)\r\n {\r\n $position=[$i,0];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 1)) && $board->getPieceAtPosition($i, 0)==self::PIECE && $board->getPieceAtPosition($i, 2)== self::PIECE)\r\n {\r\n $position=[$i,1];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 2)) && $board->getPieceAtPosition($i, 0)==self::PIECE && $board->getPieceAtPosition($i, 1)== self::PIECE)\r\n {\r\n $position=[$i,2];\r\n }\r\n }\r\n for($j=0;$j<Board::COLUMNS;$j++)\r\n {\r\n if(!($board->hasPieceAtPosition(0, $j)) && $board->getPieceAtPosition(1, $j)==self::PIECE && $board->getPieceAtPosition(2, $j)== self::PIECE)\r\n {\r\n $position=[0,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(1, $j)) && $board->getPieceAtPosition(0, $j)==self::PIECE && $board->getPieceAtPosition(2, $j)== self::PIECE)\r\n {\r\n $position=[1,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, $j)) && $board->getPieceAtPosition(0, $j)==self::PIECE && $board->getPieceAtPosition(1, $j)== self::PIECE)\r\n {\r\n $position=[2,$j];\r\n }\r\n }\r\n if($board->getPieceAtPosition(1, 1)==self::PIECE)\r\n {\r\n if(!($board->hasPieceAtPosition(0, 0)) && $board->getPieceAtPosition(2, 2)==self::PIECE)\r\n {\r\n $position = [0,0];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 2)) && $board->getPieceAtPosition(0, 0)==self::PIECE)\r\n {\r\n $position = [2,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(0, 2)) && $board->getPieceAtPosition(2, 0)==self::PIECE)\r\n {\r\n $position = [0,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 0)) && $board->getPieceAtPosition(0, 2)==self::PIECE)\r\n {\r\n $position = [2,0];\r\n }\r\n }\r\n\r\n# 2. Or place a piece that prevents the player from winning. \r\n if(is_null($position))\r\n {\r\n for($i=0;$i<Board::ROWS;$i++)\r\n {\r\n if(!($board->hasPieceAtPosition($i, 0)) && ($board->getPieceAtPosition($i, 1)==self::BADPIECE) && ($board->getPieceAtPosition($i, 2)== self::BADPIECE))\r\n {\r\n $position=[$i,0];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 1)) && ($board->getPieceAtPosition($i, 0)==self::BADPIECE) && ($board->getPieceAtPosition($i, 2)== self::BADPIECE))\r\n {\r\n $position=[$i,1];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 2)) && ($board->getPieceAtPosition($i, 0)==self::BADPIECE) && ($board->getPieceAtPosition($i, 1)== self::BADPIECE))\r\n {\r\n $position=[$i,2];\r\n }\r\n }\r\n for($j=0;$j<Board::COLUMNS;$j++)\r\n {\r\n if(!($board->hasPieceAtPosition(0, $j)) && ($board->getPieceAtPosition(1, $j)==self::BADPIECE) && ($board->getPieceAtPosition(2, $j)== self::BADPIECE))\r\n {\r\n $position=[0,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(1, $j)) && ($board->getPieceAtPosition(0, $j)==self::BADPIECE) && ($board->getPieceAtPosition(2, $j)== self::BADPIECE))\r\n {\r\n $position=[1,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, $j)) && ($board->getPieceAtPosition(0, $j)==self::BADPIECE) && ($board->getPieceAtPosition(1, $j))== self::BADPIECE)\r\n {\r\n $position=[2,$j];\r\n }\r\n }\r\n\r\n if($board->getPieceAtPosition(1, 1)==self::BADPIECE)\r\n {\r\n if(!($board->hasPieceAtPosition(0, 0)) && $board->getPieceAtPosition(2, 2)==self::BADPIECE)\r\n {\r\n $position = [0,0];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 2)) && $board->getPieceAtPosition(0, 0)==self::BADPIECE)\r\n {\r\n $position = [2,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(0, 2)) && $board->getPieceAtPosition(2, 0)==self::BADPIECE)\r\n {\r\n $position = [0,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 0)) && $board->getPieceAtPosition(0, 2)==self::BADPIECE)\r\n {\r\n $position = [2,0];\r\n }\r\n }\r\n }\r\n\r\n if(is_null($position))\r\n {\r\n $blankpositions=$board->getBlankPositions();\r\n $numberpositions = count($board->getBlankPositions());\r\n $chooseposition = rand(1,$numberpositions);\r\n $position = $blankpositions[$chooseposition - 1];\r\n }\r\n\r\n return $position;\r\n }", "public function secondMove($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') $playerUnit = 'O';\n if ($playerUnit == 'O') $playerUnit = 'X';\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n $column = array_column($this->board, $i);\n\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n\n if ($columnSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n\n if ($rightDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n for($j = 0; $j <= $this->maxIndex; $j++){\n if ($block && $this->board[$i][$j] == $playerUnit){\n $coordinates = $this->getFirstEmptyNeighboor($i, $j);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->secondMove($playerUnit, true);\n }\n return false;\n }", "function calculateRank($userId) {\n \n $ci =& get_instance();\n \n // result array \n $setWonByUser1 = array(\n \n '6:0', '6:1', '6:2', '6:3', '6:4', '7:5', '7:6', \n ); \n \n $setWonByUser2 = array(\n \n '0:6', '1:6', '2:6', '3:6', '4:6', '5:7', '6:7', \n ); \n \n $rank = 0; \n \n // for every vitory \n $wonGames = $ci->match_model->getWonMatchByUserId($userId); \n $wonGames = $wonGames['total_count']; \n $rank += $wonGames * FOR_EVERY_VITORY_RANK; \n \n // for every loss \n $lossGames = $ci->match_model->getLostMatchByUserId($userId); \n $lossGames = $lossGames['total_count']; \n $rank += $lossGames * FOR_EVERY_LOSS_RANK; \n \n // for every set won and for every game won \n \n // count when user number is 1 in game and then when user number is 2 in game \n $gameListUser1 = $ci->match_model->getConfirmedAllGamesByUserId(1, $userId); \n $gameListUser2 = $ci->match_model->getConfirmedAllGamesByUserId(2, $userId); \n \n $setWonCountUser1 = 0; \n $setGameCountUser1 = 0; \n if (!empty($gameListUser1)) {\n \n foreach ($gameListUser1 as $game) {\n \n // count set \n if (in_array(\"{$game['set1_p1']}:{$game['set1_p2']}\", $setWonByUser1)) { $setWonCountUser1++; }\n if (in_array(\"{$game['set2_p1']}:{$game['set2_p2']}\", $setWonByUser1)) { $setWonCountUser1++; }\n if (in_array(\"{$game['set3_p1']}:{$game['set3_p2']}\", $setWonByUser1)) { $setWonCountUser1++; }\n \n // count game \n $setGameCountUser1 = $game['set1_p1'] + $game['set2_p1'] + $game['set3_p1']; \n }\n }\n \n $setWonCountUser2 = 0; \n $setGameCountUser2 = 0; \n if (!empty($gameListUser2)) {\n \n foreach ($gameListUser2 as $game) {\n \n // count set \n if (in_array(\"{$game['set1_p1']}:{$game['set1_p2']}\", $setWonByUser2)) { $setWonCountUser2++; }\n if (in_array(\"{$game['set2_p1']}:{$game['set2_p2']}\", $setWonByUser2)) { $setWonCountUser2++; }\n if (in_array(\"{$game['set3_p1']}:{$game['set3_p2']}\", $setWonByUser2)) { $setWonCountUser2++; }\n \n // count game \n $setGameCountUser2 = $game['set1_p2'] + $game['set2_p2'] + $game['set3_p2']; \n }\n }\n \n // add rank for sets \n $rank += ($setWonCountUser1 + $setWonCountUser2) * FOR_EVERY_SETWON_RANK; \n\n // add rank for games \n $rank += ($setGameCountUser1 + $setGameCountUser2) * FOR_EVERY_GAMEWON_RANK; \n \n return $rank > 0 ? $rank : 0; \n}", "function PlayerPass( $pos )\r\n \t{\r\n\r\n\t\t$this->states[$pos] = 2;\r\n \t\tf_MQuery( \"UPDATE poker_draw_player SET state = 2 WHERE\r\n\t\t\t\tdraw_id = '{$this->draw_id}' AND seat = '$pos';\" );\r\n\r\n\t\t//2) next player and check ( for game end, next round, etc. )\r\n\r\n\t\t$this->MakeNextMove( );\r\n \t}", "function getNumTurns($array) {\n \n $numTurns = 0;\n for ($i = 0; $i < 3; $i++) {\n for ($j = 0; $j < 3; $j++) {\n //if the position in the game array is not \"N\"\n if(strcmp($array[$i][$j], \"N\") != 0) {\n $numTurns++;\n }\n }\n }\n return $numTurns;\n}", "function show_round()\n{\n $bdd = DB_connect();\n\n // On récupère de la table matches les informations sur la partie\n $req_match = $bdd->query('SELECT * FROM matches WHERE id = \\''.$_SESSION['match']['id'].'\\'');\n $data_match = $req_match->fetch();\n\n // On récupère de la table rounds tous les rounds de la partie\n $req_round = $bdd->query('SELECT * FROM rounds WHERE match_id = \\''.$_SESSION['match']['id'].'\\'');\n while($data_round = $req_round->fetch())\n $tab[$data_round['id']] = $data_round;\n // On sélectionne le dernier round en mémoire du match\n $round = $tab[max(array_keys($tab))];\n\n $_SESSION['match']['previous_user'] = $round['actual_user'];\n\n // On détermine si l'on est le user1 ou le user2 dans la partie\n if ($data_match['user1_id'] == $_SESSION['user']['id'])\n {\n $_SESSION['match']['user_me'] = 1;\n $_SESSION['match']['user_me_id'] = $data_match['user1_id'];\n $_SESSION['match']['user_me_score'] = $round['user1_score'];\n $_SESSION['match']['user_enemy'] = 2;\n $_SESSION['match']['user_enemy_id'] = $data_match['user2_id'];\n $_SESSION['match']['user_enemy_score'] = $round['user2_score'];\n }\n else\n {\n $_SESSION['match']['user_me'] = 2;\n $_SESSION['match']['user_me_id'] = $data_match['user2_id'];\n $_SESSION['match']['user_me_score'] = $round['user2_score'];\n $_SESSION['match']['user_enemy'] = 1;\n $_SESSION['match']['user_enemy_id'] = $data_match['user1_id'];\n $_SESSION['match']['user_enemy_score'] = $round['user1_score'];\n }\n\n // Si la partie est finie, on n'affiche pas la map\n if ($data_match['end'])\n {\n echo '<h3>La partie est finie !</h3>';\n if ($_SESSION['match']['user_me_score'] > $_SESSION['match']['user_enemy_score'])\n {\n echo '<h3>Bravo ! Tu as GAGNÉ.</h3>';\n }\n else if ($_SESSION['match']['user_me_score'] < $_SESSION['match']['user_enemy_score'])\n {\n echo '<h3>Dommage ! Tu as PERDU.</h3>';\n }\n else\n {\n echo '<h3>Bravo ! Vous êtes arrivés EX AEQUO.</h3>';\n }\n return (0);\n }\n\n // On enregistre la map dans le $_SESSION\n $map = string_to_map($round['map']);\n $_SESSION['match']['map'] = $map;\n\n // On affiche la map à jour\n echo '<table id=\"map\">';\n echo '<tr>';\n for ($j = 0; $j <= 6; $j++)\n {\n if ($j == 0)\n echo '<td></td>';\n else\n echo '<td>'.$j.'</td>';\n }\n echo '</tr>';\n for ($i = 'A'; isset($map[$i]); $i++)\n {\n echo '<tr>';\n for ($j = 0; $j <= 6; $j++)\n {\n if ($j == 0)\n echo '<td>'.$i.'</td>';\n else\n {\n if ($map[$i][$j] == 3)\n $background_color = 'red';\n else if ($map[$i][$j] == 4)\n $background_color = 'green';\n else\n $background_color = 'white';\n echo \"<td style='background-color:$background_color'></td>\";\n }\n }\n echo '</tr>';\n }\n echo '</table>';\n\n if ($round['actual_user'] == $_SESSION['match']['user_me'] ||\n ($round['actual_user'] == 0 && $_SESSION['match']['user_me'] != 1))\n {\n // On récupère le nom de l'ennemi dans la table users\n $req_enemy_login = $bdd->query('SELECT login FROM users WHERE id = \\''.$_SESSION['match']['user_enemy_id'].'\\'');\n $data_enemy_login = $req_enemy_login->fetch();\n\n echo '<h3>C\\'est au tour de '.$data_enemy_login['login'].'</h3>';\n echo '<form method=\"POST\" action=\"game.php\">\n <input type=\"submit\" name=\"reload_submit\" value=\"↻ Rafraîchir\">\n </form>';\n return (1);\n }\n else\n {\n echo '<h3>C\\'est à ton tour !</h3>\n <form method=\"POST\" action=\"#\">\n <br>\n <input type=\"text\" name=\"coord\" placeholder=\"Case\" required><br><br>\n <input type=\"submit\" value=\"Jouer\">\n </form>';\n return (0);\n }\n}", "public function getWinner(){\n $this->game->UpdateStatus();\n if ($this->game->getWinner()!=$this->game->get_current_turn()){\n return false;\n }else{\n return true;\n }\n }", "function chcekTheWinner($dom, $owner){\n $instance = DbConnector::getInstance();\n $playersList = handEvaluator();\n usort($playersList, array(\"Player\", \"cmp\")); \n $i = 0;\n echo \"<div id=\\\"summary\\\"><div>--- Summary ---</div>\";\n echo \"<table border=\\\"1\\\" BORDERCOLOR=RED style=\\\"width:100%\\\"><tr><th>Player</th><th>Score</th><th>Hand</th><th>Cards</th></tr>\";\n foreach($playersList as $player){ \n if($i === 0){\n $sql = \"SELECT `TotalMoneyOnTable`, `Transfer` FROM `TableCreatedBy_\" . $owner . \"` where `user`='\" . $player->player . \"';\"; \n $retval = $instance->sendRequest($sql);\n while ($row = mysql_fetch_row($retval)) {\n $value = $row[0];\n $flag = $row[1];\n }\n if($flag == 0){ //transfer money to accunt\n $sql = \"UPDATE `TableCreatedBy_\" . $owner . \"` SET `Money` = `Money` + \".$value.\", `Transfer`=1 where `user`='\" . $player->player . \"';\"; \n $retval = $instance->sendRequest($sql);\n }\n echo \"<td>\" . $player->player . \" won \".$value.\"</td><td>\". $player->cardsValue . \"</td><td>\" . $player->handValue . \"</td><td>\" . $player->hand . \"</td></tr>\";\n }else{\n echo \"<td>\" . $player->player . \"</td><td>\". $player->cardsValue . \"</td><td>\" . $player->handValue . \"</td><td>\" . $player->hand . \"</td></tr>\";\n }\n $i++;\n }\n echo \"</table></div>\";\n}", "public function GenerateLegalMoves($chessposition){\n\t\t$this->SetAsPosition($chessposition);\n\t\t$this->ResetLegalMovesArr();\n\t\n\t\t//loop through the entire board\n\t\t//possible candidates are (x,y)\n\t\tfor ($x=0; $x<8; $x++){\n for ($y=0; $y<8; $y++){\n $chesspiece = $this->chessposition[$x][$y];\n \n //if nothing is there\n if ($chesspiece == 0){\n continue;\n }\n \n if (($this->IsWhiteToMove && ($chesspiece < 0)) ||\n \t\t(!$this->IsWhiteToMove && ($chesspiece > 0))){\n \t\tcontinue;\n \t\t}\n \n //if chesspiece is a pawn\n if (($chesspiece == 1) || ($chesspiece == -1)){ // chesspiece = pawn\n $this->GenerateLegalPawnMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n \n //if $chesspiece is a knight\n if (($chesspiece == 2) || ($chesspiece == -2)){\n $this->GenerateLegalKnightMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }//end of examining legal moves for knight\n \n //if $chesspiece is a bishop\n if (($chesspiece == 3) || ($chesspiece == -3)){ //$chesspiece is a bishop\n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for bishop\n \n //if $chesspiece is a rook\n if (($chesspiece == 4) || ($chesspiece == -4)){\n $this->GenerateLegalRookMoves($chesspiece, $x, $y); \n \n continue; //move on to the next iteration\n }//end of generating legal moves for the rook\n \n //if $chesspiece is a queen\n if (($chesspiece == 5) || ($chesspiece == -5)){\n \n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n $this->GenerateLegalRookMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for the queen\n \n //if chesspiece is a king\n if (($chesspiece == 6) || ($chesspiece == -6)){\n $this->GenerateLegalKingMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n }\n }\n\t}", "public function GenerateLegalBishopMoves($chesspiece, $x, $y){\n\t\t//examine top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine top left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n \n return true;\n\t}", "public function moveCell($cellToMove){\n // same row\n $cells = $_SESSION['GameView::cellNumbers'];\n $empty = 0;\n for ($i=0;$i<16;$i++){\n if ($_SESSION['GameView::cellNumbers'][$i] == 0){\n \n $empty = $i;\n }\n } \n \n $sameRow = false;\n $sameColumn = false;\n $neighbour = false;\n if (floor($cellToMove / 4) == floor($empty / 4)){\n $sameRow = true;\n if (($cellToMove + 1 == $empty) || ($empty + 1 == $cellToMove)){\n $neighbour = true;\n }\n }\n \n // check if directly above or below\n if ((($cellToMove + 4) == $empty) || (($empty + 4) == $cellToMove)){\n $neighbour = true;\n }\n \n if ($neighbour){\n // switch place\n $_SESSION['GameView::moves'] += 1;\n $temp = $cells[$cellToMove];\n $_SESSION['GameView::cellNumbers'][$cellToMove] = 0;\n $_SESSION['GameView::cellNumbers'][$empty] = $temp;\n\n }\n \n return $neighbour;\n \n }", "public function GenerateLegalKnightMoves($chesspiece, $x, $y){\n\t\t$from = array($x, $y);\n\t\t\n\t\t$to1 = array($x+1, $y+2);\n\t\t$to2 = array($x-1, $y+2);\n\t\t$to3 = array($x+1, $y-2);\n\t\t$to4 = array($x-1, $y-2);\n\t\t$to5 = array($x+2, $y+1);\n\t\t$to6 = array($x-2, $y+1);\n\t\t$to7 = array($x+2, $y-1);\n\t\t$to8 = array($x-2, $y-1);\n\t\t\n\t\t$this->AddChessSquare($chesspiece, $from, $to1);\n $this->AddChessSquare($chesspiece, $from, $to2);\n $this->AddChessSquare($chesspiece, $from, $to3);\n $this->AddChessSquare($chesspiece, $from, $to4);\n $this->AddChessSquare($chesspiece, $from, $to5);\n $this->AddChessSquare($chesspiece, $from, $to6);\n $this->AddChessSquare($chesspiece, $from, $to7);\n $this->AddChessSquare($chesspiece, $from, $to8);\n \n return true;\n\t}", "public function nextPossibleMove()\n {\n $x = $this->snake['pos']['x'];\n $y = $this->snake['pos']['y'];\n \n $moves = [\n 'up' => [$x, $y - 1],\n 'right' => [$x + 1, $y],\n 'down' => [$x, $y + 1],\n 'left' => [$x - 1, $y],\n ];\n\n $moves = $this->removeDeadMoves($moves);\n\n if (empty($moves)) {\n return $moves;\n }\n\n $moves = $this->calcThresholds($moves);\n\n if (!empty($safe = array_diff_key($moves, $this->getDangerMoves($moves)))) {\n $danger = array_intersect_key($moves, $this->getDangerMoves($moves));\n\n $threshold = array_first($safe)[2];\n\n if ($threshold > 7 && !empty($danger)) {\n return $danger;\n }\n\n if ($threshold > 5) {\n if (!empty($tail = $this->getTailMoves($safe))) {\n return $tail;\n }\n }\n\n if ($threshold > 5 && $this->snake['health'] < 95) {\n $result = $this->getFoodMoves($safe);\n\n if (!empty($result)) {\n return $result;\n }\n }\n\n return $safe;\n }\n\n if (!empty($head = $this->getHeadMoves($moves))) {\n return $head;\n }\n\n if (!empty($tail = $this->getTailMoves($moves))) {\n return $tail;\n }\n\n return $moves;\n }", "function stInterPlayerTurn() {\n \n // Give him extra time for his actions to come\n self::giveExtraTime(self::getActivePlayerId());\n \n // Does he plays again?\n if (self::getGameStateValue('first_player_with_only_one_action')) {\n // First turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('first_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('second_player_with_only_one_action')) {\n // 4 players at least and this is the second turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('second_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('has_second_action')) {\n // The player took his first action and has another one\n $next_player = false;\n self::setGameStateValue('has_second_action', 0);\n }\n else {\n // The player took his second action\n $next_player = true;\n self::setGameStateValue('has_second_action', 1);\n }\n if ($next_player) { // The turn for the current player is over\n // Reset the flags for Monument special achievement\n self::resetFlagsForMonument();\n \n // Activate the next player in turn\n $this->activeNextPlayer();\n $player_id = self::getActivePlayerId();\n self::setGameStateValue('active_player', $player_id);\n }\n self::notifyGeneralInfo('<!--empty-->');\n self::trace('interPlayerTurn->playerTurn');\n $this->gamestate->nextState();\n }", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function getColumnResultFor(string $playerUnit = 'O'): bool\n {\n return $this->winByColumn($playerUnit) !== false ?:\n $this->winByColumn(infer_opponent($playerUnit)) !== false;\n }", "private function seeIfPossible()\n {\n $correct = true;\n if(Parser::onlyNumbersString($_GET['o'])){\n if($_GET['o'] == User::get_currentCityId()){\n $this->cityTroopsInfo = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT * FROM {troops_movements} WHERE\n reciver_id = $_GET[o] and movement_type = 0\"));\n }else{\n $this->cityTroopsInfo = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT * FROM {troops_movements} WHERE\n reciver_city_id = $_GET[o] and owner_city_id = \".User::get_currentCityId().\" and movement_type = 10\"));\n }\n $correct = $correct && (!(Parser::onlyNumbersString($_GET['t']) && $_GET['t'] >= 0 && $_GET['t'] <= 6));\n $i = 1;\n $ttrops = 0;\n while($correct && $i<12){\n if(!(isset($_GET['tr'.$i]) && Parser::onlyNumbersString($_GET['tr'.$i]) && $_GET['tr'.$i] >= 0 && $this->cityTroopsInfo['tr'.$i] >= $_GET['tr'.$i] )){\n $correct = false;\n }else{\n $ttrops += $_GET['tr'.$i];\n }\n $i++;\n }\n $correct = $correct && ($ttrops > 0) && Parser::onlyNumbersString($_GET['d'] && $_GET['d'] > 0);\n if($correct){\n $exsistsd = DataBaseManager::query(\"SELECT owner_user_id FROM {map} WHERE box_id = $_GET[d]\");\n $this->calculateDistance();\n $oil = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT oil FROM {materials} WHERE city_id = \".User::get_currentCityId()));\n $oil = $oil[0];\n $this->finalOil = $oil - $this->calculateOil();\n $correct = ($this->finalOil >= 0 && DataBaseManager::numRows($exsistsd));\n $reciverUserId = DataBaseManager::fetchArray($exsistsd);\n $this->reciverUserId = $reciverUserId[0];\n }\n }else{\n $correct = false;\n }\n return $correct;\n\n }", "public function displayWinner()\n {\n // Search in array scores, for the username with the highest score.\n $nameWinner = array_search(max($this->scores), $this->scores);\n $scoreWinner = max($this->scores);\n\n $this->console->stdInput(1);\n $this->console->getInpunt(\"De winnaar met \" . $scoreWinner[\"scoreTotal\"] . \" punten is: \" . $nameWinner . \"\\nPress enter to end the game!\");\n $this->console->stdInput(1);\n }", "public function winRound() {\n\n\t\t$this->points++;\n\n\t\t$this->output($this->name.' has won this round');\n\t}", "public function nextMove($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n $playerUnit = ($playerUnit == 'X') ? 'O' : 'X';\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n $column = array_column($this->ticTacToeBoard, $i);\n\n $rowSum = 0;\n\n foreach ($this->ticTacToeBoard[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n\n if ($columnSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if ($this->ticTacToeBoard[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->ticTacToeBoard[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n\n if ($rightDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n for ($j = 0; $j <= $this->maxIndex; $j++) {\n if ($block && $this->ticTacToeBoard[$i][$j] == $playerUnit) {\n $coordinates = $this->getFirstEmptyAdjscentElement($i, $j);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->nextMove($playerUnit, true);\n }\n return false;\n }", "function stPlayerInvolvedTurn() {\n $player_id = self::getGameStateValue('current_player_under_dogma_effect');\n $launcher_id = self::getGameStateValue('active_player');\n $nested_id_1 = self::getGameStateValue('nested_id_1');\n $card_id = $nested_id_1 == -1 ? self::getGameStateValue('dogma_card_id') : $nested_id_1 ;\n $current_effect_type = $nested_id_1 == -1 ? self::getGameStateValue('current_effect_type') : 1 /* Non-demand effects only*/;\n $current_effect_number = $nested_id_1 == -1 ? self::getGameStateValue('current_effect_number') : self::getGameStateValue('nested_current_effect_number_1');\n $step_max = null;\n $step = null;\n \n $qualified_effect = self::qualifyEffect($current_effect_type, $current_effect_number, self::getCardInfo($card_id)); \n self::notifyEffectOnPlayer($qualified_effect, $player_id, $launcher_id);\n \n $crown = self::getIconSquare(1);\n $leaf = self::getIconSquare(2);\n $lightbulb = self::getIconSquare(3);\n $tower = self::getIconSquare(4);\n $factory = self::getIconSquare(5);\n $clock = self::getIconSquare(6);\n \n try {\n //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n // [A] SPECIFIC CODE: what are the automatic actions to make and/or is there interaction needed?\n $code = $card_id.($current_effect_type == 0 ? \"D\" : \"N\" ).$current_effect_number;\n self::trace('[A]'.$code.' '.self::getPlayerNameFromId($player_id).'('.$player_id.')'.' | '.self::getPlayerNameFromId($launcher_id).'('.$launcher_id.')');\n switch($code) {\n // The first number is the id of the card\n // D1 means the first (and single) I demand effect\n // N1 means the first non-demand effect\n // N2 means the second non-demand effect\n // N3 means the third non-demand effect\n \n // Setting the $step_max variable means there is interaction needed with the player\n \n // id 0, age 1: Pottery\n case \"0N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n case \"0N2\":\n self::executeDraw($player_id, 1); // \"Draw a 1\"\n break;\n\n // id 1, age 1: Tools\n case \"1N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n case \"1N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 2, age 1: Writing\n case \"2N1\":\n self::executeDraw($player_id, 2); // \"Draw a 2\"\n break;\n \n // id 3, age 1: Archery\n case \"3D1\":\n self::executeDraw($player_id, 1); // \"Draw a 1\"\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 4, age 1: Metalworking\n case \"4N1\":\n while(true) {\n $card = self::executeDraw($player_id, 1, 'revealed'); // \"Draw and reveal a 1\"\n if (self::hasRessource($card, 4)) { // \"If it as tower\"\n self::notifyGeneralInfo(clienttranslate('It has a ${tower}.'), array('tower' => $tower));\n self::transferCardFromTo($card, $player_id, 'score', false, true); // \"Score it\"\n continue; // \"Repeat this dogma effect\"\n }\n break; // \"Otherwise\" \n }\n self::notifyGeneralInfo(clienttranslate('It does not have a ${tower}.'), array('tower' => $tower));\n self::transferCardFromTo($card, $player_id, 'hand'); // \"Keep it\"\n break;\n \n // id 5, age 1: Oars\n case \"5D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"5N1\":\n if (self::getGameStateValue('auxiliary_value') <= 0) { // \"If no cards were transfered due to this demand\"\n self::executeDraw($player_id, 1); // \"Draw a 1\"\n }\n break;\n \n // id 6, age 1: Clothing\n case \"6N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n case \"6N2\":\n // \"Score a 1 for each color present on your board not present on any other player board\"\n // Compute the number of specific colors\n $number_to_be_scored = 0;\n $players = self::loadPlayersBasicInfos();\n $boards = self::getAllBoards($players);\n for ($color = 0; $color < 5; $color++) { // Evaluate each color\n if (count($boards[$player_id][$color]) == 0) { // The player does not have this color => no point\n continue;\n }\n // The player has this color, do opponents have?\n $color_on_opponent_board = false;\n foreach($players as $other_player_id => $player) {\n if ($other_player_id == $player_id || $other_player_id == self::getPlayerTeammate($player_id)) {\n continue; // Skip the player being evaluated and his teammate\n }\n if (count($boards[$other_player_id][$color]) > 0) { // This opponent has this color => no point\n $color_on_opponent_board = true;\n break;\n }\n }\n if (!$color_on_opponent_board) { // The opponents do not have this color => point\n $number_to_be_scored++;\n }\n }\n // Indicate this number\n if ($number_to_be_scored == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have no specific color on your board.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has no specific color on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n else if ($number_to_be_scored == 1) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have one specific color on your board.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has one specific color on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n else {\n $translated_number = self::getTranslatedNumber($number_to_be_scored);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} specific colors on your board.'), array('i18n' => array('n'), 'You' => 'You', 'n' => $translated_number));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} specific colors on his board.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $translated_number));\n }\n // Score this number of times\n for ($i=0; $i < $number_to_be_scored; $i++) {\n self::executeDraw($player_id, 1, 'score');\n }\n break;\n \n // id 7, age 1: Sailing\n case \"7N1\":\n self::executeDraw($player_id, 1, 'board'); // \"Draw and meld a 1\"\n break;\n \n // id 8, age 1: The wheel\n case \"8N1\":\n self::executeDraw($player_id, 1); // \"Draw two 1\"\n self::executeDraw($player_id, 1); // \n break;\n \n // id 9, age 1: Agriculture\n case \"9N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 10, age 1: Domestication\n case \"10N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 11, age 1: Masonry\n case \"11N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 12, age 1: City states\n case \"12D1\":\n $number_of_towers = self::getUniqueValueFromDB(self::format(\"\n SELECT\n player_icon_count_4\n FROM\n player\n WHERE\n player_id = {player_id}\n \",\n array('player_id' => $player_id)\n ));\n \n if ($number_of_towers >= 4) { // \"If you have at least four towers on your board\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have at least four ${icon} on your board.'), array('You' => 'You', 'icon' => $tower));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has at least four ${icon} on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'icon' => $tower));\n $step_max = 1; // --> 1 interaction: see B\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have less than four ${icon} on your board.'), array('You' => 'You', 'icon' => $tower));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has less than four ${icon} on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'icon' => $tower));\n }\n break;\n \n // id 13, age 1: Code of laws\n case \"13N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 14, age 1: Mysticism\n case \"14N1\":\n $card = self::executeDraw($player_id, 1, 'revealed'); // \"Draw and reveal a 1\n $color = $card['color'];\n if (self::hasThisColorOnBoard($player_id, $color)) { // \"If it is the same color of any card on your board\"\n self::notifyPlayer($player_id, 'log', clienttranslate('This card is ${color}; ${you} have this color on your board.'), array('i18n' => array('color'), 'you' => 'you', 'color' => self::getColorInClear($color)));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('This card is ${color}; ${player_name} has this color on his board.'), array('i18n' => array('color'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'color' => self::getColorInClear($color)));\n self::transferCardFromTo($card, $player_id, 'board'); // \"Meld it\"\n self::executeDraw($player_id, 1); // \"Draw a 1\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('This card is ${color}; ${you} do not have this color on your board.'), array('i18n' => array('color'), 'you' => 'you', 'color' => self::getColorInClear($color)));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('This card is ${color}; ${player_name} does not have this color on his board.'), array('i18n' => array('color'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'color' => self::getColorInClear($color)));\n self::transferCardFromTo($card, $player_id, 'hand'); // (Put the card in your hand)\n }\n break;\n \n // id 15, age 2: Calendar\n case \"15N1\":\n if (self::countCardsInLocation($player_id, 'score') > self::countCardsInLocation($player_id, 'hand')) { // \"If you have more cards in your score pile than in your hand\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have more cards in your score pile than in your hand.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has more cards in his score pile than in his hand.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n \n self::executeDraw($player_id, 3); // \"Draw two 3\"\n self::executeDraw($player_id, 3); // \n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} do not have more cards in your score pile than in your hand.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} does not have more cards in his score pile than in his hand.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n break;\n \n // id 16, age 2: Mathematics\n case \"16N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 17, age 2: Construction\n case \"17D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"17N1\":\n $boards = self::getAllBoards(self::loadPlayersBasicInfos());\n $eligible = true;\n foreach($boards as $current_id => $board) {\n if ($current_id == self::getPlayerTeammate($player_id)) { // Ignore teammate\n continue;\n }\n $number_of_top_cards = 0;\n for($color=0; $color<5; $color++) {\n if (count($board[$color]) > 0) { // This player has a top card for this color.\n $number_of_top_cards++;\n }\n }\n if ($current_id == $player_id && $number_of_top_cards < 5 || $current_id != $player_id && $number_of_top_cards == 5) { // This player is the active player and has not 5 top cards, or he is an opponent who has 5 top cards\n $eligible = false;\n }\n }\n if ($eligible) { // \"If you are the only player with five top cards\"\n $achievement = self::getCardInfo(105);\n if ($achievement['owner'] == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} are the only player with five top cards.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} is the only player with five top cards.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n self::transferCardFromTo($achievement, $player_id, 'achievements'); // \"Claim the Empire achievement\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} are the only player with five top cards but the Empire achievement has already been claimed.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} is the only player with five top cards but the Empire achievement has already been claimed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n }\n break;\n \n // id 18, age 2: Road building\n case \"18N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 19, age 2: Currency\n case \"19N1\":\n self::setGameStateValueFromArray('auxiliary_value', array());\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 20, age 2: Mapmaking\n case \"20D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"20N1\":\n if (self::getGameStateValue('auxiliary_value') == 1) { // \"If any card was transfered due to the demand\"\n self::executeDraw($player_id, 1, 'score'); // \"Draw and score a 1\"\n }\n break;\n \n // id 21, age 2: Canal building \n case \"21N1\":\n if (self::countCardsInLocation($player_id, 'score') == 0 && self::countCardsInLocation($player_id, 'hand') == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have no cards in your hand or score pile to exchange.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has no cards in their hand or score pile to exchange.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n } else {\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n // id 22, age 2: Fermenting \n case \"22N1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $number = 0;\n for($color=0; $color<5; $color++) {\n if (self::boardPileHasRessource($player_id, $color, 2 /* leaf */)) { // There is at least one visible leaf in that color\n $number++;\n }\n }\n if ($number <= 1) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} color with one or more visible ${leaves}.'), array('i18n' => array('n'), 'You' => 'You', 'n' => self::getTranslatedNumber($number), 'leaves' => $leaf));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} color with one or more ${leaves}.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => self::getTranslatedNumber($number), 'leaves' => $leaf));\n }\n else { // $number > 1\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} colors with one or more visible ${leaves}.'), array('i18n' => array('n'), 'You' => 'You', 'n' => self::getTranslatedNumber($number), 'leaves' => $leaf));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} colors with one or more ${leaves}.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => self::getTranslatedNumber($number), 'leaves' => $leaf));\n }\n // \"For each color of your board that have one leaf or more\"\n }\n else {\n $number_of_leaves = self::getPlayerSingleRessourceCount($player_id, 2 /* leaf */);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${leaves}.'), array('You' => 'You', 'n' => $number_of_leaves, 'leaves' => $leaf));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${leaves}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_leaves, 'leaves' => $leaf));\n $number = self::intDivision($number_of_leaves,2); // \"For every two leaves on your board\"\n }\n \n for($i=0; $i<$number; $i++) {\n self::executeDraw($player_id, 2); // \"Draw a 2\"\n }\n break;\n \n // id 23, age 2: Monotheism \n case \"23D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"23N1\":\n self::executeDraw($player_id, 1, 'board', true); // \"Draw and tuck a 1\"\n break;\n \n // id 24, age 2: Philosophy \n case \"24N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"24N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 25, age 3: Alchemy \n case \"25N1\":\n $number_of_towers = self::getPlayerSingleRessourceCount($player_id, 4);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${towers}.'), array('You' => 'You', 'n' => $number_of_towers, 'towers' => $tower));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${towers}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_towers, 'towers' => $tower));\n $any_card_red = false;\n $cards = array();\n for($i=0; $i<self::intDivision($number_of_towers,3); $i++) { // \"For every three towers on your board\"\n $card = self::executeDraw($player_id, 4, 'revealed'); // \"Draw and reveal a 4\"\n if ($card['color'] == 1) { // This card is red\n $any_card_red = true;\n }\n $cards[] = $card;\n }\n \n if ($any_card_red) { // \"If any of the drawn cards are red\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} drew a red card.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} drew a red card.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n\n $step_max = 1; // --> 1 interactions: see B\n }\n else { // \"Otherwise\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} did not draw a red card.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} did not draw a red card.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n foreach($cards as $card) {\n self::transferCardFromTo($card, $player_id, 'hand'); // \"Keep them\" (ie place them in your hand)\n }\n }\n break;\n \n case \"25N2\":\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 26, age 3: Translation \n case \"26N1\":\n $step_max = 1; // --> 1 interactions: see B\n break;\n \n case \"26N2\":\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card !== null && !self::hasRessource($top_card, 1)) { // This top card is present, with no crown on it\n $eligible = false;\n }\n }\n if ($eligible) { // \"If each card on your board has a crown\"\n $achievement = self::getCardInfo(108);\n if ($achievement['owner'] == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('Each top card on ${your} board has a ${crown}.'), array('your' => 'your', 'crown' => $crown));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('Each top card on ${player_name} board has a ${crown}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'crown' => $crown));\n self::transferCardFromTo($achievement, $player_id, 'achievements'); // \"Claim the World achievement\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('Each top card on ${your} board has a ${crown} but the Empire achievement has already been claimed.'), array('your' => 'your', 'crown' => $crown));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('Each top card on ${player_name} board has a ${crown} but the World achievement has already been claimed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'crown' => $crown));\n }\n }\n break;\n \n // id 27, age 3: Engineering \n case \"27D1\":\n // \"I demand you transfer all top cards with a tower from your board to my score pile\"\n $no_top_card_with_tower = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card !== null && self::hasRessource($top_card, 4)) { // This top card is present, with a tower on it\n $no_top_card_with_tower = false;\n self::transferCardFromTo($top_card, $launcher_id, 'score');\n }\n }\n if ($no_top_card_with_tower) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have no top card with a ${tower} on your board.'), array('You' => 'You', 'tower' => $tower));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has no top card with a ${tower} on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'tower' => $tower));\n }\n break;\n \n case \"27N1\":\n $step_max = 1; // --> 1 interactions: see B\n break;\n \n // id 28, age 3: Optics \n case \"28N1\":\n $card = self::executeDraw($player_id, 3, 'board'); // \"Draw and meld a 3\"\n if (self::hasRessource($card, 1)) { // \"If it has a crown\"\n self::notifyGeneralInfo(clienttranslate('It has a ${crown}.'), array('crown' => $crown));\n self::executeDraw($player_id, 4, 'score'); // \"Draw and score a 4\"\n }\n else { // \"Otherwise\"\n self::notifyGeneralInfo(clienttranslate('It does not have a ${crown}.'), array('crown' => $crown));\n $number_of_players_with_fewer_points = self::getUniqueValueFromDB(self::format(\"\n SELECT\n COUNT(*)\n FROM\n player\n WHERE\n player_id <> {player_id} AND\n player_innovation_score < (\n SELECT\n player_innovation_score\n FROM\n player\n WHERE\n player_id = {player_id}\n ) AND\n player_team <> (\n SELECT\n player_team\n FROM\n player\n WHERE\n player_id = {player_id}\n )\n \"\n ,\n array('player_id' => $player_id)\n ));\n if ($number_of_players_with_fewer_points == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('There is no opponent who has fewer points than ${you}.'), array('you' => 'you'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('There is no opponent who has fewer points than ${player_name}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n else {\n $step_max = 2; // --> 2 interactions: see B\n }\n }\n break;\n \n // id 29, age 3: Compass\n case \"29D1\":\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 30, age 3: Paper \n case \"30N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"30N2\":\n $number_of_colors_splayed_left = 0;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) == 1 /* left */) {\n $number_of_colors_splayed_left++;\n }\n }\n if ($number_of_colors_splayed_left < 2) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} color splayed left.'), array('i18n' => array('n'), 'You' => 'You', 'n' => $number_of_colors_splayed_left));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} color splayed left.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_colors_splayed_left));\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} colors splayed left.'), array('i18n' => array('n'), 'You' => 'You', 'n' => $number_of_colors_splayed_left));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} colors splayed left.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_colors_splayed_left));\n }\n \n for($i=0;$i<$number_of_colors_splayed_left;$i++) { // For every color you have splayed left\n self::executeDraw($player_id, 4); // Draw a 4\n }\n break;\n \n // id 31, age 3: Machinery \n case \"31D1\":\n // \"Exchange all the cards in your hand with all the highest cards in my hand\"\n \n // Get cards in hand\n $ids_of_cards_in_player_hand = self::getIdsOfCardsInLocation($player_id, 'hand');\n $ids_of_highest_cards_in_launcher_hand = self::getIdsOfHighestCardsInLocation($launcher_id, 'hand');\n \n // Make the transfers\n foreach($ids_of_cards_in_player_hand as $id) {\n $card = self::getCardInfo($id);\n self::transferCardFromTo($card, $launcher_id, 'hand');\n }\n foreach($ids_of_highest_cards_in_launcher_hand as $id) {\n $card = self::getCardInfo($id);\n self::transferCardFromTo($card, $player_id, 'hand');\n }\n break;\n \n case \"31N1\":\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 32, age 3: Medicine \n case \"32D1\":\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 33, age 3: Education \n case \"33N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 34, age 3: Feudalism \n case \"34D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"34N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 35, age 4: Experimentation \n case \"35N1\":\n self::executeDraw($player_id, 5, 'board'); // \"Draw and meld a 5\"\n break;\n \n // id 36, age 4: Printing press \n case \"36N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"36N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 37, age 4: Colonialism\n case \"37N1\":\n do {\n $card = self::executeDraw($player_id, 3, 'board', true); // \"Draw and tuck a 3\"\n } while(self::hasRessource($card, 1 /* crown */)); // \"If it has a crown, repeat this dogma effect\"\n break;\n \n // id 38, age 4: Gunpowder\n case \"38D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"38N1\":\n if (self::getGameStateValue('auxiliary_value') == 1) { // \"If any card was transfered due to the demand\"\n self::executeDraw($player_id, 2, 'score'); // \"Draw and score a 2\"\n }\n break;\n \n // id 39, age 4: Invention\n case \"39N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"39N2\":\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) == 0) { // This color is missing or unsplayed\n $eligible = false;\n };\n }\n if ($eligible) { // \"If you have colors splayed, each in any direction\"\n $achievement = self::getCardInfo(107);\n if ($achievement['owner'] == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have all your five colors splayed.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has all his five colors splayed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n self::transferCardFromTo($achievement, $player_id, 'achievements'); // \"Claim the Wonder achievement\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have all your five colors splayed but the Wonder achievement has already been claimed.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has all his five colors splayed but the Wonder achievement has already been claimed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n }\n break;\n \n // id 40, age 4: Navigation\n case \"40D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 41, age 4: Anatomy\n case \"41D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 42, age 4: Perspective\n case \"42N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 43, age 4: Enterprise\n case \"43D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"43N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 44, age 4: Reformation\n case \"44N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"44N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 45, age 5: Chemistry\n case \"45N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"45N2\":\n // \"Draw and score a card of value one higher than the highest top card on your board\"\n self::executeDraw($player_id, self::getMaxAgeOnBoardTopCards($player_id) + 1, 'score');\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 46, age 5: Physics\n case \"46N1\":\n $cards = array();\n $colors = array();\n $same_color = false;\n for($i=0; $i<3; $i++) { // \"Three times\"\n $card = self::executeDraw($player_id, 6, 'revealed'); // \"Draw and reveal a 6\"\n if (in_array($card['color'], $colors)) { // This card has the same color than one that has already been drawn\n $same_color = true;\n }\n else {\n $colors[] = $card['color'];\n }\n $cards[] = $card;\n }\n \n if ($same_color) { // \"If two or more cards are the same color\"\n $step_max = 1; // --> 1 interactions: see B\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} drew two cards of the same color.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} drew two cards of the same color.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n else { // \"Otherwise\"\n self::notifyPlayer($player_id, 'log', clienttranslate('All the cards ${you} drew have different colors.'), array('you' => 'you'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('All the cards ${player_name} drew have different colors.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n foreach($cards as $card) {\n self::transferCardFromTo($card, $player_id, 'hand'); // \"Keep them\" (ie place them in your hand)\n }\n }\n break;\n \n // id 47, age 5: Coal\n case \"47N1\":\n self::executeDraw($player_id, 5, 'board', true); // \"Draw and tuck a 5\"\n break;\n\n case \"47N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"47N3\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 48, age 5: The pirate code\n case \"48D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"48N1\":\n if (self::getGameStateValue('auxiliary_value') == 1) { // \"If any card was transfered due to the demand\"\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n // id 49, age 5: Banking\n case \"49D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"49N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 50, age 5: Measurement\n case \"50N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 51, age 5: Statistics\n case \"51D1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n // Get highest cards in score\n $ids_of_highest_cards_in_score = self::getIdsOfHighestCardsInLocation($player_id, 'score');\n\n // Make the transfers\n foreach($ids_of_highest_cards_in_score as $id) {\n $card = self::getCardInfo($id);\n self::transferCardFromTo($card, $player_id, 'hand'); // \"Transfer all the highest cards in your score pile to your hand\"\n }\n }\n else { // First edition\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n\n case \"51N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 52, age 5: Steam engine\n case \"52N1\":\n self::executeDraw($player_id, 4, 'board', true); // \"Draw and tuck two 1\"\n self::executeDraw($player_id, 4, 'board', true); //\n $card = self::getBottomCardOnBoard($player_id, 3 /* yellow */);\n if ($card !== null) {\n self::transferCardFromTo($card, $player_id, 'score', false, true); // \"Score your bottom yellow card\"\n }\n break;\n \n // id 53, age 5: Astronomy\n case \"53N1\":\n while(true) {\n $card = self::executeDraw($player_id, 6, 'revealed'); // \"Draw and reveal a 6\"\n if ($card['color'] != 0 /* blue */ && $card['color'] != 2 /* green */) {\n self::notifyGeneralInfo(clienttranslate(\"This card is neither blue nor green.\"));\n break; // \"Otherwise\"\n };\n // \"If the card is green or blue\"\n self::notifyGeneralInfo($card['color'] == 0 ? clienttranslate(\"This card is blue.\") : clienttranslate(\"This card is green.\"));\n self::transferCardFromTo($card, $player_id, 'board'); // \"Meld it\"\n }\n self::transferCardFromTo($card, $player_id, 'hand'); // (\"Keep it\")\n break;\n \n case \"53N2\":\n $eligible = true;\n for($color = 0; $color < 4 /* purple is not tested */ ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card !== null && $top_card['age'] < 6) { // This top card is value 5 or fewer\n $eligible = false;\n }\n }\n if ($eligible) { // \"If all your non-purple top cards on your board are value 6 or higher\"\n $achievement = self::getCardInfo(109);\n if ($achievement['owner'] == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('All non-purple top cards on ${your} board are value ${age_6} or higher.'), array('your' => 'your', 'age_6' => self::getAgeSquare(6)));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('All non-purple top cards on ${player_name}\\'s board are value ${age_6} or higher.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'age_6' => self::getAgeSquare(6)));\n self::transferCardFromTo($achievement, $player_id, 'achievements'); // \"Claim the Universe achievement\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('All non-purple top cards on ${your} board are value ${age_6} or higher but the Universe achievement has already been claimed.'), array('your' => 'your', 'age_6' => self::getAgeSquare(6)));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('All non-purple top cards on ${player_name}\\'s board are value ${age_6} or higher but the Universe achievement has already been claimed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'age_6' => self::getAgeSquare(6)));\n }\n }\n break;\n \n // id 54, age 5: Societies\n case \"54D1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $colors = array();\n // Determine colors which top cards with a lightbulb of the player have a value higher than the tops cards of the launcher\n for($color=0; $color<5; $color++) {\n $player_top_card = self::getTopCardOnBoard($player_id, $color);\n if ($player_top_card === null || !self::hasRessource($player_top_card, 3 /* lightbulb */)) {\n continue;\n }\n $launcher_top_card = self::getTopCardOnBoard($launcher_id, $color);\n if ($launcher_top_card === null /* => Value 0, so the color is selectable */ || $player_top_card['age'] > $launcher_top_card['age']) {\n $colors[] = $color; // This color is selectable\n }\n }\n }\n else { // First edition\n $colors = array(0,1,2,3); // All but purple\n }\n self::setGameStateValueFromArray('auxiliary_value', $colors);\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 55, age 6: Atomic theory\n case \"55N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"55N2\":\n self::executeDraw($player_id, 7, 'board'); // \"Draw and meld a 7\"\n break;\n \n // id 56, age 6: Encyclopedia\n case \"56N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 57, age 6: Industrialisation\n case \"57N1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $number = 0;\n for($color=0; $color<5; $color++) {\n if (self::boardPileHasRessource($player_id, $color, 5 /* factory */)) { // There is at least one visible factory in that color\n $number++;\n }\n }\n if ($number <= 1) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} color with one or more visible ${factories}.'), array('i18n' => array('n'), 'You' => 'You', 'n' => self::getTranslatedNumber($number), 'factories' => $factory));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} color with one or more ${factories}.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => self::getTranslatedNumber($number), 'factories' => $factory));\n }\n else { // $number > 1\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} colors with one or more visible ${factories}.'), array('i18n' => array('n'), 'You' => 'You', 'n' => self::getTranslatedNumber($number), 'factories' => $factory));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} colors with one or more ${factories}.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => self::getTranslatedNumber($number), 'factories' => $factory));\n }\n // \"For each color of your board that have one factory or more\"\n }\n else {\n $number_of_factories = self::getPlayerSingleRessourceCount($player_id, 5 /* factory */);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${factories}.'), array('You' => 'You', 'n' => $number_of_factories, 'factories' => $factory));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${factories}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_factories, 'factories' => $factory));\n $number = self::intDivision($number_of_factories,2); // \"For every two factories on your board\"\n }\n \n for($i=0; $i<$number; $i++) {\n self::executeDraw($player_id, 6, 'board', true); // \"Draw and tuck a 6\"\n }\n break;\n \n case \"57N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 58, age 6: Machine tools\n case \"58N1\":\n self::executeDraw($player_id, self::getMaxAgeInScore($player_id), 'score'); // \"Draw and score a card of value equal to the highest card in your score pile\"\n break;\n \n // id 59, age 6: Classification\n case \"59N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 60, age 6: Metric system\n case \"60N1\":\n if (self::getCurrentSplayDirection($player_id, 2 /* green */) == 2 /* right */) { // \"If your green cards are splayed right\"\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n case \"60N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 61, age 6: Canning\n case \"61N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"61N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 62, age 6: Vaccination\n case \"62D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"62N1\":\n if (self::getGameStateValue('auxiliary_value') == 1) { // \"If any card was returned as a result of the demand\"\n self::executeDraw($player_id, 7, 'board'); // \"Draw and meld a 7\"\n }\n break;\n \n // id 63, age 6: Democracy \n case \"63N1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 64, age 6: Emancipation\n case \"64D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"64N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 65, age 7: Evolution \n case \"65N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 66, age 7: Publications\n case \"66N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"66N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 67, age 7: Combustion\n case \"67D1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $number_of_crowns = self::getPlayerSingleRessourceCount($launcher_id, 1 /* crown */);\n self::notifyPlayer($launcher_id, 'log', clienttranslate('${You} have ${n} ${crowns}.'), array('You' => 'You', 'n' => $number_of_crowns, 'crowns' => $crown));\n self::notifyAllPlayersBut($launcher_id, 'log', clienttranslate('${player_name} has ${n} ${crowns}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_crowns, 'crowns' => $crown));\n $number = self::intDivision($number_of_crowns, 4);\n if ($number == 0) {\n self::notifyGeneralInfo(clienttranslate('No card has to be transfered.'));\n break;\n }\n }\n else { // First edition\n $number = 2;\n }\n self::setGameStateValue('auxiliary_value', $number);\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"67N1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $bottom_red_card = self::getBottomCardOnBoard($player_id, 1 /* red */);\n if ($bottom_red_card !== null) {\n self::transferCardFromTo($bottom_red_card, 0, 'deck'); // \"Return your bottom red card\"\n }\n }\n break;\n \n // id 68, age 7: Explosives\n case \"68D1\":\n self::setGameStateValue('auxiliary_value', 0); // Flag to indicate if the player has transfered a card or not\n $step_max = 3; // --> 3 interactions: see B\n break;\n \n // id 69, age 7: Bicycle\n case \"69N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 70, age 7: Electricity\n case \"70N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 71, age 7: Refrigeration\n case \"71D1\":\n if (self::countCardsInLocation($player_id, 'hand') > 1) {\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n case \"71N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 72, age 7: Sanitation \n case \"72D1\":\n $step_max = 3; // --> 3 interactions: see B\n break;\n \n // id 73, age 7: Lighting \n case \"73N1\":\n self::setGameStateValueFromArray('auxiliary_value', array()); // Flag to indicate what ages have been tucked\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 74, age 7: Railroad \n case \"74N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"74N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 75, age 8: Quantum theory \n case \"75N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 76, age 8: Rocketry \n case \"76N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 77, age 8: Flight\n case \"77N1\":\n if (self::getCurrentSplayDirection($player_id, 1 /* red */) == 3 /* up */) { // \"If your red cards are splayed up\"\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n case \"77N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 78, age 8: Mobility \n case \"78D1\":\n self::setGameStateValueFromArray('auxiliary_value', array(0,2,3,4)); // Flag to indicate the colors the player can still choose (not red at the start)\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 79, age 8: Corporations \n case \"79D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"79N1\":\n self::executeDraw($player_id, 8, 'board'); // \"Draw and meld an ${age_8}\"\n break;\n \n // id 80, age 8: Mass media \n case \"80N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"80N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 81, age 8: Antibiotics\n case \"81N1\":\n self::setGameStateValueFromArray('auxiliary_value', array()); // Flag to indicate what ages have been tucked\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 82, age 8: Skyscrapers\n case \"82D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 83, age 8: Empiricism \n case \"83N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"83N2\":\n if (self::getPlayerSingleRessourceCount($player_id, 3 /* lightbulb */) >= 20) { // \"If you have twenty or more lightbulbs on your board\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have at least twenty ${lightbulbs}.'), array('You' => 'You', 'lightbulbs' => $lightbulb));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has at least twenty ${lightbulbs}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'lightbulbs' => $lightbulb));\n self::setGameStateValue('winner_by_dogma', $player_id); // \"You win\"\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Empiricism');\n throw new EndOfGame(); \n }\n break;\n \n // id 84, age 8: Socialism \n case \"84N1\":\n self::setGameStateValue('auxiliary_value', 0); // Flag to indicate if one purple card has been tuckeds or not\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 85, age 9: Computers \n case \"85N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"85N2\":\n $card = self::executeDraw($player_id, 10, 'board'); // \"Draw and meld a 10\"\n self::checkAndPushCardIntoNestedDogmaStack($card); // \"Execute each of its non-demand dogma effects\"\n break;\n \n // id 86, age 9: Genetics \n case \"86N1\":\n $card = self::executeDraw($player_id, 10, 'board'); // \"Draw and meld a 10\"\n $board = self::getCardsInLocation($player_id, 'board', false, true);\n $pile = $board[$card['color']];\n for($p=0; $p < count($pile)-1; $p++) { // \"For each card beneath it\"\n $card = self::getCardInfo($pile[$p]['id']);\n self::transferCardFromTo($card, $player_id, 'score', false, true); // \"Score that card\"\n }\n break;\n \n // id 87, age 9: Composites \n case \"87D1\":\n $step_max = 2; // --> 2 interactions: see B\n if (self::countCardsInLocation($player_id, 'hand') <= 1) {\n $step = 2; // --> (All but one card when there is 0 or 1 card means that nothing is to be done) Jump directly to step 2\n }\n break;\n \n // id 88, age 9: Fission\n case \"88D1\":\n $card = self::executeDraw($player_id, 10, 'revealed'); // \"Draw a 10\"\n if ($card['color'] == 1 /* red */) { // \"If it is red\"\n self::notifyGeneralInfo(clienttranslate('This card is red.'));\n self::removeAllHandsBoardsAndScores(); // \"Remove all hands, boards and score piles from the game\"\n self::notifyAll('removedHandsBoardsAndScores', clienttranslate('All hands, boards and score piles are removed from the game. Achievements are kept.'), array());\n \n // Stats\n self::setStat(true, 'fission_triggered');\n \n // \"If this occurs, the dogma action is complete\"\n // (Set the flags has if the launcher had completed the non-demand dogma effect)\n self::setGameStateValue('current_player_under_dogma_effect', $launcher_id);\n self::setGameStateValue('current_effect_type', 1);\n self::setGameStateValue('current_effect_number', 1);\n }\n else {\n self::notifyGeneralInfo(clienttranslate('This card is not red.'));\n // (Implicit) \"Place it into your hand\"\n self::transferCardFromTo($card, $player_id, 'hand');\n }\n break;\n \n case \"88N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 89, age 9: Collaboration\n case \"89D1\":\n self::executeDraw($player_id, 9, 'revealed'); // \"Draw two 9 and reveal them\"\n self::executeDraw($player_id, 9, 'revealed'); //\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"89N1\":\n $number_of_cards_on_board = self::countCardsInLocation($player_id, 'board', false, true);\n $number_of_green_cards = $number_of_cards_on_board[2];\n if ($number_of_green_cards >= 10) { // \"If you have ten or more green cards on your board\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have at least ten green cards.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has at least ten green cards.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n self::setGameStateValue('winner_by_dogma', $player_id); // \"You win\"\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Collaboration');\n throw new EndOfGame(); \n }\n break;\n \n // id 90, age 9: Satellites\n case \"90N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"90N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"90N3\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 91, age 9: Ecology\n case \"91N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 92, age 9: Suburbia\n case \"92N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 93, age 9: Services\n case \"93D1\":\n $ids_of_highest_cards_in_score = self::getIdsOfHighestCardsInLocation($player_id, 'score');\n foreach($ids_of_highest_cards_in_score as $id) {\n $card = self::getCardInfo($id);\n self::transferCardFromTo($card, $launcher_id, 'hand'); // \"Transfer all the highest cards from your score pile to my hand\"\n }\n \n if (count($ids_of_highest_cards_in_score) > 0) { // \"If you transferred any cards\"\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n\n // id 94, age 9: Specialization\n case \"94N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"94N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 95, age 10: Bioengineering\n case \"95N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"95N2\":\n $players = self::loadPlayersBasicInfos();\n $max_number_of_leaves = -1;\n $any_under_three_leaves = false;\n foreach ($players as $player_id => $player) {\n $number_of_leaves = self::getPlayerSingleRessourceCount($player_id, 2);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${leaves}.'), array('You' => 'You', 'n' => $number_of_leaves, 'leaves' => $leaf));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${leaves}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_leaves, 'leaves' => $leaf));\n if (!$any_under_three_leaves && $number_of_leaves < 3) { // Less than three\n self::notifyGeneralInfo(clienttranslate('That is less than 3.'));\n $any_under_three_leaves = true;\n }\n if ($number_of_leaves > $max_number_of_leaves) {\n $max_number_of_leaves = $number_of_leaves;\n $owner_of_max_number_of_leaves = $player_id;\n $tie = false; \n }\n else if ($number_of_leaves == $max_number_of_leaves && $player_id != self::getPlayerTeammate($owner_of_max_number_of_leaves)) {\n $tie = true;\n }\n }\n \n if (!$any_under_three_leaves) {\n self::notifyGeneralInfo(clienttranslate('Nobody has less than three ${leaves}.'), array('leaves' => $leaf));\n }\n else if ($tie) {\n self::notifyGeneralInfo(clienttranslate('There is a tie for the most number of ${leaves}. The game continues.'), array('leaves' => $leaf));\n }\n else { // \"If any player has less than three leaves, the single player with the most number of leaves\"\n self::notifyPlayer($owner_of_max_number_of_leaves, 'log', clienttranslate('${You} have more ${leaves} than each opponent.'), array('You' => 'You', 'leaves' => $leaf));\n self::notifyAllPlayersBut($owner_of_max_number_of_leaves, 'log', clienttranslate('${player_name} has more ${leaves} than each opponent.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($owner_of_max_number_of_leaves), $owner_of_max_number_of_leaves), 'leaves' => $leaf));\n self::setGameStateValue('winner_by_dogma', $owner_of_max_number_of_leaves); // \"Wins\"\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Bioengineering');\n throw new EndOfGame();\n }\n \n break;\n\n // id 96, age 10: Software\n case \"96N1\":\n self::executeDraw($player_id, 10, 'score', false, true /* score keyword*/); // \"Draw and score a 10\"\n break;\n \n case \"96N2\":\n self::executeDraw($player_id, 10, 'board'); // \"Draw and meld two 10\"\n $card = self::executeDraw($player_id, 10, 'board'); //\n self::checkAndPushCardIntoNestedDogmaStack($card); // \"Execute each of the second card's non-demand dogma effects\"\n break;\n \n // id 97, age 10: Miniaturization\n case \"97N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 98, age 10: Robotics\n case \"98N1\":\n $top_green_card = self::getTopCardOnBoard($player_id, 2 /* green */);\n if ($top_green_card !== null) {\n self::transferCardFromTo($top_green_card, $player_id, 'score', false, true /* score keyword*/); // \"Score your top green card\"\n }\n $card = self::executeDraw($player_id, 10, 'board'); // \"Draw and meld a 10\n self::checkAndPushCardIntoNestedDogmaStack($card); // \"Execute each its non-demand dogma effects\"\n break;\n \n // id 99, age 10: Databases\n case \"99D1\":\n if (self::countCardsInLocation($player_id, 'score') > 0) { // (Nothing to do if the player has nothing in his score pile)\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n // id 100, age 10: Self service\n case \"100N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"100N2\":\n $players = self::loadPlayersBasicInfos();\n $number_of_achievements = self::getPlayerNumberOfAchievements($player_id);\n $most_achievements = true;\n foreach ($players as $other_player_id => $player) {\n if ($other_player_id == $player_id || $other_player_id == self::getPlayerTeammate($player_id)) {\n continue; // Skip the player being evaluated and his teammate\n }\n \n if (self::getPlayerNumberOfAchievements($other_player_id) >= $number_of_achievements) {\n $most_achievements = false;\n }\n }\n if ($most_achievements) { // \"If you have more achievements than each other player\"\n if (self::decodeGameType(self::getGameStateValue('game_type')) == 'individual') {\n self::notifyAllPlayersBut($player_id, \"log\", clienttranslate('${player_name} has more achievements than each other player.'), array(\n 'player_name' => self::getPlayerNameFromId($player_id)\n ));\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('${You} have more achievements than each other player.'), array(\n 'You' => 'You'\n ));\n }\n else { // self::getGameStateValue('game_type')) == 'team'\n $teammate_id = self::getPlayerTeammate($player_id);\n $winning_team = array($player_id, $teammate_id);\n self::notifyAllPlayersBut($winning_team, \"log\", clienttranslate('The other team has more achievements than yours.'), array());\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('Your team has more achievements than the other.'), array());\n \n self::notifyPlayer($teammate_id, \"log\", clienttranslate('Your team has more achievements than the other.'), array());\n }\n self::setGameStateValue('winner_by_dogma', $player_id); // \"You win\"\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Self service');\n throw new EndOfGame();\n }\n break;\n \n // id 101, age 10: Globalization\n case \"101D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"101N1\":\n self::executeDraw($player_id, 6, 'score', false, true); // \"Draw and score a 6\"\n \n $players = self::loadPlayersBasicInfos();\n $nobody_more_leaves_than_factories = true;\n foreach ($players as $player_id => $player) {\n $number_of_leaves = self::getPlayerSingleRessourceCount($player_id, 2);\n $number_of_factories = self::getPlayerSingleRessourceCount($player_id, 5);\n \n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${m} ${leaves} and ${n} ${factories}.'), array('You' => 'You', 'm' => $number_of_leaves, 'leaves' => $leaf, 'n' => $number_of_factories, 'factories' => $factory));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${m} ${leaves} and ${n} ${factories}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'm' => $number_of_leaves, 'leaves' => $leaf, 'n' => $number_of_factories, 'factories' => $factory));\n \n if ($nobody_more_leaves_than_factories && $number_of_leaves > $number_of_factories) {\n self::notifyGeneralInfo(clienttranslate('That is more ${leaves} than ${factories}'), array('leaves' => $leaf, 'factories' => $factory));\n $nobody_more_leaves_than_factories = false;\n }\n }\n \n if ($nobody_more_leaves_than_factories) { // \"If no player has more leaves than factories on their board\"\n $teams = array();\n $scores = array();\n foreach ($players as $player_id => $player) {\n $team = self::getPlayerTeam($player_id);\n $score = self::getPlayerScore($player_id);\n if (!array_key_exists($team, $teams)) {\n $teams[$team] = array($player_id);\n $scores[$team] = $score;\n }\n else {\n $teams[$team][] = $player_id;\n $scores[$team] += $score;\n }\n }\n \n $max_score = -1;\n foreach($scores as $team => $score) {\n if ($score > $max_score) {\n $max_score = $score;\n $team_max = $team;\n $tie = false;\n }\n else if ($score == $max_score) {\n $tie = true;\n }\n \n // Display the score (or the combined score for the team)\n if (self::decodeGameType(self::getGameStateValue('game_type')) == 'individual') {\n $player_id = $teams[$team][0];\n if ($score < 2) {\n $message_for_others = clienttranslate('${player_name} has ${n} point.');\n $message_for_player = clienttranslate('${You} have ${n} point.');\n }\n else {\n $message_for_others = clienttranslate('${player_name} has ${n} points.');\n $message_for_player = clienttranslate('${You} have ${n} points.'); \n }\n self::notifyAllPlayersBut($player_id, \"log\", $message_for_others, array(\n 'player_name' => self::getPlayerNameFromId($player_id),\n 'n' => $score\n ));\n \n self::notifyPlayer($player_id, \"log\", $message_for_player, array(\n 'You' => 'You',\n 'n' => $score\n ));\n } \n else { // self::getGameStateValue('game_type') == 'team'\n $current_team = $teams[$team];\n $player_id = $current_team[0];\n $teammate_id = $current_team[1];\n if ($score < 2) {\n $message_for_team = clienttranslate('Your team has ${n} point.');\n $message_for_others = clienttranslate('The other team has ${n} point.');\n }\n else {\n $message_for_team = clienttranslate('Your team has ${n} points.');\n $message_for_others = clienttranslate('The other team has ${n} points.'); \n }\n self::notifyAllPlayersBut($current_team, \"log\", $message_for_others, array('n' => $score));\n \n self::notifyPlayer($player_id, \"log\", $message_for_team, array('n' => $score));\n \n self::notifyPlayer($teammate_id, \"log\",$message_for_team, array('n' => $score)); \n }\n }\n \n if ($tie) {\n self::notifyGeneralInfo(clienttranslate('There is a tie for the greatest score. The game continues.'));\n }\n else {\n $winning_team = $teams[$team_max];\n if (self::decodeGameType(self::getGameStateValue('game_type')) == 'individual') {\n $player_id = $winning_team[0];\n self::notifyAllPlayersBut($player_id, \"log\", clienttranslate('${player_name} has a greater score than each other player.'), array(\n 'player_name' => self::getPlayerNameFromId($player_id)\n ));\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('${You} have a greater score than each other player.'), array(\n 'You' => 'You'\n ));\n }\n else { // self::getGameStateValue('game_type')) == 'team'\n $player_id = $winning_team[0];\n $teammate_id = $winning_team[1];\n self::notifyAllPlayersBut($winning_team, \"log\", clienttranslate('The other team has a greater score than yours.'), array());\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('Your team has a greater score than the other one.'), array());\n \n self::notifyPlayer($teammate_id, \"log\", clienttranslate('Your team has a greater score than the other one.'), array());\n }\n self::setGameStateValue('winner_by_dogma', $player_id); // \"The single player with the most points wins\" (or combined scores for team)\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Globalization');\n throw new EndOfGame();\n }\n }\n break;\n \n // id 102, age 10: Stem cells\n case \"102N1\":\n if (self::countCardsInLocation($player_id, 'hand') == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have no cards in your hand to score.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has no cards in their hand to score.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n } else {\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n \n // id 103, age 10: A. I.\n case \"103N1\":\n self::executeDraw($player_id, 10, 'score'); // \"Draw and score a 10\"\n break;\n\n case \"103N2\":\n $players = self::loadPlayersBasicInfos();\n $software_found = false;\n foreach ($players as $any_player_id => $player) {\n $top_blue_card = self::getTopCardOnBoard($any_player_id, 0 /* blue: color of Software*/);\n if ($top_blue_card !== null && $top_blue_card['id'] == 96 /* Software */) {\n $software_found = true;\n break;\n }\n }\n \n $robotics_found = false;\n foreach ($players as $any_player_id => $player) {\n $top_red_card = self::getTopCardOnBoard($any_player_id, 1 /* red: color of Robotics*/);\n if ($top_red_card !==null && $top_red_card['id'] == 98 /* Robotics */) {\n $robotics_found = true;\n break;\n }\n }\n \n if ($software_found && $robotics_found) { // \"If Robotics and Software are top cards on any board\"\n self::notifyGeneralInfo(clienttranslate('Robotics and Software are both visible as top cards.'));\n \n $min_score = 9999;\n foreach($players as $any_player_id => $player) {\n $score = self::getPlayerScore($any_player_id);\n if ($score < $min_score) {\n $min_score = $score;\n $player_with_min_score = $any_player_id;\n $tie = false;\n }\n else if ($score == $min_score) {\n $tie = true;\n }\n \n // Display the score (or the combined score for the team)\n if ($score < 2) {\n $message_for_others = clienttranslate('${player_name} has ${n} point.');\n $message_for_player = clienttranslate('${You} have ${n} point.');\n }\n else {\n $message_for_others = clienttranslate('${player_name} has ${n} points.');\n $message_for_player = clienttranslate('${You} have ${n} points.');\n }\n self::notifyAllPlayersBut($any_player_id, \"log\", $message_for_others, array(\n 'player_name' => self::getPlayerNameFromId($any_player_id),\n 'n' => $score\n ));\n \n self::notifyPlayer($any_player_id, \"log\", $message_for_player, array(\n 'You' => 'You',\n 'n' => $score\n ));\n }\n if ($tie) {\n self::notifyGeneralInfo(clienttranslate('There is a tie for the lowest score. The game continues.'));\n }\n else {\n self::notifyAllPlayersBut($player_with_min_score, \"log\", clienttranslate('${player_name} has the lowest score.'), array(\n 'player_name' => self::getPlayerNameFromId($player_with_min_score)\n ));\n \n self::notifyPlayer($player_with_min_score, \"log\", clienttranslate('${You} have the lowest score.'), array(\n 'You' => 'You'\n ));\n self::setGameStateValue('winner_by_dogma', $player_with_min_score); // \"The single player with the most points wins\" (scores are not combined for teams)\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn A. I.');\n throw new EndOfGame();\n }\n }\n break;\n\n // id 104, age 10: The internet.\n case \"104N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"104N2\":\n self::executeDraw($player_id, 10, 'score'); // \"Draw and score a 10\"\n break;\n\n case \"104N3\":\n $number_of_clocks = self::getPlayerSingleRessourceCount($player_id, 6 /* clock */);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${clocks}.'), array('You' => 'You', 'n' => $number_of_clocks, 'clocks' => $clock));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${clocks}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_clocks, 'clocks' => $clock));\n for($i=0; $i<self::intDivision($number_of_clocks,2); $i++) { // \"For every two clocks on your board\"\n self::executeDraw($player_id, 10, 'board'); // \"Draw and meld a 10\"\n }\n break;\n \n default:\n // This should not happens\n //throw new BgaVisibleSystemException(self::format(self::_(\"Unreferenced card effect code in section A: '{code}'\"), array('code' => $code)));\n break;\n }\n //[AA]||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n }\n catch (EndOfGame $e) {\n // End of the game: the exception has reached the highest level of code\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn');\n self::trace('playerInvolvedTurn->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n \n if ($step_max === null) {\n // End of the effect for this player\n self::trace('playerInvolvedTurn->interPlayerInvolvedTurn');\n $this->gamestate->nextState('interPlayerInvolvedTurn');\n return;\n }\n // There is an interaction needed\n self::setGameStateValue('step_max', $step_max);\n\n // Prepare the first step\n self::setGameStateValue('step', $step === null ? 1 : $step);\n self::trace('playerInvolvedTurn->interactionStep');\n $this->gamestate->nextState('interactionStep');\n }", "function SDpointsForGame ( $moves ) {\n\t//Output: A number between 0 -> 1 of how suspicious that game is\n\n\tglobal $SD_CONST_TRESHOLD, $SD_CONST_ADJ;\n\n\t$deviation = SDdeviation( $moves );\n\t$output = 0;\n\n\tif( $deviation < $SD_CONST_TRESHOLD ){\n\t\t/*\n\t\t\t\t\t| Threshold - Deviation |\n\t\toutput = \t|---------------------------------|\n\t\t\t\t\t| Threshold - Adjustment Variable |\n\n\t\tBasically takes the diviation over mean and returns a scaled value between 0 -> 1\n\n\t\t*/\n\t\t$adjustment = SDrange( SDmean( $moves ) );\n\t\t$output = pow( ( $SD_CONST_TRESHOLD - $deviation ) / ( $SD_CONST_TRESHOLD - $adjustment ), 2 );\n\t\t//echo \"$output = $SD_CONST_TRESHOLD - $deviation / $SD_CONST_TRESHOLD - $adjustment \\n\";\n\t}\n\n\treturn ( $output > 1 ) ? 1 : $output;\n}", "function _assignMatchesDo() {\n\t\tdefined('_JEXEC') or die( 'Invalid Token' );\n\n\t\t// Turnierdaten!\n\t\t$tournament = new CLMTournament($this->id, true);\n\t\t// $tournament->data->typ\n\n\t\tif (($tournament->data->tl != clm_core::$access->getJid() AND $clmAccess->access('BE_tournament_edit_round') !== true) OR $clmAccess->access('BE_tournament_edit_round') === false) {\n\t\t\t$this->app->enqueueMessage( JText::_('TOURNAMENT_NO_ACCESS'),'warning' );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($tournament->data->typ == 2) {\n\t\t\t// Vollturnier nur via Rundenerstellung!\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'IMPOSSIBLE' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t} elseif ($tournament->data->typ == 3) { // KO\n\t\t\t// maximal bestätige Runde holen - ist hier MIN(nr)\n\t\t\t$query = 'SELECT MIN(nr) FROM #__clm_turniere_rnd_termine'\n\t\t\t\t. ' WHERE turnier = '.$this->id.' AND tl_ok = 1';\n\t\t\t$this->_db->setQuery( $query );\n\t\t\tif ($tlokMin = $this->_db->loadResult()) {\n\t \t\t\t$roundToDraw = $tlokMin-1;\n\t \t\t} else {\n\t \t\t\t$roundToDraw = $tournament->data->runden;\n\t\t\t}\n\t\t\t// nächste zu vervollständigende Runde ermittelt\n\t\t\tif ($roundToDraw == 0) { // dann gibt es nichts mehr zu tun\n\t\t\t\t$this->app->enqueueMessage( JText::_('NO_ROUND_LEFT'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Frage: sind in dieser Runde schon Partien angesetzt?\n\t\t\t$query = 'SELECT COUNT(*)'\n\t\t\t\t\t. ' FROM #__clm_turniere_rnd_spl'\n\t\t\t\t\t. ' WHERE turnier = '.$this->id.' AND runde = '.$roundToDraw.' AND ((spieler >= 1 AND gegner >= 1) OR ergebnis = 8)';\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$matchesAssigned = $this->_db->loadResult();\n\t\t\t\n\t\t\tif ($matchesAssigned > 0) { // bereits Matches angelegt\n\t\t\t\t$this->app->enqueueMessage( JText::_('MATCHES_ASSIGNED_ALREADY'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// OKay, jetzt kann angesetzt werden\n\t\t\t// alle Spieler, die 'in' sind holen\n\t\t\t$query = \"SELECT snr \"\n\t\t\t\t\t. \" FROM #__clm_turniere_tlnr\"\n\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND koStatus = '1'\";\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$playersIn = $this->_db->loadAssocList('snr');\n\t\t\t\n\t\t\t// wieviele Matches werden benötigt? \n\t\t\t// Spielerzahl - (maximale Matches der Runde / 2)\n\t\t\t// maximale Matches der Runde: 2^Runde\n\t\t\t$neededMatches = (count($playersIn) - pow(2, $roundToDraw)/2);\n\t\t\t\n\t\t\t// TODO: Sicherheitscheck, ob diese Boards wirklich vorhanden!\n\t\t\t\n\t\t\t// jetzt setzen wir an jedes Board eine Zufallspaarung\n\t\t\t\n\t\t\t// Matches zusammenstellen\n\t\t\t$sid = $tournament->data->sid;\n\t\t\tfor ($m=1; $m<=$neededMatches; $m++) {\n\t\t\t\t// Spieler 1\n\t\t\t\t$player1 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player1]);\n\t\t\t\t// Spieler 2\n\t\t\t\t$player2 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player2]);\n\t\t\t\t// SQL\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player1.\", spieler = \".$player1.\", gegner = \".$player2\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '1'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player2.\", spieler = \".$player2.\", gegner = \".$player1\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '0'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$this->app->enqueueMessage( JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED') );\n\t\n\t\t\t// Log\n\t\t\t$clmLog = new CLMLog();\n\t\t\t$clmLog->aktion = JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED');\n\t\t\t$clmLog->params = array('sid' => $tournament->data->sid, 'tid' => $this->id, 'rnd' => $roundToDraw); // TurnierID wird als LigaID gespeichert\n\t\t\t$clmLog->write();\n\t\n\t\n\t\t} elseif ($tournament->data->typ == 1) { // CH\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'NOTIMPLEMENTED' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\n\t}", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "function getStart($tab, $nbLigne, $nbChar){\n\n \n $z = 0;//check 0\n $u = 0;//check 1\n $add = 0;\n $err4 = \"Il manque un point de départ ou d'arrivée!\".PHP_EOL;\n\n $xd = 0;\n $yd = 0; //coord du point de départ\n\n $xa = 0;\n $ya = 0; //coord du point d'arrivée \n\n for ($j=0; $j<$nbLigne; $j++){ \n for ($i=0; $i<$nbChar; $i++){ \n \n if ($tab[$j][$i] === '0'){\n $z++;\n $z = $z++; // echo $z.' check 0'.PHP_EOL; \n //RECHERCHE DE COORDONNEES\n $xd = $i;// \n echo \"xd=\".($xd).\" \";\n $yd = $j;// \n echo \"yd=\".($yd).PHP_EOL;\n }\n if ($tab[$j][$i] === '1'){\n $u++;\n $u = $u++; // echo $u .' check 1'.PHP_EOL;\n //RECHERCHE DE COORDONNEES\n $xa = $i;//\n echo \"xa=\".($xa).\" \";\n $ya = $j;//\n echo \"ya=\".($ya).PHP_EOL; \n } \n }\n }\n\n if ($z === 1 && $u === 1){\n play($tab, $nbLigne, $nbChar, $xd, $yd, $xa, $ya); //echo \"the play can beggin\".PHP_EOL;\n }\n else\n exit($err4);\n}", "function isDraw($winningspots, $spots) {\n\t\t$impossibleStates = 0;\n\t\tforeach($winningspots as $winstate) {\n\t\t\t$countX = 0;\n\t\t\t$countO = 0;\n\t\t\tforeach ($winstate as $wincell) {\n\t\t\t\tif($spots[$wincell] == \"x\") {\n\t\t\t\t\t$countX++;\n\t\t\t\t} else if($spots[$wincell] == \"o\") {\n\t\t\t\t\t$countO++;\n\t\t\t\t}\n\t\t\t\tif ($countX > 0 && $countO > 0) {\n\t\t\t\t\t$impossibleStates++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ($impossibleStates == count($winningspots));\n\t}", "function isValid(array $grid, int $rowIndex, int $columnIndex): bool {//lolo\n $c = $grid[$rowIndex][$columnIndex];\n $xIndex = $rowIndex;\n $yIndex = $columnIndex;\n $rowIndex = 0;\n while ($rowIndex < 9)\n {\n if ($rowIndex != $xIndex) //verif diff de la case pour éviter la boucle inf\n if ($grid[$rowIndex][$columnIndex] == $c)\n return (false);\n $rowIndex++;\n }\n $columnIndex = 0;\n while ($columnIndex < 9)\n {\n if ($columnIndex != $yIndex)// idem avec la colonne\n if ($grid[$xIndex][$columnIndex] == $c)\n return (false);\n $columnIndex++;\n }\n $posY = floor($yIndex / 3) * 3; //verif la carré\n for ($i = 0; $i < 3; $i++)\n {\n $posX = floor($xIndex / 3) * 3; \n for($j = 0; $j < 3; $j++)\n {\n if ($grid[$posX][$posY] == $c && $posX != $xIndex && $posY != $yIndex)\n return false;\n $posX++;\n }\n $posY++;\n }\n return (true);\n}", "public function selectMove(){\r\n \r\n do {\r\n $userMsg = readlineUserInputMsg($this->currentPlayer);\r\n $userMove = readline($userMsg);\r\n } while (!$this->checkValidMove($userMove));\r\n\r\n return $userMove;\r\n }", "public function getRowResultFor(string $playerUnit = 'O'): bool\n {\n return $this->winByRow($playerUnit) !== false ?:\n $this->winByRow(infer_opponent($playerUnit)) !== false;\n }", "public function rejectIfInvalidRowAndColumn(Board $board, User $player, $row, $col);", "function checkPlayPos($given_pos){\n $player_ID = $_SESSION['login_user'];\n $play_pos = mysql_fetch_array(mysql_query(\"select * from Player where ID = '$player_ID';\"))['PlayPos'];\n if(!strcmp($play_pos,$given_pos))\n echo \"selected=\\\"selected\\\"\";\n }", "public function isWinner() {\n\t\t$winner = null;\n\t\t$rule = $this->getRule(); // note: rule is required for matches\n\t\tif($rule->rule_type == Rule::TYPE_MATCHPLAY) {\n\t\t\t// Get opponent scorecard\n\t\t\tif($opponent = $this->getOpponent()) {\n\t\t\t\tif($opponent_scorecard = $opponent->getScorecard()) {\n\t\t\t\t\t$this_total = $this->points_total($rule->handicap);\n\t\t\t\t\t$opponent_total = $opponent_scorecard->points_total($rule->handicap);\n\t\t\t\t\t//Yii::trace('tie:'.$this->tie_break.'vs.'.$opponent_scorecard->tie_break, 'Scorecard::isWinner');\n\t\t\t\t\t$winner = ($this_total > $opponent_total) ?\n\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t($opponent_total > $this_total ?\n\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t($this->tie_break > $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t\t\t($this->tie_break < $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t\t\tnull)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Yii::trace('return:'.($winner ? 't' : 'f'), 'Scorecard::isWinner');\n\t\treturn $winner;\n\t}", "public function checkForWin() \n\t{\n\n\t\t$score = array_intersect($this->phrase->selected, $this->phrase->getLetters());\n\n\t\tif (count($score) == count($this->phrase->getLetters())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "protected function AIMove() {\n $botMove = $this->botMove();\n echo \"Computer's move is '\" . $this->_botMark . \"' at box \" . $botMove . PHP_EOL;\n $this->_markers[$this->_botMark][] = $botMove;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_botMark) || $this->isBoardFull())\n return true;\n return false;\n }", "function getCoordinatesInfo($myPositionX, $myPositionY, $game, $map, $bombs, $opponents, $bonuses)\n{\n\t$oneUp = $myPositionY - 1;\n\t$oneDown = $myPositionY + 1;\n\t$oneLeft = $myPositionX - 1;\n\t$oneRight = $myPositionX + 1;\n\t\n\t$typeOfObstacle = [];\n\t$moveAvailable = [];\n\n\t//check four directions\n\t//up\n\t$moveAvailable[0] = 0;\n\tif(!empty($map[$myPositionX][$oneUp]))\n\t{\n\t\tfor($up = $oneUp; $up >= 0; $up--)\n\t\t{\n\t\t\t$elementInPositionToEvaluate = $map[$myPositionX][$up];\n\t\t\t\n\t\t\t$isABomb = $bombs[$myPositionX][$up] === 1;\n\t\t\t$isAnOpponent = !empty($opponents[$myPositionX][$up]);\n\t\t\t$isABonus = !empty($bonuses[$myPositionX][$up]);\n\t\t\t\n\t\t\t$typeOfObstacle[0] = getTypeOfObstacle($elementInPositionToEvaluate, $isABomb, $isAnOpponent);\n\t\t\t\n\t\t\tif(!empty($typeOfObstacle[0])){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$moveAvailable[0]++;\n\t\t}\n\t\tif(empty($typeOfObstacle[0])){\n\t\t\t$typeOfObstacle[0] = 1; //end grid\n\t\t}\n\t}\n\t\n\t//right\n\t$moveAvailable[1] = 0;\n\tif(!empty( $map[$oneRight][$myPositionY]))\n\t{\n\t\tfor($right = $oneRight; $right < $game->state->width; $right++)\n\t\t{\n\t\t\t$elementInPositionToEvaluate = $map[$right][$myPositionY];\n\t\t\t\n\t\t\t$isABomb = !empty($bombs[$right][$myPositionY]);\n\t\t\t$isAnOpponent = !empty($opponents[$right][$myPositionY]);\n\t\t\t$isABonus = !empty($bonuses[$right][$myPositionY]);\n\t\t\t\n\t\t\t$typeOfObstacle[1] = getTypeOfObstacle($elementInPositionToEvaluate, $isABomb, $isAnOpponent);\n\t\t\t\n\t\t\tif(!empty($typeOfObstacle[1])){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$moveAvailable[1]++;\n\t\t}\n\t\tif(empty($typeOfObstacle[1])){\n\t\t\t$typeOfObstacle[1] = 1; //end grid\n\t\t}\n\t}\n\n\t//down\n\t$moveAvailable[2] = 0;\n\tif(!empty($map[$myPositionX][$oneDown]))\n\t{\n\t\tfor($down = $oneDown; $down < $game->state->height; $down++)\n\t\t{\n\t\t\t$elementInPositionToEvaluate = $map[$myPositionX][$down];\n\t\t\t\n\t\t\t$isABomb = !empty($bombs[$myPositionX][$down]);\n\t\t\t$isAnOpponent = !empty($opponents[$myPositionX][$down]);\n\t\t\t$isABonus = !empty($bonuses[$myPositionX][$down]);\n\t\t\t\n\t\t\t$typeOfObstacle[2] = getTypeOfObstacle($elementInPositionToEvaluate, $isABomb, $isAnOpponent);\n\t\t\t\n\t\t\tif(!empty($typeOfObstacle[2])){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$moveAvailable[2]++;\n\t\t}\n\t\tif(empty($typeOfObstacle[2])){\n\t\t\t$typeOfObstacle[2] = 1; //end grid\n\t\t}\n\t}\n\t\n\t//left\n\t$moveAvailable[3] = 0;\n\tif(!empty($map[$oneLeft][$myPositionY]))\n\t{\n\t\tfor($left = $oneLeft; $left >= 0; $left--)\n\t\t{\n\t\t\t$elementInPositionToEvaluate = $map[$left][$myPositionY];\n\t\t\t\n\t\t\t$isABomb = !empty($bombs[$left][$myPositionY]);\n\t\t\t$isAnOpponent = !empty($opponents[$left][$myPositionY]);\n\t\t\t$isABonus = !empty($bonuses[$left][$myPositionY]);\n\t\t\t\n\t\t\t$typeOfObstacle[3] = getTypeOfObstacle($elementInPositionToEvaluate, $isABomb, $isAnOpponent);\n\t\t\t\n\t\t\tif(!empty($typeOfObstacle[3])){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$moveAvailable[3]++;\n\t\t}\n\t\tif(empty($typeOfObstacle[3])){\n\t\t\t$typeOfObstacle[3] = 1; //end grid\n\t\t}\n\t}\n\n\treturn [\n\t\t\"moveAvailable\" => $moveAvailable,\n\t\t\"typeOfObstacle\" => $typeOfObstacle\n\t];\n}" ]
[ "0.68951416", "0.662804", "0.6547386", "0.64372027", "0.64133227", "0.6302336", "0.6201344", "0.6185081", "0.6123144", "0.6109314", "0.6096924", "0.60954505", "0.60832244", "0.60800713", "0.6068831", "0.5909381", "0.59088826", "0.5907605", "0.587992", "0.5871337", "0.57961196", "0.57507026", "0.57397455", "0.5725687", "0.5691813", "0.5686842", "0.56850785", "0.5679979", "0.567716", "0.5645496", "0.5643909", "0.5639841", "0.56209576", "0.5614835", "0.56100965", "0.56054884", "0.55853987", "0.55546534", "0.5538409", "0.5532447", "0.5532151", "0.5507569", "0.55016285", "0.54931986", "0.5428263", "0.5428215", "0.536955", "0.5366788", "0.536278", "0.53522", "0.53431857", "0.53192765", "0.52878565", "0.5264574", "0.52624035", "0.5259062", "0.52466196", "0.52440387", "0.5235146", "0.52331764", "0.5229428", "0.52283645", "0.5228086", "0.5222668", "0.5214464", "0.5209841", "0.52059746", "0.520474", "0.5204192", "0.5189217", "0.5188282", "0.5173958", "0.51714754", "0.51639885", "0.51475775", "0.51442444", "0.51312906", "0.50988895", "0.5078107", "0.5064889", "0.5063495", "0.5059161", "0.505358", "0.5051401", "0.50431705", "0.50318784", "0.50309545", "0.5029176", "0.5027778", "0.502532", "0.5023638", "0.5011322", "0.5001953", "0.49949563", "0.49943212", "0.49937373", "0.49935788", "0.49907216", "0.49603", "0.49450025" ]
0.69348896
0
Function check Horizontal winning [X][X][X][X] In case of sequence 4 of the current player in a row player won
public function checkHorizontalWin($userMove){ $HorizontalCounter = self::ZERO; $gameBoards = $this->board->gameBoard; $row = $this->lastRowInsert; $current_player = "[$this->currentPlayer]"; for($col = $userMove-1; $col > -1 ; $col-- ){ if($gameBoards[$row][$col] != $current_player){ break; } $HorizontalCounter++; } for($col= $userMove; $col < Board::COLUMNS ; $col++){ if($gameBoards[$row][$col] != $current_player){ break; } $HorizontalCounter++; } return $HorizontalCounter >= self::WIN ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}", "public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }", "function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}", "public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }", "public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }", "function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n if ($rightDiagonalSum == $this->boardSize || $leftDiagonalSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n if ($rightDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $column = array_column($this->board, $i);\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n if ($columnSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($columnSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($rowSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->secondMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }", "function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}", "public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }", "function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }", "public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "public function checkForWinner($playerOne, $playerTwo){\n if(($playerOne == 1 && $playerTwo == 2) || ($playerOne == 2 && $playerTwo == 3 || ($playerOne == 3 && $playerTwo == 1))){\n $this->printResult($playerOne, $playerTwo, 1);\n return 1;\n }elseif(($playerOne == 1 && $playerTwo == 1) || ($playerOne == 2 && $playerTwo == 2) || ($playerOne == 3 && $playerTwo == 3)){\n $this->printResult($playerOne, $playerTwo, 2);\n return 2;\n }else{\n $this->printResult($playerOne, $playerTwo, 3);\n return 3;\n }\n}", "function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}", "function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}", "public function checkVerticalWin($userMove){\r\n $varticalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = ($this->board->getRows() - 1) ; $row > -1 ; $row-- ){ \r\n if($varticalCounter == self::WIN){\r\n return true;\r\n }\r\n elseif($gameBoards[$row][$userMove-1] == $current_player){\r\n $varticalCounter++;\r\n }\r\n elseif($row < 2 && $varticalCounter < 1 ){\r\n return false;\r\n }\r\n elseif($gameBoards[$row][$userMove-1] == Board::CELL){\r\n $varticalCounter = self::ZERO;\r\n continue;\r\n }\r\n else{\r\n $varticalCounter = self::ZERO;\r\n }\r\n }\r\n return $varticalCounter >= self::WIN ? true : false;\r\n \r\n }", "private function checkWiningRowColumn($playerUnit, $row = false, $checkRowColumn = false)\n {\n /**\n * check row/column winning for player unit\n */\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n //get array of row/column\n $array = ($row === true) ? $this->ticTacToeBoard[$i] : array_column($this->ticTacToeBoard, $i);\n\n $row_column = array_filter($array, function ($val) use ($playerUnit) {\n return ($val === $playerUnit);\n });\n\n if ($checkRowColumn === true && count($row_column) == $this->maxIndex) {\n return [true, $i];\n }\n if (count($row_column) == $this->boardSize) {\n return true;\n }\n }\n }", "public function test4BallsInARow($player)\n {\n $match = $this->getNewMatch();\n\n for ($i = 0 ; $i <4 ; $i++) {\n $match->score($player);\n }\n\n $this->assertEquals(1, $match->getWonGame($player));\n }", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }", "public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }", "function get_player1_returning_row(){\n if(!$this->board->player_won(1)){\n return [];\n }\n\n if(count($this->board->winner_row) === 0){\n return [];\n }\n\n return $this->board->winner_row;\n }", "public function checkNegativeDiagonalWin($userMove){\r\n $diagonalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = $this->lastRowInsert-1 ,$col = $userMove; $row > -1 && $col < Board::COLUMNS ; $row--, $col++ ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n for($row = $this->lastRowInsert ,$col = $userMove-1; $row < Board::ROWS && $col > -1 ; $row++, $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n return $diagonalCounter >= self::WIN ? true : false;\r\n }", "abstract protected function winnerExists();", "protected function winByRow(string $playerUnit)\n {\n foreach ($this->getState() as $key => $row) {\n if (implode('', $row) === $this->getWinnerResult($playerUnit)) {\n return $key;\n }\n }\n\n return false;\n }", "public function getRowResultFor(string $playerUnit = 'O'): bool\n {\n return $this->winByRow($playerUnit) !== false ?:\n $this->winByRow(infer_opponent($playerUnit)) !== false;\n }", "function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }", "public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function isRowSolved(array $grid, int $y): bool;", "public function checkForWin() \n\t{\n\n\t\t$score = array_intersect($this->phrase->selected, $this->phrase->getLetters());\n\n\t\tif (count($score) == count($this->phrase->getLetters())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function game_play($link) {\r\n echo '<br />'; \r\n if ($this->grid_size > 3) {\r\n \r\n }\r\n echo '<font face = \"courier\" size = \"5\">';\r\n echo '<table cols = \"' . ($this->debug ? $this->grid_size + 2 : $this->grid_size) . '\" border = \"1\" style = \"font-weight:bold; border-collapse: collapse\">';\r\n if ($this->debug) {\r\n echo '<thead><tr><th></th>';\r\n for ($col = 1; $col <= $this->grid_size; $col++) {\r\n echo '<th style=\"padding: 5px;\"> Column ' . $col . '</th>';\r\n }\r\n echo '<th></th></tr></thead>';\r\n echo '<tfoot><tr><th></th>';\r\n for ($col = 1; $col <= $this->grid_size; $col++) {\r\n echo '<th> Column ' . $col . '</th>';\r\n }\r\n echo '<th></th></tr></tfoot>';\r\n }\r\n echo '<tbody><tr>';\r\n $row = 1; \r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row . '</th>';\r\n }\r\n for ($pos = 0; $pos < pow($this->grid_size, 2); $pos++) {\r\n if ($link) {\r\n echo $this->show_cell($pos);\r\n } else {\r\n\t\t\t\t\r\n\t\t\t\t\t echo '<td style=\"text-align:center;' . (in_array($pos, $this->winning_line[0]) ? ' background-color: #90EE90;' : ' opacity: 0.5;' ) . '\"><div style=\"padding: 1em;\">' . $this->position[$pos] . ($this->debug ? ('<br /><span style=\"font-size:66%;\">' . $pos . ':(' . $row . ',' . (($pos % $this->grid_size) + 1) . ')</span>') : '') . '</div></td>';\r\n\t\t\t\t\t\r\n\t\t\t}\r\n if (($pos + 1) % $this->grid_size == 0) {\r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row++ . '</th>';\r\n }\r\n if (($pos + 1) != pow($this->grid_size, 2)) {\r\n echo '</tr><tr>';\r\n if ($this->debug) {\r\n echo '<th style=\"padding: 5px;\">Row ' . $row . '</th>';\r\n }\r\n }\r\n }\r\n }\r\n echo '</tr></tbody>';\r\n echo '</table>';\r\n echo '</font>';\r\n echo '<br /><hr />';\r\n }", "function isColumnSolved(array $grid, int $x): bool;", "function isValid(array $grid, int $rowIndex, int $columnIndex): bool {//lolo\n $c = $grid[$rowIndex][$columnIndex];\n $xIndex = $rowIndex;\n $yIndex = $columnIndex;\n $rowIndex = 0;\n while ($rowIndex < 9)\n {\n if ($rowIndex != $xIndex) //verif diff de la case pour éviter la boucle inf\n if ($grid[$rowIndex][$columnIndex] == $c)\n return (false);\n $rowIndex++;\n }\n $columnIndex = 0;\n while ($columnIndex < 9)\n {\n if ($columnIndex != $yIndex)// idem avec la colonne\n if ($grid[$xIndex][$columnIndex] == $c)\n return (false);\n $columnIndex++;\n }\n $posY = floor($yIndex / 3) * 3; //verif la carré\n for ($i = 0; $i < 3; $i++)\n {\n $posX = floor($xIndex / 3) * 3; \n for($j = 0; $j < 3; $j++)\n {\n if ($grid[$posX][$posY] == $c && $posX != $xIndex && $posY != $yIndex)\n return false;\n $posX++;\n }\n $posY++;\n }\n return (true);\n}", "public function playerHasWon() {\n foreach ($this->players as $player) {\n if ($player->score >= $this->game->winningScore) {\n return true;\n }\n }\n return false;\n }", "function getTurn ($board_num) {\n //get database info on player turn and player user ids\n $result = selectDB(\"SELECT PLAYERX, PLAYERO, TURN FROM BOARD WHERE BOARD_NUM='$board_num'\");\n\n //separate results into variables\n $playerx = $result['PLAYERX'];\n $playero = $result['PLAYERO'];\n $turnUser = $result['TURN'];\n \n //return 0 or 1\n if (strcmp($playerx, $turnUser) == 0) {\n return 0; //playerx's turn\n }\n else if (strcmp($playero, $turnUser) == 0) {\n return 1; //playero's turn\n }\n}", "function pokerWinner($player1Hand){\n $pairCount = 0;\n $twoPairCount = 0;\n $threeOfAKind = 0;\n $fourOfAKindCount = 0;\n $straightCount = 0;\n $flushCount = 0;\n $fullHouseCount = 0;\n $fourOfAKindCount = 0;\n $straightFlushCount = 0;\n $royalFlushCount = 0;\n $consecutive = 0;\n $value = 10;\n\n $matchingCardCount = pairFinder($player1Hand);\n\n if($matchingCardCount == 3){\n \n $fourOfAKindCount = 1;\n $threeOfAKind = 1;\n $pairCount = 2;\n }\n\n if($matchingCardCount == 2){\n $threeOfAKind = 1;\n $pairCount = 1;\n }\n\n if($matchingCardCount == 1){\n $pairCount = 1;\n\n }\n\n //check for two pairs\n if(twoPairFinder($player1Hand)){\n $pairCount = 2;\n $twoPairCount = 1;\n }\n\n\n\n if(straightFinder($player1Hand)){\n $straightCount = 1;\n\n\n }\n\n //check for flush\n if(flushFinder($player1Hand)){\n $flushCount = 1;\n\n }\n\n //check for straight flush\n if($flushCount == 1 && $straightCount == 1){\n $straightFlushCount = 1;\n }\n\n //check for royal flush\n if($straightFlushCount == 1){\n if(royalFlushFinder($player1Hand)){\n $royalFlushCount = 1;\n }\n }\n\n //Testing area\n\n // echo 'The $pairCount is: ' . $pairCount . \"\\n\" . \"\\n\";\n // echo 'The $twoPairCount is: ' . $twoPairCount . \"\\n\" . \"\\n\";\n // echo 'The $threeOfAKind is: ' . $threeOfAKind . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightCount is: ' . $straightCount . \"\\n\" . \"\\n\";\n // echo 'The $flushCount is: ' . $flushCount . \"\\n\" . \"\\n\";\n // echo 'The $fullHouseCount is: ' . $fullHouseCount . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightFlushCount is: ' . $straightFlushCount . \"\\n\" . \"\\n\";\n // echo 'The $royalFlushCount is: ' . $royalFlushCount . \"\\n\" . \"\\n\";\n\n\n //Give out points\n if($royalFlushCount == 1){\n $value = 10;\n return $value;\n }\n\n if($straightFlushCount == 1){\n $value = 9;\n return $value;\n }\n\n if($fourOfAKindCount == 1){\n $value = 8;\n return $value;\n }\n\n if($fullHouseCount == 1){\n $value = 7;\n return $value;\n }\n\n if($flushCount == 1){\n $value = 6;\n return $value;\n }\n\n if($straightCount == 1){\n $value = 5;\n return $value;\n }\n\n if($threeOfAKind == 1){\n $value = 4;\n return $value;\n }\n\n if($twoPairCount == 1){\n $value = 3;\n return $value;\n }\n\n if($pairCount == 1){\n $value = 2;\n return $value;\n }\n\n else{\n $value = 1;\n return $value;\n }\n\n\n}", "function isCollision(string $row, int $currentColumn): bool\n{\n while (strlen($row) < $currentColumn + 1) {\n $row = $row . $row;\n }\n\n if ($row[$currentColumn] === '#') {\n return true;\n }\n\n return false;\n}", "private function isValidRowColumn(): bool {\n foreach ($this->board as $row => $cols) {\n $curRow = [];\n $curCol = [];\n foreach ($cols as $col => $cellValue) {\n // check if repeated in row\n if(in_array($this->board[$row][$col], $curRow)){\n return false;\n }\n array_push($curRow, $this->board[$row][$col]);\n\n // check if repeated in column \n if(in_array($this->board[$col][$row], $curCol)){\n return false;\n }\n array_push($curCol, $this->board[$col][$row]);\n }\n }\n return true;\n }", "function getNumTurns($array) {\n \n $numTurns = 0;\n for ($i = 0; $i < 3; $i++) {\n for ($j = 0; $j < 3; $j++) {\n //if the position in the game array is not \"N\"\n if(strcmp($array[$i][$j], \"N\") != 0) {\n $numTurns++;\n }\n }\n }\n return $numTurns;\n}", "abstract public function winner();", "public function testVerifyToNotWin()\n {\n\n $match = $this->createMatch();\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n $winner = new Winner();\n $winner->verify($match, 0, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(0, $matchFound->winner);\n\n }", "protected function isWon($marker) {\n $markedBox = $this->_markers[$marker];\n foreach ($this->_winningCombination AS $box) {\n $lineBoxes = explode(\",\", $box); //separate the winning combination to 3\n if (in_array($lineBoxes[0], $markedBox) && in_array($lineBoxes[1], $markedBox) && in_array($lineBoxes[2], $markedBox)) {\n echo \"Player $marker won!\" . PHP_EOL;\n return TRUE;\n }\n }\n return FALSE;\n }", "public function isWin() {\n\t\tif ($_SESSION['game']->getState()==\"correct\") {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function winByDiagonal(string $playerUnit)\n {\n $d0 = '';\n $d1 = '';\n\n for ($x = 0; $x <= $this->getSize() - 1; $x++) {\n $d0 .= $this->getState()[$x][$x];\n }\n\n for ($x = 0; $x <= $this->getSize() - 1; $x++) {\n $d1 .= $this->getState()[$x][$this->getSize() - 1 - $x];\n }\n\n return $d0 === $this->getWinnerResult($playerUnit)\n ? 0\n : ($d1 === $this->getWinnerResult($playerUnit)\n ? 1\n : false);\n }", "private function establishOtherRows()\n {\n for ($i = 1; $i <= $this->boardWidth; $i++) {\n if ($i == $this->myRowNum) {\n continue;\n }\n\n if ($i < $this->myRowNum) {\n $this->rowsAboveMe[] = $i;\n }\n\n if ($i > $this->myRowNum) {\n $this->rowsBelowMe[] = $i;\n }\n }\n }", "public function rejectIfInvalidRowAndColumn(Board $board, User $player, $row, $col);", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "private function decideVictory()\n {\n echo 'Jugador ';\n if (!$this->human->isOver() &&\n (\n ($this->human->getPoints() == $this->machine->getPoints() && $this->human->getPoints() != PLAYER_WIN_POINTS)\n || $this->human->getPoints() > $this->machine->getPoints()\n || $this->machine->isOver()\n )\n ) echo 'Humano';\n else echo 'Máquina';\n echo ' gana la partida. ';\n }", "function get_player2_returning_row(){\n if(!$this->board->player_won(2)){\n return [];\n }\n\n if(count($this->board->winner_row) === 0){\n return [];\n }\n\n return $this->board->winner_row;\n }", "public static function diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, &$boardRows, $direction, &$removedPawnIds, &$errorMsg)\n\t{\n\t\tswitch($direction)\n\t\t{\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_UP_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_UP_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_DOWN_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_DOWN_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null; \n\t\t}\n\n\t\tfor($possiblePosition = self::MIN_POSITION; $possiblePosition <= self::MAX_POSITION; $possiblePosition++)\n\t\t{\n\t\t\tif($prevX+($diffX*$possiblePosition) === $newX && $prevY+($diffY*$possiblePosition) === $newY)\n\t\t\t{\n\t\t\t\tif(($possiblePosition % 2) !== 0)\n\t\t\t\t{\n\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\tif(\t$prevY+$diffY < 0 || \n\t\t\t\t\t\t$prevX+$diffX < 0 || \n\t\t\t\t\t\t$prevY+$diffY > count($boardRows)-1 || \n\t\t\t\t\t\t$prevX+$diffX > count($boardRows)-1)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t//it should not search further if previous and new positions are the same\n\t\t\t\t\tif($prevX === $newX && $prevY === $newY)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t$posEvaluation = $playerNumber === FIRST_PLAYER ? \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > PLAYER_PAWNS_AMOUNT) : \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > 0 && $boardRows[$prevY+$diffY][$prevX+$diffX] <= PLAYER_PAWNS_AMOUNT);\n\n\t\t\t\t\t//checking if an opponent pawn had been spotted\n\t\t\t\t\tif($posEvaluation)\n\t\t\t\t\t{\n\t\t\t\t\t\t$removedPawnIds[] = intval($boardRows[$prevY+$diffY][$prevX+$diffX]);\n\t\t\t\t\t\t$boardRows[$prevY+$diffY][$prevX+$diffX] = 0;\n\t\t\t\t\t\t$prevX+=$diffX*2;\n\t\t\t\t\t\t$prevY+=$diffY*2;\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//if the algorithm didn't reach the end that means that the chosen position is \n\t\t\t\t\t\t//illegal since newX and newY and the last opponent are too far apart\n\t\t\t\t\t\tif($prevX !== $newX && $prevY !== $newY)\n\t\t\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function isRowValid(array $grid, int $y, bool $verbose = false): bool;", "function checkForSpecialAchievements($player_id, $wonder_included) {\n $achievements_to_test = $wonder_included ? array(105, 106, 107, 108, 109) : array(105, 106, 108, 109);\n $end_of_game = false;\n \n \n foreach ($achievements_to_test as $achievement_id) {\n $achievement = self::getCardInfo($achievement_id);\n if ($achievement['owner'] != 0) { // Somebody has already claimed that achievement\n // So it's not claimable anymore\n continue;\n }\n \n switch ($achievement_id) {\n case 105: // Empire: three or more icons of all six types\n $eligible = true;\n $ressource_counts = self::getPlayerRessourceCounts($player_id);\n foreach ($ressource_counts as $icon => $count) {\n if ($count < 3) { // There are less than 3 icons\n $eligible = false;\n break;\n }\n }\n break;\n case 106: // Monument: tuck 6 cards or score 6 cards\n $flags = self::getFlagsForMonument($player_id);\n $eligible = $flags['number_of_tucked_cards'] >= 6 || $flags['number_of_scored_cards'] >= 6;\n break;\n case 107: // Wonder: 5 colors, each being splayed right or up\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) < 2) { // This color is missing, unsplayed or splayed left\n $eligible = false;\n };\n }\n break;\n case 108: // World: 12 or more visible clocks (icon 6) on the board \n $eligible = self::getPlayerSingleRessourceCount($player_id, 6) >= 12;\n break;\n case 109: // Universe: Five top cards, each being of value 8 or more\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card === null || $top_card['age'] < 8) { // This color is missing or its top card has value less than 8\n $eligible = false;\n }\n }\n break;\n default:\n break;\n }\n \n if ($eligible) { // The player meet the conditions to achieve\n try {\n self::transferCardFromTo($achievement, $player_id, 'achievements');\n }\n catch (EndOfGame $e) { // End of game has been detected\n self::trace('EOG bubbled but suspended from self::checkForSpecialAchievements');\n $end_of_game = true;\n continue; // But the other achievements must be checked as well before ending\n }\n }\n }\n // All special achievements have been checked\n if ($end_of_game) { // End of game has been detected\n self::trace('EOG bubbled from self::checkForSpecialAchievements');\n throw $e; // Re-throw the flag\n }\n }", "public function startPlay(){ \r\n\r\n $this->selectPlayer();\r\n $this->board->printBoard();\r\n\r\n while(!$this->gameOver){\r\n\r\n //check if board is full\r\n if($this->reachedMaxMoves() || $this->validateIsFullBoard()){\r\n noWinningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n break;\r\n }\r\n // set board with table\r\n $userMove = $this->selectMove();\r\n \r\n //in case that column is not full \r\n if(!$this->validateIsFullColumn($userMove)){\r\n $this->insertMoveToBoard($userMove);\r\n $this->winCheck($userMove);\r\n $this->switchPlayer();\r\n }\r\n }\r\n }", "function checkWinner($shot){\r\n\t\t\tforeach ( $this->ships as $shipNumber => $ship ) {\r\n\t\t\t\tif( !$ship->isShipSunk() ){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "private function mapHorizontal()\n {\n for ($i = $this->myRowPos; $i <= $this->totalNumCells; ($i+=$this->boardWidth)){\n $this->disabledCells[] = $i;\n }\n }", "public function rejectIfWrongMove(Board $board, User $player, $row, $col);", "function CheckTurn($n)\r\n {\r\n $turn_1=CheckSquare(5 * $n * $n + 4);\r\n $turn_2=CheckSquare(5 * $n * $n - 4);\r\n //check if any of the value was already \r\n if($turn_1||$turn_2)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }", "public function winRound() {\n\n\t\t$this->points++;\n\n\t\t$this->output($this->name.' has won this round');\n\t}", "function displayWinner($total1, $total2, $total3, $total4, $person, $person2, $person3, $person4)\n {\n echo \"Winner: \";\n \n if($total1 > $total2 && $total1 > $total3 && $total1 > $total4)\n {\n echo \"<img src='\".$person[\"profilePicUrl\"].\"'>\";\n }\n else if ($total2 > $total1 && $total2 > $total3 && $total2 > $total4)\n {\n echo \"<img src='\".$person2[\"profilePicUrl\"].\"'>\";\n }\n else if($total3 > $total1 && $total3 > $total2 && $total3 > $total4)\n {\n echo \"<img src='\".$person3[\"profilePicUrl\"].\"'>\";\n }\n else if($total4 > $total1 && $total4 > $total2 && $total4 > $total3)\n {\n echo \"<img src='\".$person4[\"profilePicUrl\"].\"'>\";\n }\n else {\n echo \"More than one winner\";\n }\n \n }", "public function getGame($username)\n\t{\n\t\t$query = \"SELECT * \n\t\t\t\t FROM tttgame \n\t\t\t\t WHERE playerX = '$username' \n\t\t\t\t OR playerO = '$username';\";\n\t\t$result = $this -> queryDB($query);\n\t\t\n\t\t$game = mysql_fetch_row($result);\n\t\t\n\t\tif ($game != false && count($game) == 7)\n\t\t{\n\t\t\t$this -> playerX = $game[0];\n\t\t\t$this -> playerO = $game[1];\n\t\t\t$this -> moves = $game[2];\n\t\t\t$this -> gametype = $game[3];\n\t\t\t$this -> score = $game[4];\n\t\t\t$this -> activePlayer = $game[5];\n\t\t\t$this -> notice = $game[6];\n\t\t\t$this -> populated = true;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "function makePlayerMove($x,$y){\n if (!$this->board->isEmpty($x,$y)){\n return False;\n } else {\n $this->board[$x][$y] = 2;\n }\n }", "private function checkShipSunk($rowStart, $colStart)\r\n {\r\n $board = $this->board;\r\n $extra = $board->fetchPointExtra($rowStart, $colStart);\r\n $sSize = $extra['size']; // Ship size\r\n $sId = $extra['id']; // Ship ID\r\n // Setup counters (we know we have 1 hit already)\r\n $horizontalHits = 1; $verticalHits = 1;\r\n // Check all 4 directions\r\n for ($dir = 0; $dir < 4; $dir++) {\r\n // Check for 4 points in direction\r\n for ($i = 1; $i < 5; $i++) {\r\n $direction = new Direction($dir);\r\n list($col, $row) = $board->calculatePosition($direction, $rowStart, $colStart, $i);\r\n\r\n // Check if we are not out of board\r\n if (!$board->fetchPointType($row, $col)) {\r\n break;\r\n }\r\n\r\n // Check if board point is hit point\r\n $val = $board->fetchPointType($row, $col);\r\n if ($val === self::POINT_HIT) {\r\n // Compare ship IDs to prevent counting clashes\r\n $id = $board->fetchPointExtra($row, $col)['id'];\r\n if ($sId !== $id) {\r\n break;\r\n }\r\n\r\n if ($direction->isHorizontal()) {\r\n $horizontalHits++;\r\n } else {\r\n $verticalHits++;\r\n }\r\n } else {\r\n // No more hits in this direction\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return ($horizontalHits === $sSize || $verticalHits === $sSize);\r\n }", "public function getWinner(){\n $this->game->UpdateStatus();\n if ($this->game->getWinner()!=$this->game->get_current_turn()){\n return false;\n }else{\n return true;\n }\n }", "public function hasLine()\n {\n $linesHorizontal = $linesVertical = [];\n\n $n = 0;\n for ($i = 0; $i < self::DIMENSION; $i++) {\n for ($j = 0; $j < self::DIMENSION; $j++) {\n $char = $this->boardArr[$n];\n if ($this->fillDirection($linesHorizontal, $char, $i)) {\n return TRUE;\n }\n if ($this->fillDirection($linesVertical, $char, $j)) {\n return TRUE;\n }\n $n++;\n }\n }\n\n // Left diagonal check.\n $leftDiagonal = [];\n for ($l = 0; $l < self::DIMENSION * self::DIMENSION; $l = $l + self::DIMENSION + 1) {\n $char = $this->boardArr[$l];\n if ($this->fillDirection($leftDiagonal, $char)) {\n return TRUE;\n }\n }\n\n // Right diagonal check.\n $rightDiagonal = [];\n for ($r = self::DIMENSION - 1; $r < self::DIMENSION * self::DIMENSION - (self::DIMENSION - 1); $r = $r + self::DIMENSION - 1) {\n $char = $this->boardArr[$r];\n if ($this->fillDirection($rightDiagonal, $char)) {\n return TRUE;\n }\n }\n return FALSE;\n }", "function whoWins(){\n $winners = array();\n $n = 100;\n for($i=0;$i<=$n;$i++){\n $winner = playTournament();\n if(!isset($winners[$winner])){\n $winners[$winner] = 1;\n } else {\n $winners[$winner] += 1;\n }\n }\n arsort($winners);\n foreach($winners as $key=>$value){\n echo $key.' '.$value.\"\\n\";\n }\n}", "function getStart($tab, $nbLigne, $nbChar){\n\n \n $z = 0;//check 0\n $u = 0;//check 1\n $add = 0;\n $err4 = \"Il manque un point de départ ou d'arrivée!\".PHP_EOL;\n\n $xd = 0;\n $yd = 0; //coord du point de départ\n\n $xa = 0;\n $ya = 0; //coord du point d'arrivée \n\n for ($j=0; $j<$nbLigne; $j++){ \n for ($i=0; $i<$nbChar; $i++){ \n \n if ($tab[$j][$i] === '0'){\n $z++;\n $z = $z++; // echo $z.' check 0'.PHP_EOL; \n //RECHERCHE DE COORDONNEES\n $xd = $i;// \n echo \"xd=\".($xd).\" \";\n $yd = $j;// \n echo \"yd=\".($yd).PHP_EOL;\n }\n if ($tab[$j][$i] === '1'){\n $u++;\n $u = $u++; // echo $u .' check 1'.PHP_EOL;\n //RECHERCHE DE COORDONNEES\n $xa = $i;//\n echo \"xa=\".($xa).\" \";\n $ya = $j;//\n echo \"ya=\".($ya).PHP_EOL; \n } \n }\n }\n\n if ($z === 1 && $u === 1){\n play($tab, $nbLigne, $nbChar, $xd, $yd, $xa, $ya); //echo \"the play can beggin\".PHP_EOL;\n }\n else\n exit($err4);\n}", "function checkLevel($who){\n\t$r = polacz();\n\t$czas = date('Y-m-d H:i:s');\n\t$zapytanie = \"SELECT * FROM players WHERE ID_Player = \" . $who . \";\";\n\t$res = $r->query($zapytanie);\n\t$row = $res->fetch_assoc();\n\tif($row){\n\t\t$lvl = $row['Level'];\n\t\t$exp = $row['Experience'];\n\t\t$points = $row['AvaPoints'];\n\t\t$minexp = (pow(2,$lvl-1)*100);\n\t\tif($exp >= $minexp){\n\t\t\t$exp -= $minexp;\n\t\t\t$lvl++;\n\t\t\t$points += 5;\n\t\t\t$zapytanie = \"UPDATE players SET Experience = '\" . $exp . \"', Level = '\" . $lvl . \"', AvaPoints = '\".$points.\"' WHERE ID_Player = \" . $who . \";\nINSERT INTO komunikaty (PLAYER_ID, Komunikat, Kom_Typ_ID, Data_Kom) VALUES ('\" . $who . \"', 'Nowy Poziom \".$lvl.\". Masz punkty do rozdania.', '0', '\" . $czas . \"');\";\n\t\t\t$res = $r->multi_query($zapytanie);\n\t\t\trozlacz($r);\n\t\t\treturn $res;\n\n\t\t}\n\t}\n\trozlacz($r);\n\treturn false;\n}", "public function gameWon()\n {\n return $this->countStones() === 1;\n }", "private function shot_collision($rect1, $shot_col, $shot_row) {\n if ($shot_col < $rect1['col'] + ($rect1['dir']? $rect1['size']: 1) &&\n $shot_col + 1 > $rect1['col'] &&\n $shot_row < $rect1['row'] + (!$rect1['dir']? $rect1['size']: 1) &&\n 1 + $shot_row > $rect1['row']) {\n return true;\n }\n return false;\n }", "function _checkGame($game, $team) {\n global $_SYS;\n\n $game = intval($game);\n $team = intval($team);\n\n /* fetch game from db */\n\n $query = 'SELECT g.away AS away,\n na.team AS away_team,\n na.nick AS away_nick,\n na.acro AS away_acro,\n ta.user AS away_hc,\n g.away_sub AS away_sub,\n ta.conference AS away_conference,\n ta.division AS away_division,\n g.home AS home,\n nh.team AS home_team,\n nh.nick AS home_nick,\n nh.acro AS home_acro,\n th.user AS home_hc,\n g.home_sub AS home_sub,\n th.conference AS home_conference,\n th.division AS home_division,\n g.site AS site,\n g.week AS week,\n g.season AS season,\n s.name AS season_name\n FROM '.$_SYS['table']['game'].' AS g\n LEFT JOIN '.$_SYS['table']['team'].' AS ta ON g.away = ta.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS na ON ta.team = na.id\n LEFT JOIN '.$_SYS['table']['team'].' AS th ON g.home = th.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS nh ON th.team = nh.id\n LEFT JOIN '.$_SYS['table']['season'].' AS s ON g.season = s.id\n WHERE g.id = '.$game;\n\n $result = $_SYS['dbh']->query($query) or die($_SYS['dbh']->error());\n\n /* check if game exists */\n\n if ($result->rows() == 0) {\n return $_SYS['html']->fehler('1', 'Game does not exist.');\n }\n\n /* check if game was already played */\n\n $row = $result->fetch_assoc();\n\n if ($row['site'] != 0) {\n return $_SYS['html']->fehler('2', 'Game was already played.');\n }\n\n /* allow if user is admin OR user is hc or sub of the team */\n\n if (!(($team == 0 && $_SYS['user']['admin'])\n || ($team == $row['away'] && ($_SYS['user']['id'] == $row['away_hc'] || $_SYS['user']['id'] == $row['away_sub']))\n || ($team == $row['home'] && ($_SYS['user']['id'] == $row['home_hc'] || $_SYS['user']['id'] == $row['home_sub'])))) {\n return $_SYS['html']->fehler('3', 'You cannot upload a log for this game.');\n }\n\n $this->_game = $row;\n\n return '';\n }", "protected function winByColumn(string $playerUnit)\n {\n foreach (range(0, $this->getSize() - 1) as $key => $column) {\n if (\n implode('', array_column($this->getState(), $column)) ===\n $this->getWinnerResult($playerUnit)\n ) {\n return $key;\n }\n }\n\n return false;\n }", "public function playRounds($rounds){\n $resultOne = 0;\n $resultTwo = 0;\n\n for($x = 1; $x <= $rounds; $x++){\n $playerOne = rand(1,3);\n $playerTwo = rand(1,3);\n\n $finalResult = $this->checkForWinner($playerOne,$playerTwo);\n if($finalResult == 3){\n $resultOne++;\n }elseif($finalResult == 1){\n $resultTwo++;\n }else{\n $x--;\n echo \"You have Draw -> New Game\\n\";\n }\n\n }\n $this->winner($resultOne,$resultTwo);\n\n }", "public function testCheckWinner()\n {\n $gamestate = $this->game->getGamestate();\n $this->game->holdHand();\n $this->assertNull($gamestate[\"hasWon\"]);\n\n $gamestate[\"active\"]->addPoints(100);\n $exp = $gamestate[\"active\"];\n $this->game->holdHand();\n\n $gamestate = $this->game->getGamestate();\n $this->assertEquals($exp, $gamestate[\"hasWon\"]);\n }", "private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "function isDraw($winningspots, $spots) {\n\t\t$impossibleStates = 0;\n\t\tforeach($winningspots as $winstate) {\n\t\t\t$countX = 0;\n\t\t\t$countO = 0;\n\t\t\tforeach ($winstate as $wincell) {\n\t\t\t\tif($spots[$wincell] == \"x\") {\n\t\t\t\t\t$countX++;\n\t\t\t\t} else if($spots[$wincell] == \"o\") {\n\t\t\t\t\t$countO++;\n\t\t\t\t}\n\t\t\t\tif ($countX > 0 && $countO > 0) {\n\t\t\t\t\t$impossibleStates++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ($impossibleStates == count($winningspots));\n\t}", "protected static function isBoardFull(array $gameBoard){\r\n\t\tforeach($gameBoard as $pos1=>$columns){\r\n\t\t\tforeach($columns as $pos2=>$player){\r\n\t\t\t\tif (false !== $player){\r\n\t\t\t\t\tcontinue ; \t\r\n\t\t\t\t}\r\n\t\t\t\t$blankPositions[] = array($pos1,$pos2);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn (!empty($blankPositions))? $blankPositions:true;\r\n\t}", "abstract protected function isGameOver();", "public function rewardWinners(& $wins,& $table){\n\t\t$pots=& $table->game_pots;\n\t\t$leftOvers=$pots[\"left_overs\"]->amount;\n\t\t$x.=print_r($wins,true);\n\t\t$x.=\"\\n\\n\";\n\t\tforeach ($wins as $points=>$winners){// loop through winners by highest points , search for elegible pot then add that pot to the users'amount'\n\t\t\t$pot_on=count($winners); // how many winners for single pot ?\n\t\t\t$x.= \"got $pot_on winners with score of $points\\n\";\n\t\t\tif ($pon_on=='1'){\n\t\t\t\t$table->dealerChat($pot_on.' winner .');\n\t\t\t}elseif($pon_on>'1'){\n\t\t\t\t$table->dealerChat($pot_on.' winners .');\n\t\t\t}\n\t\t\t$winName=$this->getWinName($points);\n\t\t\t//generate win text\n\t\t\t$winText=' With <label class=\"hand_name\">'.$winName->handName.'</label>' ;\n\t\t\tif ($winName->handName=='High Card'){\n\t\t\t\t$winText.=' '.$winName->normalKicker ;\n\t\t\t}else{\n\t\t\t\tif (isset($winName->doubleKicker)){\n\t\t\t\t\t$winText.=' of '.$winName->doubleKicker ;\n\t\t\t\t}\n\t\t\t\tif ((isset($winName->normalKicker) && !isset($winName->doubleKicker)) || isset($winName->normalKicker) && isset($winName->doubleKicker) && $winName->doubleKicker!=$winName->normalKicker){\n\t\t\t\t\t$winText.=' and '.$winName->normalKicker.' kicker' ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($winners as $winnerId){\n\t\t\t\t$x.= \" - checking winner $winnerId :\\n\";\n\t\t\t\t//search for pots who has this player id\n\t\t\t\t$winPlayer=new Player($winnerId);\n\t\t\t\t\t$x.= \" - Winner is $winPlayer->display_name $winPlayer->seat_id has $ $winPlayer->amount :\\n\";\n\t\t\t\t\tforeach ($pots as $id=>$pot){\n\t\t\t\t\t\tif ($pot->amount>0 && $id!=='left_overs'){\n\t\t\t\t\t\t\t$pot->amount+=$leftOvers;\n\t\t\t\t\t\t\t$leftOvers=0;\n\t\t\t\t\t\t\tif (!isset($pot->original_amount)){$pot->original_amount=$pot->amount;}\n\t\t\t\t\t\t\t$winAmount=round($pot->original_amount/$pot_on);\n\t\t\t\t\t\t\tif (in_array($winnerId,$pot->eligible)!==false){\n\t\t\t\t\t\t\t\t$pots[$id]->amount-=$winAmount;\n\t\t\t\t\t\t\t\t$winPlayer->amount+=$winAmount;\n\t\t\t\t\t\t\t\t$table->dealerChat($winPlayer->profile_link.' has won the pot <label class=\"cash_win\">($'.$winAmount.')</label> '.$winText.' .');\n\t\t\t\t\t\t\t\tif ($winAmount>0){$winPlayer->won=5;}else{$winPlayer->won=0;}\n\t\t\t\t\t\t\t\tif (substr($winPlayer->bet_name,0,6)=='<label'){\n\t\t\t\t\t\t\t\t\t$oldAmount=substr($winPlayer->bet_name,26,strpos($winPlayer->bet_name,'</label>')-26);\n\t\t\t\t\t\t\t\t\t$oldAmount+=$winAmount;\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$oldAmount.'</label>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$winAmount.'</label>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$winPlayer->saveBetData();\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\n\t\t\t}//\n\t\t\t\n\t\t}//\n\t\tfile_put_contents('wins.txt',$x);\n\t\n\t}", "protected function isBoardFull() {\n if ((count($this->_markers[self::X_MARK]) + count($this->_markers[self::O_MARK])) == 9) {\n echo $this->promptMessage('board_full') . PHP_EOL;\n return TRUE;\n }\n return FALSE;\n }", "protected function arrangeChairs4($argc, array $argv)\n {\n $n = $argv[1];\n $w = 1;\n $h = $n;\n $s = 2 * $n; // current best score (fake for now)\n for ($i = 1, $j = $n; $i <= $j; $i ++) {\n $j = ceil($n / $i); // minimum height\n $c = $j - $i + $i * $j; // current score\n if ($i <= $j && $c < $s) {\n $w = $i;\n $h = $j;\n $s = $c;\n }\n }\n\n echo(\"$w,$h\");\n }", "public function getColumnResultFor(string $playerUnit = 'O'): bool\n {\n return $this->winByColumn($playerUnit) !== false ?:\n $this->winByColumn(infer_opponent($playerUnit)) !== false;\n }", "public function isWinnerCombinationPresent(array $boardState) : bool;", "private function _hasPlayers(SimulationTeam $team) {\r\n \tif (!is_array($team->positionsAndPlayers) || count($team->positionsAndPlayers) == 0) {\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$noOfPlayers = 0;\r\n \tforeach ($team->positionsAndPlayers as $position => $players) {\r\n \t\tforeach ($players as $player) {\r\n \t\t\t$noOfPlayers++;\r\n \t\t}\r\n \t}\r\n \treturn ($noOfPlayers > 5);\r\n }", "function the_champ_horizontal_counter_enabled(){\r\n\tglobal $theChampCounterOptions;\r\n\tif(isset($theChampCounterOptions['hor_enable']) && $theChampCounterOptions['hor_enable'] == 1){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "private function checkNrOfCells($data) {\r\n //Check if there are the same number of cells in each row\r\n $checkValue = 0;\r\n $nrOfCells = count($data);\r\n for ($i = 0; $i < $nrOfCells; $i++) {\r\n foreach ($data AS $key => $value) {\r\n $counted = count($value);\r\n if ($i === 0) {\r\n $checkValue = $counted;\r\n } elseif ($checkValue != $counted) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "function checkCollision($shot){\r\n\t\t\t$hitCell = $this->board[$shot->getX()][$shot->getY()];\r\n\t\t\r\n\t\t\t// if cell is empty, the player didn't hit a ship\r\n\t\t\tif($hitCell == self::EMPTYCELL){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t//subtract one from the hit ship\r\n\t\t\t$this->ships[$hitCell]->reduceShipCounter();\r\n\t\t\r\n\t\t\t// if the counter is 0(ship has been destroyed), set sunk to true and check for winner\r\n\t\t\tif( $this->ships[$hitCell]->isShipSunk() ){\r\n\t\t\t\t$shot->setIsSunk(true);\r\n\t\t\t\t$this->checkWinner($shot);\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$shot->setIsHit(true);\r\n\t\t}", "public function checkIfPlayersConflictsTeam(OnWayPointEventStructure $structure) {\n\t\t$login = trim($structure->getLogin());\n\n\t\t// If there's login of player in blueTeam but he finished as redTeam make swap\n\t\tif (array_key_exists($login, $this->matchScore->blueTeamPlayers)) {\n\t\t\tif ($structure->getPlayer()->teamId != $this->matchScore->blueTeamPlayers[$login]->teamId) {\n\t\t\t\t$this->matchScore->redTeamPlayers[$login] = $this->matchScore->blueTeamPlayers[$login];\n\t\t\t\t$this->matchScore->redTeamPlayers[$login]->teamId = self::RED_TEAM;\n\t\t\t\tunset($this->matchScore->blueTeamPlayers[$login]);\n\t\t\t}\n\n\t\t} // If there's login of player in redTeam but he finished as blueTeam make swap\n\t\telse if (array_key_exists($login, $this->matchScore->redTeamPlayers)) {\n\t\t\tif ($structure->getPlayer()->teamId != $this->matchScore->redTeamPlayers[$login]->teamId) {\n\t\t\t\t$this->matchScore->blueTeamPlayers[$login] = $this->matchScore->redTeamPlayers[$login];\n\t\t\t\t$this->matchScore->blueTeamPlayers[$login]->teamId = self::BLUE_TEAM;\n\t\t\t\tunset($this->matchScore->redTeamPlayers[$login]);\n\t\t\t}\n\t\t}\n\t}", "public function GenerateLegalPawnMoves($chesspiece, $x, $y){\n\t\t$from = array($x, $y);\n\t\t\n\t if ($chesspiece > 0){ // $chesspiece is a white pawn.\n\t \t$to = array($x, $y+1);\n\t \t\n\t \tif ($this->chessposition[$x][$y+1] == 0){\n\t \t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 1){\n \t$to = array($x, $y+2);\n \tif ($this->chessposition[$x][$y+2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \t}\n }\n \n if ($this->IsEnemyPiece(1, $x+1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x+1, $y+1));\n }\n if ($this->IsEnemyPiece(1, $x-1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x-1, $y+1));\n }\n }\n\n if ($chesspiece < 0){ // $chesspiece is a black pawn\n \t$to = array($x, $y-1);\n\t \t\n\t if($this->chessposition[$x][$y-1] == 0){\n\t \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 6){\n \t$to = array($x, $y-2);\n \tif ($this->chessposition[$x][$y-2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t }\n }\n \n if ($this->IsEnemyPiece(-1, $x+1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x+1, $y-1));\n if ($this->IsEnemyPiece(-1, $x-1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x-1, $y-1)); \n }\n \n //now do en-passant\n /***\n if ($LastMovePlayed[0] == ){ //if it is a pawn\n \t$fromsquare = $this->NumToCoordinate($LastMovePlayed[0]);\n \t$tosquare = $this->NumToCoordinate($LastMovePlayed[1]);\n \t\n \t$a = $tosquare[0] + 1;\n \tif ($this->IsEnemyPiece($this->chessposition[$tosquare[0]][$tosquare[1]]))\n }\n ***/\n \n return true;\n\t}", "function no_double_moves(int $spareMoves, int $movesX, int $movesO): bool\n{\n return [\n [5, 4],\n [4, 4],\n [4, 3],\n [3, 3],\n [3, 2],\n [2, 2],\n [2, 1],\n [1, 1],\n [1, 0],\n [0, 0],\n ][$spareMoves] === [$movesX, $movesO];\n}", "protected function checkForWin($matchID, $userID)\n {\n $sql = new Sql($this->dbAdapter);\n \n $where = new \\Zend\\Db\\Sql\\Where();\n $where->nest()\n ->equalTo('tblmatchsteps.mUserID', $userID)\n ->and->equalTo('tblmatchsteps.mMatchID', $matchID)\n ->and->equalTo('tblmatchsteps.mState', 1)\n ->unnest();\n $select = $sql->select('tblmatchsteps')->columns(array('countState' => new Expression('COUNT(mState)')))\n ->where($where);\n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute();\n $count = $result->current();\n \n //If he hit 20 times\n if ($count[\"countState\"] == 20)\n {\n return true;\n }\n \n return false;\n \n }", "function check_looted_current_player($id_partie, $byTeam = false, $position = false) {\n global $wpdb;\n if ($byTeam == false AND $position == false) {\n\n try {\n $resultats = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT * FROM looted WHERE position = %s AND id_partie = %d\", get_position_by_id($id_partie, get_current_user_id()), $id_partie\n )\n );\n\n return count($resultats);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n } else {\n try {\n \n $equipe= get_team(get_current_user_id(), $id_partie);\n if($equipe == 1){\n $resultats = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT * FROM looted WHERE position = %s AND id_partie = %d AND equipe_1 = %d\", $position, $id_partie, 1\n )\n );}else {\n $resultats = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT * FROM looted WHERE position = %s AND id_partie = %d AND equipe_2 = %d\", $position, $id_partie, 1\n )\n );\n }\n\n return count($resultats);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }\n}", "private function getWinner($lpcid, $row) {\r\n if (is_null($row->testtype) || is_null($row->progress) || is_null($row->smartmessage) || is_null($row->personalization_mode)) {\r\n $row = self::winnerRequiredFields($lpcid);\r\n }\r\n $type = $row->testtype;\r\n $progress = $row->progress;\r\n $sms = $row->smartmessage;\r\n $perso = $row->personalization_mode;\r\n\r\n $validType = in_array($type, array(OPT_TESTTYPE_SPLIT, OPT_TESTTYPE_VISUALAB));\r\n\r\n if (!$validType || $progress != OPT_PROGRESS_SIG || $sms == OPT_IS_SMS_TEST || $perso == OPT_PERSOMODE_SINGLE) {\r\n return array('winnerid' => -1, 'winnername' => 'NA', 'winner_cr' => -1, 'uplift' => -1);\r\n }\r\n\r\n $max = self::getHigherCr($lpcid);\r\n $query = $this->db->select('landing_pageid, name, pagetype, CAST(cr AS DECIMAL(8,6)) AS cr', FALSE)\r\n ->from('landing_page')\r\n ->where('landingpage_collectionid', $lpcid)\r\n ->get();\r\n\r\n $winner_cr = 0;\r\n $winner_id = -1;\r\n $winner_name = 'NA';\r\n $control_winner = FALSE;\r\n\r\n foreach ($query->result() as $q) {\r\n if ($q->pagetype == 1) {\r\n $control_cr = $q->cr > 0 ? $q->cr : 1;\r\n $control_winner = $q->cr == $max ? TRUE : FALSE;\r\n } else if ($q->cr == $max) {\r\n $winner_cr = $q->cr;\r\n $winner_id = $q->landing_pageid;\r\n $winner_name = $q->name;\r\n }\r\n }\r\n\r\n $uplift = ($winner_cr - $control_cr) / $control_cr;\r\n return array(\r\n 'winnerid' => $winner_id,\r\n 'winnername' => $winner_name,\r\n 'winner_cr' => $winner_cr,\r\n 'control_cr' => $control_winner ? $control_cr : FALSE,\r\n 'uplift' => $uplift\r\n );\r\n }", "private function checkWiningDiagonal($playerUnit, $type = 'right', $returnCount = false)\n {\n $keys = ($type == 'right') ? array_keys($this->ticTacToeBoard) : array_reverse(array_keys($this->ticTacToeBoard));\n\n $diagonal = array_map(function ($row, $index) {\n return $row[$index];\n }, $this->ticTacToeBoard, $keys);\n\n $a = array_filter($diagonal, function ($val) use ($playerUnit) {\n return ($val === $playerUnit);\n });\n\n //return diagonal values\n if ($returnCount === true) {\n return $a;\n }\n return (count($a) == $this->boardSize) ? true : false;\n }", "public function isWinner() {\n\t\t$winner = null;\n\t\t$rule = $this->getRule(); // note: rule is required for matches\n\t\tif($rule->rule_type == Rule::TYPE_MATCHPLAY) {\n\t\t\t// Get opponent scorecard\n\t\t\tif($opponent = $this->getOpponent()) {\n\t\t\t\tif($opponent_scorecard = $opponent->getScorecard()) {\n\t\t\t\t\t$this_total = $this->points_total($rule->handicap);\n\t\t\t\t\t$opponent_total = $opponent_scorecard->points_total($rule->handicap);\n\t\t\t\t\t//Yii::trace('tie:'.$this->tie_break.'vs.'.$opponent_scorecard->tie_break, 'Scorecard::isWinner');\n\t\t\t\t\t$winner = ($this_total > $opponent_total) ?\n\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t($opponent_total > $this_total ?\n\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t($this->tie_break > $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t\t\t($this->tie_break < $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t\t\tnull)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Yii::trace('return:'.($winner ? 't' : 'f'), 'Scorecard::isWinner');\n\t\treturn $winner;\n\t}", "private function findLineMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('up', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i + 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i + 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i, $j);\n\t\t\t\t\t\t\t$moves[0][] = array('down', $i + 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('right', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j + 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j + 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('left', $i, $j + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('down', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i - 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i - 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('top', $i - 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('left', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j - 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j - 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t$moves[3][] = array('left', $i, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i, $j - 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function gameOver() : bool\n {\n return $this->cpu->totalScore() >= 100 || $this->player->totalScore() >= 100;\n }", "public function GenerateLegalRookMoves($chesspiece, $x, $y){\n\t //examine forward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n \tbreak; //stop examining this file.\n }\n }\n\n //examine backward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this file.\n }\n }\n\n //examine right-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this rank.\n }\n }\n\n //examine left-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this rank.\n }\n }\n \n return true;\n\t}", "public function testThreeTurns(){\n\t\t$this->assertEquals($this->game->score(array(1,2), array(3,4), array()),10);\n\t\t$this->assertEquals($this->game->score(array(1,2), array(3,4), array(2,2)),14);\n\t}" ]
[ "0.6832586", "0.6633101", "0.66100883", "0.6586113", "0.6439534", "0.64226496", "0.64079475", "0.639375", "0.6374308", "0.6293329", "0.62067664", "0.6015634", "0.5979617", "0.59258115", "0.59214294", "0.59026545", "0.5896327", "0.588674", "0.58455724", "0.58320796", "0.578149", "0.5750894", "0.5718521", "0.56764543", "0.5676315", "0.5655238", "0.56404203", "0.5587716", "0.556849", "0.5555637", "0.5547592", "0.55180955", "0.5467924", "0.5448292", "0.5374995", "0.533163", "0.5326285", "0.53234255", "0.5313783", "0.530663", "0.5305313", "0.5295794", "0.52931964", "0.527697", "0.52646273", "0.5259128", "0.5247771", "0.52384984", "0.52354074", "0.5230498", "0.5229903", "0.5214287", "0.52053314", "0.51959974", "0.51898396", "0.5185522", "0.51688325", "0.51566714", "0.5149741", "0.5144845", "0.5143158", "0.51419735", "0.5138745", "0.51375526", "0.5131228", "0.51279527", "0.5122558", "0.50943935", "0.5085041", "0.50674117", "0.50655586", "0.5062654", "0.506246", "0.50593203", "0.5056704", "0.50494856", "0.50357854", "0.5011411", "0.5009488", "0.50062585", "0.5003819", "0.49978724", "0.49919036", "0.4981897", "0.49788645", "0.49773392", "0.4973305", "0.49598098", "0.49516296", "0.49454874", "0.49289283", "0.4925266", "0.49239936", "0.49233028", "0.49221277", "0.49194646", "0.49168813", "0.4915676", "0.49154332", "0.49105573" ]
0.74083453
0
Function check Negative Diagonal winning [X] [X] [X] [X] function run from the point the user choose to type his discs check : first start to search on the upper right side of the selected userMove, then starts to search below left of the userMove selection In case of sequence at least 4 of the current player in a Diagonal player won
public function checkNegativeDiagonalWin($userMove){ $diagonalCounter = self::ZERO; $gameBoards = $this->board->gameBoard; $current_player = "[$this->currentPlayer]"; for($row = $this->lastRowInsert-1 ,$col = $userMove; $row > -1 && $col < Board::COLUMNS ; $row--, $col++ ){ if($gameBoards[$row][$col] != $current_player){ break; } $diagonalCounter++; } for($row = $this->lastRowInsert ,$col = $userMove-1; $row < Board::ROWS && $col > -1 ; $row++, $col-- ){ if($gameBoards[$row][$col] != $current_player){ break; } $diagonalCounter++; } return $diagonalCounter >= self::WIN ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }", "public static function diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, &$boardRows, $direction, &$removedPawnIds, &$errorMsg)\n\t{\n\t\tswitch($direction)\n\t\t{\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_UP_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_UP_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_DOWN_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_DOWN_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null; \n\t\t}\n\n\t\tfor($possiblePosition = self::MIN_POSITION; $possiblePosition <= self::MAX_POSITION; $possiblePosition++)\n\t\t{\n\t\t\tif($prevX+($diffX*$possiblePosition) === $newX && $prevY+($diffY*$possiblePosition) === $newY)\n\t\t\t{\n\t\t\t\tif(($possiblePosition % 2) !== 0)\n\t\t\t\t{\n\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\tif(\t$prevY+$diffY < 0 || \n\t\t\t\t\t\t$prevX+$diffX < 0 || \n\t\t\t\t\t\t$prevY+$diffY > count($boardRows)-1 || \n\t\t\t\t\t\t$prevX+$diffX > count($boardRows)-1)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t//it should not search further if previous and new positions are the same\n\t\t\t\t\tif($prevX === $newX && $prevY === $newY)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t$posEvaluation = $playerNumber === FIRST_PLAYER ? \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > PLAYER_PAWNS_AMOUNT) : \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > 0 && $boardRows[$prevY+$diffY][$prevX+$diffX] <= PLAYER_PAWNS_AMOUNT);\n\n\t\t\t\t\t//checking if an opponent pawn had been spotted\n\t\t\t\t\tif($posEvaluation)\n\t\t\t\t\t{\n\t\t\t\t\t\t$removedPawnIds[] = intval($boardRows[$prevY+$diffY][$prevX+$diffX]);\n\t\t\t\t\t\t$boardRows[$prevY+$diffY][$prevX+$diffX] = 0;\n\t\t\t\t\t\t$prevX+=$diffX*2;\n\t\t\t\t\t\t$prevY+=$diffY*2;\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//if the algorithm didn't reach the end that means that the chosen position is \n\t\t\t\t\t\t//illegal since newX and newY and the last opponent are too far apart\n\t\t\t\t\t\tif($prevX !== $newX && $prevY !== $newY)\n\t\t\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}", "public function checkVerticalWin($userMove){\r\n $varticalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = ($this->board->getRows() - 1) ; $row > -1 ; $row-- ){ \r\n if($varticalCounter == self::WIN){\r\n return true;\r\n }\r\n elseif($gameBoards[$row][$userMove-1] == $current_player){\r\n $varticalCounter++;\r\n }\r\n elseif($row < 2 && $varticalCounter < 1 ){\r\n return false;\r\n }\r\n elseif($gameBoards[$row][$userMove-1] == Board::CELL){\r\n $varticalCounter = self::ZERO;\r\n continue;\r\n }\r\n else{\r\n $varticalCounter = self::ZERO;\r\n }\r\n }\r\n return $varticalCounter >= self::WIN ? true : false;\r\n \r\n }", "function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}", "public function checkHorizontalWin($userMove){\r\n $HorizontalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $row = $this->lastRowInsert;\r\n $current_player = \"[$this->currentPlayer]\";\r\n\r\n for($col = $userMove-1; $col > -1 ; $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break; \r\n }\r\n $HorizontalCounter++;\r\n }\r\n for($col= $userMove; $col < Board::COLUMNS ; $col++){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $HorizontalCounter++; \r\n }\r\n return $HorizontalCounter >= self::WIN ? true : false;\r\n \r\n }", "public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private function findLineMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('up', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i + 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i + 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i, $j);\n\t\t\t\t\t\t\t$moves[0][] = array('down', $i + 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('right', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j + 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j + 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('left', $i, $j + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('down', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i - 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i - 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('top', $i - 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('left', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j - 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j - 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t$moves[3][] = array('left', $i, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i, $j - 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }", "protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }", "private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function checkValidMove($userMove){\r\n if(!is_numeric($userMove) ||$userMove < 1 || $userMove > Board::COLUMNS){ \r\n invalidInputMsg($this->currentPlayer);\r\n return false;\r\n }\r\n return true;;\r\n }", "private function checkWiningDiagonal($playerUnit, $type = 'right', $returnCount = false)\n {\n $keys = ($type == 'right') ? array_keys($this->ticTacToeBoard) : array_reverse(array_keys($this->ticTacToeBoard));\n\n $diagonal = array_map(function ($row, $index) {\n return $row[$index];\n }, $this->ticTacToeBoard, $keys);\n\n $a = array_filter($diagonal, function ($val) use ($playerUnit) {\n return ($val === $playerUnit);\n });\n\n //return diagonal values\n if ($returnCount === true) {\n return $a;\n }\n return (count($a) == $this->boardSize) ? true : false;\n }", "public function rejectIfWrongMove(Board $board, User $player, $row, $col);", "function getMovesForMatch ()\r\n{\r\n\t//array of chess moves assuming a few things:\r\n\t/* \t- light/dark take turns \r\n\t\t- the moves are set up to take a piece and move it to another,\r\n\t\t\tso moving pawn e2 -> e4 would be stored as the first 2 elements in a multidimensional array.\r\n\t\t- there are many things that would need to be done to support algebraic chess notation, \r\n\t\t\tI didn't go into that here.\t\t\r\n\t\t\r\n\t*/\r\n\t$matchMoves = array();\r\n\t\r\n\t/*\r\n\t$matchMoves [0]['from'] = \"e2\";\r\n\t$matchMoves [0]['to'] \t= \"e4\";\r\n\t$matchMoves [1]['from'] = \"c7\";\r\n\t$matchMoves [1]['to']\t= \"c5\";\r\n\t\r\n\t$matchMoves [2]['from'] = \"g1\";\r\n\t$matchMoves\t[2]['to']\t= \"f3\";\r\n\t$matchMoves [3]['from'] = \"b8\";\r\n\t$matchMoves [3]['to']\t= \"c6\";\r\n\t\r\n\t//begin invalid off board examples\r\n\t$matchMoves [4]['from'] = \"c6\";\r\n\t$matchMoves [4]['to'] \t= \"c9\";\r\n\t\r\n\t$matchMoves [5]['from'] = \"c6\";\r\n\t$matchMoves [5]['to'] \t= \"c0\";\r\n\t\r\n\t$matchMoves [6]['from'] = \"c6\";\r\n\t$matchMoves [6]['to'] \t= \"z9\";\r\n\t*/\r\n\t//begin invalid examples for particular pieces\r\n\t\r\n\t//king =======================\r\n\t//bad move\r\n\t$matchMoves [7]['from'] = \"e8\";\r\n\t$matchMoves [7]['to'] \t= \"g7\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [8]['from'] = \"e8\";\r\n\t$matchMoves [8]['to'] \t= \"f7\";\r\n\t\r\n\t//rook =========================\r\n\t//bad move\r\n\t$matchMoves [9]['from'] = \"h8\";\r\n\t$matchMoves [9]['to'] \t= \"h5\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [10]['from'] = \"h7\";\r\n\t$matchMoves [10]['to'] \t = \"h6\";\t\r\n\t$matchMoves [11]['from'] = \"h6\";\r\n\t$matchMoves [11]['to'] \t = \"h5\";\r\n\t$matchMoves [12]['from'] = \"h5\";\r\n\t$matchMoves [12]['to'] \t = \"h4\";\r\n\t$matchMoves [13]['from'] = \"h8\";\r\n\t$matchMoves [13]['to'] \t = \"h5\";\r\n\t\r\n\t//bishop ========================\r\n\t//bad move\r\n\t$matchMoves [14]['from'] \t= \"c8\";\r\n\t$matchMoves [14]['to'] \t\t= \"b8\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [15]['from'] \t= \"c8\";\r\n\t$matchMoves [15]['to'] \t\t= \"c7\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [16]['from'] \t= \"b7\";\r\n\t$matchMoves [16]['to'] \t\t= \"b6\";\r\n\t$matchMoves [17]['from'] \t= \"c8\";\r\n\t$matchMoves [17]['to'] \t\t= \"a6\";\r\n\t\r\n\t//queen ==========================\r\n\t$matchMoves [18]['from'] \t= \"d8\";\r\n\t$matchMoves [18]['to'] \t\t= \"c8\";\r\n\t\r\n\t\t\r\n\t//setting up a check for between functions - rook\r\n\t$matchMoves [19]['from'] \t= \"f2\";\r\n\t$matchMoves [19]['to'] \t\t= \"f3\";\r\n\t$matchMoves [20]['from'] \t= \"f3\";\r\n\t$matchMoves [20]['to'] \t\t= \"f4\";\r\n\t$matchMoves [21]['from'] \t= \"f4\";\r\n\t$matchMoves [21]['to'] \t\t= \"f5\";\r\n\t\r\n\t$matchMoves [22]['from'] \t= \"h5\";\r\n\t$matchMoves [22]['to'] \t\t= \"e5\";\r\n\t\r\n\t//demonstrating capture move a pawn to capture\r\n\t$matchMoves [23]['from'] \t= \"f7\";\r\n\t$matchMoves [23]['to'] \t\t= \"f6\";\r\n\t$matchMoves [24]['from'] \t= \"g7\";\r\n\t$matchMoves [24]['to'] \t\t= \"g6\";\r\n\t$matchMoves [25]['from'] \t= \"f5\";\r\n\t$matchMoves [25]['to'] \t\t= \"g6\";\r\n\t\r\n\r\n\treturn ($matchMoves);\r\n}", "public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "function no_double_moves(int $spareMoves, int $movesX, int $movesO): bool\n{\n return [\n [5, 4],\n [4, 4],\n [4, 3],\n [3, 3],\n [3, 2],\n [2, 2],\n [2, 1],\n [1, 1],\n [1, 0],\n [0, 0],\n ][$spareMoves] === [$movesX, $movesO];\n}", "function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}", "public function getDiagonalResultFor(string $playerUnit = 'O'): bool\n {\n return $this->winByDiagonal($playerUnit) !== false ?:\n $this->winByDiagonal(infer_opponent($playerUnit)) !== false;\n }", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n if ($rightDiagonalSum == $this->boardSize || $leftDiagonalSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n if ($rightDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $column = array_column($this->board, $i);\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n if ($columnSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($columnSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($rowSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->secondMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}", "protected function winByDiagonal(string $playerUnit)\n {\n $d0 = '';\n $d1 = '';\n\n for ($x = 0; $x <= $this->getSize() - 1; $x++) {\n $d0 .= $this->getState()[$x][$x];\n }\n\n for ($x = 0; $x <= $this->getSize() - 1; $x++) {\n $d1 .= $this->getState()[$x][$this->getSize() - 1 - $x];\n }\n\n return $d0 === $this->getWinnerResult($playerUnit)\n ? 0\n : ($d1 === $this->getWinnerResult($playerUnit)\n ? 1\n : false);\n }", "public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }", "function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}", "public function GenerateLegalBishopMoves($chesspiece, $x, $y){\n\t\t//examine top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine top left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n \n return true;\n\t}", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "public function GenerateLegalMoves($chessposition){\n\t\t$this->SetAsPosition($chessposition);\n\t\t$this->ResetLegalMovesArr();\n\t\n\t\t//loop through the entire board\n\t\t//possible candidates are (x,y)\n\t\tfor ($x=0; $x<8; $x++){\n for ($y=0; $y<8; $y++){\n $chesspiece = $this->chessposition[$x][$y];\n \n //if nothing is there\n if ($chesspiece == 0){\n continue;\n }\n \n if (($this->IsWhiteToMove && ($chesspiece < 0)) ||\n \t\t(!$this->IsWhiteToMove && ($chesspiece > 0))){\n \t\tcontinue;\n \t\t}\n \n //if chesspiece is a pawn\n if (($chesspiece == 1) || ($chesspiece == -1)){ // chesspiece = pawn\n $this->GenerateLegalPawnMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n \n //if $chesspiece is a knight\n if (($chesspiece == 2) || ($chesspiece == -2)){\n $this->GenerateLegalKnightMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }//end of examining legal moves for knight\n \n //if $chesspiece is a bishop\n if (($chesspiece == 3) || ($chesspiece == -3)){ //$chesspiece is a bishop\n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for bishop\n \n //if $chesspiece is a rook\n if (($chesspiece == 4) || ($chesspiece == -4)){\n $this->GenerateLegalRookMoves($chesspiece, $x, $y); \n \n continue; //move on to the next iteration\n }//end of generating legal moves for the rook\n \n //if $chesspiece is a queen\n if (($chesspiece == 5) || ($chesspiece == -5)){\n \n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n $this->GenerateLegalRookMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for the queen\n \n //if chesspiece is a king\n if (($chesspiece == 6) || ($chesspiece == -6)){\n $this->GenerateLegalKingMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n }\n }\n\t}", "function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }", "public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }", "public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }", "public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }", "public function GenerateLegalKingMoves($chesspiece, $x, $y){\n\t\n\t\t$from = array($x, $y);\n\t\n\t\t/**\n\t\t * Determine the legality of the usual king moves\n\t\t */\n\t\tif ($this->IsKingAllowedOnSquare($x+1, $y)){\n\t\t\t$to = array($x+1, $y);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x+1, $y+1)){\n\t\t\t$to = array($x+1, $y+1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x+1, $y-1)){\n\t\t\t$to = array($x+1, $y-1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\n\t\tif ($this->IsKingAllowedOnSquare($x-1, $y)){\n\t\t\t$to = array($x-1, $y);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x-1, $y+1)){\n\t\t\t$to = array($x-1, $y+1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x-1, $y-1)){\n\t\t\t$to = array($x-1, $y-1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x, $y-1)){\n\t\t\t$to = array($x, $y-1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\tif ($this->IsKingAllowedOnSquare($x, $y+1)){\n\t\t\t$to = array($x, $y+1);\n\t\t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t\t}\n\t\t\n\t\t/**\n\t\t * Determine whether the king can castle kingside\n\t\t */\n\t\tif ($chesspiece > 0){\n\t\t if (!$this->IsWhiteKingMoved && !$this->IsWhiteKRMoved){\n if ($this->IsKingAllowedOnSquare(5, 0) && \n $this->IsKingAllowedOnSquare(6, 0) &&\n $this->chessposition[5][0] == 0 &&\n $this->chessposition[6][0] == 0){\n // note: this function never got called.\n // therefore, the problem must be in the IsKingAllowedOnSquare function\n // not sure what the problem is exactly thoughf\n $to = array(6, 0);\n $this->AddChessSquare($chesspiece, $from, $to);\n }\n }\n \n if (!$this->IsWhiteKingMoved && !$this->IsWhiteQRMoved){\n \tif ($this->IsKingAllowedOnSquare(2, 0) && \n \t\t\t$this->IsKingAllowedOnSquare(3, 0) &&\n \t\t\t$this->chessposition[3][0] == 0 && \n \t\t\t$this->chessposition[2][0] == 0 &&\n \t\t\t$this->chessposition[1][0] == 0){\n \t\t\n \t\t$to = array(2, 0);\n \t\t$this->AddChessSquare($chesspiece, $from, $to);\n \t}\n }\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){\n\t\t\tif (!$this->IsBlackKingMoved && !$this->IsBlackKRMoved){\n if ($this->IsKingAllowedOnSquare(5, 7) && \n $this->IsKingAllowedOnSquare(6, 7) && \n $this->chessposition[5][7] == 0 &&\n $this->chessposition[6][7] == 0){\n \n $to = array(6, 7);\n $this->AddChessSquare($chesspiece, $from, $to);\n }\n }\n \n\t\t\tif (!$this->IsBlackKingMoved && !$this->IsBlackQRMoved){\n \tif ($this->IsKingAllowedOnSquare(2, 7) && \n \t\t\t$this->IsKingAllowedOnSquare(3, 7) &&\n \t\t\t$this->chessposition[1][7] == 0 &&\n \t\t\t$this->chessposition[2][7] == 0 &&\n \t\t\t$this->chessposition[3][7] == 0){\n \t\t\n \t\t$to = array(2, 7);\n \t\t$this->AddChessSquare($chesspiece, $from, $to);\n \t}\n }\n\t\t}\n \n return true;\n\t}", "public function GenerateLegalRookMoves($chesspiece, $x, $y){\n\t //examine forward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n \tbreak; //stop examining this file.\n }\n }\n\n //examine backward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this file.\n }\n }\n\n //examine right-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this rank.\n }\n }\n\n //examine left-ward moves\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this rank.\n }\n }\n \n return true;\n\t}", "public function GenerateLegalKnightMoves($chesspiece, $x, $y){\n\t\t$from = array($x, $y);\n\t\t\n\t\t$to1 = array($x+1, $y+2);\n\t\t$to2 = array($x-1, $y+2);\n\t\t$to3 = array($x+1, $y-2);\n\t\t$to4 = array($x-1, $y-2);\n\t\t$to5 = array($x+2, $y+1);\n\t\t$to6 = array($x-2, $y+1);\n\t\t$to7 = array($x+2, $y-1);\n\t\t$to8 = array($x-2, $y-1);\n\t\t\n\t\t$this->AddChessSquare($chesspiece, $from, $to1);\n $this->AddChessSquare($chesspiece, $from, $to2);\n $this->AddChessSquare($chesspiece, $from, $to3);\n $this->AddChessSquare($chesspiece, $from, $to4);\n $this->AddChessSquare($chesspiece, $from, $to5);\n $this->AddChessSquare($chesspiece, $from, $to6);\n $this->AddChessSquare($chesspiece, $from, $to7);\n $this->AddChessSquare($chesspiece, $from, $to8);\n \n return true;\n\t}", "public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }", "public function GenerateLegalPawnMoves($chesspiece, $x, $y){\n\t\t$from = array($x, $y);\n\t\t\n\t if ($chesspiece > 0){ // $chesspiece is a white pawn.\n\t \t$to = array($x, $y+1);\n\t \t\n\t \tif ($this->chessposition[$x][$y+1] == 0){\n\t \t\t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 1){\n \t$to = array($x, $y+2);\n \tif ($this->chessposition[$x][$y+2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \t}\n }\n \n if ($this->IsEnemyPiece(1, $x+1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x+1, $y+1));\n }\n if ($this->IsEnemyPiece(1, $x-1, $y+1)){\n \t$this->AddChessSquare(1, $from, array($x-1, $y+1));\n }\n }\n\n if ($chesspiece < 0){ // $chesspiece is a black pawn\n \t$to = array($x, $y-1);\n\t \t\n\t if($this->chessposition[$x][$y-1] == 0){\n\t \t$this->AddChessSquare($chesspiece, $from, $to);\n\t \tif ($y == 6){\n \t$to = array($x, $y-2);\n \tif ($this->chessposition[$x][$y-2] == 0)\n \t$this->AddChessSquare($chesspiece, $from, $to);\n\t }\n }\n \n if ($this->IsEnemyPiece(-1, $x+1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x+1, $y-1));\n if ($this->IsEnemyPiece(-1, $x-1, $y-1))\n \t$this->AddChessSquare(-1, $from, array($x-1, $y-1)); \n }\n \n //now do en-passant\n /***\n if ($LastMovePlayed[0] == ){ //if it is a pawn\n \t$fromsquare = $this->NumToCoordinate($LastMovePlayed[0]);\n \t$tosquare = $this->NumToCoordinate($LastMovePlayed[1]);\n \t\n \t$a = $tosquare[0] + 1;\n \tif ($this->IsEnemyPiece($this->chessposition[$tosquare[0]][$tosquare[1]]))\n }\n ***/\n \n return true;\n\t}", "function is_attacked($i, $opponent_color = null, $try_move = array()) {\n\n if ($opponent_color != null) {\n $opponent_color = 1 - $this->to_move;\n }\n \n # check pawns\n # _debug(\"... checking opponent pawns\");\n if ($opponent_color) {\n if ($this->_test_attack('p', $i - 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i - 11, $opponent_color, $try_move) === -1) return TRUE;\n } \n else {\n if ($this->_test_attack('p', $i + 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i + 11, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check knights\n # _debug(\"... checking opponent knights\");\n foreach (array(19, 21, 8, 12, -19, -21, -8, -12) as $step) {\n if ($this->_test_attack('n', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check bishops or queens\n # _debug(\"... checking opponent bishops\");\n foreach (array(11, 9, -11, -9) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('bq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n # check rooks or queens\n # _debug(\"... checking opponent rooks or queens\");\n foreach (array(1, 10, -1, -10) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('rq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n foreach (array(9, 10, 11, -1, 1, -9, -10, -11) as $step) {\n if ($this->_test_attack('k', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n return FALSE;\n }", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChecker = [4, 3];\n $game->gameState->possibleGoChoices = [array(\"row\"=>2, \"col\"=>5), array(\"row\"=>4, \"col\"=>3)];\n $game->gameState->boardState = $this->getMultipleBeat();\n\n $gm->userMove(2, 5, 1, $game );\n $gm->userMove(0, 3, 1, $game );\n $gm->userMove(3, 0, 1, $game );\n $result = $gm->userMove(7, 4, 1, $game );\n\n\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][3]);//initial\n $this->assertEquals(0, $result[\"gameState\"]->boardState[3][4]);//beaten\n $this->assertEquals(-1, $result[\"gameState\"]->boardState[1][6]);//still there due to turkish turn rule\n $this->assertEquals(0, $result[\"gameState\"]->boardState[1][4]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[2][1]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][1]);//beaten\n $this->assertEquals(2, $result[\"gameState\"]->boardState[7][4]);//end position of the hero checker\n\n }", "public function nextPossibleMove()\n {\n $x = $this->snake['pos']['x'];\n $y = $this->snake['pos']['y'];\n \n $moves = [\n 'up' => [$x, $y - 1],\n 'right' => [$x + 1, $y],\n 'down' => [$x, $y + 1],\n 'left' => [$x - 1, $y],\n ];\n\n $moves = $this->removeDeadMoves($moves);\n\n if (empty($moves)) {\n return $moves;\n }\n\n $moves = $this->calcThresholds($moves);\n\n if (!empty($safe = array_diff_key($moves, $this->getDangerMoves($moves)))) {\n $danger = array_intersect_key($moves, $this->getDangerMoves($moves));\n\n $threshold = array_first($safe)[2];\n\n if ($threshold > 7 && !empty($danger)) {\n return $danger;\n }\n\n if ($threshold > 5) {\n if (!empty($tail = $this->getTailMoves($safe))) {\n return $tail;\n }\n }\n\n if ($threshold > 5 && $this->snake['health'] < 95) {\n $result = $this->getFoodMoves($safe);\n\n if (!empty($result)) {\n return $result;\n }\n }\n\n return $safe;\n }\n\n if (!empty($head = $this->getHeadMoves($moves))) {\n return $head;\n }\n\n if (!empty($tail = $this->getTailMoves($moves))) {\n return $tail;\n }\n\n return $moves;\n }", "public function checkForWinner($playerOne, $playerTwo){\n if(($playerOne == 1 && $playerTwo == 2) || ($playerOne == 2 && $playerTwo == 3 || ($playerOne == 3 && $playerTwo == 1))){\n $this->printResult($playerOne, $playerTwo, 1);\n return 1;\n }elseif(($playerOne == 1 && $playerTwo == 1) || ($playerOne == 2 && $playerTwo == 2) || ($playerOne == 3 && $playerTwo == 3)){\n $this->printResult($playerOne, $playerTwo, 2);\n return 2;\n }else{\n $this->printResult($playerOne, $playerTwo, 3);\n return 3;\n }\n}", "private function findSimpleMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($this->moveDestinations as $direction)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->canMoveTo($direction, $i, $j))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$moves[] = array(array($direction, $i, $j));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function makeMove($boardState, $playerUnit = 'X')\n {\n $opponentUnit = ($playerUnit == 'X' ? 'O' : 'X');\n $playerWinCases = array();\n $opponentWinCases = array();\n $choosePlayerWinCase = -1;\n $chooseOpponentWinCase = -1;\n foreach (self::$winningCases as $key => &$winCase) {\n\n $playerWinCase = new WinningCase($boardState, $winCase, $playerUnit);\n if (!$playerWinCase->isBlocked()) {\n if ($playerWinCase->countRemainingMoves() == 0) {\n $this->winner = $playerUnit;\n $this->winningCase = $winCase;\n return;\n } else if (!$choosePlayerWinCase instanceof WinningCase\n || (\n $choosePlayerWinCase instanceof WinningCase\n && $playerWinCase->countRemainingMoves() < $choosePlayerWinCase->countRemainingMoves()\n )\n ) {\n $choosePlayerWinCase = $playerWinCase;\n }\n }\n if ($playerWinCase->countRemainingMoves() > 0) {\n $playerWinCases[$playerWinCase->countRemainingMoves()] = $playerWinCase;\n// array_push($playerWinCases, $playerWinCase);\n }\n\n $opponentWinCase = new WinningCase($boardState, $winCase, $opponentUnit);\n if (!$opponentWinCase->isBlocked()) {\n if ($opponentWinCase->countRemainingMoves() == 0) {\n $this->winner = $opponentUnit;\n $this->winningCase = $winCase;\n return;\n } else if ($opponentWinCase->countRemainingMoves() == 1) {\n $chooseOpponentWinCase = $opponentWinCase;\n }\n }\n if ($opponentWinCase->countRemainingMoves() > 0) {\n $opponentWinCases[$opponentWinCase->countRemainingMoves()] = $opponentWinCase;\n// array_push($opponentWinCases, $opponentWinCase);\n }\n }\n\n // Winning case\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() == 1) {\n #if (DEBUG) echo 'Winning case:' . \"\\r\\n\";\n $this->winner = $playerUnit;\n $this->winningCase = $choosePlayerWinCase->winCase;\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n // Block opponent winning case (to avoid loss)\n if ($chooseOpponentWinCase instanceof WinningCase && $chooseOpponentWinCase->countRemainingMoves() > 0) {\n #if (DEBUG) echo 'Block opponent winning case -> Avoid loss:' . \"\\r\\n\";\n return array_merge($chooseOpponentWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n #if (DEBUG) echo 'No immediate winnning move found -> Best move:' . \"\\r\\n\";\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() > 0) {\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n $this->winner = 'Draw';\n return;\n }", "public function secondMove($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') $playerUnit = 'O';\n if ($playerUnit == 'O') $playerUnit = 'X';\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n $column = array_column($this->board, $i);\n\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n\n if ($columnSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n\n if ($rightDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n for($j = 0; $j <= $this->maxIndex; $j++){\n if ($block && $this->board[$i][$j] == $playerUnit){\n $coordinates = $this->getFirstEmptyNeighboor($i, $j);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->secondMove($playerUnit, true);\n }\n return false;\n }", "public static function diagonallyDismissOpponentsAllSides($prevX, $prevY, $newX, $newY, $playerNumber, &$boardRows, &$removedPawnIds, &$errorMsg)\n {\n \tGameLogic::diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, $boardRows, self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_UP_DIR, $removedPawnIds, $errorMsg);\n\t\t\n\t\tif(empty($removedPawnIds))\n\t\t\tGameLogic::diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, $boardRows, self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_UP_DIR, $removedPawnIds, $errorMsg);\n\t\t\n\t\tif(empty($removedPawnIds))\n\t\t\tGameLogic::diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, $boardRows, self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_DOWN_DIR, $removedPawnIds, $errorMsg);\n\t\t\n\t\tif(empty($removedPawnIds))\n\t\t\tGameLogic::diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, $boardRows, self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_DOWN_DIR, $removedPawnIds, $errorMsg);\n }", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "function _test_attack($type, $i, $opponent_color, $try_move) {\n/*\nprintf(\"try_move['from']: %s\\n\", $try_move['from']);\nprintf(\"try_move['to']: %s\\n\", $try_move['to']);\nprintf(\"try_move['piece']: %s\\n\", $try_move['piece']);\nprintf(\"this->enpa: %s\\n\", $this->enpa);\n*/\n $p = null;\n if ($try_move) {\n\n if ($i === $try_move['from']) {\n $p = 0;\n } \n elseif ($i === $try_move['to']) {\n // The trial move takes the piece being considered\n $p = $try_move['piece'];\n } \n elseif ( $try_move['piece'] === 'p' \n && intval($this->enpa) === intval($try_move['to'])\n && intval($i) === intval($this->enpa) + 10\n ) {\n $p = 0;\n }\n elseif ( $try_move['piece'] === 'P' \n && intval($this->enpa) === intval($try_move['to'])\n && intval($i) === intval($this->enpa) - 10\n ) {\n $p = 0;\n }\n else {\n $p = $this->pos[$i];\n }\n } \n else {\n $p = $this->pos[$i];\n }\n \n if ($p === null) {\n//print(\"A\\n\");\n return 1;\n }\n\n if ($p && $this->piece_color($p) === $opponent_color && strpos($type, strtolower($p)) !== FALSE) {\n//printf(\"p:%s\\n\", $p);\n//print(\"B\\n\");\n return -1;\n }\n//print(\"C\\n\");\n return $p;\n }", "public function rejectIfInvalidRowAndColumn(Board $board, User $player, $row, $col);", "public function selectMove(){\r\n \r\n do {\r\n $userMsg = readlineUserInputMsg($this->currentPlayer);\r\n $userMove = readline($userMsg);\r\n } while (!$this->checkValidMove($userMove));\r\n\r\n return $userMove;\r\n }", "function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}", "protected function insertMoveToBoard($userMove){\r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = ($this->board->getRows() - 1) ; $row >-1 ; $row-- ){\r\n //check if cell is empty\r\n if($this->board->gameBoard[$row][$userMove-1] == Board::CELL){\r\n $this->board->gameBoard[$row][$userMove-1] = $current_player;\r\n $this->lastRowInsert =$row;\r\n $this->totalMoves++;\r\n break;\r\n }\r\n else{\r\n continue;\r\n }\r\n }\r\n echo $this->board->printBoard();\r\n }", "private function seeIfPossible()\n {\n $correct = true;\n if(Parser::onlyNumbersString($_GET['o'])){\n if($_GET['o'] == User::get_currentCityId()){\n $this->cityTroopsInfo = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT * FROM {troops_movements} WHERE\n reciver_id = $_GET[o] and movement_type = 0\"));\n }else{\n $this->cityTroopsInfo = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT * FROM {troops_movements} WHERE\n reciver_city_id = $_GET[o] and owner_city_id = \".User::get_currentCityId().\" and movement_type = 10\"));\n }\n $correct = $correct && (!(Parser::onlyNumbersString($_GET['t']) && $_GET['t'] >= 0 && $_GET['t'] <= 6));\n $i = 1;\n $ttrops = 0;\n while($correct && $i<12){\n if(!(isset($_GET['tr'.$i]) && Parser::onlyNumbersString($_GET['tr'.$i]) && $_GET['tr'.$i] >= 0 && $this->cityTroopsInfo['tr'.$i] >= $_GET['tr'.$i] )){\n $correct = false;\n }else{\n $ttrops += $_GET['tr'.$i];\n }\n $i++;\n }\n $correct = $correct && ($ttrops > 0) && Parser::onlyNumbersString($_GET['d'] && $_GET['d'] > 0);\n if($correct){\n $exsistsd = DataBaseManager::query(\"SELECT owner_user_id FROM {map} WHERE box_id = $_GET[d]\");\n $this->calculateDistance();\n $oil = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT oil FROM {materials} WHERE city_id = \".User::get_currentCityId()));\n $oil = $oil[0];\n $this->finalOil = $oil - $this->calculateOil();\n $correct = ($this->finalOil >= 0 && DataBaseManager::numRows($exsistsd));\n $reciverUserId = DataBaseManager::fetchArray($exsistsd);\n $this->reciverUserId = $reciverUserId[0];\n }\n }else{\n $correct = false;\n }\n return $correct;\n\n }", "function isValid(array $grid, int $rowIndex, int $columnIndex): bool {//lolo\n $c = $grid[$rowIndex][$columnIndex];\n $xIndex = $rowIndex;\n $yIndex = $columnIndex;\n $rowIndex = 0;\n while ($rowIndex < 9)\n {\n if ($rowIndex != $xIndex) //verif diff de la case pour éviter la boucle inf\n if ($grid[$rowIndex][$columnIndex] == $c)\n return (false);\n $rowIndex++;\n }\n $columnIndex = 0;\n while ($columnIndex < 9)\n {\n if ($columnIndex != $yIndex)// idem avec la colonne\n if ($grid[$xIndex][$columnIndex] == $c)\n return (false);\n $columnIndex++;\n }\n $posY = floor($yIndex / 3) * 3; //verif la carré\n for ($i = 0; $i < 3; $i++)\n {\n $posX = floor($xIndex / 3) * 3; \n for($j = 0; $j < 3; $j++)\n {\n if ($grid[$posX][$posY] == $c && $posX != $xIndex && $posY != $yIndex)\n return false;\n $posX++;\n }\n $posY++;\n }\n return (true);\n}", "function getTurn ($board_num) {\n //get database info on player turn and player user ids\n $result = selectDB(\"SELECT PLAYERX, PLAYERO, TURN FROM BOARD WHERE BOARD_NUM='$board_num'\");\n\n //separate results into variables\n $playerx = $result['PLAYERX'];\n $playero = $result['PLAYERO'];\n $turnUser = $result['TURN'];\n \n //return 0 or 1\n if (strcmp($playerx, $turnUser) == 0) {\n return 0; //playerx's turn\n }\n else if (strcmp($playero, $turnUser) == 0) {\n return 1; //playero's turn\n }\n}", "function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\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$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function isDraw()\n {\n return !$this->hasAvailableMoves() &&\n !$this->isWinner('X') &&\n !$this->isWinner('O');\n }", "public function nextMove($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n $playerUnit = ($playerUnit == 'X') ? 'O' : 'X';\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n $column = array_column($this->ticTacToeBoard, $i);\n\n $rowSum = 0;\n\n foreach ($this->ticTacToeBoard[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n\n if ($columnSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if ($this->ticTacToeBoard[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->ticTacToeBoard[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n\n if ($rightDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n for ($j = 0; $j <= $this->maxIndex; $j++) {\n if ($block && $this->ticTacToeBoard[$i][$j] == $playerUnit) {\n $coordinates = $this->getFirstEmptyAdjscentElement($i, $j);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->nextMove($playerUnit, true);\n }\n return false;\n }", "private function enablesDoubleQwirkle(Move $move, Board $board) {\n foreach ($move->lines($board) as $line) {\n if ($line->length() === count(Color::colors()) - 2) {\n $missingPieces = $this->missingPieces($line);\n if ($this->notAccountedFor($missingPieces[0], $board)\n && $this->notAccountedFor($missingPieces[1], $board)) {\n return true;\n }\n }\n }\n return false;\n }", "protected function isValidMove($move = NULL) {\n $hasValidMove = FALSE;\n if (isset($move)) {\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n } else {\n while (TRUE) {\n $move = strtoupper($this->userInput());\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n }\n }\n }", "public function testVerifyToNotWin()\n {\n\n $match = $this->createMatch();\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n $winner = new Winner();\n $winner->verify($match, 0, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(0, $matchFound->winner);\n\n }", "abstract public function hasAvailableMoves(): bool;", "function checkDiagonal($posW, $posB)\n{\n\t$xdiff = abs($posW[0] - $posB[0]);\n\t$ydiff = abs($posW[1] - $posB[1]);\n\tif ($xdiff == $ydiff)\n\t{\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "private function enablesQwirkle(Move $move, Board $board) {\n foreach ($move->lines($board) as $line) {\n if ($line->length() === count(Color::colors()) - 1) {\n $missingPiece = $this->missingPieces($line)[0];\n if ($this->notAccountedFor($missingPiece, $board)) {\n return true;\n }\n }\n }\n return false;\n }", "private function findBigLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\t// Top\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[3][-1]->hasMarble &&\n\t\t\t\t$this->board[3][0]->hasMarble &&\n\t\t\t\t$this->board[3][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Left\n\t\t\t\tif(\t$this->board[2][-1]->hasMarble &&\n\t\t\t\t\t$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[0][-1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[1][-2]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -2);\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$moves[0][] = array('left', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t$moves[0][] = array('left', 3, 1);\n\t\t\t\t\t$moves[0][] = array('up', 0, -1);\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -2);\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$moves[0][] = array('left', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Right\n\t\t\t\tif(\t$this->board[2][1]->hasMarble &&\n\t\t\t\t\t$this->board[1][1]->hasMarble &&\n\t\t\t\t\t$this->board[0][1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[1][2]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 2);\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$moves[1][] = array('right', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t$moves[1][] = array('right', 3, -1);\n\t\t\t\t\t$moves[1][] = array('up', 0, 1);\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 2);\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$moves[1][] = array('right', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Down\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[-3][-1]->hasMarble &&\n\t\t\t\t$this->board[-3][0]->hasMarble &&\n\t\t\t\t$this->board[-3][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Left\n\t\t\t\tif(\t$this->board[-2][-1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[0][-1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-1][-2]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('right', -1, -2);\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$moves[2][] = array('left', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[2][] = array('up', -3, -1);\n\t\t\t\t\t$moves[2][] = array('left', -3, 1);\n\t\t\t\t\t$moves[2][] = array('down', 0, -1);\n\t\t\t\t\t$moves[2][] = array('up', -3, -1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('right', -1, -2);\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$moves[2][] = array('left', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Right\n\t\t\t\tif(\t$this->board[-2][1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t$this->board[0][1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-1][2]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('left', -1, 2);\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$moves[3][] = array('right', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[3][] = array('up', -3, 1);\n\t\t\t\t\t$moves[3][] = array('right', -3, -1);\n\t\t\t\t\t$moves[3][] = array('down', 0, 1);\n\t\t\t\t\t$moves[3][] = array('up', -3, 1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('left', -1, 2);\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$moves[3][] = array('right', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Left\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][-3]->hasMarble &&\n\t\t\t\t$this->board[0][-3]->hasMarble &&\n\t\t\t\t$this->board[-1][-3]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Up\n\t\t\t\tif(\t$this->board[1][-2]->hasMarble &&\n\t\t\t\t\t$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[2][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('up', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[4][] = array('right', 1, -3);\n\t\t\t\t\t$moves[4][] = array('up', -1, -3);\n\t\t\t\t\t$moves[4][] = array('left', 1, 0);\n\t\t\t\t\t$moves[4][] = array('right', 1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('up', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Down\n\t\t\t\tif(\t$this->board[-1][-2]->hasMarble &&\n\t\t\t\t\t$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-2][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('up', -2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('down', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[5][] = array('right', -1, -3);\n\t\t\t\t\t$moves[5][] = array('down', 1, -3);\n\t\t\t\t\t$moves[5][] = array('left', 1, 0);\n\t\t\t\t\t$moves[5][] = array('right', -1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('up', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('down', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Right\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][3]->hasMarble &&\n\t\t\t\t$this->board[0][3]->hasMarble &&\n\t\t\t\t$this->board[-1][3]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Up\n\t\t\t\tif(\t$this->board[1][2]->hasMarble &&\n\t\t\t\t\t$this->board[1][1]->hasMarble &&\n\t\t\t\t\t$this->board[1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[2][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[6][] = array('left', 1, 3);\n\t\t\t\t\t$moves[6][] = array('up', -1, 3);\n\t\t\t\t\t$moves[6][] = array('right', 1, 0);\n\t\t\t\t\t$moves[6][] = array('left', 1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Down\n\t\t\t\tif(\t$this->board[-1][2]->hasMarble &&\n\t\t\t\t\t$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-2][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('down', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[7][] = array('left', -1, 3);\n\t\t\t\t\t$moves[7][] = array('down', 1, 3);\n\t\t\t\t\t$moves[7][] = array('right', -1, 0);\n\t\t\t\t\t$moves[7][] = array('left', -1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('down', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\treturn $moves;\n\t}", "abstract protected function winnerExists();", "function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }", "private function getMovePosition(Board $board)\r\n {\r\n $position = null;\r\n\r\n// todo\r\n for($i=0;$i<Board::ROWS;$i++)\r\n {\r\n if(!($board->hasPieceAtPosition($i, 0)) && $board->getPieceAtPosition($i, 1)==self::PIECE && $board->getPieceAtPosition($i, 2)== self::PIECE)\r\n {\r\n $position=[$i,0];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 1)) && $board->getPieceAtPosition($i, 0)==self::PIECE && $board->getPieceAtPosition($i, 2)== self::PIECE)\r\n {\r\n $position=[$i,1];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 2)) && $board->getPieceAtPosition($i, 0)==self::PIECE && $board->getPieceAtPosition($i, 1)== self::PIECE)\r\n {\r\n $position=[$i,2];\r\n }\r\n }\r\n for($j=0;$j<Board::COLUMNS;$j++)\r\n {\r\n if(!($board->hasPieceAtPosition(0, $j)) && $board->getPieceAtPosition(1, $j)==self::PIECE && $board->getPieceAtPosition(2, $j)== self::PIECE)\r\n {\r\n $position=[0,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(1, $j)) && $board->getPieceAtPosition(0, $j)==self::PIECE && $board->getPieceAtPosition(2, $j)== self::PIECE)\r\n {\r\n $position=[1,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, $j)) && $board->getPieceAtPosition(0, $j)==self::PIECE && $board->getPieceAtPosition(1, $j)== self::PIECE)\r\n {\r\n $position=[2,$j];\r\n }\r\n }\r\n if($board->getPieceAtPosition(1, 1)==self::PIECE)\r\n {\r\n if(!($board->hasPieceAtPosition(0, 0)) && $board->getPieceAtPosition(2, 2)==self::PIECE)\r\n {\r\n $position = [0,0];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 2)) && $board->getPieceAtPosition(0, 0)==self::PIECE)\r\n {\r\n $position = [2,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(0, 2)) && $board->getPieceAtPosition(2, 0)==self::PIECE)\r\n {\r\n $position = [0,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 0)) && $board->getPieceAtPosition(0, 2)==self::PIECE)\r\n {\r\n $position = [2,0];\r\n }\r\n }\r\n\r\n# 2. Or place a piece that prevents the player from winning. \r\n if(is_null($position))\r\n {\r\n for($i=0;$i<Board::ROWS;$i++)\r\n {\r\n if(!($board->hasPieceAtPosition($i, 0)) && ($board->getPieceAtPosition($i, 1)==self::BADPIECE) && ($board->getPieceAtPosition($i, 2)== self::BADPIECE))\r\n {\r\n $position=[$i,0];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 1)) && ($board->getPieceAtPosition($i, 0)==self::BADPIECE) && ($board->getPieceAtPosition($i, 2)== self::BADPIECE))\r\n {\r\n $position=[$i,1];\r\n }\r\n else if(!($board->hasPieceAtPosition($i, 2)) && ($board->getPieceAtPosition($i, 0)==self::BADPIECE) && ($board->getPieceAtPosition($i, 1)== self::BADPIECE))\r\n {\r\n $position=[$i,2];\r\n }\r\n }\r\n for($j=0;$j<Board::COLUMNS;$j++)\r\n {\r\n if(!($board->hasPieceAtPosition(0, $j)) && ($board->getPieceAtPosition(1, $j)==self::BADPIECE) && ($board->getPieceAtPosition(2, $j)== self::BADPIECE))\r\n {\r\n $position=[0,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(1, $j)) && ($board->getPieceAtPosition(0, $j)==self::BADPIECE) && ($board->getPieceAtPosition(2, $j)== self::BADPIECE))\r\n {\r\n $position=[1,$j];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, $j)) && ($board->getPieceAtPosition(0, $j)==self::BADPIECE) && ($board->getPieceAtPosition(1, $j))== self::BADPIECE)\r\n {\r\n $position=[2,$j];\r\n }\r\n }\r\n\r\n if($board->getPieceAtPosition(1, 1)==self::BADPIECE)\r\n {\r\n if(!($board->hasPieceAtPosition(0, 0)) && $board->getPieceAtPosition(2, 2)==self::BADPIECE)\r\n {\r\n $position = [0,0];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 2)) && $board->getPieceAtPosition(0, 0)==self::BADPIECE)\r\n {\r\n $position = [2,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(0, 2)) && $board->getPieceAtPosition(2, 0)==self::BADPIECE)\r\n {\r\n $position = [0,2];\r\n }\r\n else if(!($board->hasPieceAtPosition(2, 0)) && $board->getPieceAtPosition(0, 2)==self::BADPIECE)\r\n {\r\n $position = [2,0];\r\n }\r\n }\r\n }\r\n\r\n if(is_null($position))\r\n {\r\n $blankpositions=$board->getBlankPositions();\r\n $numberpositions = count($board->getBlankPositions());\r\n $chooseposition = rand(1,$numberpositions);\r\n $position = $blankpositions[$chooseposition - 1];\r\n }\r\n\r\n return $position;\r\n }", "public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }", "function checkForSpecialAchievements($player_id, $wonder_included) {\n $achievements_to_test = $wonder_included ? array(105, 106, 107, 108, 109) : array(105, 106, 108, 109);\n $end_of_game = false;\n \n \n foreach ($achievements_to_test as $achievement_id) {\n $achievement = self::getCardInfo($achievement_id);\n if ($achievement['owner'] != 0) { // Somebody has already claimed that achievement\n // So it's not claimable anymore\n continue;\n }\n \n switch ($achievement_id) {\n case 105: // Empire: three or more icons of all six types\n $eligible = true;\n $ressource_counts = self::getPlayerRessourceCounts($player_id);\n foreach ($ressource_counts as $icon => $count) {\n if ($count < 3) { // There are less than 3 icons\n $eligible = false;\n break;\n }\n }\n break;\n case 106: // Monument: tuck 6 cards or score 6 cards\n $flags = self::getFlagsForMonument($player_id);\n $eligible = $flags['number_of_tucked_cards'] >= 6 || $flags['number_of_scored_cards'] >= 6;\n break;\n case 107: // Wonder: 5 colors, each being splayed right or up\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) < 2) { // This color is missing, unsplayed or splayed left\n $eligible = false;\n };\n }\n break;\n case 108: // World: 12 or more visible clocks (icon 6) on the board \n $eligible = self::getPlayerSingleRessourceCount($player_id, 6) >= 12;\n break;\n case 109: // Universe: Five top cards, each being of value 8 or more\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card === null || $top_card['age'] < 8) { // This color is missing or its top card has value less than 8\n $eligible = false;\n }\n }\n break;\n default:\n break;\n }\n \n if ($eligible) { // The player meet the conditions to achieve\n try {\n self::transferCardFromTo($achievement, $player_id, 'achievements');\n }\n catch (EndOfGame $e) { // End of game has been detected\n self::trace('EOG bubbled but suspended from self::checkForSpecialAchievements');\n $end_of_game = true;\n continue; // But the other achievements must be checked as well before ending\n }\n }\n }\n // All special achievements have been checked\n if ($end_of_game) { // End of game has been detected\n self::trace('EOG bubbled from self::checkForSpecialAchievements');\n throw $e; // Re-throw the flag\n }\n }", "private function checkWiningRowColumn($playerUnit, $row = false, $checkRowColumn = false)\n {\n /**\n * check row/column winning for player unit\n */\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n //get array of row/column\n $array = ($row === true) ? $this->ticTacToeBoard[$i] : array_column($this->ticTacToeBoard, $i);\n\n $row_column = array_filter($array, function ($val) use ($playerUnit) {\n return ($val === $playerUnit);\n });\n\n if ($checkRowColumn === true && count($row_column) == $this->maxIndex) {\n return [true, $i];\n }\n if (count($row_column) == $this->boardSize) {\n return true;\n }\n }\n }", "public function checkIfOpponentIsFinishedWithPlacement($matchID, $userID)\n {\n $sql = new Sql($this->dbAdapter);\n \n //Check if Opponent has inserted Ships into the Table\n $where = new \\Zend\\Db\\Sql\\Where();\n $where\n ->nest()\n ->notEqualTo('tblshipposition.spUserID', $userID)\n ->and\n ->equalTo('tblshipposition.spMatchID', $matchID)\n ->unnest();\n $select = $sql->select('tblshipposition')\n ->where($where); \n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute(); \n \n //If I got affected Rows he has inserted so the Match can start\n if ($result->getAffectedRows() > 0)\n {\n return array('OpponentReady' => true,\n 'OpponentWon' => false);\n }\n //Else you should wait\n return array('OpponentReady' => false,\n 'OpponentWon' => false);\n }", "private function mapDiagonal()\n {\n //plot out diagnal cells above\n if (!is_null($this->rowsAboveMe)) {\n $this->rowsAboveMe = array_reverse($this->rowsAboveMe);\n $counter = 1;\n foreach ($this->rowsAboveMe as $row) {\n if ($this->inRowRange((($this->cellNum + ($this->boardWidth * ($row - $this->myRowNum))) + $counter), $row)) {\n $this->disabledCells[] = (($this->cellNum + ($this->boardWidth * ($row - $this->myRowNum))) + $counter);\n }\n\n if ($this->inRowRange((($this->cellNum + ($this->boardWidth * ($row - $this->myRowNum))) + ($counter * -1)), $row)) {\n $this->disabledCells[] = (($this->cellNum + ($this->boardWidth * ($row - $this->myRowNum))) + ($counter * -1));\n }\n $counter++;\n }\n }\n\n //plot out diagnal cells below\n if (!is_null($this->rowsBelowMe)) {\n $counter = 1;\n foreach ($this->rowsBelowMe as $row) {\n if ($this->inRowRange((($this->cellNum + ($this->boardWidth * ($row - $this->myRowNum))) + $counter), $row)) {\n $this->disabledCells[] = (($this->cellNum + ($this->boardWidth * ($row - $this->myRowNum))) + $counter);\n }\n\n if ($this->inRowRange((($this->cellNum + ($this->boardWidth * ($row - $this->myRowNum))) + ($counter * -1)), $row)) {\n $this->disabledCells[] = (($this->cellNum + ($this->boardWidth * ($row - $this->myRowNum))) + ($counter * -1));\n }\n\n $counter++;\n }\n }\n }", "function mustDrawAStarInO($i, $j, $nrLin, $nrCol) {\r\n if ($i == 1 && $j != 1 && $j != $nrCol) {\r\n return true;\r\n }\r\n\r\n if ($i == $nrLin && $j != 1 && $j != $nrCol) {\r\n return true;\r\n }\r\n\r\n if ($j == 1 && $i != 1 && $i != $nrLin) {\r\n return true;\r\n }\r\n\r\n if ($j == $nrCol && $i != 1 && $i != $nrLin) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "public function findOpenSquares(Position $position, $exclude = null, $directions = ['n', 'e', 's', 'w'], $safe = [ 'S', 'O', 'X']) {\n $exits = [];\n foreach ($directions as $key => $method) {\n $valid = $this->$method($position->x, $position->y);\n\n if (is_array($exclude)) {\n if (array_search($valid, $exclude) !== false) {\n continue;\n }\n }\n\n if ($valid && array_search($position->value, $safe) !== false) {\n $exits[] = $valid;\n }\n }\n return $exits;\n }", "private function decideVictory()\n {\n echo 'Jugador ';\n if (!$this->human->isOver() &&\n (\n ($this->human->getPoints() == $this->machine->getPoints() && $this->human->getPoints() != PLAYER_WIN_POINTS)\n || $this->human->getPoints() > $this->machine->getPoints()\n || $this->machine->isOver()\n )\n ) echo 'Humano';\n else echo 'Máquina';\n echo ' gana la partida. ';\n }", "public function moveCell($cellToMove){\n // same row\n $cells = $_SESSION['GameView::cellNumbers'];\n $empty = 0;\n for ($i=0;$i<16;$i++){\n if ($_SESSION['GameView::cellNumbers'][$i] == 0){\n \n $empty = $i;\n }\n } \n \n $sameRow = false;\n $sameColumn = false;\n $neighbour = false;\n if (floor($cellToMove / 4) == floor($empty / 4)){\n $sameRow = true;\n if (($cellToMove + 1 == $empty) || ($empty + 1 == $cellToMove)){\n $neighbour = true;\n }\n }\n \n // check if directly above or below\n if ((($cellToMove + 4) == $empty) || (($empty + 4) == $cellToMove)){\n $neighbour = true;\n }\n \n if ($neighbour){\n // switch place\n $_SESSION['GameView::moves'] += 1;\n $temp = $cells[$cellToMove];\n $_SESSION['GameView::cellNumbers'][$cellToMove] = 0;\n $_SESSION['GameView::cellNumbers'][$empty] = $temp;\n\n }\n \n return $neighbour;\n \n }", "function CheckTurn($n)\r\n {\r\n $turn_1=CheckSquare(5 * $n * $n + 4);\r\n $turn_2=CheckSquare(5 * $n * $n - 4);\r\n //check if any of the value was already \r\n if($turn_1||$turn_2)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }", "protected function thinkBot() {\n $cellReturn = '';\n $markers = array($this->_botMark, $this->_userMark); //offense first, then defense\n while ($this->isValidMove($cellReturn) === FALSE) {\n //defense and offense\n foreach ($markers AS $marker) {\n foreach ($this->_winningCombination AS $cells) {\n $lineCells = explode(\",\", $cells); //separate the winning combination to 3\n $marked = 0;\n $noMark = 0;\n for ($x = 0; $x < 3; $x++) {\n if (in_array($lineCells[$x], $this->_markers[$marker]))\n $marked++;\n else\n $noMark = $lineCells[$x];\n }\n if ($marked == 2 && $this->isValidMove($noMark)) {\n $cellReturn = $noMark;\n break;\n }\n }\n if ($cellReturn != '')\n break;\n }\n //plan\n if ($cellReturn == '') {\n while (!$this->isValidMove($cellReturn)) {\n $combinationRandKey = rand(0, 7);\n //separate the winning combination to 3 elements\n $lineCells = explode(\",\", $this->_winningCombination[$combinationRandKey]);\n if ($this->isValidMove($lineCells[0]))\n $cellReturn = $lineCells[0];\n elseif ($this->isValidMove($lineCells[1]))\n $cellReturn = $lineCells[1];\n else\n $cellReturn = $lineCells[2];\n }\n }\n }\n return $cellReturn;\n }", "private function movement_check($data) {\n if ($this->SQL->GetPlayerData(Session::get('PlayerGUID'))->AP == 0){\n $data['location_err'] = true;\n }\n // Get Player Gameboard location\n $location = $this->SQL->GetPlayerLocation(Session::get('PlayerGUID'));\n // Look up Gameboard data\n $MapData = $this->SQL->GetMap($location->ID);\n // Check if desired destination is in GetMap (stop teleportation)\n $isTooFar = true;\n foreach ($MapData as $value) {\n if ($value->ID == $data['location']){$isTooFar = false;}\n }\n // Set error flag if an error was found\n $data['HAS_ERRORS'] = true;\n if (\n empty($data['location_err']) &&\n $isTooFar == false\n ) {\n $data['HAS_ERRORS'] = false;\n }\n // Return to the controller\n return($data);\n }", "abstract public function winner();", "private function findRectangleMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\t// Top Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[3][-1]->hasMarble &&\n\t\t\t\t$this->board[3][0]->hasMarble &&\n\t\t\t\t$this->board[3][1]->hasMarble &&\n\t\t\t\t$this->board[2][-1]->hasMarble &&\n\t\t\t\t$this->board[2][0]->hasMarble &&\n\t\t\t\t$this->board[2][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[1][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t$moves[0][] = array('down', 3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('down', 3, 1);\n\t\t\t\t\t\t$moves[0][] = array('up', 0, 1);\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -1);\n\t\t\t\t\t\t$moves[0][] = array('down', 2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('down', 2, 1);\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -1);\n\t\t\t\t\t\t$moves[0][] = array('up', 0, 1);\n\t\t\t\t\t\t$moves[0][] = array('down', 3, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[1][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t$moves[1][] = array('down', 3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('down', 3, -1);\n\t\t\t\t\t\t$moves[1][] = array('up', 0, -1);\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 1);\n\t\t\t\t\t\t$moves[1][] = array('down', 2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('down', 2, -1);\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 1);\n\t\t\t\t\t\t$moves[1][] = array('up', 0, -1);\n\t\t\t\t\t\t$moves[1][] = array('down', 3, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble && !$this->board[1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[2][] = array('down', 3, -1);\n\t\t\t\t\t$moves[2][] = array('left', 1, 0);\n\t\t\t\t\t$moves[2][] = array('left', 3, 1);\n\t\t\t\t\t$moves[2][] = array('left', 2, 1);\n\t\t\t\t\t$moves[2][] = array('down', 3, -1);\n\t\t\t\t\t$moves[2][] = array('right', 1, -2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[1][0]->hasMarble && !$this->board[1][-1]->hasMarble && $this->board[1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[3][] = array('down', 3, -1);\n\t\t\t\t\t$moves[3][] = array('right', 1, -2);\n\t\t\t\t\t$moves[3][] = array('left', 3, 1);\n\t\t\t\t\t$moves[3][] = array('left', 2, 1);\n\t\t\t\t\t$moves[3][] = array('down', 3, -1);\n\t\t\t\t\t$moves[3][] = array('left', 1, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble && !$this->board[1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[4][] = array('down', 3, 1);\n\t\t\t\t\t$moves[4][] = array('right', 1, 0);\n\t\t\t\t\t$moves[4][] = array('right', 3, -1);\n\t\t\t\t\t$moves[4][] = array('right', 2, -1);\n\t\t\t\t\t$moves[4][] = array('down', 3, 1);\n\t\t\t\t\t$moves[4][] = array('left', 1, 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble && $this->board[1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[5][] = array('down', 3, 1);\n\t\t\t\t\t$moves[5][] = array('left', 1, 2);\n\t\t\t\t\t$moves[5][] = array('right', 3, -1);\n\t\t\t\t\t$moves[5][] = array('right', 2, -1);\n\t\t\t\t\t$moves[5][] = array('down', 3, 1);\n\t\t\t\t\t$moves[5][] = array('right', 1, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Down Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[-3][-1]->hasMarble &&\n\t\t\t\t$this->board[-3][0]->hasMarble &&\n\t\t\t\t$this->board[-3][1]->hasMarble &&\n\t\t\t\t$this->board[-2][-1]->hasMarble &&\n\t\t\t\t$this->board[-2][0]->hasMarble &&\n\t\t\t\t$this->board[-2][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[-1][0]->hasMarble && !$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[6][] = array('up', -3, -1);\n\t\t\t\t\t$moves[6][] = array('up', -3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', -3, 1);\n\t\t\t\t\t\t$moves[6][] = array('down', 0, 1);\n\t\t\t\t\t\t$moves[6][] = array('right', -1, -1);\n\t\t\t\t\t\t$moves[6][] = array('up', -2, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('up', -2, 1);\n\t\t\t\t\t\t$moves[6][] = array('right', -1, -1);\n\t\t\t\t\t\t$moves[6][] = array('down', 0, 1);\n\t\t\t\t\t\t$moves[6][] = array('up', -3, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[1][0]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[7][] = array('up', -3, 1);\n\t\t\t\t\t$moves[7][] = array('up', -3, 0);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -3, -1);\n\t\t\t\t\t\t$moves[7][] = array('down', 0, -1);\n\t\t\t\t\t\t$moves[7][] = array('left', -1, 1);\n\t\t\t\t\t\t$moves[7][] = array('up', -2, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, -1);\n\t\t\t\t\t\t$moves[7][] = array('left', -1, 1);\n\t\t\t\t\t\t$moves[7][] = array('down', 0, -1);\n\t\t\t\t\t\t$moves[7][] = array('up', -3, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[8] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[8][] = array('up', -3, -1);\n\t\t\t\t\t$moves[8][] = array('left', -1, 0);\n\t\t\t\t\t$moves[8][] = array('left', -3, 1);\n\t\t\t\t\t$moves[8][] = array('left', -2, 1);\n\t\t\t\t\t$moves[8][] = array('up', -3, -1);\n\t\t\t\t\t$moves[8][] = array('right', -1, -2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-1][-2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[9] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[9][] = array('up', -3, -1);\n\t\t\t\t\t$moves[9][] = array('right', -1, -2);\n\t\t\t\t\t$moves[9][] = array('left', -3, 1);\n\t\t\t\t\t$moves[9][] = array('left', -2, 1);\n\t\t\t\t\t$moves[9][] = array('up', -3, -1);\n\t\t\t\t\t$moves[9][] = array('left', -1, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[10] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[10][] = array('up', -3, 1);\n\t\t\t\t\t$moves[10][] = array('right', -1, 0);\n\t\t\t\t\t$moves[10][] = array('right', -3, -1);\n\t\t\t\t\t$moves[10][] = array('right', -2, -1);\n\t\t\t\t\t$moves[10][] = array('up', -3, 1);\n\t\t\t\t\t$moves[10][] = array('left', -1, 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[-1][0]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-1][2]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[11] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[11][] = array('up', -3, 1);\n\t\t\t\t\t$moves[11][] = array('left', -1, 2);\n\t\t\t\t\t$moves[11][] = array('right', -3, -1);\n\t\t\t\t\t$moves[11][] = array('right', -2, -1);\n\t\t\t\t\t$moves[11][] = array('up', -3, 1);\n\t\t\t\t\t$moves[11][] = array('right', -1, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Left Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][-3]->hasMarble &&\n\t\t\t\t$this->board[1][-2]->hasMarble &&\n\t\t\t\t$this->board[0][-3]->hasMarble &&\n\t\t\t\t$this->board[0][-2]->hasMarble &&\n\t\t\t\t$this->board[-1][-3]->hasMarble &&\n\t\t\t\t$this->board[-1][-2]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[1][-1]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][-1]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[12] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[12][] = array('right', 0, -3);\n\t\t\t\t\t$moves[12][] = array('right', -1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -3);\n\t\t\t\t\t\t$moves[12][] = array('left', 1, 0);\n\t\t\t\t\t\t$moves[12][] = array('up', -1, -1);\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -2);\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$moves[12][] = array('right', 1, -2);\n\t\t\t\t\t\t$moves[12][] = array('up', -1, -1);\n\t\t\t\t\t\t$moves[12][] = array('left', 1, 0);\n\t\t\t\t\t\t$moves[12][] = array('right', 1, -3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][-1]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][-1]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[13] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[13][] = array('right', 0, -3);\n\t\t\t\t\t$moves[13][] = array('right', 1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -3);\n\t\t\t\t\t\t$moves[13][] = array('left', -1, 0);\n\t\t\t\t\t\t$moves[13][] = array('down', 1, -1);\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -2);\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$moves[13][] = array('right', -1, -2);\n\t\t\t\t\t\t$moves[13][] = array('down', 1, -1);\n\t\t\t\t\t\t$moves[13][] = array('left', -1, 0);\n\t\t\t\t\t\t$moves[13][] = array('right', -1, -3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble && !$this->board[2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[14] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[14][] = array('right', 1, -3);\n\t\t\t\t\t$moves[14][] = array('up', 0, -1);\n\t\t\t\t\t$moves[14][] = array('up', -1, -3);\n\t\t\t\t\t$moves[14][] = array('up', -1, -2);\n\t\t\t\t\t$moves[14][] = array('right', 1, -3);\n\t\t\t\t\t$moves[14][] = array('down', 2, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][-1]->hasMarble && !$this->board[1][-1]->hasMarble && $this->board[2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[15] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[15][] = array('right', 1, -3);\n\t\t\t\t\t$moves[15][] = array('down', 2, -1);\n\t\t\t\t\t$moves[15][] = array('up', -1, -3);\n\t\t\t\t\t$moves[15][] = array('up', -1, -2);\n\t\t\t\t\t$moves[15][] = array('right', 1, -3);\n\t\t\t\t\t$moves[15][] = array('up', 0, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble && !$this->board[-2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[16] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[16][] = array('right', -1, -3);\n\t\t\t\t\t$moves[16][] = array('down', 0, -1);\n\t\t\t\t\t$moves[16][] = array('down', 1, -3);\n\t\t\t\t\t$moves[16][] = array('down', 1, -2);\n\t\t\t\t\t$moves[16][] = array('right', -1, -3);\n\t\t\t\t\t$moves[16][] = array('up', -2, -1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][-1]->hasMarble && !$this->board[-1][-1]->hasMarble && $this->board[-2][-1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[17] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[17][] = array('right', -1, -3);\n\t\t\t\t\t$moves[17][] = array('up', -2, -1);\n\t\t\t\t\t$moves[17][] = array('down', 1, -3);\n\t\t\t\t\t$moves[17][] = array('down', 1, -2);\n\t\t\t\t\t$moves[17][] = array('right', -1, -3);\n\t\t\t\t\t$moves[17][] = array('down', 0, -1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Right Area\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][3]->hasMarble &&\n\t\t\t\t$this->board[1][2]->hasMarble &&\n\t\t\t\t$this->board[0][3]->hasMarble &&\n\t\t\t\t$this->board[0][2]->hasMarble &&\n\t\t\t\t$this->board[-1][3]->hasMarble &&\n\t\t\t\t$this->board[-1][2]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t($this->board[1][1]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[1][1]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[18] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[18][] = array('left', 0, 3);\n\t\t\t\t\t$moves[18][] = array('left', -1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 3);\n\t\t\t\t\t\t$moves[18][] = array('right', 1, 0);\n\t\t\t\t\t\t$moves[18][] = array('up', -1, 1);\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 2);\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$moves[18][] = array('left', 1, 2);\n\t\t\t\t\t\t$moves[18][] = array('up', -1, 1);\n\t\t\t\t\t\t$moves[18][] = array('right', 1, 0);\n\t\t\t\t\t\t$moves[18][] = array('left', 1, 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t!$this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble &&\n\t\t\t\t\t($this->board[-1][1]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t(!$this->board[-1][1]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[19] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[19][] = array('left', 0, 3);\n\t\t\t\t\t$moves[19][] = array('left', 1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this->board[-1][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 3);\n\t\t\t\t\t\t$moves[19][] = array('right', -1, 0);\n\t\t\t\t\t\t$moves[19][] = array('down', 1, 1);\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 2);\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$moves[19][] = array('left', -1, 2);\n\t\t\t\t\t\t$moves[19][] = array('down', 1, 1);\n\t\t\t\t\t\t$moves[19][] = array('right', -1, 0);\n\t\t\t\t\t\t$moves[19][] = array('left', -1, 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble && !$this->board[2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[20] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[20][] = array('left', 1, 3);\n\t\t\t\t\t$moves[20][] = array('up', 0, 1);\n\t\t\t\t\t$moves[20][] = array('up', -1, 3);\n\t\t\t\t\t$moves[20][] = array('up', -1, 2);\n\t\t\t\t\t$moves[20][] = array('left', 1, 3);\n\t\t\t\t\t$moves[20][] = array('down', 2, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][1]->hasMarble && !$this->board[1][1]->hasMarble && $this->board[2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[21] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[21][] = array('left', 1, 3);\n\t\t\t\t\t$moves[21][] = array('down', 2, 1);\n\t\t\t\t\t$moves[21][] = array('up', -1, 3);\n\t\t\t\t\t$moves[21][] = array('up', -1, 2);\n\t\t\t\t\t$moves[21][] = array('left', 1, 3);\n\t\t\t\t\t$moves[21][] = array('up', 0, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble && !$this->board[-2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[22] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[22][] = array('left', -1, 3);\n\t\t\t\t\t$moves[22][] = array('down', 0, 1);\n\t\t\t\t\t$moves[22][] = array('down', 1, 3);\n\t\t\t\t\t$moves[22][] = array('down', 1, 2);\n\t\t\t\t\t$moves[22][] = array('left', -1, 3);\n\t\t\t\t\t$moves[22][] = array('up', -2, 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$this->board[0][1]->hasMarble && !$this->board[-1][1]->hasMarble && $this->board[-2][1]->hasMarble)\n\t\t\t\t{\n\t\t\t\t\t$moves[23] = array();\n\t\t\t\t\t\n\t\t\t\t\t$moves[23][] = array('left', -1, 3);\n\t\t\t\t\t$moves[23][] = array('up', -2, 1);\n\t\t\t\t\t$moves[23][] = array('down', 1, 3);\n\t\t\t\t\t$moves[23][] = array('down', 1, 2);\n\t\t\t\t\t$moves[23][] = array('left', -1, 3);\n\t\t\t\t\t$moves[23][] = array('down', 0, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\treturn $moves;\n\t}", "function mainDiagonal (array $arr, int $matrixSize) : bool{\n $start_i = 0; $start_j = 0;\n $i = $start_i; $j = $start_j;\n\n while ($start_i <= $matrixSize - 3){\n $prev = $arr[$i][$j]; //[0][0]\n $curr = $arr[$i+1][$j+1]; //[1][1]\n $next = $arr[$i+2][$j+2]; //[2][2]\n\n if ($prev === $curr && $prev === $next){\n return true;\n }else{\n $i++; $j++;\n }\n\n if ($i === $matrixSize){\n $start_i++;\n $i = $start_i;\n $j = $start_j;\n }\n }\n\n //Under main diagonal\n $start_i = 2; $start_j = $matrixSize - 1; $i = $start_i; $j = $start_j;\n\n while ($start_i <= $matrixSize-2){\n $prev = $arr[$i][$j]; //[0][0]\n $curr = $arr[$i-1][$j-1]; //[1][1]\n $next = $arr[$i-2][$j-2]; //[2][2]\n\n if ($prev === $curr && $prev === $next){\n return true;\n }else{\n $i--; $j--;\n }\n if ($i - 2 <= 0){\n $start_i++;\n $i = $start_i;\n $j = $start_j;\n }\n }\n return false;\n}", "protected function checkForWin($matchID, $userID)\n {\n $sql = new Sql($this->dbAdapter);\n \n $where = new \\Zend\\Db\\Sql\\Where();\n $where->nest()\n ->equalTo('tblmatchsteps.mUserID', $userID)\n ->and->equalTo('tblmatchsteps.mMatchID', $matchID)\n ->and->equalTo('tblmatchsteps.mState', 1)\n ->unnest();\n $select = $sql->select('tblmatchsteps')->columns(array('countState' => new Expression('COUNT(mState)')))\n ->where($where);\n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute();\n $count = $result->current();\n \n //If he hit 20 times\n if ($count[\"countState\"] == 20)\n {\n return true;\n }\n \n return false;\n \n }", "function drawChessBoard($x, $y){\n $flag = true; \n if($x <= 10 && $y <= 10 && $x >= 2 && $y >= 2){\n $sizeDiv = 80;\n $widthBlock = $x * $sizeDiv; \n $heightBlock = $y * $sizeDiv; \n $chessBoard = '<div class=\"displayChessBord\" style=\"height:' . $heightBlock . 'px; \n width:' . $widthBlock . 'px\">';\n for ($i = 0; $i < $y; $i++) { \n for ($r = 0; $r < $x; $r++) {\n if($flag){\n $chessBoard .= '<div class=\"black\"></div>';\n }else{\n $chessBoard .= '<div class=\"white\"></div>';\n }\n $flag = !$flag;\n }\n \n if($x % 2 == 0){\n $flag = !$flag;\n }\n }\n $chessBoard .= '</div>';\n }else{\n $chessBoard = '<span class=\"alertInfo\">Enter data according to the rules and format.</span';\n } \n\n return $chessBoard;\n }", "function buttons($instance, $owner, $doc, $dom) {\n\n $move = $dom->getElementsByTagName('currentMove');\n $currentPlayer = $move[0]->nodeValue;\n\n $sql = \"SELECT `USER`, `Move` FROM `TableCreatedBy_\" . $owner . \"`;\";\n $retval = $instance->sendRequest($sql);\n\n if ($_SESSION[\"user\"] === $currentPlayer) {\n while ($row = mysql_fetch_row($retval)) {\n if ($row[0] === $currentPlayer) {\n if ($row[1] === \"none\") {\n printCall($doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printPlayerButtons(\"Check\", \"Check\", \"checkFunction()\", $doc);\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n } else if ($row[1] !== \"fold\") {\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printCall($doc);\n }\n }\n }\n }\n}", "public function checkIfOpponentIsFinishedWithMatchStep($matchID, $userID)\n {\n $lastMSID = $this->getLastMatchStepID($userID, $matchID);\n $oppID = $this->getOpponentID($matchID, $userID);\n \n $sql = new Sql($this->dbAdapter);\n \n //Check if Opponent has inserted a MatchStep that is finished\n $where = new \\Zend\\Db\\Sql\\Where();\n $where\n ->nest()\n ->notEqualTo('tblmatchsteps.mUserID', $userID)\n ->and->equalTo('tblmatchsteps.mMatchID', $matchID)\n ->and->greaterThan('tblmatchsteps.msID', $lastMSID)\n ->and->equalTo('tblmatchsteps.mRoundFinished', 1)\n ->unnest();\n $select = $sql->select('tblmatchsteps')\n ->where($where); \n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute();\n //If I got affected Rows he has inserted so the Match can start\n if ($result->getAffectedRows() > 0)\n {\n\n if ($this->checkForWin($matchID, $oppID) == true)\n {\n $hits = $this->getAllHitShips($matchID, $oppID, $lastMSID);\n \n return array('OpponentReady' => true,\n 'OpponentWon' => true,\n 'Hits' => $hits);\n }\n \n $hits = $this->getAllHitShips($matchID, $oppID, $lastMSID);\n $miss = $this->getLastMiss($matchID, $oppID, $lastMSID);\n return array('OpponentReady' => true,\n 'OpponentWon' => false,\n 'Hits' => $hits,\n 'Miss' => $miss);\n }\n $hits = $this->getAllHitShips($matchID, $oppID, $lastMSID);\n $miss = $this->getLastMiss($matchID, $oppID, $lastMSID);\n \n if($miss[\"x\"] == null )\n {\n //Else you should wait\n return array('OpponentReady' => false,\n 'OpponentWon' => false,\n 'Hits' => $hits,\n 'Miss' => $miss);\n }\n //Else you should wait\n return array('OpponentReady' => true,\n 'OpponentWon' => false,\n 'Hits' => $hits,\n 'Miss' => $miss); \n }", "public function getConsideredMoves()\n {\n return $this->state->getValidMoves();\n }", "function getNumTurns($array) {\n \n $numTurns = 0;\n for ($i = 0; $i < 3; $i++) {\n for ($j = 0; $j < 3; $j++) {\n //if the position in the game array is not \"N\"\n if(strcmp($array[$i][$j], \"N\") != 0) {\n $numTurns++;\n }\n }\n }\n return $numTurns;\n}", "function SDpointsForGame ( $moves ) {\n\t//Output: A number between 0 -> 1 of how suspicious that game is\n\n\tglobal $SD_CONST_TRESHOLD, $SD_CONST_ADJ;\n\n\t$deviation = SDdeviation( $moves );\n\t$output = 0;\n\n\tif( $deviation < $SD_CONST_TRESHOLD ){\n\t\t/*\n\t\t\t\t\t| Threshold - Deviation |\n\t\toutput = \t|---------------------------------|\n\t\t\t\t\t| Threshold - Adjustment Variable |\n\n\t\tBasically takes the diviation over mean and returns a scaled value between 0 -> 1\n\n\t\t*/\n\t\t$adjustment = SDrange( SDmean( $moves ) );\n\t\t$output = pow( ( $SD_CONST_TRESHOLD - $deviation ) / ( $SD_CONST_TRESHOLD - $adjustment ), 2 );\n\t\t//echo \"$output = $SD_CONST_TRESHOLD - $deviation / $SD_CONST_TRESHOLD - $adjustment \\n\";\n\t}\n\n\treturn ( $output > 1 ) ? 1 : $output;\n}", "public function getColumnResultFor(string $playerUnit = 'O'): bool\n {\n return $this->winByColumn($playerUnit) !== false ?:\n $this->winByColumn(infer_opponent($playerUnit)) !== false;\n }", "public function checkForWin() \n\t{\n\n\t\t$score = array_intersect($this->phrase->selected, $this->phrase->getLetters());\n\n\t\tif (count($score) == count($this->phrase->getLetters())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function getStart($tab, $nbLigne, $nbChar){\n\n \n $z = 0;//check 0\n $u = 0;//check 1\n $add = 0;\n $err4 = \"Il manque un point de départ ou d'arrivée!\".PHP_EOL;\n\n $xd = 0;\n $yd = 0; //coord du point de départ\n\n $xa = 0;\n $ya = 0; //coord du point d'arrivée \n\n for ($j=0; $j<$nbLigne; $j++){ \n for ($i=0; $i<$nbChar; $i++){ \n \n if ($tab[$j][$i] === '0'){\n $z++;\n $z = $z++; // echo $z.' check 0'.PHP_EOL; \n //RECHERCHE DE COORDONNEES\n $xd = $i;// \n echo \"xd=\".($xd).\" \";\n $yd = $j;// \n echo \"yd=\".($yd).PHP_EOL;\n }\n if ($tab[$j][$i] === '1'){\n $u++;\n $u = $u++; // echo $u .' check 1'.PHP_EOL;\n //RECHERCHE DE COORDONNEES\n $xa = $i;//\n echo \"xa=\".($xa).\" \";\n $ya = $j;//\n echo \"ya=\".($ya).PHP_EOL; \n } \n }\n }\n\n if ($z === 1 && $u === 1){\n play($tab, $nbLigne, $nbChar, $xd, $yd, $xa, $ya); //echo \"the play can beggin\".PHP_EOL;\n }\n else\n exit($err4);\n}", "protected function reachedMaxMoves(){\r\n if($this->totalMoves == $this->board->getMaxMoves()){\r\n return true;\r\n }\r\n return false;\r\n }", "function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}", "private function set_card_visibility(&$move, $mode) {\n\t\t$iLastFrom = count($move['from']) - 1;\n\t\tif($iLastFrom >= 0) {\n\t\t\t$move['from'][$iLastFrom]->display = true;\n\t\t\t$this->currentScore += 20;\n\t\t}\n\t\t\n\t\t// La carte parente de l'emplacement de destination n'est plus visible si mouvement inversé\n\t\t$iLastTo = count($move['to']) - 2;\n\t\tif($iLastTo >= 0 && $mode == 'reverse') {\n\t\t\t$move['to'][$iLastTo]->display = false;\n\t\t\t$this->currentScore -= 20;\n\t\t}\n\t}", "function change_direction($current_dir,$turn){\r\n\tglobal $NORTH,$SOUTH,$EAST,$WEST;\r\n\t\r\n\tif($current_dir == $NORTH && $turn == \"L\"){\r\n\t\treturn $WEST;\r\n\t}\r\n\tif($current_dir == $NORTH && $turn == \"R\"){\r\n\t\treturn $EAST;\r\n\t}\r\n\t\r\n\tif($current_dir == $SOUTH && $turn == \"L\"){\r\n\t\treturn $EAST;\r\n\t}\r\n\tif($current_dir == $SOUTH && $turn == \"R\"){\r\n\t\treturn $WEST;\r\n\t}\r\n\t\r\n\tif($current_dir == $EAST && $turn == \"L\"){\r\n\t\treturn $NORTH;\r\n\t}\r\n\tif($current_dir == $EAST && $turn == \"R\"){\r\n\t\treturn $SOUTH;\r\n\t}\r\n\t\r\n\tif($current_dir == $WEST && $turn == \"L\"){\r\n\t\treturn $SOUTH;\r\n\t}\r\n\tif($current_dir == $WEST && $turn == \"R\"){\r\n\t\treturn $NORTH;\r\n\t}\r\n\t\r\n}", "function verificaJogoVelha($jogo){\n\t//valor 1 => jogador 1\n\t//valor 2 => jogador 2\n\t\n\tif($jogo[0] != 0){\n\t\t//primeira horizontal\n\t\tif($jogo[0] == $jogo[1] && $jogo[0] == $jogo[2]){\n\t\t\treturn $jogo[0];\n\t\t}\n\t\t//primeira vertical\n\t\telse if($jogo[0] == $jogo[3] && $jogo[0] == $jogo[6]){\n\t\t\treturn $jogo[0];\n\t\t}\n\t\t//primeira diagonal\n\t\telse if($jogo[0] == $jogo[4] && $jogo[0] == $jogo[8]){\n\t\t\treturn $jogo[0];\n\t\t}\n\t}\n\tif($jogo[2] != 0){\n\t\t//terceira vertical\n\t\tif($jogo[2] == $jogo[5] && $jogo[2] == $jogo[8]){\n\t\t\treturn $jogo[2];\n\t\t}\n\t\t//segunda diagonal\n\t\telse if($jogo[2] == $jogo[4] && $jogo[2] == $jogo[6]){\n\t\t\treturn $jogo[2];\n\t\t}\n\t}\n\tif($jogo[7] != 0){\n\t\t//terceira horizontal\n\t\tif($jogo[6] == $jogo[7] && $jogo[7] == $jogo[8]){\n\t\t\treturn $jogo[7];\n\t\t}\n\t\t//segunda vertical\n\t\telse if($jogo[1] == $jogo[7] && $jogo[4] == $jogo[7]){\n\t\t\treturn $jogo[7];\n\t\t}\n\t}\n\t//segunda horizontal\n\tif($jogo[3] != 0 && $jogo[3] == $jogo[4] && $jogo[3] == $jogo[5]){\n\t\treturn $jogo[3];\n\t}\n\t\n\tfor($i = 0; $i < 9; $i++){\n\t\tif($jogo[$i] == 0) break;\n\t}\n\t\n\tif($i == 9) return 'empate';\n\t\n\treturn false;\n}" ]
[ "0.6600075", "0.6290938", "0.62222743", "0.61987793", "0.6095502", "0.60868734", "0.5933043", "0.584326", "0.57317954", "0.5723613", "0.56872284", "0.56503785", "0.5627409", "0.5589535", "0.55676717", "0.55502504", "0.5538387", "0.5535532", "0.5506976", "0.54482555", "0.5431541", "0.54125214", "0.53979534", "0.53699183", "0.5362783", "0.5346643", "0.5328598", "0.53224474", "0.53185534", "0.53040487", "0.5292429", "0.52618587", "0.52368623", "0.5217092", "0.5205505", "0.51966715", "0.5189789", "0.5180505", "0.51769394", "0.51656705", "0.5161406", "0.51575816", "0.5155663", "0.511692", "0.50945735", "0.5043761", "0.5022372", "0.5022356", "0.4972503", "0.49714482", "0.49636823", "0.49288833", "0.49261165", "0.49229375", "0.49105653", "0.49008688", "0.48965228", "0.4868472", "0.48589766", "0.48559946", "0.4845202", "0.4827683", "0.4817236", "0.48102736", "0.47983968", "0.47970584", "0.47864026", "0.4781254", "0.4772684", "0.4755146", "0.47504234", "0.47449857", "0.47228253", "0.47134212", "0.47067577", "0.47041285", "0.47030175", "0.4698391", "0.46951503", "0.46946406", "0.4692605", "0.46838143", "0.46828642", "0.4653212", "0.46529058", "0.46320102", "0.46289003", "0.46271133", "0.46059552", "0.45986927", "0.45585388", "0.45453787", "0.4530437", "0.45273095", "0.4521348", "0.4514264", "0.4513103", "0.4506144", "0.44960392", "0.4495087" ]
0.7485393
0
Player Set current player
public function setCurrentPlayer($player){ $this->currentPlayer = $player; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPlayer(Player $player);", "public function setCurrentPlayer($player) {\n $this->game->set_current_turn($player);\n }", "public function switchActivePlayer()\n\t{\n\t\t$activeplayer = $this -> activePlayer;\n\t\t$playerX = $this -> playerX;\n\t\t$playerO = $this -> playerO;\n\t\tif ($activeplayer == $playerX)\n\t\t\t$this -> activePlayer = $playerO;\n\t\telse\n\t\t\t$this -> activePlayer = $playerX;\n\t\t\t\n\t\t$newactive = $this -> activePlayer;\n\t\t\n\t\t$query = \"UPDATE tttgame \n\t\t\t\t SET activeplayer = '$newactive' \n\t\t\t\t WHERE playerX = '$playerX' \n\t\t\t\t AND playerO = '$playerO';\";\n\t\t$this -> queryDB($query);\n\t}", "public function updatePlayer($player)\n\t{\n\t}", "protected function selectPlayer(){\r\n $this->currentPlayer = rand(1,2);\r\n selectRandPlayerMsg($this->currentPlayer);\r\n }", "private function initPlayer(): void\n {\n $name = $this->getConfig()->getPlayerName();\n $interaction = $this->getConfig()->getInteractionInterface();\n\n $this->player = PlayerFabric::createReal($this->pile, $name, $interaction);\n }", "public function ensurePlayerActive(Player $player, $value = null);", "public function onPlayerInteract(Player $player) : void {\n\t}", "public function setPlayer(Player $player)\n {\n $this->player = $player;\n\n return $this;\n }", "private function _changeActivePlayer()\n\t{\n\t\t// Get next player id, then save it to this game\n\t\t$this->read();\n\t\t$this->Player->id = $this->data['Game']['active_player'];\n\t\t$this->Player->read();\n\t\t$this->set('active_player', $this->Player->data['Player']['next_player_id']);\n\t\t$this->save();\n\t\t\n\t\t// Success\n\t\treturn true;\n\t}", "public function player(string $player)\n {\n $this->player = $player;\n\n return $this;\n }", "private function setMessageToPlayer()\n {\n if ($this->isUserMode()) {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng. Vill du vara med i tävlingen, spara poängen med den gröna knappen!\";\n } else {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng!\";\n }\n }", "public function switchPlayer(){\n\t\tfor($col = 0; $col < 3; $col++){\n\t\t\tfor($row = 0; $row < 3; $row++){\n\t\t\t\tif(isset($_GET[\"cell-\".$col.\"-\".$row])){\n\t\t\t\t\tif($this->player1->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player1;\n\t\t\t\t\t}\n\t\t\t\t\tif($this->player2->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->currentPlayer === $this->player1){\n\t\t\t$this->currentPlayer = $this->player2;\n\t\t} else {\n\t\t\t$this->currentPlayer = $this->player1;\n\t\t}\n\t}", "public function __construct(\\App\\Player $player)\n {\n $this->player = $player;\n }", "public function setNextPlayer($idPlayer)\n {\n if ($this->id_player6 == 0)\n {\n $this->id_player6 = $idPlayer;\n }\n else if ($this->id_player7 == 0)\n {\n $this->id_player7 = $idPlayer;\n }\n else if ($this->id_player8 == 0)\n {\n $this->id_player8 = $idPlayer;\n }\n else if ($this->id_player9 == 0)\n {\n $this->id_player9 = $idPlayer;\n }\n else if ($this->id_player10 == 0)\n {\n $this->id_player10 = $idPlayer;\n }\n else if ($this->id_player11 == 0)\n {\n $this->id_player11 = $idPlayer;\n }\n else if ($this->id_player12 == 0)\n {\n $this->id_player12 = $idPlayer;\n }\n else if ($this->id_player13 == 0)\n {\n $this->id_player13 = $idPlayer;\n }\n else if ($this->id_player14 == 0)\n {\n $this->id_player14 = $idPlayer;\n }\n else if ($this->id_player15 == 0)\n {\n $this->id_player15 = $idPlayer;\n }\n else if ($this->id_player16 == 0)\n {\n $this->id_player16 = $idPlayer;\n }\n else if ($this->id_player17 == 0)\n {\n $this->id_player17 = $idPlayer;\n }\n else if ($this->id_player18 == 0)\n {\n $this->id_player18 = $idPlayer;\n }\n else if ($this->id_player19 == 0)\n {\n $this->id_player19 = $idPlayer;\n }\n else if ($this->id_player20 == 0)\n {\n $this->id_player20 = $idPlayer;\n }\n return $this;\n }", "public function getPlayer()\n\t{\n\t\treturn $this->player;\n\t}", "public function getPlayer()\n {\n return $this->player;\n }", "public function getPlayer()\n {\n return $this->player;\n }", "public function getPlayer()\n {\n return $this->player;\n }", "public function registerPlayer(Player $player) {\r\n\r\n if($player->isSpectator() || \r\n\r\n (!is_null($this->getMain()->getServer()->getPluginManager()->getPlugin(\"SpectatorPlus\")) &&\r\n\r\n $this->getMain()->getServer()->getPluginManager()->getPlugin(\"SpectatorPlus\")->isSpectator($player))) { // Support for spectator Plus\r\n\r\n $this->spectators[$player->getName()] = $player;\r\n\r\n $player->HideAndSeekRole = self::ROLE_SPECTATE;\r\n\r\n } elseif($this->step == self::STEP_WAIT || $this->step == self::STEP_START) {$player->hideAndSeekGame = $this;\r\n\r\n // API inside player's class (easilier to get data)\r\n\r\n $player->HideAndSeekRole = self::ROLE_WAIT;\r\n\r\n $player->playsHideAndSeek = true;\r\n\r\n $this->players[$player->getName()] = $player;\r\n\r\n $player->setGamemode(2); // Set it to adventure so player cannot break blocks.\r\n\r\n $this->sendMessage(\"§a\" . $player->getName() . \" joined (\" . count($this->players) . \"/\" . $this->getMaxPlayers() . \"). \" . (round($this->getMaxPlayers() * 0.75) - count($this->players)) . \" players left before starting\");\r\n\r\n } else {\r\n\r\n $this->spectators[$player->getName()] = $player;\r\n\r\n $player->HideAndSeekRole = self::ROLE_SPECTATE;\r\n\r\n $player->setGamemode(3);\r\n\r\n }\r\n\r\n }", "public function giveController(Player $player) : void{\n\t\t$player->getInventory()->addItem($this->getControllerItem());\n\t}", "public function setMediaPlayer( Streamwide_Engine_Media_Player $mediaPlayer )\n {\n $this->_mediaPlayer = $mediaPlayer;\n }", "public function getPlayer();", "public function setPlayerName($value)\n {\n return $this->set(self::_PLAYER_NAME, $value);\n }", "function initPlayer($player) {\n\t\t// creates player object ...\n\t\t$player_item = new Player($player);\n\n\t\tldb_playerConnect($this, $player_item);\n\n\t\t// adds a new player to the intern player list ...\n\t\t$this->server->players->addPlayer($player_item);\n\n\t\t// display console message ...\n\t\t$this->console('<< player {1} online [{2}] {3} wins',\n\t\t\t$player_item->id,\n\t\t\t$player_item->login,\n\t\t\t$player_item->getWins());\n\t}", "public function setName($playerName) {\n\t\tConnectionFactory::updateTableRowAbsoluteBasic(\"users\", array('name' => $playerName),\n\t\tarray('id'=>$this->id));\n\t\t$this->name = $playerName;\n\t}", "public function player() : Player\n {\n return $this->player;\n }", "public function registerPlayer(Player $player): void\n {\n foreach ($this->players as $key => $value) {\n if ($value->id === null) {\n // Can inject player in non-active slot.\n $this->players[$key] = $player;\n\n break;\n }\n }\n }", "public abstract function onPlayerSelect();", "public function setPlayersPlaying($pdo, $playerID, $opponentID) {\n $pdo->beginTransaction();\n \n try {\n $sql = \"UPDATE player SET isPlaying = 1 WHERE id = {$playerID} OR id = {$opponentID}\";\n $sth = $pdo->prepare($sql);\n \n $sth->execute();\n $currentID = $pdo->lastInsertId(); \n $pdo->commit(); \n } catch (PDOException $e) {\n die(\"<p>{$e->getMessage()}\");\n $pdo->rollBack();\n return NULL;\n }\n }", "function addPlayer ($player) {\r\n\t\t$this->members = array_push($this->members,$player);\r\n\t}", "public function setAttackTime(Player $player, $newVal) {\n\t\t$this->attackTimeProperty->setValue($player, $newVal);\n\t}", "public function SetPlayer($id_setup, $id_char, $id_category)\n\t{\n\t\t#$this->model->setPlayer($id_setup, $id_char, $id_category);\n\t\t#$this->run('Edit', array('id_setup' => $id_setup));\n\t\t$this->run(\n\t\t\t'Edit',\n\t\t\tarray(\n\t\t\t\t'id_setup' => $this->model->setPlayer($id_setup, $id_char, $id_category)->id_setup\n\t\t\t)\n\t\t);\n\t}", "public function edit(Player $player)\n {\n //\n }", "public function edit(Player $player)\n {\n //\n }", "function playerConnect($player) {\n\n\t\t// request information about the new player ...\n\t\t// ... and callback to function newPlayer() ...\n\t\t$this->addCall('GetPlayerInfo', array($player[0]), 0, 'newPlayer');\n\t}", "public function setControllerCooldown(Player $player) : void{\n\t\t$task = new ControllerCooldown($this);\t\n\t\t$handler = $this->getScheduler()->scheduleRepeatingTask($task, 1);\n\t\t$task->setHandler($handler);\n\t\t$this->cooldown[$task->getTaskId()] = $player;\n\t}", "static function updatePlayer($player) {\n CommonDao::connectToDb();\n $query = \"update player set first_name = \\\"\" . $player->getFirstName() . \"\\\",\n last_name = \\\"\" . $player->getLastName() . \"\\\",\n mlb_team_id = \" . $player->getMlbTeam()->getId() . \",\n birth_date = '\" . $player->getBirthDate() . \"',\n sportsline_id = \" . $player->getSportslineId() .\n \" where player_id = \" . $player->getId();\n $result = mysql_query($query) or die('Invalid query: ' . mysql_error());\n }", "public function SwitchPlayer($id_setlist, $id_category)\n\t{\n\t\t#$data = $this->model->switchPlayer($id_setlist, $id_category);\n\t\t#$this->run('Edit', array('id_setup' => $data->id_setup));\n\n\t\t$this->run(\n\t\t\t'Edit',\n\t\t\tarray(\n\t\t\t\t'id_setup' => $this->model->switchPlayer($id_setlist, $id_category)->id_setup\n\t\t\t)\n\t\t);\n\t}", "function newPlayer($player) {\n\n\t\t// creates player object ...\n\t\t$player_item = new Player($player);\n\t\tif ($player_item->login == \"\")\n\t\t\t{\n\t\t\t//$this->console(\"New broken Player entered - ignored.\");\n\t\t\treturn;\n\t\t\t}\n\t\t\n\t\tif ($player_item->id == $this->lastloginid)\n\t\t\t{\n\t\t\t//$this->console(\"Dublicated join event - ignored.\");\n\t\t\treturn;\n\t\t\t}\n\t\t$this->lastloginid = $player_item->id;\n\n\t\t// adds a new player to the intern player list ...\n\t\t$this->server->players->addPlayer($player_item);\n\n\t\t// display console message ...\n\t\t$this->console('<< player {1} joined the game [{2}]',\n\t\t\t$player_item->id,\n\t\t\t$player_item->login);\n\n\t\t// send chat message to player ...\n\t\t// format message parameters ...\n\t\t$message = myWelcomeMessage($this, $player_item);\n\n\t\t// replace colors ...\n\t\t$message = $this->formatColors($message);\n\n\t\t// send the message ...\n\t\t$message = str_replace('{br}', \"\\n\", $message);\n\t\tif ($this->settings['welcome_msg_window']) {\n\t\t \tif ($player_item->login)\n\t\t\t\tpopup_msg($player_item->login, $message, 10000);\n\t\t} else {\n\t\t\t$this->client->addCall('ChatSendServerMessageToLogin', array(str_replace(\"\\n\\n\", \"\\n\", $message), $player_item->login));\n\t\t\t$this->client->multiquery();\n\t\t}\n\n\t\t// release a new player connect event ...\n\t\t$this->releaseEvent('onPlayerConnect', $player_item);\n\t}", "public function testsetPlayerScore()\n {\n $dice = new DiceHand();\n $this->assertInstanceOf(\"\\Ame\\Dice\\DiceHand\", $dice);\n\n $dice->setPlayerScore(1);\n $res = $dice->getPlayerCurrentScore();\n $exp = 1;\n $this->assertEquals($exp, $res);\n }", "public function incrIdPlayer($increment) {\n $this->setIdPlayer($this->getIdPlayer() + $increment);\n }", "public function play($currentPlayerId, $type = Game::IMPORT_TYPE_NORMAL)\n {\n $gameData = Cache::get('tcg.userGame', null);\n if (!$gameData) {\n $game = GameBuilder::buildTest($currentPlayerId, ['isBot' => false]);\n } else {\n\n $game = Game::import($type, $gameData, $currentPlayerId);\n }\n $this->game = $game;\n\n }", "public function getPlayer()\n {\n return $this->get(self::_PLAYER);\n }", "public function getPlayer()\n {\n return $this->get(self::_PLAYER);\n }", "function doSavePlayer() {\n\t\tif(!LibTools::isAdmin()) {\n\t\t\treturn;\n\t\t}\n\t\t$savePlayer = $_POST['savePlayer'];\n\t\t$pseudo = $savePlayer[\"pseudo\"];\n\t\t$prenom = $savePlayer[\"prenom\"];\n\t\t$nom \t= $savePlayer[\"nom\"];\n\t\t$mail\t= $savePlayer[\"mail\"];\n\t\t$tel\t= $savePlayer[\"tel\"];\n\t\t\n\t\tSs::get()->dao->playerDao->save($this->id, $pseudo, $prenom, $nom, $mail, $tel);\n\t}", "public function getPlayer()\n {\n return $this->participation->getPlayer();\n }", "public function testSetOrderPlayer()\n {\n $game = new DiceGame(4, 1);\n $this->assertInstanceOf(\"\\Ida\\Dice\\DiceGame\", $game);\n\n $game->setOrder();\n $order = $game->getOrder();\n $firstPlayer = $game->getPlayerTurn();\n\n $this->assertEquals($order[0], $firstPlayer);\n }", "public function setPlayerUsername(string $playerUsername)\n {\n $this->playerUsername = $playerUsername;\n\n return $this;\n }", "public function select(CustomPlayer $player) {\n\t\t$player->particleEffectExtra[\"i\"] = 0;\n\t}", "public function UpdatePlayer($player)\n {\n if ($this->IsMember($player->expires) && !$player->memberNumber) {\n $player->memberNumber = $this->GetNextMemberNumber();\n }\n\n $dbTalker = new DbTalker();\n return $dbTalker->updatePlayer($player);\n }", "public function setPlayer(Down_UserSummary $value)\n {\n return $this->set(self::_PLAYER, $value);\n }", "public function setPlayer(Down_UserSummary $value)\n {\n return $this->set(self::_PLAYER, $value);\n }", "function set_PlayerR($PlayerID, $username, $numberWins, $numberLoss, $numberReports, $imageID, $message)\n {\n $this->PlayerID = $PlayerID;\n $this->username = $username;\n $this->numberWins = $numberWins;\n $this->numberLoss = $numberLoss;\n $this->numberReports = $numberReports;\n $this->imageID = $imageID;\n $this->message = $message;\n\n }", "public function setPlayerLevel($value)\n {\n return $this->set(self::_PLAYER_LEVEL, $value);\n }", "private function sendSavedMessage(Player $player) : void{\n $player->sendMessage(TextFormat::GOLD . \"You were teleported to safety while a mine was being reset :)\");\n }", "public function set_game()\n {\n $player = Player::findOrFail(Input::json('player_id'));\n $game = Game::findOrFail(Input::json('game_id'));\n\n if (Input::json('playing') && !$player->games->contains($game->id)) {\n $player->games()->attach($game->id, ['created_at' => DB::raw('now()'), 'updated_at' => DB::raw('now()')]);\n }\n else {\n $player->games()->detach($game->id);\n }\n }", "public function setPlayers($players)\n {\n $this->players = $players;\n\n return $this;\n }", "function play($pkt){\n if( $this->active_player && $this->state->paused){\n $this->json('VideoPlayer.PlayPause',null,$pkt);\n }\n else\n $this->nak($pkt['from']);\n }", "public function getPlayerUsername()\n {\n return $this->playerUsername;\n }", "public function updateAvailability(Player $player)\n {\n if ($player->getOpponent()) {\n $game = $player->getGame();\n $game->manipulateAvailable(false);\n $this->em->persist($game);\n $this->em->flush();\n }\n }", "function playerConnect($player) {\n\n\t\t// request information about the new player\n\t\t// (removed callback mechanism here, as GetPlayerInfo occasionally\n\t\t// returns no data and then the connecting login would be lost)\n\t\t$login = $player[0];\n\t\t$this->client->query('GetDetailedPlayerInfo', $login);\n\t\t$playerd = $this->client->getResponse();\n\t\t$this->client->query('GetPlayerInfo', $login, 1);\n\t\t$player = $this->client->getResponse();\n\n\t\t// check for server\n\t\tif (isset($player['Flags']) && floor($player['Flags'] / 100000) % 10 != 0) {\n\t\t\t// register relay server\n\t\t\tif (!$this->server->isrelay && $player['Login'] != $this->server->serverlogin) {\n\t\t\t\t$this->server->relayslist[$player['Login']] = $player;\n\n\t\t\t\t// log console message\n\t\t\t\t$this->console('<<< relay server {1} ({2}) connected', $player['Login'],\n\t\t\t\t stripColors($player['NickName'], false));\n\t\t\t}\n\n\t\t// on relay, check for player from master server\n\t\t} elseif ($this->server->isrelay && floor($player['Flags'] / 10000) % 10 != 0) {\n\t\t\t; // ignore\n\t\t} else {\n\t\t\t$ipaddr = isset($playerd['IPAddress']) ? preg_replace('/:\\d+/', '', $playerd['IPAddress']) : ''; // strip port\n\n\t\t\t// if no data fetched, notify & kick the player\n\t\t\tif (!isset($player['Login']) || $player['Login'] == '') {\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('CONNECT_ERROR'));\n\t\t\t\t$message = $this->formatColors($message);\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $login);\n\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CONNECT_DIALOG'))));\n\t\t\t\t// log console message\n\t\t\t\t$this->console('GetPlayerInfo failed for ' . $login . ' -- notified & kicked');\n\t\t\t\treturn;\n\n\t\t\t// if player IP in ban list, notify & kick the player\n\t\t\t} elseif (!empty($this->bannedips) && in_array($ipaddr, $this->bannedips)) {\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('BANIP_ERROR'));\n\t\t\t\t$message = $this->formatColors($message);\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $login);\n\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t$this->client->addCall('Ban', array($login, $this->formatColors($this->getChatMessage('BANIP_DIALOG'))));\n\t\t\t\t// log console message\n\t\t\t\t$this->console('Player ' . $login . ' banned from ' . $ipaddr . ' -- notified & kicked');\n\t\t\t\treturn;\n\n\t\t\t// client version checking\n\t\t\t} else {\n\t\t\t\t// extract version number\n\t\t\t\t$version = str_replace(')', '', preg_replace('/.*\\(/', '', $playerd['ClientVersion']));\n\t\t\t\tif ($version == '') $version = '2.11.11';\n\t\t\t\t$message = str_replace('{br}', LF, $this->getChatMessage('CLIENT_ERROR'));\n\n\t\t\t\t// if invalid version, notify & kick the player\n\t\t\t\tif ($this->settings['player_client'] != '' &&\n\t\t\t\t strcmp($version, $this->settings['player_client']) < 0) {\n\t\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $login);\n\t\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CLIENT_DIALOG'))));\n\t\t\t\t\t// log console message\n\t\t\t\t\t$this->console('Obsolete player client version ' . $version . ' for ' . $login . ' -- notified & kicked');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// if invalid version, notify & kick the admin\n\t\t\t\tif ($this->settings['admin_client'] != '' && $this->isAnyAdminL($player['Login']) &&\n\t\t\t\t strcmp($version, $this->settings['admin_client']) < 0) {\n\t\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $login);\n\t\t\t\t\tsleep(5); // allow time to connect and see the notice\n\t\t\t\t\t$this->client->addCall('Kick', array($login, $this->formatColors($this->getChatMessage('CLIENT_DIALOG'))));\n\t\t\t\t\t// log console message\n\t\t\t\t\t$this->console('Obsolete admin client version ' . $version . ' for ' . $login . ' -- notified & kicked');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// create player object\n\t\t\t$player_item = new Player($playerd);\n\t\t\t// set default window style, panels & background\n\t\t\t$player_item->style = $this->style;\n\t\t\t$player_item->panels['admin'] = set_panel_bg($this->panels['admin'], $this->panelbg);\n\t\t\t$player_item->panels['donate'] = set_panel_bg($this->panels['donate'], $this->panelbg);\n\t\t\t$player_item->panels['records'] = set_panel_bg($this->panels['records'], $this->panelbg);\n\t\t\t$player_item->panels['vote'] = set_panel_bg($this->panels['vote'], $this->panelbg);\n\t\t\t$player_item->panelbg = $this->panelbg;\n\n\t\t\t// adds a new player to the internal player list\n\t\t\t$this->server->players->addPlayer($player_item);\n\n\t\t\t// log console message\n\t\t\t$this->console('<< player {1} joined the game [{2} : {3} : {4} : {5} : {6}]',\n\t\t\t $player_item->pid,\n\t\t\t $player_item->login,\n\t\t\t $player_item->nickname,\n\t\t\t $player_item->nation,\n\t\t\t $player_item->ladderrank,\n\t\t\t $player_item->ip);\n\n\t\t\t// replace parameters\n\t\t\t$message = formatText($this->getChatMessage('WELCOME'),\n\t\t\t stripColors($player_item->nickname),\n\t\t\t $this->server->name, XASECO2_VERSION);\n\t\t\t// hyperlink package name & version number\n\t\t\t$message = preg_replace('/XASECO2.+' . XASECO2_VERSION . '/', '$l[' . XASECO_ORG . ']$0$l', $message);\n\n\t\t\t// send welcome popup or chat message\n\t\t\tif ($this->settings['welcome_msg_window']) {\n\t\t\t\t$message = str_replace('{#highlite}', '{#message}', $message);\n\t\t\t\t$message = preg_split('/{br}/', $this->formatColors($message));\n\t\t\t\t// repack all lines\n\t\t\t\tforeach ($message as &$line)\n\t\t\t\t\t$line = array($line);\n\t\t\t\tdisplay_manialink($player_item->login, '',\n\t\t\t\t array('Icons64x64_1', 'Inbox'), $message,\n\t\t\t\t array(1.2), 'OK');\n\t\t\t} else {\n\t\t\t\t$message = str_replace('{br}', LF, $this->formatColors($message));\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', str_replace(LF.LF, LF, $message), $player_item->login);\n\t\t\t}\n\n\t\t\t// if there's a record on current map\n\t\t\t$cur_record = $this->server->records->getRecord(0);\n\t\t\tif ($cur_record !== false && $cur_record->score > 0) {\n\t\t\t\t// set message to the current record\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_CURRENT'),\n\t\t\t\t stripColors($this->server->map->name),\n\t\t\t\t ($this->server->gameinfo->mode == Gameinfo::STNT ?\n\t\t\t\t $cur_record->score : formatTime($cur_record->score)),\n\t\t\t\t stripColors($cur_record->player->nickname));\n\t\t\t} else { // if there should be no record to display\n\t\t\t\t// display a no-record message\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_NONE'),\n\t\t\t\t stripColors($this->server->map->name));\n\t\t\t}\n\n\t\t\t// show top-8 & records of all online players before map\n\t\t\tif (($this->settings['show_recs_before'] & 2) == 2 && function_exists('show_maprecs')) {\n\t\t\t\tshow_maprecs($this, $player_item->login, 1, 0); // from chat.records2.php\n\t\t\t} elseif (($this->settings['show_recs_before'] & 1) == 1) {\n\t\t\t\t// or show original record message\n\t\t\t\t$this->client->query('ChatSendServerMessageToLogin', $this->formatColors($message), $player_item->login);\n\t\t\t}\n\n\t\t\t// throw main 'player connects' event\n\t\t\t$this->releaseEvent('onPlayerConnect', $player_item);\n\t\t\t// throw postfix 'player connects' event (access control)\n\t\t\t$this->releaseEvent('onPlayerConnect2', $player_item);\n\t\t}\n\t}", "function playerSentToPenaltyBox($currentPlayer) {\n\t}", "function markExecutingPlayer($player_id) {\n self::DbQuery(self::format(\"\n UPDATE\n player\n SET\n effects_had_impact = TRUE\n WHERE\n player_id = {player_id}\n \", \n array('player_id' => $player_id)\n ));\n }", "public function setKit(Player $player, $id = 0) {\n $player_name = $player->getName();\n $player->getInventory()->clearAll();\n switch($id) {\n case 0:\n $player->sendMessage($this->colorize(\"&cKit Removed!\"));\n $this->players[$player_name] = 0; //Will be unset on death or /leave maybe?\n break;\n case 1:\n $player->sendMessage($this->colorize(\"&aYou have chosen the &cAssassin&a kit.\"));\n $player->getInventory()->setHelmet(Item::get(298));\n $player->getInventory()->setChestplate(Item::get(299));\n $player->getInventory()->setLeggings(Item::get(316));\n $player->getInventory()->setBoots(Item::get(301));\n $player->getInventory()->sendArmorContents($player);\n $sword = Item::fromString(\"iron_sword\");\n $sword->setCount(1);\n $player->getInventory()->addItem($sword);\n $this->players[$player_name] = 1; //Will be unset on death or /leave maybe?\n break;\n case 2:\n $player->sendMessage($this->colorize(\"&aYou have chosen the &9Tank&a kit.\"));\n $player->getInventory()->setHelmet(Item::get(306));\n $player->getInventory()->setChestplate(Item::get(303));\n $player->getInventory()->setLeggings(Item::get(304));\n $player->getInventory()->setBoots(Item::get(309));\n $player->getInventory()->sendArmorContents($player);\n $sword = Item::fromString(\"wooden_sword\");\n $sword->setCount(1);\n $player->getInventory()->addItem($sword);\n $this->players[$player_name] = 2; //Will be unset on death or /leave maybe?\n break;\n case 3:\n $player->sendMessage($this->colorize(\"&aYou have chosen the &8Spectre&a kit.\"));\n $player->getInventory()->setBoots(Item::get(305));\n $player->getInventory()->sendArmorContents($sender);\n $axe = Item::fromString(\"stone_axe\");\n $axe->setCount(1);\n $player->getInventory()->addItem($axe);\n $sugar = Item::fromString(\"sugar\");\n $sugar->setCount(1);\n $player->getInventory()->addItem($sugar);\n $this->players[$player_name] = 3; //Will be unset on death or /leave maybe?\n break;\n }\n }", "public function getIdPlayer()\n {\n return $this->idPlayer;\n }", "public function addPlayer(Player $player) {\n $this->players[] = $player;\n }", "public function getPlayerId(){\n\t\treturn $this->playerId;\n\t}", "private function onPlayerCreated(Player $player) : void{\n\t\t$rm = new ReflectionMethod(NetworkSession::class, \"onPlayerCreated\");\n\t\t$rm->invoke($this, $player);\n\t\t$this->player_add_resolver->resolve($player);\n\t}", "public function getPlayerId()\n {\n return $this->playerId;\n }", "function updateScore(Player $player, int $points)\n{\n $score = $player->getScore();\n $player->setScore($score + $points);\n}", "abstract protected function putPlayersInDuel(): void;", "public function setType($playerType) {\n\t\tConnectionFactory::updateTableRowAbsoluteBasic(\"users\", array('type' => $playerType),\n\t\tarray('id'=>$this->id));\n\t\t$this->type = $playerType;\n\t}", "public function getPlayerName(){\n\t\treturn $this->playerName;\n\t}", "public function nextPlayer() : Player\n {\n $next = $this->curPlayer->getNext();\n \n if (isset($next)) {\n $this->curPlayer = $next;\n } else {\n $this->curPlayer = $this->firstPlayer;\n }\n\n return $this->curPlayer;\n }", "public function setLocal($local){ }", "public function requestPlayerAction(Player $player, HandBetPair $hand);", "public function getPlayerId() {\n return $this->playerId;\n }", "public function setByPlayerIdAttribute($input)\n {\n $this->attributes['by_player_id'] = $input ? $input : null;\n }", "public function changeAllPlayersStatus($status) {\n foreach ($this->players as &$player) {\n $player->status = $status;\n }\n }", "public function save(player $player, $isUser = false) {\n\t\tif(player_mapper_db::player_exists($player->get('steamid'), $isUser)) {\n\t\t\t$this->update($player, $isUser);\n\t\t}\n\t\telse {\n\t\t\t$this->insert($player, $isUser);\n\t\t}\n\t}", "public function passGo($player){\n $player->collect($this->go_amount);\n }", "public function __construct()\n {\n $this->matchFinished = false;\n //$this->player1 = new Player('A');\n //$this->player2 = new Player('B');\n }", "public function testSettingPlayers()\n {\n $dice = new DicePlayers();\n $this->assertInstanceOf(\"\\Heln\\Dice\\DicePlayers\", $dice);\n\n $dice->setPlayers();\n $res = $dice->getPlayers();\n $exp = [\n \"Player\" => 0,\n \"Computer\" => 0,\n ];\n $this->assertEquals($exp, $res);\n }", "public function getHostPlayer() {\n return $this->hostPlayer;\n }", "public function updatePlayer(Player $playerData){\n $sql = \"UPDATE jogador \n SET time_id_time = '{$playerData->__getIdTeam()}',\n nome = '{$playerData->__getPlayerName()}', \n data_nascimento = '{$playerData->__getBirthDatePlayer()}', \n cpf = '{$playerData->__getCpfPlayer()}', \n numero = '{$playerData->__getPlayerNumber()}' \n WHERE id_jogador='{$playerData->__getIdPlayer()}' \";\n $this->connection->dataBase->Execute($sql);\n return $playerData;\n\t}", "public function currentPlayer() {\n $p = 'x';\n foreach ($this->moves as $move) {\n $p = ($move->player == 'x') ? 'o' : 'x';\n }\n return $p;\n }", "public function getPlayer_id() {\n return $this->getValue('player_id');\n }", "function PlayerPass( $pos )\r\n \t{\r\n\r\n\t\t$this->states[$pos] = 2;\r\n \t\tf_MQuery( \"UPDATE poker_draw_player SET state = 2 WHERE\r\n\t\t\t\tdraw_id = '{$this->draw_id}' AND seat = '$pos';\" );\r\n\r\n\t\t//2) next player and check ( for game end, next round, etc. )\r\n\r\n\t\t$this->MakeNextMove( );\r\n \t}", "protected function setUp() {\r\n\t\t$this->board = $this->getMock('Board');\r\n\t\t$this->playerName = 'Test';\r\n\t\t$this->player = new Player($this->playerName, $this->board);\r\n\t}", "public function play()\n {\n $game = $this->getGame();\n $playerList = $game->getPlayerList();\n /** @var IPlayer $player */\n array_map(function($player){\n $player->removeCards();\n }, $playerList->getPlayers());\n $this->getGame()->setDeck((new \\FiveCardDraw\\Service\\Deck\\StandardDeckBuilder())->build());\n for ($i = 0; $i < 5; ++$i) {\n /** @var IPlayer $player */\n foreach ($playerList->getPlayers() as $player) {\n $player->addCard($game->getDeck()->draw());\n }\n }\n $game->changeState(new TradeState($game));\n }", "protected function setMark() {\n echo $this->promptMessage('choose_mark');\n $mark = $this->limitInput(array(self::X_MARK, self::O_MARK, self::QUIT_BUTTON));\n switch ($mark) {\n case self::X_MARK:\n $this->_userMark = self::X_MARK;\n $this->_botMark = self::O_MARK;\n break;\n case self::O_MARK:\n $this->_userMark = self::O_MARK;\n $this->_botMark = self::X_MARK;\n break;\n case self::QUIT_BUTTON:\n $this->quit();\n }\n echo \"You will be Player \" . $this->_userMark . \".\" . PHP_EOL;\n echo $this->promptMessage('start_game') . PHP_EOL;\n }", "public function update(Player $player)\n {\n $this->entityManager->persist($player);\n $this->entityManager->flush();\n return $player;\n }", "public function player()\n {\n return $this->hasOne('App\\Models\\Player');\n }", "public function player()\n\t{\n\t\treturn $this->belongsTo('App\\Player');\n\t}", "public function setUsername($value)\n {\n $this->_username = $value;\n }", "public function setUsername($l) {\n $this->_username = $l;\n }", "public function setLeader($teamId, $login) {\n dibi::query(\"UPDATE teams SET leader=%s\", $login, \"WHERE id=%i\", $teamId);\n }", "public function __construct($player, $session)\n {\n $this->player = $player;\n $this->session = $session;\n }", "public function addPlayer(AbstractClient $client): void\n {\n $this->players[$client->getId()] = $client;\n }" ]
[ "0.8006255", "0.7876374", "0.68962395", "0.6857048", "0.6619847", "0.6473134", "0.63770133", "0.62825596", "0.62732565", "0.6243762", "0.61989444", "0.61837643", "0.61639684", "0.6089696", "0.6029448", "0.6025325", "0.6009613", "0.6009613", "0.6009613", "0.5985696", "0.5928059", "0.5899848", "0.58896065", "0.5889113", "0.58675927", "0.5852861", "0.5838359", "0.58195025", "0.5805915", "0.578558", "0.5769036", "0.5692766", "0.5676397", "0.56473446", "0.56473446", "0.55795544", "0.557887", "0.5554889", "0.55233365", "0.54962957", "0.54950845", "0.54524946", "0.5441033", "0.5434171", "0.5434171", "0.5415023", "0.54088783", "0.5406227", "0.5393182", "0.5384567", "0.53793544", "0.53788114", "0.53788114", "0.5365258", "0.5364719", "0.5352175", "0.5326695", "0.53125125", "0.53056103", "0.52897644", "0.5286126", "0.52848995", "0.52565134", "0.52517676", "0.5228919", "0.5228669", "0.5221042", "0.52067584", "0.519708", "0.5195529", "0.51868653", "0.5169874", "0.5124658", "0.5119591", "0.5113213", "0.5110939", "0.5104199", "0.50993264", "0.50829", "0.50806415", "0.50772864", "0.50769293", "0.506916", "0.5067124", "0.50633717", "0.5062954", "0.5062792", "0.5054145", "0.50404173", "0.50335807", "0.50116247", "0.49994746", "0.499542", "0.4993338", "0.49878243", "0.49877667", "0.4975022", "0.49680695", "0.4964666", "0.49590418" ]
0.87652165
0
Set Last Row inseat
public function setLastRowInsert($row){ $this->lastRowInsert = $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function lastRow() {\n\t}", "private function setCurrRow()\r\n {\r\n // (1) if bNewRow, there is no selection\r\n if( $this->oComp->bNewRow ) {\r\n $this->oComp->kfuiCurrRow->SetKey(0); // this also clears the form's oDS->kfr\r\n }\r\n // (2) if there is no current row, make the first row the current row\r\n else if( !$this->oComp->kfuiCurrRow->GetKey() && @$this->raWindowRows[0] && $this->raWindowRows[0]->Key() ) {\r\n $this->oComp->kfuiCurrRow->SetKey( $this->raWindowRows[0]->Key() );\r\n // handled in Init() $this->iOffsetCurrRow = $this->iWindowOffset; // curr row is now at top of window\r\n }\r\n // (3) insert the current row if it is not in the window but likely of interest to the user\r\n else if( $this->oComp->kfuiCurrRow->GetKey() && @$_REQUEST['kluge_Added A Row Just Now Or We Really Like this One Row']) {\r\n $bFound = false;\r\n foreach( $this->raWindowRows as $kfr ) {\r\n if( $kfr->Key() == $this->oComp->kfuiCurrRow->GetKey() ) {\r\n $bFound = true;\r\n break;\r\n }\r\n }\r\n if( !$bFound ) {\r\n // scan the view\r\n // insert the current row into the window, maybe half way, and pop off the last one\r\n // fix problems with iOffsetCurrRow, offsets for scrolling down (should see the popped row)\r\n }\r\n }\r\n }", "public function lastLine()\n {\n $this->line()->application->cursor->previousLine();\n }", "public function moveLast()\n {\n $target = static::max($this->getPositionColumn());\n\n return $this->moveTo($target);\n }", "public function SetLastRecord($record){$this->_lastrecord = $record;}", "public function deleteLastRow()\n {\n array_pop($this->childNodes);\n }", "public function lastCol() {\n\t}", "public function setLastRoll() {\n $this->lastRoll = [];\n}", "public function lastRow()\n {\n $query = clone $this;\n $offset = $this->limit ? $this->limit['start'] : 0;\n\n // Limit index to start in case of empty results\n $index = max($this->count() + $offset - 1, 0);\n $query->setLimit(1, $index);\n return $query;\n }", "public function lastItem();", "public function getLastRowInsert(){\r\n return $this->lastRowInsert;\r\n }", "public function getEndRow(): int\n {\n return $this->end;\n }", "public function last();", "public function last();", "public function last();", "public function getLastItem() {}", "public function getLastItem() {}", "public function getLast();", "public function getLast();", "function MoveLast()\n\t{\n\t\tif ($this->EOF) return false;\n\t\treturn $this->Move($this->_numOfRows - 1);\n\t}", "function MoveLast() {}", "function resetRow($Old,$Current,$Row)\n{\n if($Old != $Current)\n {\n $Row = 2;\n $Zone= '';\n }\n\n return $Row;\n}", "public function last() {\n return $this->seek($this->data['num_rows'] - 1);\n }", "private function lastPage() {\n $this->currentPageNumber--;\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->lastPage[\"vOffset\"];\n $this->hOffset = $this->lastPage[\"hOffset\"];\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "function LastRow(){\n\t\t\t\t\t$this->db->select('id_servicio');\n\t\t\t\t\t$this->db->order_by('id_servicio','DESC');\n\t\t\t\t\t$this->db->limit(1);\n\t\t\t\t\t$query = $this->db->get('t_dat_servicios')->row()->id_servicio;\n\n\t\t\t\t\tif ($query != null) {\n\t\t\t\t\t\treturn $query;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}", "public function last_row($type = 'object')\n\t{\n\t\t$result = &$this->result($type);\n\t\tif ( ! isset($this->num_rows))\n\t\t{\n\t\t\t$this->num_rows = count($result);\n\t\t}\n\t\t$this->current_row = $this->num_rows - 1;\n\t\treturn $result[$this->current_row];\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "private function writeDefaultRowHeight(): void\n {\n $defaultRowHeight = $this->phpSheet->getDefaultRowDimension()->getRowHeight();\n\n if ($defaultRowHeight < 0) {\n return;\n }\n\n // convert to twips\n $defaultRowHeight = (int) 20 * $defaultRowHeight;\n\n $record = 0x0225; // Record identifier\n $length = 0x0004; // Number of bytes to follow\n\n $header = pack('vv', $record, $length);\n $data = pack('vv', 1, $defaultRowHeight);\n $this->append($header . $data);\n }", "public function set_last_fetch( $timestamp ) {\n\t\t$this->ryte_option[ self::LAST_FETCH ] = $timestamp;\n\t}", "public function getLastItem()\n {\n if ($this->valid() === false) {\n return null;\n }\n return $this->getRow($this->count() - 1);\n }", "public function setLast($value)\n\t{\n\t\t$this->last = $value;\n\t\treturn $this;\n\t}", "public function getLastRow()\n {\n if (!is_null($this->summaryRow)) {\n return $this->summaryRow;\n }\n\n if (count($this->rows) == 0) {\n return false;\n }\n $row = array_slice($this->rows, -1);\n return $row[0];\n }", "function moveToNextRow();", "public function getLastRow() : int\n {\n\n // Convert A1:D3 to D3.\n list(,$endRef) = explode(':', $this->getTableNode()->getAttribute('ref'));\n\n // Convert D3 to 3.\n $endRow = (int) ( preg_replace('/([A-Z])/', '', $endRef) );\n\n return $endRow;\n }", "protected function setLastInsertId() {\n $id = $this->connection->getPdo()->lastInsertId();\n //if the table doesn't have the auto increment field or sequence,\n // the value of 0 will be returned \n if (!$id) {\n $id = true;\n }\n $this->insertId = $id;\n return $this;\n }", "public function set_alt_rows() { $this->alt_rows = true; }", "public static function getLastRowId()\n {\n return self::$id;\n }", "public function last()\n {\n if ($this->list === null)\n $this->rewind();\n $row = end($this->list);\n return $row;\n }", "function\tpunchTable( $_lastLine=false) {\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTDataIT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t}\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\n\t\t/**\n\t\t * if there's less than 20 mm on this page\n\t\t *\tgoto next page\n\t\t */\n\t\t$remHeight\t=\t$frm->remHeight() ;\n\t\tif ( $remHeight < mmToPt( $this->saveZone) && !$_lastLine) {\n\t\t\t$this->tableFoot() ;\n\t\t\t$this->myDoc->newPage() ;\n\t\t\t$this->tableHead() ;\n\t\t}\n\t}", "public function setMaxRow($value)\n {\n return $this->set('MaxRow', $value);\n }", "public function MoveLast()\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\t$this->activeRow = $this->RowCount() - 1;\r\n\t\tif( !$this->Error() )\r\n\t\t{\r\n\t\t\tif( !$this->Seek( $this->activeRow ) )\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "protected function _moveNext()\n {\n if ($nextRow = $this->_getNextRow()) {\n $this->_currentRow = $this->_formatRow($nextRow);\n } else {\n $this->_currentRow = array();\n }\n \n if (!$this->_currentRow) {\n fclose($this->_handle);\n $this->_valid = false;\n $this->_handle = null;\n }\n }", "public function rewind() {\n\t\tif( $this->isDirty() ) { $this->executeQuery(); }\n\t\t$this->_currentRow = 0;\n\t}", "public function getLastIndex()\n {\n return $this->index - 1;\n }", "function setRowDatas(&$row) {\r\n\t\t/* for optimization reason, do not save row. save just needed parameters */\r\n\t}", "public function next(){\n\t\t$this->nextRow(1,'max');\n\t}", "function getLastItem() { return $this->m_lastItem; }", "function lastPage()\n\t\t{\n\t\t\t$this->currentPage = $this->numberOfPages();\n\t\t}", "public function last(): mixed;", "public function last(): mixed;", "public function nextRowset()\n {\n }", "public function addLast($e);", "public function resetExpandedRows()\n\t{\n\t\t$this->setExpandedRows();\n\t}", "public function getAndRemoveLastItem();", "public function GoToEnd()\n {\n $this->setItemPointer(($this->Length() - 1));\n }", "public function set_last_tab_index( $index = 1 ) {\n\t\t\n\t\t$this->last_tab_index = $index;\n\t\t\n\t}", "public function setRow(int $row): void\n {\n $this->row = $row;\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 getLast()\n\t{\n\t\treturn $this->last;\n\t}", "function asdb_last($array)\n\t{\n\t\treturn end($array);\n\t}", "function setRowDatas(&$row) {\r\n\t\t\r\n }", "public function lastKey();", "function evt__5__salida()\n\t{\n\t\tunset($this->pant_sel_temp);\n\t\t$this->get_entidad()->tabla('pantallas')->resetear_cursor();\n\t}", "final public function getLast() {\n\t\treturn null;\n\t}" ]
[ "0.7037437", "0.6079164", "0.58813494", "0.57635623", "0.57365763", "0.57318896", "0.57262325", "0.5721942", "0.5720174", "0.56707984", "0.56589437", "0.56538653", "0.56523293", "0.56523293", "0.56523293", "0.55810255", "0.55810255", "0.54979813", "0.54979813", "0.54957116", "0.54656225", "0.544129", "0.5432345", "0.5410745", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.53951734", "0.53851473", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.53167695", "0.52829874", "0.52799577", "0.5274346", "0.5211434", "0.52077353", "0.51850533", "0.5181191", "0.5155056", "0.5150695", "0.51299405", "0.51221573", "0.5112788", "0.5095092", "0.50487024", "0.5034208", "0.5001402", "0.4994898", "0.4985655", "0.49689648", "0.4967653", "0.49665758", "0.49665758", "0.49573782", "0.49469733", "0.4944523", "0.49402574", "0.49364567", "0.4910531", "0.4909697", "0.49034372", "0.49001467", "0.48991963", "0.4893844", "0.4890948", "0.48796764", "0.48725086" ]
0.69677466
1
Set Last Row inseat
public function getLastRowInsert(){ return $this->lastRowInsert; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function lastRow() {\n\t}", "public function setLastRowInsert($row){\r\n $this->lastRowInsert = $row;\r\n }", "private function setCurrRow()\r\n {\r\n // (1) if bNewRow, there is no selection\r\n if( $this->oComp->bNewRow ) {\r\n $this->oComp->kfuiCurrRow->SetKey(0); // this also clears the form's oDS->kfr\r\n }\r\n // (2) if there is no current row, make the first row the current row\r\n else if( !$this->oComp->kfuiCurrRow->GetKey() && @$this->raWindowRows[0] && $this->raWindowRows[0]->Key() ) {\r\n $this->oComp->kfuiCurrRow->SetKey( $this->raWindowRows[0]->Key() );\r\n // handled in Init() $this->iOffsetCurrRow = $this->iWindowOffset; // curr row is now at top of window\r\n }\r\n // (3) insert the current row if it is not in the window but likely of interest to the user\r\n else if( $this->oComp->kfuiCurrRow->GetKey() && @$_REQUEST['kluge_Added A Row Just Now Or We Really Like this One Row']) {\r\n $bFound = false;\r\n foreach( $this->raWindowRows as $kfr ) {\r\n if( $kfr->Key() == $this->oComp->kfuiCurrRow->GetKey() ) {\r\n $bFound = true;\r\n break;\r\n }\r\n }\r\n if( !$bFound ) {\r\n // scan the view\r\n // insert the current row into the window, maybe half way, and pop off the last one\r\n // fix problems with iOffsetCurrRow, offsets for scrolling down (should see the popped row)\r\n }\r\n }\r\n }", "public function lastLine()\n {\n $this->line()->application->cursor->previousLine();\n }", "public function moveLast()\n {\n $target = static::max($this->getPositionColumn());\n\n return $this->moveTo($target);\n }", "public function SetLastRecord($record){$this->_lastrecord = $record;}", "public function deleteLastRow()\n {\n array_pop($this->childNodes);\n }", "public function lastCol() {\n\t}", "public function setLastRoll() {\n $this->lastRoll = [];\n}", "public function lastRow()\n {\n $query = clone $this;\n $offset = $this->limit ? $this->limit['start'] : 0;\n\n // Limit index to start in case of empty results\n $index = max($this->count() + $offset - 1, 0);\n $query->setLimit(1, $index);\n return $query;\n }", "public function lastItem();", "public function getEndRow(): int\n {\n return $this->end;\n }", "public function last();", "public function last();", "public function last();", "public function getLastItem() {}", "public function getLastItem() {}", "public function getLast();", "public function getLast();", "function MoveLast()\n\t{\n\t\tif ($this->EOF) return false;\n\t\treturn $this->Move($this->_numOfRows - 1);\n\t}", "function MoveLast() {}", "function resetRow($Old,$Current,$Row)\n{\n if($Old != $Current)\n {\n $Row = 2;\n $Zone= '';\n }\n\n return $Row;\n}", "public function last() {\n return $this->seek($this->data['num_rows'] - 1);\n }", "private function lastPage() {\n $this->currentPageNumber--;\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->lastPage[\"vOffset\"];\n $this->hOffset = $this->lastPage[\"hOffset\"];\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "function LastRow(){\n\t\t\t\t\t$this->db->select('id_servicio');\n\t\t\t\t\t$this->db->order_by('id_servicio','DESC');\n\t\t\t\t\t$this->db->limit(1);\n\t\t\t\t\t$query = $this->db->get('t_dat_servicios')->row()->id_servicio;\n\n\t\t\t\t\tif ($query != null) {\n\t\t\t\t\t\treturn $query;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}", "public function last_row($type = 'object')\n\t{\n\t\t$result = &$this->result($type);\n\t\tif ( ! isset($this->num_rows))\n\t\t{\n\t\t\t$this->num_rows = count($result);\n\t\t}\n\t\t$this->current_row = $this->num_rows - 1;\n\t\treturn $result[$this->current_row];\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "private function writeDefaultRowHeight(): void\n {\n $defaultRowHeight = $this->phpSheet->getDefaultRowDimension()->getRowHeight();\n\n if ($defaultRowHeight < 0) {\n return;\n }\n\n // convert to twips\n $defaultRowHeight = (int) 20 * $defaultRowHeight;\n\n $record = 0x0225; // Record identifier\n $length = 0x0004; // Number of bytes to follow\n\n $header = pack('vv', $record, $length);\n $data = pack('vv', 1, $defaultRowHeight);\n $this->append($header . $data);\n }", "public function set_last_fetch( $timestamp ) {\n\t\t$this->ryte_option[ self::LAST_FETCH ] = $timestamp;\n\t}", "public function getLastItem()\n {\n if ($this->valid() === false) {\n return null;\n }\n return $this->getRow($this->count() - 1);\n }", "public function setLast($value)\n\t{\n\t\t$this->last = $value;\n\t\treturn $this;\n\t}", "public function getLastRow()\n {\n if (!is_null($this->summaryRow)) {\n return $this->summaryRow;\n }\n\n if (count($this->rows) == 0) {\n return false;\n }\n $row = array_slice($this->rows, -1);\n return $row[0];\n }", "function moveToNextRow();", "public function getLastRow() : int\n {\n\n // Convert A1:D3 to D3.\n list(,$endRef) = explode(':', $this->getTableNode()->getAttribute('ref'));\n\n // Convert D3 to 3.\n $endRow = (int) ( preg_replace('/([A-Z])/', '', $endRef) );\n\n return $endRow;\n }", "protected function setLastInsertId() {\n $id = $this->connection->getPdo()->lastInsertId();\n //if the table doesn't have the auto increment field or sequence,\n // the value of 0 will be returned \n if (!$id) {\n $id = true;\n }\n $this->insertId = $id;\n return $this;\n }", "public function set_alt_rows() { $this->alt_rows = true; }", "public static function getLastRowId()\n {\n return self::$id;\n }", "public function last()\n {\n if ($this->list === null)\n $this->rewind();\n $row = end($this->list);\n return $row;\n }", "function\tpunchTable( $_lastLine=false) {\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTDataIT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t}\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\n\t\t/**\n\t\t * if there's less than 20 mm on this page\n\t\t *\tgoto next page\n\t\t */\n\t\t$remHeight\t=\t$frm->remHeight() ;\n\t\tif ( $remHeight < mmToPt( $this->saveZone) && !$_lastLine) {\n\t\t\t$this->tableFoot() ;\n\t\t\t$this->myDoc->newPage() ;\n\t\t\t$this->tableHead() ;\n\t\t}\n\t}", "public function setMaxRow($value)\n {\n return $this->set('MaxRow', $value);\n }", "public function MoveLast()\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\t$this->activeRow = $this->RowCount() - 1;\r\n\t\tif( !$this->Error() )\r\n\t\t{\r\n\t\t\tif( !$this->Seek( $this->activeRow ) )\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "protected function _moveNext()\n {\n if ($nextRow = $this->_getNextRow()) {\n $this->_currentRow = $this->_formatRow($nextRow);\n } else {\n $this->_currentRow = array();\n }\n \n if (!$this->_currentRow) {\n fclose($this->_handle);\n $this->_valid = false;\n $this->_handle = null;\n }\n }", "public function rewind() {\n\t\tif( $this->isDirty() ) { $this->executeQuery(); }\n\t\t$this->_currentRow = 0;\n\t}", "public function getLastIndex()\n {\n return $this->index - 1;\n }", "function setRowDatas(&$row) {\r\n\t\t/* for optimization reason, do not save row. save just needed parameters */\r\n\t}", "public function next(){\n\t\t$this->nextRow(1,'max');\n\t}", "function getLastItem() { return $this->m_lastItem; }", "function lastPage()\n\t\t{\n\t\t\t$this->currentPage = $this->numberOfPages();\n\t\t}", "public function last(): mixed;", "public function last(): mixed;", "public function nextRowset()\n {\n }", "public function addLast($e);", "public function resetExpandedRows()\n\t{\n\t\t$this->setExpandedRows();\n\t}", "public function getAndRemoveLastItem();", "public function GoToEnd()\n {\n $this->setItemPointer(($this->Length() - 1));\n }", "public function set_last_tab_index( $index = 1 ) {\n\t\t\n\t\t$this->last_tab_index = $index;\n\t\t\n\t}", "public function setRow(int $row): void\n {\n $this->row = $row;\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 getLast()\n\t{\n\t\treturn $this->last;\n\t}", "function asdb_last($array)\n\t{\n\t\treturn end($array);\n\t}", "function setRowDatas(&$row) {\r\n\t\t\r\n }", "public function lastKey();", "function evt__5__salida()\n\t{\n\t\tunset($this->pant_sel_temp);\n\t\t$this->get_entidad()->tabla('pantallas')->resetear_cursor();\n\t}", "final public function getLast() {\n\t\treturn null;\n\t}" ]
[ "0.7037437", "0.69677466", "0.6079164", "0.58813494", "0.57635623", "0.57365763", "0.57318896", "0.57262325", "0.5721942", "0.5720174", "0.56707984", "0.56538653", "0.56523293", "0.56523293", "0.56523293", "0.55810255", "0.55810255", "0.54979813", "0.54979813", "0.54957116", "0.54656225", "0.544129", "0.5432345", "0.5410745", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.54005164", "0.53951734", "0.53851473", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.5317656", "0.53167695", "0.52829874", "0.52799577", "0.5274346", "0.5211434", "0.52077353", "0.51850533", "0.5181191", "0.5155056", "0.5150695", "0.51299405", "0.51221573", "0.5112788", "0.5095092", "0.50487024", "0.5034208", "0.5001402", "0.4994898", "0.4985655", "0.49689648", "0.4967653", "0.49665758", "0.49665758", "0.49573782", "0.49469733", "0.4944523", "0.49402574", "0.49364567", "0.4910531", "0.4909697", "0.49034372", "0.49001467", "0.48991963", "0.4893844", "0.4890948", "0.48796764", "0.48725086" ]
0.56589437
11
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n return __CLASS__;;\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName() { return __CLASS__; }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public static function className() : string {\n return get_called_class();\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public static function getClassName() {\n return get_called_class();\n }", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "protected function getClassName(): string\n {\n return $this->className;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassName(): string;", "public function getClassName() : string;", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public function getClass()\n {\n return $this->_className;\n }", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public static function className()\n\t{\n\t\treturn static::class;\n\t}", "public function toClassName(): string\n {\n return ClassName::full($this->name);\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "function getName()\n {\n return get_class($this);\n }", "public function className(): string\n {\n return $this->taskClass->name();\n }", "public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function toString()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function getNamespacedName()\n {\n return get_class();\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }", "function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}", "public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}", "public function __toString() {\n\t\treturn $this->className();\n\t}", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }" ]
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529981", "0.85237026", "0.8502733", "0.8493115", "0.8491238", "0.8488943", "0.8484194", "0.847459", "0.8441478", "0.8418852", "0.8399611", "0.83950585", "0.83949184", "0.83853173", "0.8378261", "0.837777", "0.8372544", "0.8355432", "0.8355432", "0.83479965", "0.8325877", "0.8325877", "0.8312873", "0.83027107", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.82474744", "0.8242934", "0.8202995", "0.8185409", "0.8184752", "0.81829107", "0.81829107", "0.8176191", "0.81761754", "0.8162896", "0.8142928", "0.81323636", "0.8062757", "0.80528253", "0.8045769", "0.8033823", "0.8026215", "0.8001116", "0.79949147", "0.79779136", "0.79672754", "0.7957633", "0.790449", "0.78617185", "0.7860126", "0.7847096", "0.78195953", "0.7817044", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.77821547", "0.7761565", "0.77588034", "0.7747239", "0.77409905", "0.77409905", "0.7710985", "0.76808393", "0.7670475", "0.76640886", "0.76514393", "0.76499707", "0.76323646", "0.76005036", "0.75937456" ]
0.0
-1
Display a listing of the resource.
public function all(){ $posts = $this->repository->all(); SEOMeta::setTitle("Blog"); SEOMeta::setDescription("Blog público com as opiniões de diversos alunos e professores da plataforma"); return view('posts.all', ['posts' => $posts]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id){ $request = $this->service->update($request->all(), $id); $post = $request['success'] ? $request['data'] : null; session()->flash('success',[ 'success' => $request['success'], 'messages' => $request['messages'] ]); return redirect()->back(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id){ $request= $this->service->delete($id); $post = $request['success'] ? $request['data'] : null; session()->flash('success',[ 'success' => $request['success'], 'messages' => $request['messages'] ]); return redirect()->back(); }
{ "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
Return an array of files with their full paths contained in a directory and its subdirectories
public function directoryFiles($path) { $contents = []; // Scan directory $directoryFiles = scandir($path); foreach ($directoryFiles as $index => $filePath) { // Ommit . and .. if ( ! in_array($filePath, ['.', '..'])) { // Check if this is a directory if (is_dir($path . DIRECTORY_SEPARATOR . $filePath)) { // Rescan and get files in this directory $contents = array_merge($contents, self::directoryFiles($path . DIRECTORY_SEPARATOR . $filePath)); } else { // Add file to contens array $contents[] = $path . DIRECTORY_SEPARATOR . $filePath; } } } return $contents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function papi_get_all_files_in_directory( $directory = '' ) {\n\t$result = [];\n\n\tif ( empty( $directory ) || ! is_string( $directory ) ) {\n\t\treturn $result;\n\t}\n\n\tif ( file_exists( $directory ) && $handle = opendir( $directory ) ) {\n\t\twhile ( false !== ( $file = readdir( $handle ) ) ) {\n\t\t\tif ( ! in_array( $file, ['..', '.'] ) ) {\n\t\t\t\tif ( is_dir( $directory . '/' . $file ) ) {\n\t\t\t\t\t$result = array_merge( $result, papi_get_all_files_in_directory( $directory . '/' . $file ) );\n\t\t\t\t} else {\n\t\t\t\t\t$file = $directory . '/' . $file;\n\t\t\t\t\t$result[] = preg_replace( '/\\/\\//si', '/', $file );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tclosedir( $handle );\n\t}\n\n\treturn $result;\n}", "function getFiles($dir) {\n\t$files = array();\n\t$dh = opendir($dir);\n\twhile (($file = readdir($dh)) !== false) {\n\t\t$path = $dir . $file;\n\t\tif (!is_dir($path)) {\n\t\t\t$files[] = $path;\n\t\t}\n\t\telseif (is_dir($path) && basename($path) != \".\" && basename($path) != \"..\") {\n\t\t\t$files = array_merge($files, getFiles($path . \"/\"));\n\t\t}\n\t}\n\tclosedir($dh);\n\treturn $files;\n}", "function getFiles($dir = \".\")\r\n{\r\n $files = array();\r\n if ($handle = opendir($dir)) {\r\n while (false !== ($item = readdir($handle))) {\r\n if (is_file(\"$dir/$item\")) {\r\n $files[] = \"$dir/$item\";\r\n } elseif (is_dir(\"$dir/$item\") && ($item != \".\") && ($item != \"..\")) {\r\n $files = array_merge($files, getFiles(\"$dir/$item\"));\r\n }\r\n }\r\n closedir($handle);\r\n }\r\n return $files;\r\n}", "function getFilesFromDir($dir) { \n\n $files = array(); \n if ($handle = opendir($dir)) { \n while (false !== ($file = readdir($handle))) { \n if ($file != \".\" && $file != \"..\") { \n if(is_dir($dir.'/'.$file)) { \n $dir2 = $dir.'/'.$file; \n $files[] = getFilesFromDir($dir2); \n } \n else { \n $files[] = $dir.'/'.$file; \n } \n } \n } \n closedir($handle); \n } \n\n return $files; \n}", "public function getFiles()\n {\n $result = array();\n foreach ($this->_subdirectories as $directory) {\n $result = array_merge(\n $result,\n array_map(\n array($this, '_prependDirectory'),\n $directory->getFiles()\n )\n );\n }\n $result = array_merge(\n $result,\n array_map(\n array($this, '_prependDirectory'),\n array_keys($this->_files)\n )\n );\n return $result;\n }", "function getFilesInDir($dirname, $path_return = ''){\n if( !is_dir($dirname) ){\n return false;\n }\n // On ouvre le dossier\n $dir = opendir($dirname);\n // Init du tableau\n $files = array();\n // On liste les fichier\n while($file = readdir($dir)){\n if($file != '.' && $file != '..' && !is_dir($dirname.$file) && $file != ' '){\n $files[$file] = $path_return . $file;\n }\n }\n // On ferme le dossier\n closedir($dir);\n // On retourne les fichiers\n return $files;\n}", "function getFilesRecursively($rootPath, $fullPath = false) {\n if (! is_dir($rootPath)) {\n return array();\n }\n\n $dirs = scandir($rootPath);\n if (false === $dirs) {\n return array();\n }\n\n $return = array();\n\n $temps = array();\n foreach ($dirs as $dir) {\n if ($dir == '.' || $dir == '..') continue;\n $temps[] = realpath($rootPath .'/'. $dir);\n }\n $dirs = $temps;\n\n do {\n $new_dirs = array();\n\n foreach ($dirs as $dir) {\n if (is_dir($dir)) {\n $temps = scandir($dir);\n\n if (false !== $temps) {\n foreach ($temps as $temp) {\n if ('.' == $temp || '..' == $temp) continue;\n\n $new_dirs[] = $dir .'/'. $temp;\n }\n }\n }\n\n if (is_file($dir)) {\n $return[] = realpath($dir);\n }\n }\n\n $dirs = $new_dirs;\n\n } while (count($dirs) > 0);\n\n if (false === $fullPath) {\n foreach ($return as $index => $path) {\n $return[$index] = basename($path);\n }\n }\n\n return $return;\n}", "function getLocalFolderFiles($path) {\n $result = array();\n if ($dh = dir($path)) {\n while (FALSE !== ($file = $dh->read())) {\n if ($file != '.' && $file != '..' &&\n !is_dir($path.'/'.$file)) {\n $result[$file] = $file;\n }\n }\n }\n return $result;\n }", "function listFolderFiles($dir, $updir = \"\", $array = array()){\n $ffs = scandir($dir);\n foreach($ffs as $ff){\n if($ff != '.' && $ff != '..' ){\n if(count(explode(\".\", $ff))!=1){\n $array[]=$updir.explode(\".\", $ff)[0];\n }\n else {\n $array = listFolderFiles($dir.\"/\".$ff, $updir .$ff.\"/\", $array);\n }\n }\n }\n return $array;\n}", "function file_array($path, $exclude = \".|..\", $recursive = false) {\n $path = rtrim($path, \"/\") . \"/\";\n $folder_handle = opendir($path);\n $exclude_array = explode(\"|\", $exclude);\n $result = array();\n while(false !== ($filename = readdir($folder_handle))) {\n if(!in_array(strtolower($filename), $exclude_array)) {\n if(is_dir($path . $filename . \"/\")) {\n if($recursive) $result[] = file_array($path, $exclude, true);\n } else {\n $result[] = $filename;\n }\n }\n }\n return $result;\n}", "protected function _getFilesRecursive($dir)\n\t{\n\t\t$files = array();\n\t\tforeach (scandir($dir) as $f) {\n\t\t\tif ($f !== '.' and $f !== '..') {\n\t\t\t\tif (is_dir(\"$dir/$f\")) {\n\t\t\t\t\t$files = array_merge($files, $this->_getFilesRecursive(\"$dir/$f\"));\n\t\t\t\t} else {\n\t\t\t\t\t$files[] = $dir.'/'.$f;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "private function allFilesRecursively($nativePath) {\n\t\t\t$files = scandir($nativePath);\n\t\t\tif (!$files) throw new ServiceException(\"INVALID_PATH\", $this->path);\n\t\t\t\n\t\t\t$ignored = $this->ignoredItems($this->publicPath($nativePath));\n\t\t\t$result = array();\n\t\t\t\n\t\t\tforeach($files as $i => $name) {\n\t\t\t\tif (substr($name, 0, 1) == '.' || in_array(strtolower($name), $ignored))\n\t\t\t\t\tcontinue;\n\t\n\t\t\t\t$fullPath = self::joinPath($nativePath, $name);\n\t\t\t\tif (is_dir($fullPath)) {\n\t\t\t\t\t$result = array_merge($result, $this->allFilesRecursively($fullPath));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result[] = $fullPath;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function findDirectoriesWithFiles($path, $pattern = '*') {\n $res = array();\n if(substr($path, -1) != '/') $path = $path.'/';\n foreach(glob($path.$pattern, GLOB_BRACE) as $file) {\n $res[] = dirname($file);\n }\n foreach(glob($path.'*', GLOB_ONLYDIR|GLOB_BRACE) as $file) {\n $res = array_merge($res, findDirectoriesWithFiles($file, $pattern));\n }\n return $res;\n}", "function sloodle_get_files($dir, $relative = true)\n {\n // Make sure we have a valid directory\n if (empty($dir)) return false;\n // Open the directory\n if (!is_dir($dir)) return false;\n if (!$dh = opendir($dir)) return false;\n \n // Go through each item\n $output = array();\n while (($file = readdir($dh)) !== false) {\n // Ignore anything starting with a . and anything which isn't a file\n if (strpos($file, '.') == 0) continue;\n $filetype = @filetype($dir.'/'.$file);\n if (empty($filetype) || $filetype != 'file') continue;\n \n // Store it\n if ($relative) $output[] = $file;\n else $output[] = $dir.'/'.$file;\n }\n closedir($dh);\n natcasesort($output);\n return $output;\n }", "function getFilesFromDir($dir) {\r\n $filesArray = scandir($dir);\r\n array_shift($filesArray);\r\n array_shift($filesArray);\r\n return $filesArray;\r\n}", "public static function getFiles($path)\n {\n $rii = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($path));\n $files = [];\n foreach ($rii as $file) {\n if ($file->isDir()) {\n continue;\n }\n $files[] = $file->getPathname();\n }\n\n return $files;\n }", "public function get_all_files( $dir ) {\n\t\t$files = array();\n\t\t$dir_iterator = new RecursiveDirectoryIterator( $dir );\n\t\t$iterator = new RecursiveIteratorIterator( $dir_iterator, RecursiveIteratorIterator::SELF_FIRST );\n\n\t\tforeach ( $iterator as $file ) {\n\t\t\t// Only return files that are no directory references or Mac resource forks.\n\t\t\tif ( $file->isFile() && ! in_array( $file->getBasename(), array( '..', '.' ) ) && ! stristr( $file->getPathname(), '__MACOSX' ) ) {\n\t\t\t\tarray_push( $files, $file->getPathname() );\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "function getFiles(string $path): array\n{\n\tclearstatcache();\n\t$scanned_directory = array_diff(scandir($path), array('..', '.', '.DS_Store'));\n\treturn $scanned_directory;\n}", "public function getFilesFromDir($dir)\n {\n $di = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);\n $iterator = new RecursiveIteratorIterator($di);\n $iterator = new CallbackFilterIterator($iterator, [$this, 'filterPaths']);\n $result = [];\n foreach ($iterator as $file) {\n if (!in_array(pathinfo($file, PATHINFO_EXTENSION), $this->file_extensions)) {\n continue;\n }\n $result[] = $file;\n }\n return $result;\n }", "function directoryToArray($directory, $recursive) {\n $array_items = array();\n if ($handle = opendir($directory)) {\n while (false !== ($file = readdir($handle))) {\n if ($file != \".\" && $file != \"..\") {\n if (is_dir($directory. \"/\" . $file)) {\n if($recursive) {\n $array_items = array_merge($array_items, directoryToArray($directory. \"/\" . $file, $recursive));\n }\n } else {\n $file = $directory . \"/\" . $file;\n $array_items[] = preg_replace(\"/\\/\\//si\", \"/\", $file);\n }\n }\n }\n closedir($handle);\n }\n return $array_items;\n}", "function rd_do_dir($dir)\n{\n\t$out=array();\n\t$_dir=($dir=='')?'.':$dir;\n\t$dh=@opendir($_dir);\n\tif ($dh!==false)\n\t{\n\t\twhile (($file=readdir($dh))!==false)\n\t\t{\n\t\t\tif (!in_array($file,array('.','..','git','.svn','CVS','_vti_cnf')))\n\t\t\t{\n\t\t\t\tif (is_file($_dir.'/'.$file))\n\t\t\t\t{\n\t\t\t\t\t$path=$dir.(($dir!='')?'/':'').$file;\n\t\t\t\t\t$out[]=$path;\n\t\t\t\t} elseif (is_dir($_dir.'/'.$file))\n\t\t\t\t{\n\t\t\t\t\t$out=array_merge($out,rd_do_dir($dir.(($dir!='')?'/':'').$file));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $out;\n}", "protected function getDirectoryFiles($directory)\n {\n $files = [];\n foreach (Finder::create()->files()->name('*.php')->in($directory) as $file) {\n $nesting = $this->getDirectoryNesting($file, $directory);\n $files[$nesting.basename($file->getRealPath(), '.php')] = $file->getRealPath();\n }\n return $files;\n }", "public function getFiles($fullPath = true)\n {\n // What information do we have to get?\n if ($fullPath === true) {\n $method = 'realpath';\n\n } else {\n $method = 'dirname';\n }\n\n // Collect the data.\n $result = array();\n foreach ($this->map as $file) {\n $result[] = $method($file['path']);\n }\n\n return $result;\n }", "function dirList($directory) \n{\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory);\n // keep going until all files in directory have been read\n while ($file = readdir($handler)) {\n // if $file isn't this directory or its parent, \n // add it to the results array\n if ($file != '.' && $file != '..')\n $results[] = $directory.$file;\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n}", "function get_files ($folder, $include_subs = FALSE) {\n\tif(substr($folder, -1) == '/') {\n\t\t$folder = substr($folder, 0, -1);\n\t}\n\n\t// Make sure a valid folder was passed\n\tif(!file_exists($folder) || !is_dir($folder) || !is_readable($folder)) {\n\t\treturn FALSE;\n\t\texit();\n\t}\n\n\t// Grab a file handle\n\t$all_files = FALSE;\n\tif($handle = opendir($folder))\t{\n\t\t$all_files = array();\n\t\t// Start looping through a folder contents\n\t\twhile ($file = @readdir ($handle)) {\n\t\t\t// Set the full path\n\t\t\t$path = $folder.'/'.$file;\n\n\t\t\t// Filter out this and parent folder\n\t\t\tif($file != '.' && $file != '..') {\n\t\t\t\t// Test for a file or a folder\n\t\t\t\tif(is_file($path)) {\n\t\t\t\t\t$all_files[] = $path;\n\t\t\t\t} elseif (is_dir($path) && $include_subs) {\n\t\t\t\t\t// Get the subfolder files\n\t\t\t\t\t$subfolder_files = get_files ($path, TRUE);\n\n\t\t\t\t\t// Anything returned\n\t\t\t\t\tif ($subfolder_files) {\n\t\t\t\t\t\t$all_files = array_merge($all_files, $subfolder_files);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Cleanup\n\n\t\tclosedir($handle);\n\t}\n\t// Return the file array\n\t@sort($all_files);\n\treturn $all_files;\n}", "public function getAllFiles() {\n $files = [];\n\n foreach(scandir($this->dir) as $filename) {\n if($filename != '.' && $filename != '..') {\n $files[] = $this->getFileInfo($filename);\n }\n }\n\n return $files;\n }", "public function getFiles(DirectoryInterface $directory): array;", "protected function listFiles($dir) {\n $dir = file_stream_wrapper_uri_normalize($dir);\n $files = array();\n if ($items = scandir($dir)) {\n foreach ($items as $item) {\n if (is_file(\"$dir/$item\")) {\n $files[] = \"$dir/$item\";\n }\n }\n }\n return $files;\n }", "function find_all_files($dir) \n{ \n $files = array();\n foreach (glob($dir) as $file) {\n $files[] = $file;\n }\n return $files;\n}", "public function getFiles($subdir = '', $recursive = false)\n\t{\n\t\t$files = $this->adapter->listContents($subdir, $recursive);\n\t\t$out = array();\n\t\tforeach ($files as $file)\n\t\t{\n\t\t\t$out[] = $file->path;\n\t\t}\n\t\treturn $out;\n\t}", "function RecursiveScanDir($dir, $prefix = '') {\n\t$dir = rtrim($dir, '\\\\/');\n\t$result = array();\n\tforeach (scandir($dir) as $f) {\n if (\n preg_match('`/tmp/`', \"$dir/$f\")\n || preg_match('`/fpdf.php$`', \"$dir/$f\")\n || preg_match('`/libs/pi_barcode.php$`', \"$dir/$f\")\n || preg_match('`/libs/phpmailer/`', \"$dir/$f\")\n || preg_match('`/libs/securimage/`', \"$dir/$f\")\n || preg_match('`/libs/Smarty/`', \"$dir/$f\")\n )\n continue;\n\t\tif ($f !== '.' and $f !== '..') {\n\t\t\tif (is_dir(\"$dir/$f\")) {\n\t\t\t\t$result = array_merge($result, RecursiveScanDir(\"$dir/$f\", \"$prefix$f/\"));\n\t\t\t} else {\n\t\t\t\tif ( strtolower(substr(pathinfo($f,PATHINFO_EXTENSION),0,3)) == \"php\" && pathinfo(__FILE__,PATHINFO_BASENAME ) != pathinfo($f,PATHINFO_BASENAME ) )\n\t\t\t\t\t$result[] = $prefix.$f;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}", "function scandir_recursive($directory, $format = null, $excludes = array()){\n $format = ($format == null) ? 'absolute' : $format;\n $paths = array();\n $stack[] = $directory;\n while($stack){\n $this_resource = array_pop($stack);\n if ($resource = scandir($this_resource)){\n $i = 0;\n while (isset($resource[$i])){\n if ($resource[$i] != '.' && $resource[$i] != '..'){\n $current = array(\n 'absolute' => \"{$this_resource}/{$resource[$i]}\",\n 'relative' => preg_replace('/' . preg_quote($directory, '/') . '/', '', \"{$this_resource}/{$resource[$i]}\")\n );\n if (is_file($current['absolute'])){\n $paths[] = $current[$format];\n } elseif (is_dir($current['absolute'])){\n $paths[] = $current[$format];\n $stack[] = $current['absolute'];\n }\n }\n $i++;\n }\n }\n }\n if (count($excludes) > 0){\n $clean = array();\n foreach($paths as $path){\n $remove = false;\n foreach($excludes as $exclude){\n $exclude = preg_quote($exclude, '/');\n $exclude = str_replace('\\*', '.*', $exclude);\n if (preg_match('/' . $exclude . '/', $path)){\n $remove = true;\n }\n }\n if (!$remove) $clean[] = $path;\n }\n $paths = $clean;\n }\n return $paths;\n}", "public function getFiles()\n {\n $dir = $this->getDir();\n\n return array_filter(array_map(function ($file) use ($dir) {\n if (is_file($dir.$file) && pathinfo($file, PATHINFO_EXTENSION) == 'php') {\n return $dir.$file;\n }\n }, scandir($dir)));\n }", "private function traversePath($path)\n {\n $filenames = array();\n\n $directory = new DirectoryIterator($path);\n\n foreach ($directory as $file) {\n if ($file->isDot()) {\n continue;\n }\n if ($file->isDir()) {\n $filenames = array_merge($filenames, $this->traversePath($file->getPathname()));\n } else {\n $filenames[] = $this->trimFilename($file);\n }\n }\n\n return $filenames;\n }", "static function find_files( $dir ) {\n\t\t$found_files = array();\n\t\t$files = scandir( $dir );\n\n\t\tforeach ( $files as $value ) {\n\t\t\t// skip special dot files\n\t\t\t// and any file that starts with a . - think hidden directories like .svn or .git\n\t\t\tif ( strpos( $value, '.' ) === 0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// is it a file?\n\t\t\tif ( is_file( \"$dir/$value\" ) ) {\n\t\t\t\t$found_files[] = \"$dir/$value\";\n\t\t\t\tcontinue;\n\t\t\t} else { // it's a directory\n\t\t\t\tforeach ( self::find_files( \"$dir/$value\" ) as $value ) {\n\t\t\t\t\t$found_files[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $found_files;\n\t}", "function get_filenames($source_dir, $include_path = FALSE, $_recursion = FALSE)\n {\n static $_filedata = array();\n\n if ($fp = @opendir($source_dir))\n {\n // reset the array and make sure $source_dir has a trailing slash on the initial call\n if ($_recursion === FALSE)\n {\n $_filedata = array();\n $source_dir = rtrim(realpath($source_dir), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n } \n\n while (FALSE !== ($file = readdir($fp)))\n {\n if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0)\n {\n get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE);\n }\n elseif (strncmp($file, '.', 1) !== 0)\n {\n $_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file;\n }\n }\n return $_filedata;\n }\n else\n {\n return FALSE;\n }\n }", "private function get_filelist_as_array($dir = 'images/', $recursive = true, $basedir = '')\n {\n if ($dir == '') {return array();} else {$results = array(); $subresults = array();}\n if (!is_dir($dir)) {$dir = dirname($dir);} // so a files path can be sent\n if ($basedir == '') {$basedir = realpath($dir).DIRECTORY_SEPARATOR;}\n\n $files = scandir($dir);\n foreach ($files as $key => $value){\n if ( ($value != '.') && ($value != '..') ) {\n $path = realpath($dir.DIRECTORY_SEPARATOR.$value);\n if (is_dir($path)) { // do not combine with the next line or..\n if ($recursive) { // ..non-recursive list will include subdirs\n $subdirresults = self::get_filelist_as_array($path,$recursive,$basedir);\n $results = array_merge($results,$subdirresults);\n }\n } else { // strip basedir and add to subarray to separate file list\n $subresults[] = str_replace($basedir,'',$path);\n }\n }\n }\n // merge the subarray to give the list of files then subdirectory files\n if (count($subresults) > 0) {$results = array_merge($subresults,$results);}\n return $results;\n }", "public static function list_files($directory, $recursive = false, $path = false)\n {\n $files = array();\n\n if ($path === false) {\n $paths = array_reverse(self::include_paths());\n\n foreach ($paths as $path) {\n // Recursively get and merge all files\n $files = array_merge($files, self::list_files($directory, $recursive, $path.$directory));\n }\n } else {\n $path = rtrim($path, '/').'/';\n\n if (is_readable($path)) {\n $items = (array) glob($path.'*');\n\n if (! empty($items)) {\n foreach ($items as $index => $item) {\n $files[] = $item = str_replace('\\\\', '/', $item);\n\n // Handle recursion\n if (is_dir($item) and $recursive == true) {\n // Filename should only be the basename\n $item = pathinfo($item, PATHINFO_BASENAME);\n\n // Append sub-directory search\n $files = array_merge($files, self::list_files($directory, true, $path.$item));\n }\n }\n }\n }\n }\n\n return $files;\n }", "function getFiles($path) {\n $files = array();\n if ($handle = opendir($path)) {\n while (false !== ($file = readdir($handle))) {\n if ($file != \".\" && $file != \"..\") {\n $files[] = $file;\n }\n }\n closedir($handle);\n }\n return $files;\n }", "function files_dir__listdir( $dirpath )\n{\n $ret = array() ;\n if($handle = opendir( $dirpath ))\n {\n\twhile (false !== ($file = readdir($handle)))\n\t{\n array_push( $ret, $file ) ;\n } \n }\n return $ret ;\n}", "public function findFiles($dir)\n {\n if (!file_exists($dir)) {\n return array();\n }\n $dirlen = strlen(rtrim($dir, '/')) + 1;\n $names = array();\n foreach (new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator(\n $dir,\n FilesystemIterator::SKIP_DOTS\n )\n ) as $pathname => $fileInfo) {\n if (!$fileInfo->isFile()) {\n continue;\n }\n // strip dir/ from the name\n $names[] = substr($pathname, $dirlen);\n }\n return $names;\n }", "static private function find_contents($dir)\n {\n $result = array();\n $root = scandir($dir);\n foreach ($root as $value) {\n if ($value === '.' || $value === '..') {\n continue;\n }\n if (is_file($dir . DIRECTORY_SEPARATOR . $value)) {\n if (! self::$ext_filter || in_array(strtolower(pathinfo($dir . DIRECTORY_SEPARATOR . $value, PATHINFO_EXTENSION)), self::$ext_filter)) {\n self::$files[] = $result[] = $dir . DIRECTORY_SEPARATOR . $value;\n }\n continue;\n }\n if (self::$recursive) {\n foreach (self::find_contents($dir . DIRECTORY_SEPARATOR . $value) as $value) {\n self::$files[] = $result[] = $value;\n }\n }\n }\n // Return required for recursive search\n return $result;\n }", "public function get_file_list() {\n\t\tset_time_limit( 0 );\n\n\t\t$this->image_dir = self::_add_trailing_slash( $this->image_dir );\n\n\t\tif ( is_dir( $this->image_dir ) ) {\n $result = array();\n\t\t\t$iterator = new \\RecursiveDirectoryIterator( $this->image_dir, \\FileSystemIterator::SKIP_DOTS );\n\t\t\t$iterator = new \\RecursiveIteratorIterator( $iterator );\n\t\t\t$iterator = new \\RegexIterator( $iterator, '/^.+\\.(jpe?g|png|gif|svg)$/i', \\RecursiveRegexIterator::MATCH );\n\n\t\t\tforeach ( $iterator as $info ) {\n\t\t\t if ( $info->isFile() ) {\n $result[] = $info->getPathname();\n }\n\t\t\t}\n\n\t\t\tunset( $iterator );\n\t\t} else {\n $result = false;\n }\n\n\t\treturn $result;\n\t}", "protected static function getRouteFiles(string $dir, array &$results = []): array\n {\n $files = scandir($dir);\n foreach ($files as $key => $value) {\n $path = realpath($dir . DIRECTORY_SEPARATOR . $value);\n if (!is_dir($path)) {\n $results[] = $path;\n } else if ($value !== \".\" && $value !== \"..\") {\n self::getRouteFiles($path, $results);\n }\n }\n return $results;\n }", "function scanDir() {\r\n $returnArray = array();\r\n \r\n if ($handle = opendir($this->uploadDirectory)) {\r\n \r\n while (false !== ($file = readdir($handle))) {\r\n if (is_file($this->uploadDirectory.\"/\".$file)) {\r\n $returnArray[] = $file;\r\n }\r\n }\r\n \r\n closedir($handle);\r\n }\r\n else {\r\n die(\"<b>ERROR: </b> No se puede leer el directorio <b>\". $this->uploadDirectory.'</b>');\r\n }\r\n return $returnArray; \r\n }", "public function directoryFilenames($path = '', $config = [])\n\t{\n\t\tif (!isset($config['fileTypeOrder'])) $config['fileTypeOrder'] = false;\n\n\t\t$files = [];\n\n\t\tif (substr($path, -1) != \"/\")\n\t\t\t$path .= \"/\";\n\n\t\tif (is_dir($path) && $handle = opendir($path))\n\t\t{\n\t\t\tif ($config['fileTypeOrder'])\n\t\t\t{\n\t\t\t\t$config['fileTypeOrder'] = $this->formatFileTypesList($config['fileTypeOrder']);\n\n\t\t\t\t$files_list = glob($path.'*.{'.implode(',', $config['fileTypeOrder']).'}', GLOB_BRACE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$files_list = scandir($path);\n\t\t\t}\n\n\t\t\tforeach ($files_list as $entry)\n\t\t\t{\n\t\t\t\t$entry = str_replace($path, '', $entry); // if glob, remove path from filename\n\n\t\t\t\tif (is_file($path.$entry))\n\t\t\t\t\t$files[] = $entry;\n\t\t\t}\n\t\t}\n\n\t\tif (isset($config['returnJson']) && $config['returnJson'])\n\t\t\treturn json_encode($files);\n\t\telseif (isset($config['returnStr']) && $config['returnStr'])\n\t\t\treturn implode(', ', $files);\n\t\telse\n\t\t\treturn $files;\n\t}", "function getAllFiles($dir, $ext)\n {\n $dirIterator = new RecursiveDirectoryIterator($dir);\n $fileIterator = new RecursiveIteratorIterator($dirIterator);\n $files = array();\n foreach ($fileIterator as $file) {\n if ($file->isFile() && strrpos($file->getPathname(), \".{$ext}\")) {\n $filename = str_replace('\\\\', '/', $file->getPathname());\n $files[] = str_replace(\"{$dir}/\", '', $filename);\n }\n }\n return $files;\n }", "function _getFilesInDir($dir)\n {\n $files = array();\n if (!is_dir($dir)) {\n return $files;\n }\n \n $dh = dir( $dir );\n while ($entry = $dh->read()) {\n if ($entry == \".\" || $entry == \"..\") {\n continue;\n }\n if (is_readable($dir.\"/\".$entry)) {\n array_push($files,$entry);\n }\n }\n return $files;\n }", "function get_all_directory_files($directory_path)\n{\n\n $scanned_directory = array_diff(scandir($directory_path), array('..', '.'));\n\n\n\n return custom_shuffle($scanned_directory);\n}", "public function paths($file_dir, $file_name)\n {\n if (stripos($file_name, $file_dir) === 0) {\n $full_file_path = $file_name;\n $file_name = implode('/', array_diff(explode('/', $file_name), explode('/', $file_dir)));\n } else {\n $full_file_path = $file_dir . '/' . $file_name;\n }\n $this->logger->debug(__METHOD__ . ' ' . $file_name . ' or ' . $full_file_path);\n\n return [$file_name, $full_file_path];\n }", "static function listFiles($dir, $rec = 0) {\n $arr = array();\n $dir = new \\DirectoryIterator($dir);\n foreach ($dir as $d) {\n $pth = $d->getPathname();\n $d->isFile()\n && array_push($arr, $pth);\n $d->isDir() && !$d->isDot()\n && $rec && $arr = array_merge\n ($arr, self::listFiles($pth));\n } return $arr;\n }", "function fileTree($path = CONTENT_DIR, $relative = '') {\n $files = [];\n foreach (scandir($path) as $file) {\n if (strpos($file, '.') !== (int) 0) {\n $files[$relative.$file] = is_dir(\"$path/$file\") ? fileTree(\"$path/$file\", $relative.$file.'/') : $file;\n }\n }\n return $files;\n }", "public function listDir($dir)\n {\n $out = array();\n foreach ($this->getPaths() as $modDir) {\n if (!is_dir($modDir . '/' . $dir)) {\n continue;\n }\n foreach (scandir($modDir . '/' . $dir) as $d) {\n if ($d[0] == '.') {\n continue;\n }\n $out[] = realpath(\"$modDir/$dir/$d\");\n }\n }\n return $out;\n }", "public function get_files($directory)\n {\n $files = array();\n\n if ($directory[strlen($directory)-1] !== '/') $directory .= '/';\n\n if ($catalog = opendir($directory))\n {\n while (false !== ($item = readdir($catalog)))\n {\n if (!in_array($item, array(\".\",\"..\",\".git\")))\n {\n $file = $directory.$item;\n $fileName = pathinfo($item);\n $fileSize = filesize($file) / 8;\n $fileType = filetype($file);\n if ($fileType === 'dir')\n {\n $path = $directory.$fileName['filename'];\n }\n $fileData = array(\n 'name' => $fileName['filename'],\n 'extension' => $fileName['extension'],\n 'size' => $fileSize,\n 'type' => $fileType,\n 'path' => $path,\n );\n $files[] = $fileData;\n }\n }\n }\n closedir($catalog);\n\n return $files;\n }", "function find($dir, $pattern){\n // escape any character in a string that might be used to trick\n // a shell command into executing arbitrary commands\n $dir = escapeshellcmd($dir);\n // get a list of all matching files in the current directory\n $files = glob(\"$dir/$pattern\");\n // find a list of all directories in the current directory\n // directories beginning with a dot are also included\n foreach (glob(\"$dir/{.[^.]*,*}\", GLOB_BRACE|GLOB_ONLYDIR) as $sub_dir){\n $arr = find($sub_dir, $pattern); // resursive call\n $files = array_merge($files, $arr); // merge array with files from subdirectory\n }\n // return all found files\n return $files;\n}", "function directory_to_array($directory, $recursive = true, $include_directories_in_list = true, $include_files_in_list = false)\r\n\t{\r\n\t\t$array_items = array();\r\n\t\tif ($handle = opendir($directory))\r\n\t\t{\r\n\t\t\twhile (false !== ($file = readdir($handle)))\r\n\t\t\t{\r\n\t\t\t\tif ($file != \".\" && $file != \"..\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (is_dir($directory. \"/\" . $file))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($recursive)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$array_items = array_merge($array_items, $this->directory_to_array($directory. \"/\" . $file, $recursive));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($include_directories_in_list)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$file = $directory . \"/\" . $file;\r\n\t\t\t\t\t\t\t$array_items[] = preg_replace(\"/\\/\\//si\", \"/\", $file);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($include_files_in_list)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$file = $directory . \"/\" . $file;\r\n\t\t\t\t\t\t\t$array_items[] = preg_replace(\"/\\/\\//si\", \"/\", $file);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($handle);\r\n\t\t}\r\n\t\treturn $array_items;\r\n\t}", "public static function get_file_list() {\n\t\t$new_file_list = array();\n\t\t$files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( ABSPATH ), RecursiveIteratorIterator::SELF_FIRST );\n\t\tforeach ( $files as $file ) {\n\t\t\t$file = realpath( $file );\n\t\t\tif ( File_List::in_ignore_list( $file ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( is_dir( $file) ) {\n\t\t\t\t$file .= '/';\n\t\t\t}\n\t\t\t$new_file_list[] = array( $file, File_List::INCLUDED ) ;\n\t\t}\n\t\tasort( $new_file_list );\n\t\treturn array_values( $new_file_list );\n\t}", "public function getFileTree($directory)\n {\n $directoryIterator = new \\RecursiveDirectoryIterator($directory, \\FilesystemIterator::SKIP_DOTS);\n $iterator = new \\RecursiveIteratorIterator($directoryIterator);\n $files = [];\n foreach ($iterator as $file) {\n $files[] = trim(str_replace($directory, '', $file->getPathname()), DIRECTORY_SEPARATOR);\n }\n return $files;\n }", "function getDirectoryList($directory)\n{\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory) or die($directory . \" doesn't exist\");\n // open directory and walk through the filenames\n while ($file = readdir($handler)) {\n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\") {\n $results[] = $file;\n }\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n}", "public function getDirFiles($path, $constSelector = null){\n $directoryContent = scandir($path);\n $contentCollection = [];\n foreach($directoryContent as $dirElement){\n if($this->checkFileSelector($path.$dirElement, $constSelector)){\n $contentCollection[] = $dirElement;\n }\n }\n return $contentCollection;\n }", "function createFileList($path=\"\", $dir=\"\") {\n\t\t\n\t\tif (empty($path)) {\n\t\t\t$path = $this->path;\n\t\t\t$root = true;\n\t\t} else {\n\t\t\t$root = false;\n\t\t}\n\n\t\t// temporary arrays to hold separate file and directory content\n\t\t$filelist = array();\n\t\t$directorylist = array();\n\n\t\t// get the ignore list, in local scope (can't use $this-> later on)\n\t\t$ignorelist = $this->ignorelist;\n\n\t\t// Open directory and read contents\n\t\tif (is_dir($path)) {\n\n\t\t\t// loop through the contents\n $dirContent = scandir($path);\n\n\t\t\tforeach($dirContent as $key => $file) {\n\n\t\t\t\t// skip over any files in the ignore list, and mac-only files starting with ._\n\t\t\t\tif (!in_array($file, $ignorelist) && (strpos($file, \"._\") !== 0)) {\n\n\t\t\t\t\t// condition : if it is a directory, add to dir list array\n\t\t\t\t\tif (is_dir($path.$file)) {\n\n\t\t\t\t\t\t$directorylist[$file] = array(\n\t\t\t\t\t\t\t\"files\" => $this->createFileList($path.$file, $file)\n\t\t\t\t\t\t);\n\n // file, add to file array\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($root) {\n\t\t\t\t\t\t\t$directorylist[\"root\"][\"files\"][] = array(\n\t\t\t\t\t\t\t\t\"file\" => $file,\n\t\t\t\t\t\t\t\t\"path\" => $path,\n\t\t\t\t\t\t\t\t\"dir\" => $dir\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$filelist[] = array(\n\t\t\t\t\t\t\t\t\"file\" => $file,\n\t\t\t\t\t\t\t\t\"path\" => $path,\n\t\t\t\t\t\t\t\t\"dir\" => $dir . \"/\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// merge file and directory lists\n\t\t$finalList = array_merge($directorylist, $filelist);\n\t\t\n\t\treturn $finalList;\n\t}", "function getPathArray($mixedPath) {\r\n\t$toReturn = array();\r\n\t\r\n\t$matchResult = preg_match('/^[\\\\\\\\|\\/]+/', $mixedPath);\r\n\t\r\n\tif ($matchResult != 0) {\r\n\t\t$toReturn[] = DS; // add / or \\ to beginning of path if that is intended.\r\n\t}\r\n\t\r\n\t$splitPath = spliti('[/\\]', $mixedPath);\r\n\t\r\n\tfor ($i = 0; $i < count($splitPath)-1; ++$i) {\r\n\t\t$toReturn[] = $splitPath[$i]; // add all the directories minus the filename.\r\n\t}\r\n\t\r\n\treturn $toReturn;\r\n}", "public function listFilePathsRecursive(callable $filter = null): array\n {\n return iterator_to_array($this->scanFilePathsRecursive($filter));\n }", "function getDirContents($dir)\n{\n $handle = opendir($dir);\n if (!$handle)\n return array();\n $contents = array();\n while ($entry = readdir($handle)) {\n if ($entry == '.' || $entry == '..')\n continue;\n \n $entry = $dir . DIRECTORY_SEPARATOR . $entry;\n if (is_file($entry)) {\n $contents[] = $entry;\n } else if (is_dir($entry)) {\n $contents = array_merge($contents, getDirContents($entry));\n }\n }\n closedir($handle);\n return $contents;\n}", "function wsod_pathposall($dir){ \n $slash = wsod_detect_filesystem_slash();\n $pos = wsod_strposall($dir,$slash);\n foreach ($pos as $no) {\n $subdir[] = substr($dir, 0, $no);\n }\n if (is_array($subdir)) {\n rsort($subdir); // make list in reverse\n return $subdir; // return array of available subdir paths\n } else {\n return array();\n }\n}", "public static function getDirContents($dir, &$results = array())\n {\n $files = scandir($dir);\n\n foreach($files as $key => $value){\n $path = realpath($dir.DIRECTORY_SEPARATOR.$value);\n if(!is_dir($path)) {\n $results[] = $path;\n } else if($value != \".\" && $value != \"..\") {\n self::getDirContents($path, $results);\n $results[] = $path;\n }\n }\n\n return $results;\n }", "private static function getSubDirs( $dir ) {\n\t\t$files = array();\n\t\t$dir = new \\DirectoryIterator($dir);\n\t\tforeach ($dir as $fileinfo) {\n\t\t\t# Filter unwanted files\n\t\t\tif( $fileinfo->isDot()\n\t\t\t || !$fileinfo->isDir()\n\t\t\t || $fileinfo->isLink()\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$files[] = $fileinfo->getFilename();\n\t\t}\n\t\tsort($files);\n\t\treturn $files;\n\t}", "public function getFiles($path)\n {\n $files = [];\n\n foreach (new \\DirectoryIterator($this->path($path)) as $file) {\n if ($file->isFile()) {\n $files[] = $file->getFileInfo();\n }\n }\n\n return $files;\n }", "public function get_file_list_in_glob( $dir = '' ) {\n\t\tset_time_limit( 0 );\n\n\t\t$result = array();\n\t\t$dir = ( empty( $dir ) ) ? $this->image_dir : $dir;\n\t\t$dir = self::_delete_trailing_slash( $dir );\n\n\t\tif ( is_dir( $dir ) ) {\n\t\t\t$files = glob( $dir . DIRECTORY_SEPARATOR . \"*\", GLOB_BRACE );\n\n\t\t\tforeach ( $files as $v ) {\n\t\t\t\tif ( is_file( $v ) ) {\n\t\t\t\t\tswitch ( self::get_mime_type( $v ) ) {\n\t\t\t\t\t\tcase 'image/jpeg':\n\t\t\t\t\t\tcase 'image/png':\n\t\t\t\t\t\tcase 'image/gif':\n\t\t\t\t\t\tcase 'image/svg+xml':\n\t\t\t\t\t\t\t$result[] = $v;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( is_dir( $v ) ) {\n\t\t\t\t\t$result = array_merge( $result, self::get_file_list_in_glob( $v ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset( $files );\n\t\t}\n\n\t\treturn $result;\n\t}", "function browse($dir) {\nglobal $filenames;\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle))) {\n if ($file != \".\" && $file != \"..\" && is_file($dir.'/'.$file)) {\n $filenames[] = $dir.'/'.$file;\n }\n else if ($file != \".\" && $file != \"..\" && is_dir($dir.'/'.$file)) {\n browse($dir.'/'.$file);\n }\n }\n closedir($handle);\n }\n return $filenames;\n}", "public static function getFiles( $directory )\n {\n if ( substr( $directory, -1 ) == DS )\n {\n $directory = substr( $directory, 0, -1 );\n }\n \n if( !file_exists( $directory ) || !is_dir( $directory ) )\n throw new Exception( 'Directory ['.Security::preventInjection ( $directory ).'] does not exist, unable to get files.' );\n \n $base = $directory;\n $directoryHandle = opendir( $directory );\n \n $arr = array();\n\n while ( $contents = readdir( $directoryHandle ) )\n {\n if ( $contents != '.' && $contents != '..' )\n {\n $path = $directory . DS . $contents;\n\n if ( is_dir( $path ) )\n {\n $files = self::getFiles( $base.DS.$contents );\n foreach($files as $file)\n $arr[] = $file;\n }\n else\n {\n $arr[] = $base.DS.$contents;\n }\n }\n }\n\n closedir( $directoryHandle );\n return $arr;\n }", "function getDirectoryList ($directory) {\r\r\n // create an array to hold directory list\r\r\n $results = array();\r\r\n\r\r\n // create a handler for the directory\r\r\n $handler = opendir($directory);\r\r\n\r\r\n // open directory and walk through the filenames\r\r\n while ($file = readdir($handler)) {\r\r\n\r\r\n // if file isn't this directory or its parent, add it to the results\r\r\n if ($file != \".\" && $file != \"..\") {\r\r\n $results[] = $file;\r\r\n }\r\r\n\r\r\n }\r\r\n\r\r\n // tidy up: close the handler\r\r\n closedir($handler);\r\r\n\r\r\n // done!\r\r\n return $results;\r\r\n}", "public function Get(){\n\n // TODO: this is horrible - try to use glob or RecursiveIteratorIterator - no time\n $fileList = [];\n\n if (!is_dir($this->currentPath)) {\n return $fileList;\n }\n\n $files = $this->scanFolder($this->currentPath);\n\n // up one level link\n if ($this->currentPath != $this->rootPath) {\n $fileList[] = array(\n 'file_name' => \"&uarr;\",\n 'directory' => true,\n 'extension' => '',\n 'size' => \"\",\n 'link' => $this->oneLevelUp(),\n );\n }\n\n foreach ($files as $file) {\n if($file == \".\" || $file == \"..\"){\n continue;\n }\n\n if ($this->isDir($file)) {\n $fileList[] = array(\n 'file_name' => $file,\n 'directory' => true,\n 'extension' => 'folder',\n 'size' => \"\",\n 'link' => $this->currentPath . $file,\n );\n } else {\n // filter on the fly\n $ext = $this->fileExtension($file);\n if(!empty($this->extensionFilter)){\n if(!in_array($ext, $this->extensionFilter)){\n continue;\n }\n }\n $fileList[] = [\n 'file_name' => $file,\n 'directory' => false,\n 'extension' => $ext,\n 'size' => $this->fileSize($file),\n 'link' => \"\",\n ];\n\n }\n }\n\n return $fileList;\n }", "function sloodle_get_subdirectories($dir, $relative = true)\n {\n // Make sure we have a valid directory\n if (empty($dir)) return false;\n // Open the directory\n if (!is_dir($dir)) return false;\n if (!$dh = opendir($dir)) return false;\n \n // Go through each item\n $output = array();\n while (($file = readdir($dh)) !== false) {\n // Ignore anything starting with a . and anything which isn't a directory\n if (strpos($file, '.') == 0) continue;\n $filetype = @filetype($dir.'/'.$file);\n if (empty($filetype) || $filetype != 'dir') continue;\n \n // Store it\n if ($relative) $output[] = $file;\n else $output[] = $dir.'/'.$file;\n }\n closedir($dh);\n natcasesort($output);\n return $output;\n }", "public function getFilesForGivenDirectory($directory, $crawlRecursive = false, &$entries = array()) {\n\t\tif (substr($directory, -1, 1) != '/') $directory .= '/';\n\t\tself::checkForDirectoryToBeExisting($directory);\n\t\t$dirHandle = opendir($directory);\n\t\tif (!$dirHandle) throw new Exception('Directory ' . $directory . ' could not be opened 1287246092');\n\t\twhile(($dirEntry = readdir($dirHandle)) != false) {\n\t\t\tif (!($dirEntry == '.' || $dirEntry == '..')) {\n\t\t\t\tif (!is_dir($directory.$dirEntry)) {\n\t\t\t\t\tif ($this->fileMatchesFilePattern($dirEntry)) {\n\t\t\t\t\t $entries[] = $directory . $dirEntry;\n\t\t\t\t\t}\t\n\t\t\t\t} elseif (is_dir($directory.$dirEntry) && $crawlRecursive) {\n\t\t\t\t\t$this->getFilesForGivenDirectory($directory.$dirEntry, true, $entries);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($dirHandle);\n\t\treturn $entries;\n\t}", "private function directoryScan($dir) {\n\t\t\n\t\t// check for the validity of input / working directory\n\t\t\n\t\tif (!is_dir($dir)) {\n\t\t\tdie(\"'$dir' is not a directory.\".LE);\n\t\t}\n\t\t\n\t\t// listing directory contents\n\t\t\n\t\t$result = [];\n\t\t\n\t\t$root = scandir($dir);\n\t\tforeach($root as $value)\n\t\t{\n\t\t\t// removing dots & output directory\n\t\t\t\n\t\t\tif($value === '.' || $value === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// listing only files\n\t\t\t\n\t\t\tif(is_file(\"$dir\".DS.\"$value\")) {\n\t\t\t\t$result[$value]=\"$dir\".DS.\"$value\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// recursive call to self(this method) so we can get files listing recursively\n\t\t\t\n\t\t\tforeach($this->directoryScan(\"$dir\".DS.\"$value\") as $value1)\n\t\t\t{\n\t\t\t\t$result[basename($value1)]=$value1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function listDirPathsRecursive(callable $filter = null): array\n {\n return iterator_to_array($this->scanDirPathsRecursive($filter));\n }", "function getDirectoryList ($directory) {\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory);\n // open directory and walk through the filenames\n while ($file = readdir($handler)) {\n // if file isn't this directory or its parent, add it to the results\n if ($file[0] != '.') {\n $results[] = is_dir($directory . '/' . $file) ? \"{$file}/\" : $file;\n }\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n sort($results);\n return $results;\n}", "public function getPaths()\n {\n $out = array();\n $pluginsDir = $this->baseDir . '/modules';\n foreach (scandir($pluginsDir) as $f) {\n if ($f[0] != '.' && is_dir($pluginsDir . '/' . $f)) {\n $out[$f] = realpath($pluginsDir . '/' . $f);\n }\n }\n return $out;\n }", "public function getFiles() : Array\n\t{\n\t\t$files = [];\n\n\t\tif ($this->exists() && $this->isReadable()) {\n\n\t\t\t$directory = opendir($this->directory);\n\t\t\twhile($opened = readdir($directory)) {\n\t\t\t\n\t\t\t\tif (is_file($this->directory . DIRECTORY_SEPARATOR . $opened) && !Directory::isBlockListed($opened)) {\n\t\t\t\t\t$files[] = $opened;\n\t\t\t\t}\n\t\t\n\t\t\t}\n\n\t\t\tclosedir($directory);\n\t\t}\n\n\t\treturn $files;\n\t}", "public function loadFiles()\n\t{\n\t\t$files = array();\n\t\t\n\t\t$searchPath = $this->getLocalFolder().\"/*.*\";\n\t\t$filesArray = glob($searchPath);\n\t\t\n\t\tforeach($filesArray as $file)\n\t\t{\n\t\t\t$files[] = new File($file);\n\t\t}\n\t\t\n\t\treturn $files;\n\t}", "private function getEntriesRecursive($path, $baseDir='')\n {\n $paths = array();\n\n $startPos = 0;\n if (!empty($baseDir)) {\n $startPos = strlen($baseDir)+1;\n $path = $baseDir.'/'.$path;\n }\n\n if (!file_exists($path)) {\n $paths[] = substr($path, $startPos);\n } else {\n $files = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),\n RecursiveIteratorIterator::CHILD_FIRST\n );\n\n foreach ($files as $fileinfo) {\n $paths[] = substr($fileinfo->getPathname(), $startPos);\n }\n }\n\n return $paths;\n }", "private function getBundleFiles(string $pPath): array\n {\n $results = [];\n\n foreach (new DirectoryIterator($pPath) as $file) {\n if ($file->isDot()) {\n continue;\n }\n\n if ($file->isDir()) {\n $results = array_merge($results, $this->getBundleFiles($file->getPathname()));\n continue;\n }\n\n $filename = $file->getFilename();\n $path = basename($file->getPath());\n $results[] = [$file->getPathname(), \"$path/$filename\"];\n }\n\n return $results;\n }", "function getFiles($path, $extra = \"\") {\n // check for needed slash at the end\n\t\t$length = strlen($path);\n\t\tif ($path{$length-1}!='/') { \n $path.='/';\n }\n \n $imagetypes = $this->conf[\"filetypes\"] ? explode(',', $this->conf[\"filetypes\"]) : array(\n 'jpg',\n 'jpeg',\n 'gif',\n 'png'\n );\n\n if($dir = dir($path)) {\n $files = Array();\n\n while(false !== ($file = $dir->read())) {\n if ($file != '.' && $file != '..') {\n $ext = strtolower(substr($file, strrpos($file, '.')+1));\n if (in_array($ext, $imagetypes)) {\n array_push($files, $extra . $file);\n }\n else if ($this->conf[\"recursive\"] == '1' && is_dir($path . \"/\" . $file)) {\n $dirfiles = $this->getFiles($path . \"/\" . $file, $extra . $file . \"/\");\n if (is_array($dirfiles)) {\n $files = array_merge($files, $dirfiles);\n }\n }\n }\n }\n\n $dir->close();\n #$files = shuffle($files);\n #echo t3lib_div::view_array($files);\n return $files;\n }\n }", "public function allFiles($directory)\n {\n return iterator_to_array(Finder::create()->files()->ignoreDotFiles(false)->in($directory), false);\n }", "protected function collectFileList($path)\n {\n $realPath = realpath($this->resolveBundlePath($path));\n $filePathArray = array();\n\n switch (true) {\n case is_file($realPath):\n $filePathArray[] = $realPath;\n continue;\n case is_dir($realPath):\n $iterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($realPath),\n \\RecursiveIteratorIterator::CHILD_FIRST\n );\n foreach ($iterator as $item) {\n if (substr_count($item->getPathname(), '/.') == 0 && ($item->isFile() || $item->isLink())) {\n $filePathArray[] = $item->getPathname();\n }\n }\n continue;\n default:\n $message = 'The provided path is neither a file nor a directory: ' . $realPath;\n throw new \\Exception($message);\n }\n\n return $filePathArray;\n }", "public static function get_files_list_in_dir($dir_path = '') {\n $current_dir = self::get_media_dir_path($dir_path);\n $file_list = array();\n\n if ($handle = opendir($current_dir)) {\n while (false !== ($file = readdir($handle))) {\n if ($file != \".\") {\n $file_path = self::get($dir_path.$file);\n $file_path_in_dir = $current_dir.$file;\n $is_dir = is_dir($file_path_in_dir);\n $file_size = floor((filesize($file_path_in_dir) / 1024) * 100) / 100 . ' KB';\n\n array_push($file_list, array(\n 'file_name' => $file,\n 'file_path' => $file_path,\n 'file_size' => !$is_dir ? $file_size : '',\n 'is_dir' => $is_dir\n ));\n }\n }\n \n closedir($handle);\n }\n\n // Sort the files based on the is_dir variable\n $is_dir_sort = array_column($file_list, 'is_dir');\n array_multisort($is_dir_sort, SORT_DESC, $file_list);\n\n return $file_list;\n }", "function getDirContents(string $dir, array $excludeFiles=array()): array\n {\n $results = array();\n $files = scandir($dir);\n\n foreach($files as $value){\n\n if(!is_dir($dir. DIRECTORY_SEPARATOR .$value)){\n if (strstr($value, 'Test.php') !== false) {\n array_push($results,array(\"file\"=>$value,\"dir\"=>$dir. DIRECTORY_SEPARATOR));\n }\n } else if(is_dir($dir. DIRECTORY_SEPARATOR .$value) && !in_array($value,$excludeFiles)) {\n $rr=$this->getDirContents($dir. DIRECTORY_SEPARATOR .$value,$excludeFiles);\n $results=array_merge($results, $rr);\n }\n }\n return $results;\n }", "function directory_list($directory_base_path, $filter_dir = false, $filter_files = false, $exclude = \".|..|.DS_Store|.svn\", $recursive = true)\r\n\t{\r\n\t\t$directory_base_path = rtrim($directory_base_path, \"/\") . \"/\";\r\n\r\n\t\tif ( !is_dir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"File at: $directory_base_path is not a directory.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$result_list = array();\r\n\t\t$exclude_array = explode(\"|\", $exclude);\r\n\r\n\t\tif ( !$folder_handle = opendir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"Could not open directory at: $directory_base_path\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile ( false !== ($filename = readdir($folder_handle)) )\r\n\t\t\t{\r\n\t\t\t\tif ( !in_array($filename, $exclude_array) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( is_dir($directory_base_path . $filename . \"/\") )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( $recursive && strcmp($filename, \".\") != 0 && strcmp($filename, \"..\") != 0 )\r\n\t\t\t\t\t\t{ // prevent infinite recursion\r\n\t\t\t\t\t\t\terror_log($directory_base_path . $filename . \"/\");\r\n\t\t\t\t\t\t\t$result_list[$filename] = $this->directory_list(\"$directory_base_path$filename/\", $filter_dir, $filter_files, $exclude, $recursive);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telseif ( !$filter_dir )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ( !$filter_files )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($folder_handle);\r\n\t\t\treturn $result_list;\r\n\t\t}\r\n\t}", "public static function getListOfLocalFilesByDir( string $dir ): array\n {\n $files = [];\n\n // TODO: move to arg\n $sitePath = SiteInfo::getPath('site');\n\n if (is_dir($dir)) {\n $iterator = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator(\n $dir,\n RecursiveDirectoryIterator::SKIP_DOTS\n )\n );\n\n foreach (array_keys(iterator_to_array($iterator)) as $filename) {\n if (! is_string($filename)) {\n continue;\n }\n\n $pathCrawlable = self::filePathLooksCrawlable($filename);\n\n if (!$pathCrawlable) {\n continue;\n }\n\n $url = str_replace($sitePath, '/', $filename);\n\n $files[] = $url;\n }\n }\n\n return $files;\n }", "private function findFiles($directory, $extensions = array())\r\n {\r\n $directory = ROOT_DIR_NAME;\r\n\r\n if($this->check_search_directory($directory))\r\n {\r\n $search = $this->filter_search_str($this->search);\r\n $directories = array();//\"\";\r\n function glob_recursive($directory, &$directories = array(), $search)\r\n {\r\n foreach(glob($directory, GLOB_ONLYDIR | GLOB_NOSORT) as $folder)\r\n {\r\n $directories[] = $folder;\r\n glob_recursive(\"{$folder}/*\", $directories, $search);\r\n }\r\n }\r\n @glob_recursive($directory, $directories, $search);\r\n $files = array ();\r\n foreach($directories as $directory)\r\n {\r\n $slashes = \"../\";\r\n if(strpos($directory, \"..//\") !== FALSE)\r\n {\r\n $slashes = \"..//\";\r\n }\r\n if (in_array(str_replace($slashes, \"\", $directory), $this->ignored)) continue;\r\n $this->find_all_files($directory, $extensions, $search);\r\n /*foreach($extensions as $extension)\r\n {\r\n foreach(glob(\"{$directory}/{$search}.{$extension}\") as $file)\r\n {\r\n $files[$extension][] = $file;\r\n $filename = str_replace(\"..//\", \"\", $file);\r\n $this->root_files_folders[$filename] = filemtime($file);\r\n }\r\n }*/\r\n }\r\n @arsort($this->root_files_folders);\r\n if($this->sort != 'date')\r\n {\r\n @$this->root_files_folders = $this->sort_with_name($this->root_files_folders);\r\n }\r\n }\r\n @$this->root_files_folders = array_keys($this->root_files_folders);\r\n }", "function directoryToArray($directory, $recursive = true) {\n\t\t $array_items = array();\n\t\t if ($handle = opendir($directory)) {\n\t\t\t while (false !== ($file = readdir($handle))) {\n\t\t\t\t if ($file != \".\" && $file != \"..\") {\n\t\t\t\t\t if (is_dir($directory. \"/\" . $file)) {\n\t\t\t\t\t\t if($recursive) {\n\t\t\t\t\t\t\t $array_items = array_merge($array_items, $this->directoryToArray($directory. \"/\" . $file, $recursive));\n\t\t\t\t\t\t }\n\t\t\t\t\t\t $file = $directory . \"/\" . $file;\n\t\t\t\t\t\t $array_items[] = preg_replace(\"/\\/\\//si\", \"/\", $file);\n\t\t\t\t\t } else {\n\t\t\t\t\t\t $file = $directory . \"/\" . $file;\n\t\t\t\t\t\t $array_items[] = preg_replace(\"/\\/\\//si\", \"/\", $file);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t\t closedir($handle);\n\t\t }\n\t\t return $array_items;\n\t }", "public function fileList()\n {\n return array_values(array_diff(scandir($this->location), ['.', '..']));\n }", "public static function findFiles(string $pathDir, ?string $pattern = null, bool $bReturnRelativePaths = false)\n {\n return self::_findFilesRecursive($pathDir, $pattern, $bReturnRelativePaths, '');\n }", "public function getFileToConvert()\n {\n $directory = $this->inputDirectory;\n $files = array();\n if ($handle = @opendir($directory)) {\n while (false !== ( $file = readdir($handle) )) {\n if (!preg_match(\"/^\\./\", $file)) {\n if (is_file($directory . '/' . $file)) {\n $files[] = $file;\n }\n }\n }\n }\n return $files;\n }", "public function getFiles(Project $p, $includeEmpty = true) {\n \n if ($this->files === null) {\n \n $ds = $this->getDirectoryScanner($p);\n $this->files = $ds->getIncludedFiles();\n \n if ($includeEmpty) {\n \n // first any empty directories that will not be implicitly added by any of the files\n $implicitDirs = array();\n foreach($this->files as $file) {\n $implicitDirs[] = dirname($file);\n } \n \n $incDirs = $ds->getIncludedDirectories();\n \n // we'll need to add to that list of implicit dirs any directories\n // that contain other *directories* (and not files), since otherwise\n // we get duplicate directories in the resulting tar\n foreach($incDirs as $dir) {\n foreach($incDirs as $dircheck) {\n if (!empty($dir) && $dir == dirname($dircheck)) {\n $implicitDirs[] = $dir;\n }\n }\n }\n \n $implicitDirs = array_unique($implicitDirs);\n \n // Now add any empty dirs (dirs not covered by the implicit dirs)\n // to the files array. \n \n foreach($incDirs as $dir) { // we cannot simply use array_diff() since we want to disregard empty/. dirs\n if ($dir != \"\" && $dir != \".\" && !in_array($dir, $implicitDirs)) {\n // it's an empty dir, so we'll add it.\n $this->files[] = $dir;\n }\n }\n } // if $includeEmpty\n \n } // if ($this->files===null)\n \n return $this->files;\n }", "function getAllFiles($dirName){\n $files = [];\n try{\n $dirHandle = opendir( appDir($dirName));\n while($fileOrDir = readdir($dirHandle)){\n if(is_dir($fileOrDir)){\n continue;\n }\n $files[] = $dirName.'/'.$fileOrDir;\n }\n closedir($dirHandle);\n }catch(\\Exception $ex){\n echo $ex->getMessage();\n exit;\n }\n return $files;\n}", "function getFiles(){\r\n\r\n global $dirPtr, $theFiles;\r\n \r\n chdir(\".\");\r\n $dirPtr = openDir(\".\");\r\n $currentFile = readDir($dirPtr);\r\n while ($currentFile !== false){\r\n $theFiles[] = $currentFile;\r\n $currentFile = readDir($dirPtr);\r\n } // end while\r\n \r\n}", "function scan_directory($dir, $ext = '*', $recurse = true) {\n $files = array ();\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle))) {\n if ($file == '.' || $file == '..' ||\n $file == 'CVS' || preg_match('|^\\.|', $file)) {\n continue;\n }\n if (is_link($dir . '/' . $file)) {\n continue;\n }\n if (is_dir ($dir . '/' . $file)) {\n if ($recurse == true)\n $files = array_merge($files, scan_directory ($dir . '/' . $file, $ext));\n } else {\n if($ext == get_file_extension($file) || $ext == '*') {\n $files[] = $dir . '/' . $file;\n }\n }\n }\n closedir($handle);\n }\n return $files;\n}", "public static function directoryFileList($directory){\n $directorys = scandir($directory);\n\t\tunset($directorys[0]);\n unset($directorys[1]);\n $directorys = array_values($directorys);\n for ($checkDirectory=0; $checkDirectory < count($directorys); $checkDirectory++) {\n if(!is_file($directory.$directorys[$checkDirectory])){\n unset($directorys[$checkDirectory]);\n }\n }\n return array_values($directorys);\n }" ]
[ "0.7470955", "0.74113894", "0.739653", "0.7379512", "0.73318774", "0.7309054", "0.7257001", "0.71673524", "0.7162255", "0.71231693", "0.7106282", "0.7070243", "0.7036096", "0.7017344", "0.6989162", "0.69792134", "0.6940224", "0.6939942", "0.6930784", "0.69298387", "0.6923743", "0.6875841", "0.6862709", "0.6853105", "0.68446845", "0.6832023", "0.6823228", "0.6816348", "0.6799952", "0.6792188", "0.6789362", "0.6787582", "0.6784028", "0.67766505", "0.6761609", "0.6755119", "0.674822", "0.6745334", "0.67397016", "0.6717116", "0.6716006", "0.67042017", "0.66990215", "0.6698884", "0.6697791", "0.66783184", "0.66777045", "0.66751367", "0.66735196", "0.66725117", "0.6650651", "0.66438025", "0.6631815", "0.66209805", "0.6614321", "0.6614172", "0.6608258", "0.6605989", "0.6589171", "0.6580818", "0.6573706", "0.6568669", "0.6560838", "0.6559463", "0.65485114", "0.6537044", "0.6526897", "0.65174055", "0.6516372", "0.6513236", "0.65105444", "0.6501369", "0.6492616", "0.64896166", "0.64864784", "0.6472662", "0.6465239", "0.6463628", "0.6455913", "0.6445807", "0.64431703", "0.6442867", "0.6439272", "0.64376795", "0.64368296", "0.6435956", "0.64174986", "0.6416151", "0.64137846", "0.6409384", "0.64073956", "0.64071196", "0.6400795", "0.63995147", "0.6397748", "0.639632", "0.6393945", "0.6386711", "0.6383953", "0.63816863" ]
0.79096025
0
Return the form metadata.
public static function get_big_sea_survey_definition() { return array( 'title' => 'Big Sea Survey', 'category' => 'Forms for specific surveying methods', 'description' => 'A dynamic form which allows a front page to define the number of transects to record across '. 'a set of zones and multiple copies of the second page allow data to be input per transect.' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMetaData()\n {\n if (is_null($this->_metaData)) {\n list($app, $name) = explode('/', $this->_config['name']);\n $args = array($name, $this->_config['params']);\n $this->_metaData = $GLOBALS['registry']->callByPackage(\n $app, 'getTableMetaData', $args);\n\n // We need to make vars for the columns.\n foreach ($this->_metaData['sections'] as $secname => $section) {\n foreach ($section['columns'] as $col) {\n $title = isset($col['title']) ? $col['title'] : '';\n $typename = isset($col['type']) ? $col['type'] : 'text';\n $params = isset($col['params']) ? $col['params'] : array();\n // Column types which begin with % are pseudo-types handled\n // directly.\n if (substr($typename, 0, 1) != '%') {\n $type = Horde_Form::getType($typename, $params);\n $var = new Horde_Form_Variable(\n $title, $col['name'], $type, false, true, '');\n $this->_formVars[$secname][$col['name']] = $var;\n }\n }\n }\n }\n\n return $this->_metaData;\n }", "public function metadata()\r\n\t{\r\n return array(\"nit\" => array(),\r\n \"nombre\" => array(),\r\n \"telefono\" => array(),\r\n \"direccion\" => array(),\r\n \"correo\" => array());\r\n }", "public function provideMetaDataFieldsDefinition(AbstractCrudForm $form): array;", "public function getFieldsMetadata()\n {\n return $this->fieldsMetadata;\n }", "abstract public function getFormDesc();", "public function getMetaData()\n {\n return $this->metadata;\n }", "protected function metadataFields()\n {\n return [\n 'first_name',\n 'last_name',\n 'city',\n 'phone_number',\n 'state',\n 'postal_code',\n 'modified_by'\n ];\n }", "function getMetadata() {\n\t\treturn $this->_Metadata;\n\t}", "public function getMetaData()\n {\n return [\n 'type' => $this->type,\n 'mimetype' => $this->mimetype,\n 'size' => $this->size,\n 'width' => $this->width,\n 'height' => $this->height\n ];\n }", "public function getMetadata()\n {\n return $this->Metadata;\n }", "public function getFormContent()\n {\n return $this->form->getContent();\n }", "public function getForm() {\n\t\treturn isset($this->attributes['form'])?$this->attributes['form']:null;\n\t}", "public function get_data()\n {\n return $this->form_data;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getFormParameters()\n {\n return $this->form_parameters;\n }", "public function getMetadata()\n {\n return $this->_metadata;\n }", "public function retrieveFormFields()\n {\n return $this->start()->uri(\"/api/form/field\")\n ->get()\n ->go();\n }", "public function getMetadata();", "public function getMetadata();", "public function getMetadata();", "public function formdata()\n {\n return Formdata::getinstance();\n }", "public function getFormData()\n {\n return $this->_getApi()->getFormFields($this->_getOrder(), $this->getRequest()->getParams());\n }", "public function getMetadata() {}", "public function getMetadata() {}", "public function get_metadata() {\n return $this->metadata;\n }", "public function getMeta();", "public function getMeta();", "public function form_fields() {\n\t\treturn apply_filters( \"appthemes_{$this->box_id}_metabox_fields\", $this->form() );\n\t}", "public function getForm();", "protected function getMetadata()\n {\n // object not working must use array\n $metadata['platform'] = \"Magento 1\";\n $metadata['version'] = Mage::getVersion();\n return $metadata;\n }", "public function getMetaData();", "public static function getFormFieldMap() {\n return array(\n 'name' => 'title',\n 'blurb' => 'blurb',\n 'image' => 'image',\n 'link' => 'link',\n );\n }", "protected function _getForm() \r\n\t{ \r\n\t\t$form = \"\";\r\n\t\t$allElementSets = $this->_getAllElementSets();\r\n\t\t$ignoreElements = array();\r\n\t\tforeach ($allElementSets as $elementSet) { //traverse each element set to create a form group for each\r\n\t\t\tif($elementSet['name'] != \"Item Type Metadata\") { // start with non item type metadata\r\n\t\t\t\t\r\n\t\t\t\t$form .= '<div id=\"' . text_to_id($elementSet['name']) . '-metadata\">';\r\n\t\t\t\t$form .= '<fieldset class=\"set\">';\r\n\t\t\t\t$form .= '<h2>' . __($elementSet['name']) . '</h2>';\r\n\t\t\t\t$form .= '<p class=\"element-set-description\" id=\"';\r\n\t\t\t\t$form .= html_escape(text_to_id($elementSet['name']) . '-description') . '\">';\r\n\t\t\t\t$form .= url_to_link(__($elementSet['description'])) . '</p>';\r\n\t\t\t\t\r\n\t\t\t\t$elements = $this->_getAllElementsInSet($elementSet['id']);\r\n\t\t\t\tforeach ($elements as $element) { //traverse each element in the set to create a form input for each in the form group\r\n\t\t\t\t\t$allElementValues = $this->_allElementValues($element['id'], $elements);\r\n\t\t\t\t\tif ((!in_array($element['id'], $ignoreElements)) && (count($allElementValues) > 1)) { // if the element has a value and has multiple inputs\r\n\t\t\t\t\t\t$form .= $this->_field($allElementValues, true);\r\n\t\t\t\t\t\tarray_push($ignoreElements, $element['id']);\r\n\t\t\t\t\t} else if (!in_array($element['id'], $ignoreElements)) { \r\n\t\t\t\t\t\t$form .= $this->_field($allElementValues, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$form .= \"</fieldset>\";\r\n\t\t\t\t$form .= \"</div>\";\r\n\t\t\t} else { // if item type metadata\r\n\t\t\t\t$item_types = get_records('ItemType', array('sort_field' => 'name'), 1000);\r\n\t\t\t\t$defaultItemType = $this->_helper->db->getTable('DefaultMetadataValue')->getDefaultItemType();\r\n\t\t\t\t$defaultItemTypeId = 0;\r\n\t\t\t\tif (!empty($defaultItemType)) {\r\n\t\t\t\t\t$defaultItemTypeId = intval($defaultItemType[0][\"text\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$form .= '<div id=\"item-type-metadata-metadata\">';\r\n\t\t\t\t$form .= '<h2>' . __($elementSet['name']) . '</h2>';\r\n\t\t\t\t$form .= '<div class=\"field\" id=\"type-select\">';\r\n\t\t\t\t$form .= '<div class=\"two columns alpha\">';\r\n\t\t\t\t$form .= '<label for=\"item-type\">Item Type</label> </div>';\r\n\t\t\t\t$form .= '<div class=\"inputs five columns omega\">';\r\n\t\t\t\t$form .= '<select name=\"item_type_id\" id=\"item-type\">';\r\n\t\t\t\t$form .= '<option value=\"\">Select Below </option>';\r\n\t\t\t\tforeach ($item_types as $item_type) {\r\n\t\t\t\t\tif($item_type[\"id\"] == $defaultItemTypeId) {\r\n\t\t\t\t\t\t$form .= '<option value=\"' . $item_type['id'] . '\" selected=\"selected\">' . $item_type['name'] . '</option>';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$form .= '<option value=\"' . $item_type['id'] . '\">' . $item_type['name'] . '</option>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$form .= '</select> </div>';\r\n\t\t\t\t$form .= '<input type=\"submit\" name=\"change_type\" id=\"change_type\" value=\"Pick this type\" style=\"display: none;\">';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t$form .= '<div id=\"type-metadata-form\">';\r\n\t\t\t\t$form .= '<div class=\"five columns offset-by-two omega\">';\r\n\t\t\t\t$form .= '<p class=\"element-set-description\">';\r\n\t\t\t\t$form .= '</p>';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n return $form;\r\n }", "public function getMetaInfo() {\n return $this->meta;\n }", "function getForm()\n {\n return $this->getAttribute(\"form\");\n }", "public function getMetaData() {\n\t\treturn $this->arrMetadata;\n\t}", "public function MetadataEntryForm()\n {\n // NIWA are worried about parameter case and would like it case insensitive so convert all get vars to lower\n // I think this is because they are not 100% what case the parameters from oracle will be in.\n $params = array_change_key_case($this->getRequest()->getVars(), CASE_LOWER);\n\n // Check in the parameters sent to this page if there are certian fields needed to power the\n // functionality which emails project coordinators and if so get them as we will need to add\n // them to the bottom of the form as hidden fields, this way we can access them in the form\n // processing and send the email.\n $hiddenFields = array();\n\n // These 2 fields can be populated either by Project_Coordinator or Project_Administrator as Oracle actually\n // sends Project_Administrator. NIWA want to keep the field here called coordinator.\n if (!empty($params['project_coordinator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_coordinator'];\n } else if (!empty($params['project_administrator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_administrator'];\n }\n\n if (!empty($params['project_coordinator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_coordinator_email'];\n } else if (!empty($params['project_administrator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_administrator_email'];\n }\n\n if (!empty($params['project_manager'])) {\n $hiddenFields['_Project_Manager'] = $params['project_manager'];\n }\n\n if (!empty($params['project_code'])) {\n $hiddenFields['_Project_Code'] = $params['project_code'];\n }\n\n // Get the fields defined for this page, exclude the placeholder fields as they are not displayed to the user.\n $metadataFields = $this->Fields()->where(\"FieldType != 'PLACEHOLDER'\")->Sort('SortOrder', 'asc');\n\n // Create fieldfield for the form fields.\n $formFields = FieldList::create();\n $actions = FieldList::create();\n $requiredFields = array();\n\n // Push the required fields message as a literal field at the top.\n $formFields->push(\n LiteralField::create('required', '<p>* Required fields</p>')\n );\n\n if ($metadataFields->count()) {\n foreach($metadataFields as $field) {\n // Create a version of the label with spaces replaced with underscores as that is how\n // any paraemters in the URL will come (plus we can use it for the field name)\n $fieldName = str_replace(' ', '_', $field->Label);\n $fieldLabel = $field->Label;\n\n // If the field is required then add it to the required fields and also add an\n // asterix to the end of the field label.\n if ($field->Required) {\n $requiredFields[] = $fieldName;\n $fieldLabel .= ' *';\n }\n\n // Check if there is a parameter in the GET vars with the corresponding name.\n $fieldValue = null;\n\n if (isset($params[strtolower($fieldName)])) {\n $fieldValue = $params[strtolower($fieldName)];\n }\n\n // Define a var for the new field, means no matter the type created\n // later on in the code we can apply common things like the value.\n $newField = null;\n\n // Single line text field creation.\n if ($field->FieldType == 'TEXTBOX') {\n $formFields->push($newField = TextField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'TEXTAREA') {\n $formFields->push($newField = TextareaField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'KEYWORDS') {\n // If keywords then output 2 fields the textbox for the keywords and then also a\n // literal read only list of those already specified by the admin below.\n $formFields->push($newField = TextAreaField::create($fieldName, $fieldLabel));\n $formFields->push(LiteralField::create(\n $fieldName . '_adminKeywords',\n \"<div class='control-group' style='margin-top: -12px'>Already specified : \" . $field->KeywordsValue . \"</div>\"\n ));\n } else if ($field->FieldType == 'DROPDOWN') {\n // Some dropdowns have an 'other' option so must add the 'other' to the entries\n // and also have a conditionally displayed text field for when other is chosen.\n $entries = $field->DropdownEntries()->sort('SortOrder', 'Asc')->map('Key', 'Label');\n\n if ($field->DropdownOtherOption == true) {\n $entries->push('other', 'Other');\n }\n\n $formFields->push(\n $newField = DropdownField::create(\n $fieldName,\n $fieldLabel,\n $entries\n )->setEmptyString('Select')\n );\n\n if ($field->DropdownOtherOption == true) {\n $formFields->push(\n TextField::create(\n \"${fieldName}_other\",\n \"Please specify the 'other'\"\n )->hideUnless($fieldName)->isEqualTo(\"other\")->end()\n );\n\n //++ @TODO\n // Ideally if the dropdown is required then if other is selected the other field\n // should also be required. Unfortunatley the conditional validation logic of ZEN\n // does not work in the front end - so need to figure out how to do this.\n }\n }\n\n // If a new field was created then set some things on it which are common no matter the type.\n if ($newField) {\n // Set help text for the field if defined.\n if (!empty($field->HelpText)) {\n $newField->setRightTitle($field->HelpText);\n }\n\n // Field must only be made readonly if the admin specified that they should be\n // provided that a value was specified in the URL for it.\n if ($field->Readonly && $fieldValue) {\n $newField->setReadonly(true);\n }\n\n // Set the value of the field one was plucked from the URL params.\n if ($fieldValue) {\n $newField->setValue($fieldValue);\n }\n }\n }\n\n // Add fields to the bottom of the form for the user to include a message in the email sent to curators\n // this is entirely optional and will not be used in most cases so is hidden until a checkbox is ticked.\n $formFields->push(\n CheckboxField::create('AdditionalMessage', 'Include a message from me to the curators')\n );\n\n // For the email address, because its project managers filling out the form, check if the Project_Manager_email\n // has been specified in the URL params and if so pre-populate the field with that value.\n $formFields->push(\n $emailField = EmailField::create('AdditionalMessageEmail', 'My email address')\n ->setRightTitle('Please enter your email address so the curator knows who the message below is from.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n if (isset($params['project_manager_email'])) {\n $emailField->setValue($params['project_manager_email']);\n }\n\n $formFields->push(\n TextareaField::create('AdditionalMessageText', 'My message')\n ->setRightTitle('You can enter a message here which is appended to the email sent the curator after the record has successfully been pushed to the catalogue.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n // If there are any hidden fields then loop though and add them as hidden fields to the bottom of the form.\n if ($hiddenFields) {\n foreach($hiddenFields as $key => $val) {\n $formFields->push(\n HiddenField::create($key, '', $val)\n );\n }\n }\n\n // We have at least one field so set the action for the form to submit the entry to the catalogue.\n $actions = FieldList::create(FormAction::create('sendMetadataForm', 'Send'));\n } else {\n $formFields->push(\n ErrorMessage::create('No metadata entry fields have been specified for this page.')\n );\n }\n\n // Set up the required fields validation.\n $validator = ZenValidator::create();\n $validator->addRequiredFields($requiredFields);\n\n // Create form.\n $form = Form::create($this, 'MetadataEntryForm', $formFields, $actions, $validator);\n\n // Check if the data for the form has been saved in the session, if so then populate\n // the form with this data, if not then just return the default form.\n $data = Session::get(\"FormData.{$form->getName()}.data\");\n\n return $data ? $form->loadDataFrom($data) : $form;\n }", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "public function metadata()\n\t{\n\t\treturn array(\"id\" => array(), \"dia\" => array(), \"hora\" => array(), \"empleado\" => array()); \n\t}", "public function form(){\n\t\treturn $this->form;\n\t}", "public function meta()\n {\n return $this->meta;\n }", "protected function getCreateFormFields()\n {\n return $this->formFields();\n }", "public function getFormValues() {\n return $this->values[HVAL_FORMPARAM];\n }", "public function getFormFields()\n {\n return $this->form->getFields();\n }", "public function getForm() {\n return $this->form;\n }", "private function getMeta() {\n $metadata = array(\n 'title' => 'User', \n 'desc' => 'Request URL: ' . Config::get('app.api_url'), \n 'meta' => array( \n 'title' => 'User | Seeties', \n 'description' => 'Sample meta description' \n ),\n 'sidebar' => View::make('user.sidebar')\n );\n\n return $metadata;\n }", "public function getGenericMetadata()\n {\n return $this->generic_metadata;\n }", "function getForm() {\n return $this->form;\n }", "private function getMetaData ()\n\t\t{\n\t\t\t$data = file_get_contents (\"META.inf\");\n\t\t\t$o = json_decode ($data,true);\n\t\t\treturn $o;\t\n\t\t}", "public static function metadata()\n {\n return Metadata::get(get_called_class());\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getFileMetadata()\n {\n return $this->get('FileMetadata');\n }", "public function getForm()\n {\n RETURN $this->strategy->getForm();\n }", "function get_fields() {\n global $Tainacan_Item_Metadata;\n return $Tainacan_Item_Metadata->fetch($this, 'OBJECT');\n\n }", "public function getMeta()\n {\n return $this->Meta;\n }", "public function getForm()\n {\n return $this->form;\n }", "public function getForm()\n {\n return $this->form;\n }", "abstract protected function getFormIntroductionFields();", "public function getMeta() {\n return $this->meta;\n }", "public function getForm(): array\n {\n return $this->form;\n }", "public function getFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n $value = $element['object']->getSubmittedValue();\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }", "public function meta()\n {\n return array_merge(parent::meta(), [\n 'fields' => 'adasd'\n ]);\n }", "public function getInfo() {\n $class = get_class($this);\n return [\n '#input' => TRUE,\n '#id_label_id' => 0,\n '#process' => [\n [$class, 'processIdLabel'],\n ],\n '#element_validate' => [\n [$class, 'validateIdLabel'],\n ],\n '#theme_wrappers' => ['fieldset'],\n '#multiple' => FALSE,\n '#cardinality' => self::CARDINALITY_UNLIMITED,\n ];\n }", "protected function getMeta()\n {\n return array('displayname' => $this->__('TinyMCE'),\n 'description' => $this->__('TinyMCE editor.'),\n 'version' => '3.5.8',\n 'url' => 'http://www.tinymce.com/',\n 'license' => 'LGPL-2.1',\n );\n }", "public function getMeta() {\n return $this->meta;\n }", "function GetMetaInfo(){\r\n\r\n\treturn !empty($_POST['app_meta'])? json_decode($_POST['app_meta'],true):array();\r\n}", "protected function forms()\r\n {\r\n $metaFileInfo = $this->getFormObj()->GetMetaFileInfo();\r\n $modulePath = $metaFileInfo['modules_path'];\r\n $modulePath = substr($modulePath,0,strlen($modulePath)-1);\r\n global $g_MetaFiles;\r\n php_grep(\"<EasyForm\", $modulePath);\r\n \r\n for ($i=0; $i<count($g_MetaFiles); $i++)\r\n {\r\n $g_MetaFiles[$i] = str_replace('/','.',str_replace(array($modulePath.'/','.xml'),'', $g_MetaFiles[$i]));\r\n $list[$i]['val'] = $g_MetaFiles[$i];\r\n $list[$i]['txt'] = $g_MetaFiles[$i];\r\n }\r\n\r\n return $list; \r\n }", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "public function &getForm() {\n return $this->form;\n }", "public function getFormData()\n {\n return $this->form->getData();\n }", "public function getMetaData(): array {\n\t\treturn $this->content['metadata'] ?? [];\n\t}", "protected function getInputMetaData(MortarFormInput $input)\n\t{\n\t\t$inputOptions = array();\n\t\t$validationRules = $input->getRules();\n\t\t$validationClientSideRules = array();\n\t\tif(!is_null($validationRules) && count($validationRules) > 0)\n\t\t{\n\t\t\t$validationClientSideRules = array();\n\t\t\tforeach($validationRules as $ruleName => $ruleArgument)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif(!($className = MortarFormValidationLookup::getClass($ruleName)))\n\t\t\t\t\t\tthrow new FormWarning('Unable to load validation class for rule ' . $ruleName);\n\n\t\t\t\t\t$argument = $className::getHtmlArgument($input, $ruleArgument);\n\t\t\t\t\t$validationClientSideRules[$ruleName] = $argument;\n\n\t\t\t\t}catch(Exception $e){\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(count($validationClientSideRules) > 0)\n\t\t\t\t$inputOptions['validation'] = $validationClientSideRules;\n\t\t}\n\n\t\tif($input->property('html'))\n\t\t\t$inputOptions['html'] = true;\n\n\t\tif(isset($input->mask))\n\t\t\t$inputOptions['mask'] = $input->mask;\n\n\t\tif(isset($input->properties['autocomplete']) && $input->properties['autocomplete'])\n\t\t{\n\t\t\t$inputOptions['autocomplete']['data'] = $input->properties['autocomplete'];\n\t\t\tif(isset($input->properties['multiple']))\n\t\t\t{\n\t\t\t\t$inputOptions['autocomplete']['options']['multiple'] = true;\n\t\t\t}\n\t\t\tunset($input->properties['autocomplete']);\n\t\t}\n\n\t\t$plugins = new Hook();\n\t\t$plugins->enforceInterface('FormMetadataHook');\n\t\t$plugins->loadPlugins('Forms', 'Metadata', 'Base');\n\t\t$plugins->loadPlugins('Forms', 'Metadata', $input->type);\n\t\t$pluginInput = $plugins->getMetadataOptions($input);\n\n\t\tforeach($pluginInput as $inputItem)\n\t\t\t$inputOptions = array_merge($inputOptions, $inputItem);\n\n\t\treturn (count($inputOptions > 0)) ? $inputOptions : false;\n\t}", "public function getRichFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n\n $value = array (\n \t'value' => $element['object']->getSubmittedValue(),\n \t'description' => $element['object']->getDescription()\n );\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }", "protected function _readFormFields() {}", "function fields() {\n return array(\n 'title' => 'The title of the content',\n 'fieldname' => t('fieldname'),\n 'title' => t('title'),\n 'label' => t('Label'),\n 'data_type' => t('data type'),\n 'html_type' => t('html_type'),\n );\n }", "public function getMetas()\n {\n return $this->metas;\n }", "public function getForm()\n {\n return $this->_form;\n }", "public function formData()\n {\n return array(\n 'id' => $this->_id,\n 'name' => $this->_name,\n 'content' => $this->_content,\n 'categoryId' => $this->_category_id,\n 'userId' => $this->_user_id\n );\n }", "public function formInfo()\n {\n $value = Recipe::find(1);\n\n return view('form-recipe_page',\n [\n 'value' => $value\n ]);\n }", "public function form() {\n\t\treturn array();\n\t}", "abstract function getForm();", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Show manufacturer name'),\n 'name' => 'MF_TITLE',\n 'label' => $this->l('Enable Manufacturers Name'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Show manufacturer description'),\n 'name' => 'MF_DESCRIPTION',\n 'label' => $this->l('Provide a description for the heading'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Number of manufacturers to display (Enter 0 to display all)'),\n 'name' => 'MF_MAN_NUMBER',\n 'label' => $this->l('Number of Manufacturers'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on desktops'),\n 'name' => 'MF_PER_ROW_DESKTOP',\n 'label' => $this->l('Logo\\'s per row (Desktop)'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on tablets'),\n 'name' => 'MF_PER_ROW_TABLET',\n 'label' => $this->l('Logo\\'s per row (Tablet)'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on mobiles'),\n 'name' => 'MF_PER_ROW_MOBILE',\n 'label' => $this->l('Logo\\'s per row (Mobile)'),\n 'required' => true,\n ),\n array(\n 'type' => 'select',\n 'desc' => 'How the logo\\'s should be sorted',\n 'name' => 'MF_MAN_ORDER',\n 'label' => $this->l('Order by'),\n 'options' => array(\n 'query' => array(\n array(\n 'id_option' => 'name_asc',\n 'name' => $this->l('Name ASC'),\n ),\n array(\n 'id_option' => 'name_desc',\n 'name' => $this->l('Name DESC'),\n ),\n array(\n 'id_option' => 'manu_asc',\n 'name' => $this->l('Manufacturer ID ASC'),\n ),\n array(\n 'id_option' => 'manu_desc',\n 'name' => $this->l('Manufacturer ID DESC'),\n ),\n ),\n 'id' => 'id_option',\n 'name' => 'name',\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable Manufacturers Name'),\n 'name' => 'MF_SHOW_MAN_NAME',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes'),\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No'),\n )\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function getFormParams() {\n\t\treturn $this->_formParams;\n\t}", "public function model()\n {\n return FormInfo::class;\n }", "public function getFormCustomFields(){\n\t}" ]
[ "0.7069291", "0.6970771", "0.6890191", "0.6722233", "0.6678683", "0.6641073", "0.6616351", "0.66120785", "0.6585969", "0.6539794", "0.653801", "0.65291524", "0.6526674", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.65049636", "0.65012014", "0.649713", "0.64892817", "0.64892817", "0.64892817", "0.6470759", "0.64666706", "0.6464076", "0.6464076", "0.6447667", "0.64307714", "0.64307714", "0.64146876", "0.6396654", "0.63954884", "0.6381739", "0.63743263", "0.63632905", "0.6339569", "0.6335655", "0.63290447", "0.63260996", "0.6325171", "0.6325171", "0.6317418", "0.63110673", "0.6309669", "0.6307945", "0.6302714", "0.6300597", "0.6279092", "0.62778485", "0.6273024", "0.6266592", "0.6257825", "0.6248985", "0.6238815", "0.6238815", "0.6238815", "0.6238815", "0.6238815", "0.62343323", "0.6234082", "0.62280285", "0.6215414", "0.62134063", "0.62134063", "0.62042874", "0.6187947", "0.6187825", "0.6173366", "0.61672485", "0.61660326", "0.6156526", "0.6150419", "0.61497337", "0.61440045", "0.6135441", "0.6126317", "0.61260366", "0.6093409", "0.6092681", "0.60672235", "0.60664475", "0.60481435", "0.604608", "0.60305107", "0.60265505", "0.60238457", "0.60153115", "0.599827", "0.5993986", "0.5985485", "0.5985029", "0.59814465" ]
0.0
-1
Get the list of parameters for this form.
public static function get_parameters() { $r = array_merge( parent::get_parameters(), array( array( 'name' => 'transect_count_attr_ids', 'caption' => 'Transect count attribute IDs', 'description' => 'Comma separated list of sample attribute IDs. Specify each attribute that can contain a count of transects surveyed '. '(e.g. low shore, middle shore, high shore). For each attribute, n transects will be available for data input.', 'type' => 'textfield', 'required' => true, 'group' => 'Big Sea setup' ), array( 'name' => 'transect_captions', 'caption' => 'Transect captions', 'description' => 'Comma separated list of captions to use for each of the above attributes, in the same order.', 'type' => 'textfield', 'required' => true, 'group' => 'Big Sea setup' ), array( 'name' => 'child_sample_zone_attr_id', 'caption' => 'Child sample zone attribute ID', 'description' => 'A text attribute used to store the zone in the child sample.', 'type' => 'select', 'table' => 'sample_attribute', 'valueField' => 'id', 'captionField' => 'caption', 'group' => 'Big Sea setup' ), array( 'name' => 'child_sample_transect_attr_id', 'caption' => 'Child sample transect attribute ID', 'description' => 'An integer attribute used to store the transect in the child sample.', 'type' => 'select', 'table' => 'sample_attribute', 'valueField' => 'id', 'captionField' => 'caption', 'group' => 'Big Sea setup' ), array( 'name' => 'search_species_transect_attr_id', 'caption' => 'Parent sample search species attribute ID', 'description' => 'An integer multivalut attribute used to store the search species list in the parent attribute.', 'type' => 'select', 'table' => 'sample_attribute', 'valueField' => 'id', 'captionField' => 'caption', 'group' => 'Big Sea setup' ), array( 'name' => 'front_page_path', 'caption' => 'Front page path', 'description' => 'Path to the front page input form.', 'type' => 'textfield', 'required' => true, 'group' => 'Big Sea setup' ), array( 'name' => 'parent_sample_method_id', 'caption' => 'Parent Sample Method', 'type' => 'select', 'table' => 'termlists_term', 'captionField' => 'term', 'valueField' => 'id', 'extraParams' => array('termlist_external_key' => 'indicia:sample_methods'), 'required' => false, 'helpText' => 'The sample method that will be used for created visit samples.', 'group' => 'Big Sea setup' ) ) ); return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormParameters()\n {\n return $this->form_parameters;\n }", "public static function get_parameters() {\n return array(\n array(\n 'name' => 'termlist_id',\n 'caption' => 'Term List',\n 'description' => 'The term list being edited.',\n 'type' => 'select',\n 'table' => 'termlist',\n 'captionField' => 'title',\n 'valueField' => 'id',\n 'siteSpecific'=>true,\n 'group' => 'Terms',\n 'required'=>true\n ),\n array(\n 'name' => 'language_id',\n 'caption' => 'Language',\n 'description' => 'The language that terms are created in.',\n 'type' => 'select',\n 'table' => 'language',\n 'captionField' => 'language',\n 'valueField' => 'id',\n 'siteSpecific'=>true,\n 'group' => 'Terms',\n 'required'=>true\n )\n );\n }", "public function getParameters()\n {\n return $this->parameters->all();\n }", "function getFormParams() {\n\t\treturn $this->_formParams;\n\t}", "public function get_parameters() {\r\n\t\treturn $this->parameters;\r\n\t}", "public function parameters()\n\t{\n\t\treturn [\n\t\t\t'parent_id' => $this->input('parent_id'),\n\t\t\t'title' => $this->input('title'),\n\t\t\t'icon' => $this->input('icon'),\n\t\t\t'description' => $this->input('description'),\n\t\t\t'is_active' => $this->has('is_active')\n\t\t];\n\t}", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function parameters()\n {\n return $this->parameters;\n }", "public function parameters()\n {\n return $this->parameters;\n }", "public function get_parameters()\n\t{\n\t\treturn $this->set_params;\n\t}", "public function getParameters()\n {\n return array();\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "function getParameters() {\n\t\treturn $this->inputParameters;\n\t}", "public function getParameters() {\n \n return $this->params;\n \n }", "public function getParameters() {\n return $this->parameters;\n }", "public function getParameters()\r\n {\r\n return $this->parameters;\r\n }", "public function getParametersList(){\n return $this->_get(2);\n }", "public function getParameters()\n\t{\n\t\treturn $this->parameters;\n\t}", "public function GetParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters() {\n\t\treturn $this->parameters;\n\t}", "public function all()\r\n {\r\n return $this->parameters;\r\n }", "public function parameters(): array\n {\n return $this->getAttribute('parameters');\n }", "function getParameters() {\n return $this->parameters;\n }", "public function all()\n {\n return $this->params;\n }", "public function getParameters() : array\n {\n return $this->parameters;\n }", "public function params() : DeepList {\n return $this->_params;\n }", "public function params()\n {\n if (empty($this->params)) {\n return null;\n }\n\n $params = isset($this->params) ? $this->params : array();\n\n $many = $this->hasMany('params');\n\n return array(\n 'title' => $many ? 'Options' : 'Option',\n 'txt' => $many\n ? 'The following request parameters are available:'\n : 'The following request parameter is available:',\n 'items' => array_values($params)\n );\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParams()\n {\n return $this->getAttribute('params', false, null);\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function parameters()\n {\n return array_merge($this->get, $this->post);\n }", "public static function get_parameters() {\n return array(array(\n 'name' => 'groups_page_path',\n 'caption' => 'Path to main groups page',\n 'description' => 'Path to the Drupal page which my groups are listed on.',\n 'type' => 'text_input'\n ), array(\n 'name' => 'group_home_path',\n 'caption' => 'Path to the group home page',\n 'description' => 'Path to the Drupal page which hosts group home pages.',\n 'type' => 'text_input',\n 'required'=>false\n ));\n }", "public function getParams() {\n return $this->params;\n }", "public function getParameters(/* ... */)\n {\n return $this->_params;\n }", "public function params()\n {\n return $this->params;\n }", "public static function get_parameters() {\n return array(array(\n 'name' => 'groups_page_path',\n 'caption' => 'Path to main groups page',\n 'description' => 'Path to the Drupal page which my groups are listed on.',\n 'type' => 'text_input'\n ), array(\n 'name' => 'group_home_path',\n 'caption' => 'Path to the group home page',\n 'description' => 'Path to the Drupal page which hosts group home pages.',\n 'type' => 'text_input'\n ));\n }", "public function getParams() {\n \n return $this->_params;\n }", "public function getParameters(): array {\n\t\t\treturn $this->parameters;\n\t\t}", "public function get_params() {\n\t\treturn $this->params;\n\t}", "public static function parameters()\n {\n $fields = array('name', 'amount');\n return array_intersect_key(self::fields(), array_flip($fields));\n }", "public function getParams()\r\n\t{\r\n\t\treturn $this->params;\r\n\t}", "public function parameters()\n {\n return [\n 'dir' => $this->input('dir'),\n 'hash' => $this->input('hash', ''),\n 'data' => $this->input('data'),\n 'name' => $this->input('name'),\n 'type' => $this->input('type'),\n 'offset' => $this->input('offset'),\n 'eof' => $this->input('eof'),\n ];\n }", "function get_parameters()\r\n {\r\n return $this->parameters;\r\n }", "public function getParams()\n\t{\n\t\treturn $this->params;\n\t}", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParameters()\n {\n // TODO: Implement getParameters() method.\n }", "public function getParams() {\n return $this->_params;\n }", "public function getParams() {\n\t\treturn $this->params;\n\t}", "public function getParameters()\n {\n return get_object_vars($this->record);\n }", "public function params()\n {\n return $this->_params;\n }", "private static function ParamList ()\n {\n return array (\n \"a\" => array (\n \"charset\", \"coords\", \"href\",\n \"hreflang\", \"name\", \"rel\",\n \"rev\", \"shape\", \"target\",\n \"style\",\n ),\n \"button\" => array (\n \"disabled\", \"name\", \"type\",\n \"value\", \"accesskey\", \"class\",\n \"dir\", \"id\", \"lang\", \"style\",\n \"tabindex\", \"title\", \"xml:lang\",\n ),\n );\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParams() {\n\n\t\treturn $this->_params;\n\t}", "public function getParams() {\n\t\treturn $this -> v_params;\n\t}" ]
[ "0.8332949", "0.78399944", "0.76719576", "0.76072896", "0.7491836", "0.7477387", "0.74732774", "0.74732774", "0.74732774", "0.74732774", "0.7458015", "0.7458015", "0.74534774", "0.7426106", "0.74234897", "0.74234897", "0.74234897", "0.74234897", "0.74234897", "0.74234897", "0.74234897", "0.74234897", "0.74234897", "0.74234897", "0.74234897", "0.7418266", "0.7405367", "0.73993206", "0.7379144", "0.73661053", "0.7360747", "0.73432946", "0.73357743", "0.73357743", "0.7321258", "0.7267087", "0.7264286", "0.7248696", "0.72352016", "0.72326", "0.7207198", "0.720445", "0.7196979", "0.7196979", "0.7196979", "0.7196979", "0.7186249", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.71808344", "0.717533", "0.71655667", "0.7165153", "0.7161899", "0.715624", "0.7156014", "0.71535003", "0.71355164", "0.71334225", "0.7131085", "0.71279657", "0.7110398", "0.70988107", "0.70961255", "0.7095723", "0.7095723", "0.7095723", "0.7095723", "0.7092396", "0.70911676", "0.70766336", "0.70731527", "0.7073022", "0.7067651", "0.7067448", "0.7067038", "0.7067038", "0.70516616", "0.70516616", "0.70516616", "0.70516616", "0.70516616", "0.70516616", "0.70516616", "0.70516616", "0.7045622", "0.70375687" ]
0.0
-1
Override get_form_html. We remove the second tab when first inputting a new sample, because the second tab can't save unless there is a parent sample available to link to.
protected static function get_form_html($args, $auth, $attributes) { if (empty($_GET['id'])) return 'This form must be called with an id in the URL parameters'; data_entry_helper::$javascript .= "indiciaData.latLongNotationPrecision=5;\n"; return parent::get_form_html($args, $auth, $attributes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareForm()\n\t{\n\t\tparent::_prepareForm();\n\n\t\t$oMainTab = $this->getTab('main');\n\t\t$oAdditionalTab = $this->getTab('additional');\n\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\t$oMainTab\n\t\t\t->add(Admin_Form_Entity::factory('Div')->class('row')\n\t\t\t\t->add($oDivLeft = Admin_Form_Entity::factory('Div')->class('col-xs-12 col-md-6 col-lg-7 left-block'))\n\t\t\t\t->add($oDivRight = Admin_Form_Entity::factory('Div')->class('col-xs-12 col-md-6 col-lg-5 right-block'))\n\t\t\t);\n\n\t\t\t$oMainTab\n\t\t\t->add(Admin_Form_Entity::factory('Script')\n\t\t\t\t->value('\n\t\t\t\t\t$(function(){\n\t\t\t\t\t\tvar timer = setInterval(function(){\n\t\t\t\t\t\t\tif ($(\"#' . $windowId . ' .left-block\").height())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclearInterval(timer);\n\n\t\t\t\t\t\t\t\t$(\"#' . $windowId . ' .right-block\").find(\"#' . $windowId . '_notes\").slimscroll({\n\t\t\t\t\t\t\t\t\theight: $(\"#' . $windowId . ' .left-block\").height() - 75,\n\t\t\t\t\t\t\t\t\tcolor: \"rgba(0, 0, 0, 0.3)\",\n\t\t\t\t\t\t\t\t\tsize: \"5px\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t});\n\t\t\t\t'));\n\n\t\t$oDivLeft\n\t\t\t->add($oMainRow1 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t->add($oMainRow2 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t->add($oMainRow3 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t->add($oMainRow4 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t;\n\n\t\t$oDivRight\n\t\t\t->add($oMainRowRight1 = Admin_Form_Entity::factory('Div')->class('row'));\n\n\t\t$sColorValue = ($this->_object->id && $this->getField('color')->value)\n\t\t\t? $this->getField('color')->value\n\t\t\t: '#aebec4';\n\n\t\t$this->getField('color')\n\t\t\t->colorpicker(TRUE)\n\t\t\t->value($sColorValue);\n\n\t\t$oMainTab\n\t\t\t->move($this->getField('name')->divAttr(array('class' => 'form-group col-xs-12')), $oMainRow1)\n\t\t\t->move($this->getField('description')->divAttr(array('class' => 'form-group col-xs-12'))->rows(10), $oMainRow2)\n\t\t\t->move($this->getField('datetime')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-6')), $oMainRow3)\n\t\t\t->move($this->getField('deadline')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-6')), $oMainRow3)\n\t\t\t->move($this->getField('color')->set('data-control', 'hue')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6')), $oMainRow4)\n\t\t\t->move($this->getField('completed')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-6 margin-top-21')), $oMainRow4);\n\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\t$countNotes = $this->_object->Crm_Notes->getCount()\n\t\t\t? '<span class=\"badge badge-palegreen\">' . $this->_object->Crm_Notes->getCount() . '</span>'\n\t\t\t: '';\n\n\t\tob_start();\n\t\t?>\n\t\t<div class=\"tabbable\">\n\t\t\t<ul class=\"nav nav-tabs tabs-flat\" id=\"crmProjectTabs\">\n\t\t\t\t<li class=\"active\">\n\t\t\t\t\t<a data-toggle=\"tab\" href=\"#<?php echo $windowId?>_notes\" data-path=\"/admin/crm/project/note/index.php\" data-window-id=\"<?php echo $windowId?>_notes\" data-additional=\"crm_project_id=<?php echo $this->_object->id?>\">\n\t\t\t\t\t\t<?php echo Core::_(\"Crm_Project.tabNotes\")?> <?php echo $countNotes?>\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<div class=\"tab-content tabs-flat\">\n\t\t\t\t<div id=\"<?php echo $windowId?>_notes\" class=\"tab-pane in active\">\n\t\t\t\t\t<?php\n\t\t\t\t\tAdmin_Form_Entity::factory('Div')\n\t\t\t\t\t\t->controller($this->_Admin_Form_Controller)\n\t\t\t\t\t\t->id(\"crm-project-notes\")\n\t\t\t\t\t\t->add(\n\t\t\t\t\t\t\t$this->_object->id\n\t\t\t\t\t\t\t\t? $this->_addNotes()\n\t\t\t\t\t\t\t\t: Admin_Form_Entity::factory('Code')->html(\n\t\t\t\t\t\t\t\t\tCore_Message::get(Core::_('Crm_Project.enable_after_save'), 'warning')\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t->execute();\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t$oMainRowRight1->add(Admin_Form_Entity::factory('Div')\n\t\t\t->class('form-group col-xs-12 margin-top-20')\n\t\t\t->add(\n\t\t\t\tAdmin_Form_Entity::factory('Code')\n\t\t\t\t\t->html(ob_get_clean())\n\t\t\t)\n\t\t);\n\n\t\t$this->title($this->_object->id\n\t\t\t? Core::_('Crm_Project.edit_title', $this->_object->name, FALSE)\n\t\t\t: Core::_('Crm_Project.add_title')\n\t\t);\n\n\t\treturn $this;\n\t}", "function getHtmlStep2Form()\r\n\t{\r\n\t\treturn $this->getAdminTableHtml( 2 );\r\n\t}", "function newFormBookmark()\n\t{\n\t\t$form = $this->initFormBookmark();\n\t\t$html1 = $form->getHTML();\n\t\t$html2 = '';\n\t\tif (!$_REQUEST[\"bm_link\"])\n\t\t{\n\t\t\t$form2 = $this->initImportBookmarksForm();\n\t\t\t$html2 = \"<br />\" . $form2->getHTML();\n\t\t}\n\t\t$this->tpl->setVariable(\"ADM_CONTENT\", $html1.$html2);\n\t}", "function getHtmlStep1Form()\r\n\t{\r\n\t\treturn $this->getAdminTableHtml( 1 );\r\n\t}", "private function get_inputs_output_html() {\n\t\t$i = 0;\n\t\t$j = 0;\n\n\t\t$addon_title = $this->addon_raw['title'];\n\t\t$fieldsets = array();\n\t\tforeach ($this->options as $key => $option) {\n\t\t\t\t$fieldsets[$key] = $option;\n\t\t}\n\n\t\t$output = '';\n\n\t\tif(count((array) $fieldsets)) {\n\t\t\t$output .= '<div class=\"sp-pagebuilder-fieldset\">';\n\t\t\t$output .= '<ul class=\"sp-pagebuilder-nav sp-pagebuilder-nav-tabs\">';\n\t\t\tforeach ( $fieldsets as $key => $value ) {\n\t\t\t\t$output .= '<li class=\"'. (( $i === 0 )?\"active\":\"\" ) .'\"><a href=\"#sp-pagebuilder-tab-'. $key .'\" aria-controls=\"'. $key .'\" data-toggle=\"tab\">'. ucfirst( $key ) .'</a></li>';\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$output .= '</ul>';\n\t\t\t$output .= '<div class=\"tab-content\">';\n\t\t\tforeach ( $fieldsets as $key => $value ) {\n\t\t\t\t$output .= '<div class=\"tab-pane '. (( $j === 0 )? \"active\":\"\" ) .'\" id=\"sp-pagebuilder-tab-'. $key .'\">';\n\t\t\t\t$output .= $this->get_input_fields( $key, $addon_title );\n\t\t\t\t$output .= '</div>';\n\n\t\t\t\t$j++;\n\t\t\t}\n\t\t\t$output .= '</div>';\n\t\t\t$output .= '</div>';\n\t\t}\n\n\t\treturn $output;\n\t}", "public function onRsformBackendAfterShowFormEditTabs(): void\n\t{\n\t\t$formId = $this->app->input->getInt('formId');\n\t\t$tables = $this->db->getTableList();\n\t\t$table = $this->db->getPrefix() . 'rsform_jdideal';\n\n\t\tif (!in_array($table, $tables, true))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Load the settings\n\t\t$settings = $this->loadFormSettings($formId);\n\n\t\t$form = new Form('ropayments');\n\t\t$form->loadFile(__DIR__ . '/configuration.xml');\n\t\t$form->bind(['roPaymentsParams' => $settings->toArray()]);\n\n\t\tHTMLHelper::_('formbehavior.chosen');\n\n\t\t?>\n\t\t<div id=\"ropayments\" class=\"form-horizontal <?php\n\t\techo Version::MAJOR_VERSION === 3 ? 'ropayments3' : ''; ?>\">\n\t\t\t<?php\n\t\t\techo HTMLHelper::_(\n\t\t\t\t'bootstrap.startTabSet', 'ropayments-config',\n\t\t\t\t['active' => 'ropayments-general']\n\t\t\t);\n\t\t\techo HTMLHelper::_(\n\t\t\t\t'bootstrap.addTab',\n\t\t\t\t'ropayments-config',\n\t\t\t\t'ropayments-general',\n\t\t\t\tText::_('PLG_RSFP_JDIDEAL_CONFIG_GENERAL')\n\t\t\t);\n\t\t\techo $form->renderField('profileAlias', 'roPaymentsParams');\n\t\t\techo $form->renderField('currency', 'roPaymentsParams');\n\t\t\techo $form->renderField('allowEmpty', 'roPaymentsParams');\n\t\t\techo $form->renderField('showMessage', 'roPaymentsParams');\n\t\t\techo HTMLHelper::_('bootstrap.endTab');\n\t\t\techo HTMLHelper::_(\n\t\t\t\t'bootstrap.addTab',\n\t\t\t\t'ropayments-config',\n\t\t\t\t'ropayments-currency',\n\t\t\t\tText::_('PLG_RSFP_JDIDEAL_CONFIG_PRICE')\n\t\t\t);\n\t\t\techo $form->renderField('thousands', 'roPaymentsParams');\n\t\t\techo $form->renderField('decimal', 'roPaymentsParams');\n\t\t\techo $form->renderField('numberDecimals', 'roPaymentsParams');\n\t\t\techo $form->renderField('priceMask', 'roPaymentsParams');\n\t\t\techo $form->renderField('amountMask', 'roPaymentsParams');\n\t\t\techo '<div class=\"totalPriceMask\">';\n\t\t\techo $form->renderField('totalMask', 'roPaymentsParams');\n\t\t\techo '</div>';\n\t\t\techo $form->renderField('taxType', 'roPaymentsParams');\n\t\t\techo $form->renderField('taxValue', 'roPaymentsParams');\n\t\t\techo HTMLHelper::_('bootstrap.endTab');\n\t\t\techo HTMLHelper::_(\n\t\t\t\t'bootstrap.addTab',\n\t\t\t\t'ropayments-config',\n\t\t\t\t'ropayments-fields',\n\t\t\t\tText::_('PLG_RSFP_JDIDEAL_CONFIG_FIELDS')\n\t\t\t);\n\t\t\techo $form->renderField('fieldOrderNumber', 'roPaymentsParams');\n\t\t\techo $form->renderField('fieldName', 'roPaymentsParams');\n\t\t\techo $form->renderField('fieldEmail', 'roPaymentsParams');\n\t\t\techo HTMLHelper::_('bootstrap.endTab');\n\t\t\techo HTMLHelper::_(\n\t\t\t\t'bootstrap.addTab',\n\t\t\t\t'ropayments-config',\n\t\t\t\t'ropayments-emails',\n\t\t\t\tText::_('PLG_RSFP_JDIDEAL_CONFIG_MAIL')\n\t\t\t);\n\t\t\techo $form->renderField('userEmail', 'roPaymentsParams');\n\t\t\techo $form->renderField('adminEmail', 'roPaymentsParams');\n\t\t\techo $form->renderField('additionalEmails', 'roPaymentsParams');\n\t\t\techo $form->renderField(\n\t\t\t\t'sendEmailOnFailedPayment', 'roPaymentsParams'\n\t\t\t);\n\t\t\techo $form->renderField('confirmationEmail', 'roPaymentsParams');\n\t\t\techo '<div class=\"control-group ro-confirmation-info\" data-showon=\\'[{\"field\":\"roPaymentsParams[confirmationEmail]\",\"values\":[\"1\"],\"sign\":\"=\",\"op\":\"\"}]\\' style=\"display: none;\">';\n\t\t\techo '<div class=\"text-info\">' . Text::_(\n\t\t\t\t\t'PLG_RSFP_JDIDEAL_CONFIRMATIONHELP'\n\t\t\t\t) . '</div>';\n\t\t\techo '</div>';\n\t\t\techo $form->renderField(\n\t\t\t\t'confirmationRecipient', 'roPaymentsParams'\n\t\t\t);\n\t\t\techo $form->renderField('confirmationSubject', 'roPaymentsParams');\n\t\t\techo $form->renderField('confirmationMessage', 'roPaymentsParams');\n\t\t\techo $form->renderField('includeNonSelected', 'roPaymentsParams');\n\t\t\techo HTMLHelper::_('bootstrap.endTab');\n\t\t\techo HTMLHelper::_('bootstrap.endTabSet');\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}", "public function generate_html_forms()\n\t{\n\t\t$return_str = '<div class=\"bwp-wrap bwp-option-page-wrapper\" style=\"padding-bottom: 20px;\">' . \"\\n\";\n\t\tif (sizeof($this->form_tabs) >= 2)\n\t\t\t$return_str .= apply_filters('bwp_admin_form_icon', '<div class=\"icon32\" id=\"icon-options-general\"><br></div>' . \"\\n\");\n\t\telse\n\t\t\t$return_str .= '<div class=\"icon32\" id=\"icon-options-general\"><br></div>';\t\t\t\n\t\t\n\t\tif (sizeof($this->form_tabs) >= 2)\n\t\t{\n\t\t\t$count = 0;\n\t\t\t$return_str .= '<h2 class=\"bwp-option-page-tabs\">' . \"\\n\";\n\t\t\t$return_str .= apply_filters('bwp_admin_plugin_version', '') . \"\\n\";\n\t\t\tforeach ($this->form_tabs as $title => $link)\n\t\t\t{\n\t\t\t\t$count++;\n\t\t\t\t$active = ($count == $this->current_tab) ? ' nav-tab-active' : '';\n\t\t\t\t$return_str .= '<a class=\"nav-tab' . $active . '\" href=\"' . $link . '\">' . $title . '</a>' . \"\\n\";\n\t\t\t}\n\t\t\t$return_str .= '</h2>' . \"\\n\";\n\t\t}\n\t\telse if (!isset($this->form_tabs[0]))\n\t\t{\n\t\t\t$title = array_keys($this->form_tabs);\n\t\t\t$return_str .= '<h2>' . $title[0] . '</h2>' . \"\\n\";\n\t\t}\n\t\telse\n\t\t\t$return_str .= '<h2>' . $this->form_tabs[0] . '</h2>' . \"\\n\";\n\n\t\t$return_str .= '<div class=\"bwp-option-box clear\">' . \"\\n\";\n\n\t\t// Begin generating each form\n\t\tforeach ($this->forms as $form)\n\t\t{\n\t\t\t// If this form has 'divider' items, we need to split HTML fields appropriately\n\t\t\t$dividers = (isset($form->form['divider']) && is_array($form->form['divider'])) ? array_keys($form->form['divider']) : array();\n\t\t\t$form_style = (!empty($form->style)) ? ' style=\"' . $form->style . '\" ' : '';\n\t\t\t$multi_form_style = (!empty($form->style) && 0 < sizeof($dividers)) ? ' style=\"' . $form->style . '\" ' : '';\n\n\t\t\tif (0 == sizeof($dividers))\n\t\t\t{\n\t\t\t\t$return_str .= '<div class=\"bwp-option-box-inside\"' . $form_style . '>' . \"\\n\";\n\t\t\t\t$return_str .= apply_filters('bwp_opf_before_form_' . $form->form_name, '');\n\t\t\t\techo $return_str;\n\t\t\t\tdo_action('bwp_opa_before_form_' . $form->form_name, $form->form_name);\n\t\t\t}\n\t\t\telse\n\t\t\t\techo $return_str;\n\n\t\t\t$enctype = (!empty($form->form_enctype)) ? ' enctype=\"' . $form->form_enctype . '\" ' : '';\n\t\t\t$return_str = '<form class=\"bwp-option-page\" name=\"' . $form->form_name . '\" method=\"post\" action=\"\"' . $enctype . $multi_form_style . '>' . \"\\n\";\n\n\t\t\t// Nonce\n\t\t\t$return_str .= wp_nonce_field($form->form_name, \"_wpnonce\", false, false) . \"\\n\";\n\t\t\t$return_str .= apply_filters('bwp_opf_referrer_field_' . $form->form_name, wp_referer_field(false)) . \"\\n\";\n\n\t\t\t$return_str .= '<ul>' . \"\\n\";\n\n\t\t\tif (isset($form->form_items) && is_array($form->form_items))\n\t\t\t{\n\t\t\t\t// If this form needs to be divided, so be it\n\t\t\t\tif (0 < sizeof($dividers))\n\t\t\t\t{\n\t\t\t\t\t$return_str .= '<div class=\"bwp-option-box-inside\">' . \"\\n\";\n\t\t\t\t\t$return_str .= apply_filters('bwp_opf_before_form_' . $form->form_name, '');\n\t\t\t\t\techo $return_str;\n\t\t\t\t\tdo_action('bwp_opa_before_form_' . $form->form_name, $form->form_name);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\techo $return_str;\n\t\t\t\t// Reset the result\n\t\t\t\t$return_str = '';\n\t\t\t\t// Generate individual items\n\t\t\t\t$form_count = 0;\n\t\t\t\tforeach ($form->form_items as $key => $type)\n\t\t\t\t{\n\t\t\t\t\tif (!empty($form->form_item_names[$key]) && isset($form->form_item_labels[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$extra_classes = ('heading' == $type) ? ' bwp-li-heading' : ' bwp-li-item';\n\t\t\t\t\t\t// Before the field\n\t\t\t\t\t\techo $return_str;\n\t\t\t\t\t\tdo_action('bwp_opa_before_field_' . $form->form_name . '_' . $form->form_item_names[$key], $form->form_name);\n\t\t\t\t\t\t$return_str = '';\n\t\t\t\t\t\t// The field\n\t\t\t\t\t\t$return_str .= ('hidden' != $form->form_items[$key]) ? '<li class=\"clear' . $extra_classes . '\">' . $form->generate_html_fields($type, $form->form_item_names[$key]) . '</li>' : $form->generate_html_fields($type, $form->form_item_names[$key]) . \"\\n\";\n\t\t\t\t\t\t// After the field\n\t\t\t\t\t\techo $return_str;\n\t\t\t\t\t\tdo_action('bwp_opa_after_field_' . $form->form_name . '_' . $form->form_item_names[$key], $form->form_name);\n\t\t\t\t\t\t$return_str = '';\n\t\t\t\t\t\tif (in_array($form->form_item_names[$key], $dividers))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$form_count++;\n\t\t\t\t\t\t\techo $return_str;\n\t\t\t\t\t\t\tdo_action('bwp_opa_after_divided_form_' . $form->form_name . '_' . $form_count, $form->form_name);\n\t\t\t\t\t\t\t$return_str = '';\n\t\t\t\t\t\t\t$return_str .= apply_filters('bwp_opf_multi_submit_button_' . $form->form_name, '<p class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"save_' . $form->form_name . '\" value=\"' . __('Save All Changes', $this->domain) . '\" /> &nbsp;<input type=\"submit\" class=\"button-secondary\" name=\"reset_' . $form->form_name . '\" value=\"' . __('Reset to Defaults', $this->domain) . '\" /></p>', $form_count) . \"\\n\";\n\t\t\t\t\t\t\t$return_str .= '</div>' . \"\\n\";\n\t\t\t\t\t\t\t$return_str .= '<div class=\"bwp-option-box-inside\">' . \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If this form needs to be divided, add the final Save all changes button\n\t\t\t\tif (0 < sizeof($dividers))\n\t\t\t\t\t$return_str .= apply_filters('bwp_opf_multi_submit_button_' . $form->form_name, '<p class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"save_' . $form->form_name . '\" value=\"' . __('Save All Changes', $this->domain) . '\" /> &nbsp;<input type=\"submit\" class=\"button-secondary\" name=\"reset_' . $form->form_name . '\" value=\"' . __('Reset to Defaults', $this->domain) . '\" /></p>', 'last') . \"\\n\";\n\t\t\t}\n\n\t\t\t$return_str .= '</ul>' . \"\\n\";\t\t\n\t\t\t$return_str .= apply_filters('bwp_opf_before_submit_button_' . $form->form_name, '');\n\t\t\techo $return_str;\n\t\t\tdo_action('bwp_opa_before_submit_button_' . $form->form_name, $form->form_name);\n\n\t\t\t$submit = apply_filters('bwp_opf_submit_button_' . $form->form_name, '<p class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"save_' . $form->form_name . '\" value=\"' . __('Save Changes', $this->domain) . '\" /> &nbsp;<input type=\"submit\" class=\"button-secondary\" name=\"reset_' . $form->form_name . '\" value=\"' . __('Reset to Defaults', $this->domain) . '\" /></p>') . \"\\n\";\n\t\t\t$return_str = apply_filters('bwp_op_submit_button', $submit) . \"\\n\";\n\t\t\t$return_str .= '</form>' . \"\\n\";\n\n\t\t\tif (0 == sizeof($dividers))\n\t\t\t\t$return_str .= '</div>' . \"\\n\";\n\t\t}\n\n\t\t$return_str .= '<div class=\"clear\"><!-- --></div>' . \"\\n\";\n\t\t$return_str .= '</div>' . \"\\n\";\n\t\t$return_str .= '</div>' . \"\\n\";\n\n\t\techo $return_str;\n\t}", "function buildTabs()\r\n {\r\n $this->_formBuilt = true;\r\n\r\n // Here we get all page names in the controller\r\n $pages = array();\r\n $myName = $current = $this->getAttribute('id');\r\n while (null !== ($current = $this->controller->getPrevName($current))) {\r\n $pages[] = $current;\r\n }\r\n $pages = array_reverse($pages);\r\n $pages[] = $current = $myName;\r\n while (null !== ($current = $this->controller->getNextName($current))) {\r\n $pages[] = $current;\r\n }\r\n // Here we display buttons for all pages, the current one's is disabled\r\n foreach ($pages as $pageName) {\r\n $disabled = ($pageName == $myName ? array('disabled' => 'disabled')\r\n : array());\r\n\r\n $tabs[] = $this->createElement('submit',\r\n $this->getButtonName($pageName),\r\n ucfirst($pageName),\r\n array('class' => 'flat') + $disabled);\r\n }\r\n $this->addGroup($tabs, 'tabs', null, '&nbsp;', false);\r\n }", "function add_from_tab_content () {\n require_once dirname(__FILE__).'/templates/form-tab-content.php';\n }", "private function testsSection() {\n global $DB, $CFG, $PAGE;\n //var_dump($PAGE->context->id); \n //echo '<pre>'.print_r($PAGE, true).'</pre>'; \n $this->_form->addElement('header', 'tests', 'Tests'); \n \n $this->_form->addElement('html', '<div id=\"ca-tests\">');\n \n // Get existing tests\n $tests = $DB->get_records('codeactivity_tests', array('activity_id' => $this->current->id)); \n //echo '<pre>'.print_r($this, true).'</pre>'; \n if (!empty($tests)) {\n foreach ($tests as $test) {\n //echo '<pre>'.print_r($test, true).'</pre>'; \n $this->_form->addElement('html', codeactivity::testHTML($test->id));\n } \n } \n \n \n $this->_form->addElement('html', '</div>'); // #ca-tests\n \n $this->_form->addElement('html', '<div id=\"ca-add-test\" style=\"display:none;\">');\n //get_string('codeactivityname', 'codeactivity'), array('size'=>'64'));\n $this->_form->addElement('text',\n 'testname',\n get_string('test_name', 'codeactivity'),\n array('size' => '64')\n );\n $this->_form->setType('testname', PARAM_RAW);\n $this->_form->addElement(\n 'select', \n 'testtype', \n get_string('test_type', 'codeactivity'), \n array(\n 'unittest' => get_string('unittest', 'codeactivity'), \n 'output' => get_string('outputmatch', 'codeactivity')\n )\n ); \n \n $this->_form->addElement('html', '<div id=\"ca-unittestcode\" style=\"display:none;\">'); \n $this->_form->addElement(\n 'textarea',\n 'unittestcode',\n get_string('unittest_code', 'codeactivity')\n ); \n $this->_form->addElement('html', '</div>'); \n \n $this->_form->addElement('html', '<div id=\"ca-outputmatching\" style=\"display:none;\">');\n $this->_form->addElement(\n 'select',\n 'runfile',\n get_string('runfile', 'codeactivity'),\n array()); \n \n $this->_form->addElement(\n 'textarea',\n 'expectedoutput',\n get_string('expected_output', 'codeactivity')); \n\n $this->_form->addElement(\n 'selectyesno',\n 'convertnulls',\n get_string('convert_nulls', 'codeactivity')); \n $this->_form->addElement(\n 'selectyesno',\n 'ignorewhitespace',\n get_string('ignore_whitespace', 'codeactivity')); \n $this->_form->addElement('html', '</div>'); \n \n $this->_form->addElement('html', '</div>'); // #ca-add-test\n \n $buttonarray=array();\n \n $buttonarray[] = $this->_form->createElement('button', 'add_test', 'Add Test');\n $buttonarray[] = $this->_form->createElement('button', 'add_save', 'Save');\n $buttonarray[] = $this->_form->createElement('button', 'add_cancel', 'Cancel');\n \n $this->_form->addGroup($buttonarray, 'add_buttons', '', array(''), false);\n \n $this->_form->addElement('hidden', 'ca_temp_code', uniqid()); \n $this->_form->setType('ca_temp_code', PARAM_RAW); \n //echo '<pre>'.print_r($PAGE->context, true).'</pre>'; \n $this->_form->addElement('hidden', 'ca_context', $PAGE->context->instanceid);\n $this->_form->setType('ca_context', PARAM_RAW); \n \n }", "function newFormBookmarkFolder()\n\t{\n\t\tif (!$this->tree->isInTree($this->id))\n\t\t{\n\t\t\t$this->ctrl->setParameter($this, 'bmf_id', '');\n\t\t\t$this->ctrl->redirect($this);\n\t\t}\n\n\t\t$form = $this->initFormBookmarkFolder();\n\t\t$this->tpl->setVariable(\"ADM_CONTENT\", $form->getHTML());\n\t}", "protected function _prepareForm()\n\t{\n\t\tparent::_prepareForm();\n\n\t\t$oMainTab = $this->getTab('main');\n\t\t$oAdditionalTab = $this->getTab('additional');\n\n\t\t$modelName = $this->_object->getModelName();\n\n\t\tswitch ($modelName)\n\t\t{\n\t\t\tcase 'shop_discount':\n\t\t\t\t// Создаем вкладку\n\t\t\t\t$oShopDiscountTabExportImport = Admin_Form_Entity::factory('Tab')\n\t\t\t\t\t->caption(Core::_('Shop_Discount.tab_export'))\n\t\t\t\t\t->name('ExportImport');\n\n\t\t\t\t// Добавляем вкладку\n\t\t\t\t$this\n\t\t\t\t\t->addTabAfter($oShopDiscountTabExportImport, $oMainTab);\n\n\t\t\t\t$oMainTab\n\t\t\t\t\t->add($oMainRow1 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t\t\t->add($oMainRow2 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t\t\t->add($oMainRow3 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t\t\t//->add($oMainRow4 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t\t\t->add($oDaysBlock = Admin_Form_Entity::factory('Div')->class('well with-header well-sm'))\n\t\t\t\t\t->add($oSiteuserGroupBlock = Admin_Form_Entity::factory('Div')->class('well with-header well-sm'))\n\t\t\t\t\t->add($oMainRow5 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t\t\t->add($oMainRow6 = Admin_Form_Entity::factory('Div')->class('row'));\n\n\t\t\t\t$oShopDiscountTabExportImport\n\t\t\t\t\t->add($oShopDiscountTabExportImportRow1 = Admin_Form_Entity::factory('Div')->class('row'));\n\n\t\t\t\t//Переносим GUID на \"Экспорт/Импорт\"\n\t\t\t\t$oMainTab->move($this->getField('guid'), $oShopDiscountTabExportImport);\n\n\t\t\t\t$oShopDiscountTabExportImport->move($this->getField('guid'), $oShopDiscountTabExportImportRow1);\n\n\t\t\t\t$this->getField('description')->rows(7)->wysiwyg(Core::moduleIsActive('wysiwyg'));\n\t\t\t\t$oMainTab->move($this->getField('description')->divAttr(array('class' => 'form-group col-xs-12')), $oMainRow2);\n\n\t\t\t\t$sColorValue = ($this->_object->id && $this->getField('color')->value)\n\t\t\t\t? $this->getField('color')->value\n\t\t\t\t: '#aebec4';\n\n\t\t\t\t$this->getField('color')\n\t\t\t\t\t->colorpicker(TRUE)\n\t\t\t\t\t->value($sColorValue);\n\n\t\t\t\t$oMainTab->move($this->getField('start_datetime')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-2')), $oMainRow3);\n\t\t\t\t$oMainTab->move($this->getField('end_datetime')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-2')), $oMainRow3);\n\t\t\t\t$oMainTab->move($this->getField('start_time')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-2')), $oMainRow3);\n\t\t\t\t$oMainTab->move($this->getField('end_time')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-2')), $oMainRow3);\n\t\t\t\t$oMainTab->move($this->getField('color')->set('data-control', 'hue')->divAttr(array('class' => 'form-group col-xs-6 col-sm-4 col-md-3')), $oMainRow3);\n\n\t\t\t\t$oDaysBlock\n\t\t\t\t\t->add(Admin_Form_Entity::factory('Div')\n\t\t\t\t\t\t->class('header bordered-palegreen')\n\t\t\t\t\t\t->value(Core::_(\"Shop_Discount.days\"))\n\t\t\t\t\t)\n\t\t\t\t\t->add($oDaysBlockRow1 = Admin_Form_Entity::factory('Div')->class('row'));\n\n\t\t\t\t$oMainTab->move($this->getField('day1')->divAttr(array('class' => 'form-group col-xs-6 col-sm-4 col-md-3 col-lg-2')), $oDaysBlockRow1);\n\t\t\t\t$oMainTab->move($this->getField('day2')->divAttr(array('class' => 'form-group col-xs-6 col-sm-4 col-md-3 col-lg-2')), $oDaysBlockRow1);\n\t\t\t\t$oMainTab->move($this->getField('day3')->divAttr(array('class' => 'form-group col-xs-6 col-sm-4 col-md-3 col-lg-2')), $oDaysBlockRow1);\n\t\t\t\t$oMainTab->move($this->getField('day4')->divAttr(array('class' => 'form-group col-xs-6 col-sm-4 col-md-3 col-lg-2')), $oDaysBlockRow1);\n\t\t\t\t$oMainTab->move($this->getField('day5')->divAttr(array('class' => 'form-group col-xs-6 col-sm-4 col-md-3 col-lg-3')), $oDaysBlockRow1);\n\t\t\t\t$oMainTab->move($this->getField('day6')->divAttr(array('class' => 'form-group col-xs-6 col-sm-4 col-md-3 col-lg-2'))->class('colored-danger'), $oDaysBlockRow1);\n\t\t\t\t$oMainTab->move($this->getField('day7')->divAttr(array('class' => 'form-group col-xs-6 col-sm-4 col-md-3 col-lg-2'))->class('colored-danger'), $oDaysBlockRow1);\n\n\t\t\t\t// Группа доступа\n\t\t\t\t$aSiteuser_Groups = array(0 => Core::_('Shop_Discount.all'));\n\n\t\t\t\tif (Core::moduleIsActive('siteuser'))\n\t\t\t\t{\n\t\t\t\t\t$oSiteuser_Controller_Edit = new Siteuser_Controller_Edit($this->_Admin_Form_Action);\n\t\t\t\t\t$aSiteuser_Groups = $aSiteuser_Groups + $oSiteuser_Controller_Edit->fillSiteuserGroups($this->_object->Shop->site_id);\n\t\t\t\t}\n\n\t\t\t\t$oSiteuserGroupBlock\n\t\t\t\t\t->add(Admin_Form_Entity::factory('Div')\n\t\t\t\t\t\t->class('header bordered-azure')\n\t\t\t\t\t\t->value(Core::_(\"Shop_Discount.siteuser_groups\"))\n\t\t\t\t\t)\n\t\t\t\t\t->add($oSiteuserGroupBlockRow1 = Admin_Form_Entity::factory('Div')->class('row'));\n\n\t\t\t\t$aTmp = array();\n\n\t\t\t\t$aShop_Discount_Siteuser_Groups = $this->_object->Shop_Discount_Siteuser_Groups->findAll(FALSE);\n\t\t\t\tforeach ($aShop_Discount_Siteuser_Groups as $oShop_Discount_Siteuser_Group)\n\t\t\t\t{\n\t\t\t\t\t!in_array($oShop_Discount_Siteuser_Group->siteuser_group_id, $aTmp)\n\t\t\t\t\t\t&& $aTmp[] = $oShop_Discount_Siteuser_Group->siteuser_group_id;\n\t\t\t\t}\n\n\t\t\t\tforeach ($aSiteuser_Groups as $siteuser_group_id => $name)\n\t\t\t\t{\n\t\t\t\t\t$oSiteuserGroupBlockRow1->add($oCheckbox = Admin_Form_Entity::factory('Checkbox')\n\t\t\t\t\t\t->divAttr(array('class' => 'form-group col-xs-12 col-md-4'))\n\t\t\t\t\t\t->name('siteuser_group_' . $siteuser_group_id)\n\t\t\t\t\t\t->caption(htmlspecialchars($name))\n\t\t\t\t\t);\n\n\t\t\t\t\t(!$this->_object->id || in_array($siteuser_group_id, $aTmp))\n\t\t\t\t\t\t&& $oCheckbox->checked('checked');\n\t\t\t\t}\n\n\t\t\t\t$oMainTab\n\t\t\t\t\t->move($this->getField('active')->divAttr(array('class' => 'form-group col-xs-12 col-sm-4 margin-top-21')), $oMainRow5)\n\t\t\t\t\t->move($this->getField('not_apply_purchase_discount')->divAttr(array('class' => 'form-group col-xs-12 col-sm-4 margin-top-21'))->class('colored-danger times'), $oMainRow5)\n\t\t\t\t\t->move($this->getField('public')->divAttr(array('class' => 'form-group col-xs-12 col-sm-4 margin-top-21')), $oMainRow5);\n\n\t\t\t\t$oMainTab\n\t\t\t\t\t->move($this->getField('url')->divAttr(array('class' => 'form-group col-xs-12 col-sm-8'))->placeholder('https://'), $oMainRow6)\n\t\t\t\t\t->move($this->getField('sorting')->divAttr(array('class' => 'form-group col-xs-12 col-sm-4 col-md-3 col-lg-2')), $oMainRow6);\n\n\t\t\t\t$oMainTab\n\t\t\t\t\t->delete($this->getField('value'))\n\t\t\t\t\t->delete($this->getField('type'));\n\n\t\t\t\t// Удаляем группу\n\t\t\t\t$oAdditionalTab->delete($this->getField('shop_discount_dir_id'));\n\n\t\t\t\t$oGroupSelect = Admin_Form_Entity::factory('Select');\n\n\t\t\t\t$oGroupSelect\n\t\t\t\t\t->caption(Core::_('Shop_Discount.shop_discount_dir_id'))\n\t\t\t\t\t->options(array(' … ') + self::fillShopDiscountDir($this->_object->shop_id))\n\t\t\t\t\t->name('shop_discount_dir_id')\n\t\t\t\t\t->value($this->_object->shop_discount_dir_id)\n\t\t\t\t\t->divAttr(array('class' => 'form-group col-xs-12 col-lg-4'));\n\n\t\t\t\t$oMainRow1->add($oGroupSelect);\n\n\t\t\t\t$oMainRow1->add(Admin_Form_Entity::factory('Div')\n\t\t\t\t\t->class('col-xs-12 col-sm-4 col-md-3 col-lg-2 form-group input-group select-group')\n\t\t\t\t\t->add(Admin_Form_Entity::factory('Code')\n\t\t\t\t\t\t->html('<div class=\"caption\">' . Core::_('Shop_Discount.value') . '</div>')\n\t\t\t\t\t)\n\t\t\t\t\t->add(Admin_Form_Entity::factory('Input')\n\t\t\t\t\t\t->name('value')\n\t\t\t\t\t\t->value($this->_object->value)\n\t\t\t\t\t\t->divAttr(array('class' => ''))\n\t\t\t\t\t\t->class('form-control semi-bold')\n\t\t\t\t\t\t->add(Core_Html_Entity::factory('Select')\n\t\t\t\t\t\t\t->name('type')\n\t\t\t\t\t\t\t->options(array(\n\t\t\t\t\t\t\t\t'%',\n\t\t\t\t\t\t\t\t$this->_object->Shop->Shop_Currency->sign\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\t->value($this->_object->type)\n\t\t\t\t\t\t\t->class('form-control input-group-addon')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$oMainTab->move($this->getField('coupon')\n\t\t\t\t\t->divAttr(array('class' => 'form-group margin-top-21 col-xs-12 col-sm-6 col-md-4 col-lg-3'))->onclick(\"$.toggleCoupon(this)\"), $oMainRow1);\n\n\t\t\t\t$hidden = !$this->_object->coupon\n\t\t\t\t\t? ' hidden'\n\t\t\t\t\t: '';\n\n\t\t\t\t$oMainTab->move($this->getField('coupon_text')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-3 col-lg-3' . $hidden)), $oMainRow1);\n\n\t\t\t\t$title = $this->_object->id\n\t\t\t\t\t? Core::_('Shop_Discount.item_discount_edit_form_title', $this->_object->name, FALSE)\n\t\t\t\t\t: Core::_('Shop_Discount.item_discount_add_form_title');\n\t\t\tbreak;\n\t\t\tcase 'shop_discount_dir':\n\t\t\t\t$oMainTab\n\t\t\t\t\t->add($oMainRow1 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t\t\t->add($oMainRow2 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t\t\t->add($oMainRow3 = Admin_Form_Entity::factory('Div')->class('row'));\n\n\t\t\t\t$this->getField('description')->rows(9)->wysiwyg(Core::moduleIsActive('wysiwyg'));\n\t\t\t\t$oMainTab->move($this->getField('description')->divAttr(array('class' => 'form-group col-xs-12')), $oMainRow2);\n\n\t\t\t\t// Удаляем группу\n\t\t\t\t$oAdditionalTab->delete($this->getField('parent_id'));\n\n\t\t\t\t$oGroupSelect = Admin_Form_Entity::factory('Select');\n\n\t\t\t\t$oGroupSelect\n\t\t\t\t\t->caption(Core::_('Shop_Discount_Dir.parent_id'))\n\t\t\t\t\t->options(array(' … ') + self::fillShopDiscountDir($this->_object->shop_id, 0, array($this->_object->id)))\n\t\t\t\t\t->name('parent_id')\n\t\t\t\t\t->value($this->_object->parent_id)\n\t\t\t\t\t->divAttr(array('class' => 'form-group col-xs-12 col-md-6'));\n\n\t\t\t\t$oMainRow3->add($oGroupSelect);\n\n\t\t\t\t$oMainTab->move($this->getField('sorting')->divAttr(array('class' => 'form-group col-xs-12 col-sm-3')), $oMainRow3);\n\n\t\t\t\t$title = $this->_object->id\n\t\t\t\t\t? Core::_('Shop_Discount_Dir.edit_title', $this->_object->name, FALSE)\n\t\t\t\t\t: Core::_('Shop_Discount_Dir.add_title');\n\t\t\tbreak;\n\t\t}\n\n\t\t$this->title($title);\n\n\t\treturn $this;\n\t}", "public function renderForm()\n {\n $lang = $this->context->language;\n\n $inputs[] = [\n 'type' => 'switch',\n 'label' => $this->l(\"Active\"),\n 'name' => 'active',\n 'values' => [\n [\n 'id' => 'active_on',\n 'value' => 1,\n ],\n [\n 'id' => 'active_off',\n 'value' => 0,\n ],\n ]\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Page Name'),\n 'name' => 'name',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Title'),\n 'name' => 'meta_title_lang',\n 'required' => true,\n 'id' => 'name',\n 'lang' => true,\n 'class' => 'copyMeta2friendlyURL',\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Description'),\n 'name' => 'meta_description_lang',\n 'lang' => true,\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'tags',\n 'label' => $this->l('Meta Keywords'),\n 'name' => 'meta_keywords_lang',\n 'lang' => true,\n 'hint' => [\n $this->l('To add \"tags\" click in the field, write something, and then press \"Enter.\"'),\n $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ],\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Friendly URL'),\n 'name' => 'url',\n 'required' => true,\n 'hint' => $this->l('Only letters and the hyphen (-) character are allowed.'),\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Breadcrumb URL Parameters'),\n 'name' => 'breadcrumb_parameters',\n 'required' => false,\n 'hint' => $this->l('Parameters to be applied when rendering as a breadcrumb'),\n ];\n\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'css',\n 'label' => $this->l('Style'),\n 'name' => 'style',\n 'lang' => false,\n //'autoload_rte' => true,\n 'id' => 'style',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 50,\n ];\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'html',\n 'label' => $this->l('Content'),\n 'name' => 'content_lang',\n 'lang' => true,\n //'autoload_rte' => true,\n 'id' => 'content',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 70,\n ];\n\n\n $allPages = $this->module->getAllHTMLPages(true);\n array_unshift($allPages, '-');\n\n\n if ($this->display == 'edit') {\n $inputs[] = [\n 'type' => 'hidden',\n 'name' => 'id_page'\n ];\n $title = $this->l('Edit Page');\n $action = 'submitEditCustomHTMLPage';\n\n $pageId = Tools::getValue('id_page');\n\n $this->fields_value = $this->module->getHTMLPage($pageId);\n\n // Remove the current page from the list of pages\n foreach ($allPages as $i => $p) {\n if ($p != '-' && $p['id_page'] == $pageId) {\n unset($allPages[$i]);\n break;\n }\n }\n }\n else {\n\n }\n\n // Parent select\n $inputs[] = [\n 'type' => 'select',\n 'label' => $this->l('Parent'),\n 'name' => 'id_parent',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ]\n ];\n //$this->fields_value['id_relatedTo'] = [];\n\n array_shift($allPages);\n\n // List of Pages this Page is related to\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Show On ($page->related[])'),\n 'multiple' => true,\n 'name' => 'id_relatedTo',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ],\n 'hint' => $this->l('Makes this page show up on other pages (not as a child page but as a related page): $page->related[]')\n ];\n\n $inputs[] = [\n 'type' => 'html',\n 'html_content' => '<hr/>',\n 'name' => 'id_page',\n ];\n\n // List of Products\n $products = Product::getProducts($lang->id, 0, 1000, 'id_product', 'ASC');\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Products ($product or $products)'),\n 'name' => 'id_products',\n 'multiple' => true,\n 'options' => [\n 'query' => $products,\n 'id' => 'id_product',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $products. If only one is selected then $product will be populated'),\n ];\n\n // List of Categories\n $categories = Category::getCategories($lang->id, true, false);\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Categories ($category or $categories)'),\n 'name' => 'id_categories',\n 'multiple' => true,\n 'options' => [\n 'query' => $categories,\n 'id' => 'id_category',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $categories. If only one is selected then $category will be populated'),\n ];\n\n $this->fields_form = [\n 'legend' => [\n 'title' => $title,\n 'icon' => 'icon-cogs',\n ],\n 'input' => $inputs,\n 'buttons' => [\n 'save-and-stay' => [\n 'title' => $this->l('Save and Stay'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action.'AndStay',\n 'icon' => 'process-icon-save',\n 'type' => 'submit'\n ]\n\n ],\n 'submit' => [\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action,\n ],\n\n ];\n\n\n return parent::renderForm();\n }", "public function beforeHtml() {\n $form_name = $this->getAttribute('id');\n\n if ($this->getAttribute('method') == 'post') {\n\n $uni = session::getInstance()->createToken($form_name);\n\n $this->addHidden('token')->setValue($uni)->setId('token_' . $form_name);\n $this->addHidden('token_name')->setId('token_name' . $form_name)->setValue($form_name);\n }\n\n $classe = 'form';\n\n if ($this->getAttribute('class'))\n $classe = $this->getAttribute('class') . ' ' . $classe;\n\n $this->setAttribute('class',$classe);\n\n\t\treturn parent::beforeHtml(array(), 'form_' . $form_name);\n //return $this->processElementsWrap();\n\n\n //Old process code!!\n\n $hidden = array();\n\n $wrap_class = 'form_output_handler_' . $this->_wrapper;\n $wrapper = new $wrap_class($form_name);\n\n foreach ($this->_elements as $element) {\n if (!is_object($element))\n $wrapper->wrap($element,true);\n else {\n switch ($element->type) {\n case 'hidden':\n if ($element->getAttribute('name') == 'MAX_FILE_SIZE')\n $wrapper->wrap($element,true);\n else\n $hidden[] = $element->html();\n break;\n case 'submit':\n case 'reset':\n $wrapper->wrapSubmit($element);\n break;\n default:\n $wrapper->wrap($element);\n }\n }\n }\n\n return array(\n 'elements' => $wrapper->output($form_name) .\n implode(\"\\n\",$hidden)\n );\n }", "protected function getForm( $html=false ) { return $this->form_name; }", "function workspace_page_new(){\n\t$output = \"\";\n\t$output .= '<form class=\"form-horizontal\" role=\"form\">\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label class=\"col-sm-3 control-label no-padding-right\" for=\"form-field-1\"> Text Field </label>\n\t\t\n\t\t\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t\t\t<input type=\"text\" id=\"form-field-1\" placeholder=\"Username\" class=\"col-xs-10 col-sm-5\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label class=\"col-sm-3 control-label no-padding-right\" for=\"form-field-2\"> Password Field </label>\n\n\t\t\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t\t\t<input type=\"password\" id=\"form-field-2\" placeholder=\"Password\" class=\"col-xs-10 col-sm-5\" />\n\t\t\t\t\t\t<span class=\"help-inline col-xs-12 col-sm-7\">\n\t\t\t\t\t\t\t<span class=\"middle\">Inline help text</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label class=\"col-sm-3 control-label no-padding-right\" for=\"form-field-6\">Tooltip and help button</label>\n\n\t\t\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t\t\t<input data-rel=\"tooltip\" type=\"text\" id=\"form-field-6\" placeholder=\"Tooltip on hover\" title=\"Hello Tooltip!\" data-placement=\"bottom\" />\n\t\t\t\t\t\t<span class=\"help-button\" data-rel=\"popover\" data-trigger=\"hover\" data-placement=\"left\" data-content=\"More details.\" title=\"Popover on hover\">?</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\n\t\t\t</form>';\n\treturn html($output);\n}", "protected function getForm() {\n\t\tglobal $wgScript;\n\n\t\t$this->opts['title'] = $this->getPageTitle()->getPrefixedText();\n\t\tif ( !isset( $this->opts['target'] ) ) {\n\t\t\t$this->opts['target'] = '';\n\t\t} else {\n\t\t\t$this->opts['target'] = str_replace( '_', ' ', $this->opts['target'] );\n\t\t}\n\n\t\tif ( !isset( $this->opts['namespace'] ) ) {\n\t\t\t$this->opts['namespace'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['nsInvert'] ) ) {\n\t\t\t$this->opts['nsInvert'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['associated'] ) ) {\n\t\t\t$this->opts['associated'] = false;\n\t\t}\n\n\t\tif ( !isset( $this->opts['contribs'] ) ) {\n\t\t\t$this->opts['contribs'] = 'user';\n\t\t}\n\n\t\tif ( !isset( $this->opts['year'] ) ) {\n\t\t\t$this->opts['year'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['month'] ) ) {\n\t\t\t$this->opts['month'] = '';\n\t\t}\n\n\t\tif ( $this->opts['contribs'] == 'newbie' ) {\n\t\t\t$this->opts['target'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['tagfilter'] ) ) {\n\t\t\t$this->opts['tagfilter'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['topOnly'] ) ) {\n\t\t\t$this->opts['topOnly'] = false;\n\t\t}\n\n\t\tif ( !isset( $this->opts['newOnly'] ) ) {\n\t\t\t$this->opts['newOnly'] = false;\n\t\t}\n\n\t\t$form = Html::openElement(\n\t\t\t'form',\n\t\t\tarray(\n\t\t\t\t'method' => 'get',\n\t\t\t\t'action' => $wgScript,\n\t\t\t\t'class' => 'mw-contributions-form'\n\t\t\t)\n\t\t);\n\n\t\t# Add hidden params for tracking except for parameters in $skipParameters\n\t\t$skipParameters = array(\n\t\t\t'namespace',\n\t\t\t'nsInvert',\n\t\t\t'deletedOnly',\n\t\t\t'target',\n\t\t\t'contribs',\n\t\t\t'year',\n\t\t\t'month',\n\t\t\t'topOnly',\n\t\t\t'newOnly',\n\t\t\t'associated'\n\t\t);\n\n\t\tforeach ( $this->opts as $name => $value ) {\n\t\t\tif ( in_array( $name, $skipParameters ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$form .= \"\\t\" . Html::hidden( $name, $value ) . \"\\n\";\n\t\t}\n\n\t\t$tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] );\n\n\t\tif ( $tagFilter ) {\n\t\t\t$filterSelection = Html::rawElement(\n\t\t\t\t'td',\n\t\t\t\tarray( 'class' => 'mw-label' ),\n\t\t\t\tarray_shift( $tagFilter )\n\t\t\t);\n\t\t\t$filterSelection .= Html::rawElement(\n\t\t\t\t'td',\n\t\t\t\tarray( 'class' => 'mw-input' ),\n\t\t\t\timplode( '&#160', $tagFilter )\n\t\t\t);\n\t\t} else {\n\t\t\t$filterSelection = Html::rawElement( 'td', array( 'colspan' => 2 ), '' );\n\t\t}\n\n\t\t$labelNewbies = Xml::radioLabel(\n\t\t\t$this->msg( 'sp-contributions-newbies' )->text(),\n\t\t\t'contribs',\n\t\t\t'newbie',\n\t\t\t'newbie',\n\t\t\t$this->opts['contribs'] == 'newbie',\n\t\t\tarray( 'class' => 'mw-input' )\n\t\t);\n\t\t$labelUsername = Xml::radioLabel(\n\t\t\t$this->msg( 'sp-contributions-username' )->text(),\n\t\t\t'contribs',\n\t\t\t'user',\n\t\t\t'user',\n\t\t\t$this->opts['contribs'] == 'user',\n\t\t\tarray( 'class' => 'mw-input' )\n\t\t);\n\t\t$input = Html::input(\n\t\t\t'target',\n\t\t\t$this->opts['target'],\n\t\t\t'text',\n\t\t\tarray( 'size' => '40', 'required' => '', 'class' => 'mw-input' ) +\n\t\t\t\t( $this->opts['target'] ? array() : array( 'autofocus' )\n\t\t\t\t)\n\t\t);\n\t\t$targetSelection = Html::rawElement(\n\t\t\t'td',\n\t\t\tarray( 'colspan' => 2 ),\n\t\t\t$labelNewbies . '<br />' . $labelUsername . ' ' . $input . ' '\n\t\t);\n\n\t\t$namespaceSelection = Xml::tags(\n\t\t\t'td',\n\t\t\tarray( 'class' => 'mw-label' ),\n\t\t\tXml::label(\n\t\t\t\t$this->msg( 'namespace' )->text(),\n\t\t\t\t'namespace',\n\t\t\t\t''\n\t\t\t)\n\t\t);\n\t\t$namespaceSelection .= Html::rawElement(\n\t\t\t'td',\n\t\t\tnull,\n\t\t\tHtml::namespaceSelector(\n\t\t\t\tarray( 'selected' => $this->opts['namespace'], 'all' => '' ),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'namespace',\n\t\t\t\t\t'id' => 'namespace',\n\t\t\t\t\t'class' => 'namespaceselector',\n\t\t\t\t)\n\t\t\t) . '&#160;' .\n\t\t\t\tHtml::rawElement(\n\t\t\t\t\t'span',\n\t\t\t\t\tarray( 'style' => 'white-space: nowrap' ),\n\t\t\t\t\tXml::checkLabel(\n\t\t\t\t\t\t$this->msg( 'invert' )->text(),\n\t\t\t\t\t\t'nsInvert',\n\t\t\t\t\t\t'nsInvert',\n\t\t\t\t\t\t$this->opts['nsInvert'],\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title' => $this->msg( 'tooltip-invert' )->text(),\n\t\t\t\t\t\t\t'class' => 'mw-input'\n\t\t\t\t\t\t)\n\t\t\t\t\t) . '&#160;'\n\t\t\t\t) .\n\t\t\t\tHtml::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),\n\t\t\t\t\tXml::checkLabel(\n\t\t\t\t\t\t$this->msg( 'namespace_association' )->text(),\n\t\t\t\t\t\t'associated',\n\t\t\t\t\t\t'associated',\n\t\t\t\t\t\t$this->opts['associated'],\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title' => $this->msg( 'tooltip-namespace_association' )->text(),\n\t\t\t\t\t\t\t'class' => 'mw-input'\n\t\t\t\t\t\t)\n\t\t\t\t\t) . '&#160;'\n\t\t\t\t)\n\t\t);\n\n\t\tif ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {\n\t\t\t$deletedOnlyCheck = Html::rawElement(\n\t\t\t\t'span',\n\t\t\t\tarray( 'style' => 'white-space: nowrap' ),\n\t\t\t\tXml::checkLabel(\n\t\t\t\t\t$this->msg( 'history-show-deleted' )->text(),\n\t\t\t\t\t'deletedOnly',\n\t\t\t\t\t'mw-show-deleted-only',\n\t\t\t\t\t$this->opts['deletedOnly'],\n\t\t\t\t\tarray( 'class' => 'mw-input' )\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$deletedOnlyCheck = '';\n\t\t}\n\n\t\t$checkLabelTopOnly = Html::rawElement(\n\t\t\t'span',\n\t\t\tarray( 'style' => 'white-space: nowrap' ),\n\t\t\tXml::checkLabel(\n\t\t\t\t$this->msg( 'sp-contributions-toponly' )->text(),\n\t\t\t\t'topOnly',\n\t\t\t\t'mw-show-top-only',\n\t\t\t\t$this->opts['topOnly'],\n\t\t\t\tarray( 'class' => 'mw-input' )\n\t\t\t)\n\t\t);\n\t\t$checkLabelNewOnly = Html::rawElement(\n\t\t\t'span',\n\t\t\tarray( 'style' => 'white-space: nowrap' ),\n\t\t\tXml::checkLabel(\n\t\t\t\t$this->msg( 'sp-contributions-newonly' )->text(),\n\t\t\t\t'newOnly',\n\t\t\t\t'mw-show-new-only',\n\t\t\t\t$this->opts['newOnly'],\n\t\t\t\tarray( 'class' => 'mw-input' )\n\t\t\t)\n\t\t);\n\t\t$extraOptions = Html::rawElement(\n\t\t\t'td',\n\t\t\tarray( 'colspan' => 2 ),\n\t\t\t$deletedOnlyCheck . $checkLabelTopOnly . $checkLabelNewOnly\n\t\t);\n\n\t\t$dateSelectionAndSubmit = Xml::tags( 'td', array( 'colspan' => 2 ),\n\t\t\tXml::dateMenu(\n\t\t\t\t$this->opts['year'] === '' ? MWTimestamp::getInstance()->format( 'Y' ) : $this->opts['year'],\n\t\t\t\t$this->opts['month']\n\t\t\t) . ' ' .\n\t\t\t\tXml::submitButton(\n\t\t\t\t\t$this->msg( 'sp-contributions-submit' )->text(),\n\t\t\t\t\tarray( 'class' => 'mw-submit' )\n\t\t\t\t)\n\t\t);\n\n\t\t$form .= Xml::fieldset( $this->msg( 'sp-contributions-search' )->text() );\n\t\t$form .= Html::rawElement( 'table', array( 'class' => 'mw-contributions-table' ), \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $targetSelection ) . \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $namespaceSelection ) . \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $filterSelection ) . \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $extraOptions ) . \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $dateSelectionAndSubmit ) . \"\\n\"\n\t\t);\n\n\t\t$explain = $this->msg( 'sp-contributions-explain' );\n\t\tif ( !$explain->isBlank() ) {\n\t\t\t$form .= \"<p id='mw-sp-contributions-explain'>{$explain->parse()}</p>\";\n\t\t}\n\n\t\t$form .= Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' );\n\n\t\treturn $form;\n\t}", "function cmc_framework_markets_landing_settings_tab_section(&$form, $i) {\n \n $fieldset_key = 'tab' . $i;\n $title_key = 'cmc_framework_markets_tab' . $i;\n $content_key = 'cmc_framework_markets_tab' . $i . '_content';\n $pricing_key = 'cmc_framework_markets_tab' . $i . '_pricing';\n $image_key = 'cmc_framework_markets_tab' . $i . '_image';\n $image_key_delete = 'cmc_framework_markets_tab' . $i . '_image_delete';\n \n $form[$fieldset_key] = array(\n '#type' => 'fieldset',\n '#title' => t('Tab') . $i,\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n \n $form[$fieldset_key][$title_key] = array(\n '#type' => 'textfield',\n '#title' => t('Title'),\n '#default_value' => variable_get($title_key, 'Tab title'),\n );\n \n\n $textarea_defaults = variable_get($content_key, 'Content');\n $form[$fieldset_key][$content_key] = array(\n '#type' => 'text_format',\n '#title' => t('Content'),\n \t'#default_value' => $textarea_defaults['value'],\n '#format' => $textarea_defaults['format'],\n '#description' => 'Please do not put in images in textarea',\n );\n \n// http://stackoverflow.com/questions/7690295/drupal-module-configuration-process-uploaded-file\n $form[$fieldset_key][$image_key] = array(\n '#type' => 'managed_file',\n '#title' => t('Content Image'),\n '#description' => t('Uploading a file will replace the content image. This should be a generic image so it can be used for multiple languages. E.g. Don\\'t put text into it'),\n '#upload_location' => 'public://cmc_framework/markets-landing'\n );\n \n $image_fid = variable_get($image_key, '');\n $image = file_load($image_fid);\n \n if (!empty($image->fid)) {\n $data = array(\n 'path' => file_create_url($image->uri),\n );\n $form[$fieldset_key][$image_key]['#description'] .= '<br />' . theme('image', $data);\n \n }\n \n $form[$fieldset_key][$image_key_delete] = array(\n '#type' => 'checkbox',\n '#title' => t('Delete Image'),\n );\n \n \n \n // pricing, only do this if module is on\n if (module_exists('cmc_pricing')) {\n \n $view = views_get_view('cmc_pricing');\n $content = $view->preview('pricing_panel_list');\n \n $options = array('' => 'None');\n foreach ($view->result as $res) {\n $options[$res->nid] = $res->node_title;\n }\n \n $form[$fieldset_key][$pricing_key] = array(\n '#type' => 'select',\n '#options' => $options,\n '#title' => t('Tab Pricing panel'),\n //'#description' => t('Time in seconds, should be < 30. Feed returns last 30 movements and we might have more than 1 movement per second'),\n '#default_value' => variable_get($pricing_key, ''),\n );\n }\n}", "function _onRenderForm($tmp) {\n\t\t\n\t\t/* Show Page title */\n\t\tif ($this->_FORM_CONFIG ['showtitle'] == 1) {\n\t\t\t$tmp->assign ( 'SHOW_PAGE_TITLE', TRUE );\n\t\t}\n\t\t\n\t\t/* Show Reset Button */\n\t\tif ($this->_FORM_CONFIG ['showresetbutton'] == 1) {\n\t\t\t$tmp->assign ( 'SHOW_RESET_BUTTON', TRUE );\n\t\t}\n\t\t\n\t\t$tmp->assign ( 'RESETBUTTONTEXT', $this->_FORM_CONFIG ['resetbuttontext'] );\n\t\t$tmp->assign ( 'SUBMITBUTTONTEXT', $this->_FORM_CONFIG ['submitbuttontext'] );\n\t\t\n\t\treturn $tmp;\n\t}", "public function onRsformBackendAfterShowFormEditTabsTab(): void\n\t{\n\t\t?>\n\t\t<li>\n\t\t\t<?php\n\t\t\techo HTMLHelper::_(\n\t\t\t\t'link',\n\t\t\t\t'javascript: void(0);',\n\t\t\t\t'<span class=\"rsficon jdicon-jdideal\"></span><span class=\"inner-text\">'\n\t\t\t\t. Text::_(\n\t\t\t\t\t'PLG_RSFP_JDIDEAL_LABEL'\n\t\t\t\t) . '</span>'\n\t\t\t);\n\t\t\t?>\n\t\t</li>\n\t\t<?php\n\t}", "public function initTemplateSelectionForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\n\t\t// page name\n\t\t$hi = new ilHiddenInputGUI(\"page\");\n\t\t$hi->setValue($_GET[\"page\"]);\n\t\t$form->addItem($hi);\n\n\t\t// page template\n\t\t$radg = new ilRadioGroupInputGUI($lng->txt(\"wiki_page_template\"), \"page_templ\");\n\t\t$radg->setRequired(true);\n\n\t\tif ($this->object->getEmptyPageTemplate())\n\t\t{\n\t\t\t$op1 = new ilRadioOption($lng->txt(\"wiki_empty_page\"), 0);\n\t\t\t$radg->addOption($op1);\n\t\t}\n\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPageTemplate.php\");\n\t\t$wt = new ilWikiPageTemplate($this->object->getId());\n\t\t$ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);\n\t\tforeach ($ts as $t)\n\t\t{\n\t\t\t$op = new ilRadioOption($t[\"title\"], $t[\"wpage_id\"]);\n\t\t\t$radg->addOption($op);\n\t\t}\n\n\t\t$form->addItem($radg);\n\n\t\t// save and cancel commands\n\t\t$form->addCommandButton(\"createPageUsingTemplate\", $lng->txt(\"wiki_create_page\"));\n\t\t$form->addCommandButton(\"cancelCreationPageUsingTemplate\", $lng->txt(\"cancel\"));\n\n\t\t$form->setTitle($lng->txt(\"wiki_new_page\").\": \".$_GET[\"page\"]);\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\n\t\treturn $form;\n\t}", "function uultra_new_links_add_form()\r\n\t{\r\n\t\t\r\n\t\t$meta = 'uultra_link_content';\r\n\t\t$html = '<div id=\"#uultra-add-links-box\" class=\"uultra-links-content-edition-box \" title=\"Add New Link\">';\r\n\t\t\r\n\t\t$html .= '<input name=\"uultra-current-selected-widget-to-edit\" id=\"uultra-current-selected-widget-to-edit\" type=\"hidden\" />';\r\n\t\t\r\n\t\t\r\n\t\t$html .= '<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Name: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_link_title\" type=\"text\" id=\"uultra_link_title\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Slug: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_link_slug\" type=\"text\" id=\"uultra_link_slug\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Type:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_link_type\" id=\"uultra_link_type\" size=\"1\">\r\n\t\t\t\t <option value=\"\" selected=\"selected\">'.__(\"Select Type: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"Text: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"2\">Shortcode</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t<td>'.__('Content:','xoousers').'</td>\r\n\t\t\t\t<td>&nbsp;</textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t</table> '; \t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$html .= '<div class=\"uultra-field-msbox-div-history\" id=\"uultra-msg-history-list\">';\r\n\t\t\r\n\t\t$html .= $this->uultra_get_addlink_html_form($meta, $content);\r\n\t\t\r\n\t\t$html .= '</div>';\t\r\n\t\t\r\n\t\t\r\n\t\t\t \r\n\t\t$html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button uultra-links-add-new-close\" value=\"'.__('Close','xoousers').'\" /> <input type=\"button\" name=\"submit\" class=\"button button-primary uultra-links-add-new-confirm\" value=\"'.__('Submit','xoousers').'\" /> <span id=\"uultra-add-new-links-m-w\" ></span>\r\n\t\t\t\t</p> ';\t\t\r\n\t\t$html .= '</div>';\t\t\r\n\t\t\t\r\n\t\treturn $html;\r\n\t}", "function makeForm() {\n?>\n <div id=\"form_wrap\">\n <a class=\"faux_button\" id=\"done_goback_button\" href=\"#\">Go Back</a>\n<?php if(! $this->is_find_form AND ! $this->is_new): ?>\n <button class=\"faux_button\" id=\"clone_this\" <?php if( $this->is_new == 1 ){ echo 'disabled';} ?> >Clone</button>\n <a class=\"faux_button\" href=\"/cancer_types/views_controllers/form_cancer_type.php?new=yes\">New Cancer Type</a>\n <span class=\"right\"><a class=\"faux_button\" id=\"delete\" href=\"#\">Delete</a></span>\n<?php elseif($this->is_find_form) : ?>\n <span style=\"float:right\">\n <button class=\"search_button\" id=\"search_button\" name=\"search_button\" >Search</button>\n <b>Match:</b> <select class=\"semi_faux\" id=\"conjunction\"><option value=\"OR\">Any</option><option value=\"AND\">All</option></select> Fields\n </span>\n <div style=\"clear:both\"></div>\n <p id=\"search_inform\"></p>\n<?php endif ?>\n\n <div class=\"clear\"></div>\n <br> \n <br>\n\n <?php \n // We don't want to go through the whole generic_update during a search \n if(! $this->is_find_form ):\n ?>\n <form method=\"post\" id=\"generic_edit_form\" class=\"generic_update\">\n <?php else: ?>\n <form method=\"post\" id=\"generic_find_form\" >\n <?php endif ?>\n \n<?php if(! $this->is_find_form ): ?>\n <input type=\"hidden\" name=\"id\" value=\"<?php echo $this->id ?>\">\n <span class=\"tag\">ID:</span> <b><?php echo $this->id ?></b><br><br>\n<?php endif ?>\n <input type=\"hidden\" name=\"is_new\" value=\"<?php echo $this->is_new ?>\">\n <input type=\"hidden\" name=\"table\" value=\"cancer_type\">\n <input type=\"hidden\" name=\"table_display\" value=\"<?php echo $this->table_display ?>\">\n <input type=\"hidden\" name=\"title_input\" value=\"cancer_type\"> \n \n \n <span class=\"tag\">Cancer Type:</span> <input class=\"info\" type=\"text\" name=\"cancer_type\" size=\"95\" value=\"<?php echo $this->cancer_type ?>\"> <br>\n <span class=\"tag\">Synopsis</span> <input class=\"info\" type=\"text\" name=\"synopsis\" size=\"95\" value=\"<?php echo $this->synopsis ?>\"> \n \n <span class=\"tag_long\">Primary Anatomical Site</span> <?php $this->buildGenericSelect('primary_anatomical_site', 'primary_anatomical_site', 'table_index', 'descriptor') ?>\n<!-- \n <span class=\"leftForm\"></span><br>\n <span class=\"rightForm\"></span>\n -->\n <br> <br>\n <span class=\"tag\">Overview:</span><textarea class=\"form_text\" name=\"overview\"><?php echo $this->overview; ?></textarea>\n<br><br>\n <button class=\"faux_button\" id=\"undo_generic_update\" >Undo</button>\n </form>\n\n </div>\n<?php\n$this->deleteInfo();\n }", "function workflow_hide_fields_form_preset_edit($form, &$form_state) {\r\n\r\n if (empty($form_state['preset'])) {\r\n $preset = workflow_hide_fields_preset_create();\r\n }\r\n else {\r\n $preset = $form_state['preset'];\r\n }\r\n\r\n // Title\r\n $form['title'] = array(\r\n '#type' => 'textfield',\r\n '#maxlength' => '255',\r\n '#title' => t('Title'),\r\n '#description' => t('A human-readable title for this option set.'),\r\n '#required' => TRUE,\r\n '#default_value' => $preset->title,\r\n );\r\n $form['name'] = array(\r\n '#type' => 'machine_name',\r\n '#maxlength' => '255',\r\n '#machine_name' => array(\r\n 'source' => array('title'),\r\n 'exists' => 'workflow_hide_fields_preset_exists',\r\n ),\r\n '#required' => TRUE,\r\n '#default_value' => $preset->name,\r\n );\r\n\r\n\r\n // Options Vertical Tab Group table\r\n $form['preset'] = array(\r\n '#type' => 'vertical_tabs',\r\n );\r\n\r\n $default_options = workflow_hide_fields_option_elements($preset->options);\r\n // Add the options to the vertical tabs section\r\n foreach ($default_options as $key => $value) {\r\n $form['options'][] = $value;\r\n }\r\n\r\n if (!empty($form_state['values']['nodeType'])) {\r\n $selected = $form_state['values']['nodeType'];\r\n\r\n // When the form is rebuilt during ajax processing, the $selected variable\r\n // will now have the new value and so the options will change. \r\n $form['options'][0]['fields']['fieldResponsible']['#options'] = _ajax_get_fields_options($selected);\r\n $form['options'][0]['fields']['fieldRating']['#options'] = _ajax_get_fields_options($selected);\r\n $form['options'][0]['fields']['fieldState']['#options'] = _ajax_get_fields_options($selected);\r\n $form['options'][0]['fields']['fieldsWritableOnlyOnCreation']['#options'] = _ajax_get_fields_options($selected);\r\n }\r\n else {\r\n $form['options'][0]['fields']['fieldResponsible']['#options'] = _ajax_get_fields_options($form['options'][0]['nodeType']['#default_value']);\r\n $form['options'][0]['fields']['fieldRating']['#options'] = _ajax_get_fields_options($form['options'][0]['nodeType']['#default_value']);\r\n $form['options'][0]['fields']['fieldState']['#options'] = _ajax_get_fields_options($form['options'][0]['nodeType']['#default_value']);\r\n $form['options'][0]['fields']['fieldsWritableOnlyOnCreation']['#options'] = _ajax_get_fields_options($form['options'][0]['nodeType']['#default_value']);\r\n }\r\n\r\n return $form;\r\n}", "function recommends_req_wizard_student_info($form, &$form_state) {\n $form = array();\n $form['streq'] = array(\n '#type' => 'fieldset',\n '#title' => variable_get('recommends_req_student_professor'),\n '#prefix' => '<div id=\"formlimit\">',\n '#suffix' => '</div>'\n );\n \n \n $form['streq']['prefix'] = array(\n '#type' => 'select',\n '#title' => t('Name prefix'),\n '#size' => 1,\n '#required' => TRUE,\n '#options' => array(\n \t'Mr.' => t('Mr.'),\n \t'Ms.' => t('Ms.'),\n \t'Mrs.' => t('Mrs.'), \n ),\n );\n \n $form['streq']['first_name'] = array(\n '#type' => 'textfield',\n '#title' => t('First name'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['first_name']) ? $form_state['values']['first_name'] : '',\n );\n $form['streq']['initial'] = array(\n '#type' => 'textfield',\n '#title' => t('Initial'),\n '#size' => 3,\n '#maxlength' => 20,\n '#default_value' => !empty($form_state['values']['initial']) ? $form_state['values']['initial'] : '',\n );\n $form['streq']['last_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Last name'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['last_name']) ? $form_state['values']['last_name'] : '',\n );\n \n $form['streq']['suffix'] = array(\n '#type' => 'textfield',\n '#title' => t('Name suffix'),\n '#size' => 5,\n '#maxlength' => 50,\n '#default_value' => !empty($form_state['values']['suffix']) ? $form_state['values']['suffix'] : '',\n );\n $form['streq']['email'] = array(\n '#type' => 'textfield',\n '#title' => t('Email'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['email']) ? $form_state['values']['email'] : '',\n\n );\n $form['streq']['reqby'] = array(\n '#type' => 'hidden',\n '#title' => t('Date recommendations required by'),\n '#size' => 10,\n '#maxlength' => 15,\n '#description' => t('Date in the form of yyyy/mm/dd.'),\n \n );\n $form['streq']['comments'] = array(\n '#type' => 'textarea',\n '#title' => t('Statement of intent, Point of view'),\n '#cols' => 25,\n '#resizable' => TRUE,\n '#rows' => 5,\n '#default_value' => !empty($form_state['values']['comments']) ? $form_state['values']['comments'] : '',\n\n );\n return $form;\n}", "function renderWholeForm() {\n\t\t$output = $this->renderCurrentStep();\n\t\t$output .= $this->renderSubmitButtons();\n\n\t\treturn $this->wrapWithForm ($output);\n\t}", "function rnd15_site_tabs_style_render_region_settings_form($style_settings, $panel_display) {\n \n // View Modes of Fieldable Panel Pane - add a select field\n $entity_info = entity_get_info('fieldable_panels_pane');\n foreach ($entity_info['view modes'] as $id => $config) {\n // push label value back to array key, so it displays label on dropdown options \n $entity_info['view modes'][$id] = $entity_info['view modes'][$id]['label'];\n }\n\n $view_mode_default_value = isset($style_settings['view_mode']) ? $style_settings['view_mode'] : '';\n \n $form['view_mode'] = array(\n '#type' => 'select',\n '#title' => t('View Modes of Panes'),\n '#multiple' => FALSE,\n '#options' => $entity_info['view modes'],\n '#default_value' => $view_mode_default_value,\n '#description' => t('Set view modes of all fieldable panes'),\n );\n\n $tabs_heading_default_value = isset($style_settings['tabsHeading']) ? $style_settings['tabsHeading'] : '';\n\n $form['tabsHeading'] = array(\n '#title' => t('Tabs Heading'),\n '#description' => t('H3 rendered above the tabs'),\n '#type' => 'textfield',\n '#default_value' => $tabs_heading_default_value,\n );\n\n /** \n * Array of non-empty regions in the minipanel, allowing dev to choose\n * which region/tab the page defaults to upon page open\n */\n $regionList = array_keys($panel_display->panels);\n\n // Set array to use 1-index rather than 0-index, to match region naming/numbering convention (as used in js)\n foreach ( $regionList as $key => $val ) {\n $regionList[ $key+1 ] = $val;\n }\n \n unset($regionList[0]);\n\n // Defaults to using tab/region #1 as default tab when user lands on page\n $default_tab_default_value = isset($style_settings['defaultTab']) ? $style_settings['defaultTab'] : '1';\n\n $form['defaultTab'] = array(\n '#title' => t('Default Tab'),\n '#description' => t('Sets the default tab for the page (if no tabname is stipulated in the URL)'),\n '#type' => 'select',\n '#multiple' => FALSE,\n '#options' => $regionList,\n '#default_value' => $default_tab_default_value,\n );\n\n // Extra classes - this output same level of tab wrapper\n $extra_classes_default_value = isset($style_settings['extraClasses']) ? $style_settings['extraClasses'] : '';\n $form['extraClasses'] = array(\n '#title' => t('Extra Classes'),\n '#description' => t('Drop any classes you want in here, this class applies to the same level of tab wrapper'),\n '#type' => 'textfield',\n '#default_value' => $extra_classes_default_value,\n );\n \n return $form;\n}", "function showForm() {\n \tglobal $pluginpath;\n \t\n \tif ($this->idt == \"\") {\n \t //user is creating new template\n \t\t$title = MF_NEW_TEMPLATE;\n \t\t$this->action = 'createtempl';\n\t\t$btnText = MF_CREATE_TEMPLATE_BUTTON; \n \t} else {\n \t //user is editing old template\n \t\t$title = \tMF_CHANGE_TEMPLATE;\n \t\t$this->action = 'changetempl';\n\t\t$btnText = MF_CHANGE_FORUM_BUTTON;\n \t}\n \t\n\t$this->doHtmlSpecChars();\n\t\t\n\tinclude \"admin/tempForm.php\";\n \t\n }", "protected function setFormContent()\n {\n\t\t$content = $this->getTitle();\n\t\t\n\t\t$content .= '<p>Your meditation time on <b>';\n\t\t$content .= $this->data['long_date'];\n\t\t$content .= '</b> has been deleted. Would you like to restore it?</p>';\n\t\t\n\t\t$this->Form = new Form;\n\t\t$this->buildForm();\n\t\t$content .= $this->Form->getHtml();\n\t\t\n\t\t// Add the cancel link\n\t\t$content .= $this->cancelLink();\n\t\t\n\t\t$this->content = $content;\n }", "protected function settingsForm(array $form, FormStateInterface $form_state) {\n $casestudy = $this->getEntity();\n\n if ($casestudy->isNew()) {\n return $form;\n }\n\n// $elements = \\Drupal::entityTypeManager()\n// ->getStorage('question')\n// ->loadByProperties([\n// 'casestudy' => $casestudy->id(),\n// ]);\n //print_r($el);\n\n $elements = $casestudy->getElements();\n// print_r($casestudy);\n// print_r($elements);\n// exit;\n\n $header = $this->getTableHeader();\n $rows = [];\n $delta = count($elements);\n foreach ($elements as $key => $element) {\n $elementObj = \\Drupal::entityTypeManager()\n ->getStorage('question')\n ->load($key);\n if($elementObj){\n $elementObj->weight = $element['weight'];\n $rows[$key] = $this->getElementRow($elementObj, $delta);\n }\n }\n\n\n// $local_actions = [];\n// $local_actions['add_element'] = [\n// '#theme' => 'menu_local_action',\n// '#link' => [\n// 'title' => $this->t('Add Question'),\n// 'url' => new Url('entity.question.add', ['casestudy' => $casestudy->id()]),\n// //'attributes' => WebformDialogHelper::getModalDialogAttributes(800),\n// ]\n// ];\n// $local_actions['add_page'] = [\n// '#theme' => 'menu_local_action',\n// '#link' => [\n// 'title' => $this->t('Add HTML Page'),\n// 'url' => new Url('entity.question.add_html', ['casestudy' => $casestudy->id()]),\n// 'attributes' => WebformDialogHelper::getModalDialogAttributes(800),\n// ]\n// ];\n//\n// $form['local_actions'] = [\n// '#prefix' => '<ul class=\"action-links\">',\n// '#suffix' => '</ul>',\n// ] + $local_actions;\n\n $form['elements'] = [\n '#type' => 'table',\n '#header' => $header,\n '#empty' => $this->t('Please add elements to this case study.'),\n '#attributes' => [\n 'class' => ['webform-ui-elements-table'],\n ],\n '#tabledrag' => [\n [\n 'action' => 'order',\n 'relationship' => 'sibling',\n 'group' => 'row-weight',\n ],\n ],\n ] + $rows;\n //print_r($form);\n\n // Must preload libraries required by (modal) dialogs.\n //WebformDialogHelper::attachLibraries($form);\n //$form['#attached']['library'][] = 'webform_ui/webform_ui';\n return $form;\n }", "function form( $instance ) {\n\t\t$defaults = array( 'title' => '', 'datefirst' => 'all', 'datesecond' => 'all', 'datethird' => 'all', 'datefourth' => 'all', 'titlefirst' => '', 'metafirst' => '','titlesecond' => '', 'metasecond' => '','titlethird' => '', 'metathird' => '','titlefourth' => '', 'metafourth' => '',);\n\t\t$instance = wp_parse_args( (array) $instance, $defaults ); ?>\n\t\n\t\t<div>\n\t\t<p><em style=\"color:red;\"><?php _e('Use this widget only in sidebar area!', 'rehub_framework');?></em></p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e('Title of widget:', 'rehub_framework'); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" value=\"<?php echo $instance['title']; ?>\" />\n\t\t</p>\t\t\t\t\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'titlefirst' ); ?>\"><?php _e('Enter title for first tab:', 'rehub_framework'); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'titlefirst' ); ?>\" name=\"<?php echo $this->get_field_name( 'titlefirst' ); ?>\" value=\"<?php echo $instance['titlefirst']; ?>\" />\n\t\t\t<span><em><?php _e('Required', 'rehub_framework');?></em></span>\n\t\t</p>\n\t\t<p>\n\t\t<label for=\"<?php echo $this->get_field_id('datefirst'); ?>\"><?php _e('Show posts for first tab published:', 'rehub_framework');?></label> \n\t\t<select id=\"<?php echo $this->get_field_id('datefirst'); ?>\" name=\"<?php echo $this->get_field_name('datefirst'); ?>\" style=\"width:100%;\">\n\t\t\t<option value='all' <?php if ( 'all' == $instance['datefirst'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('all time', 'rehub_framework');?></option>\n\t\t\t<option value='day' <?php if ( 'day' == $instance['datefirst'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last 24 hours', 'rehub_framework');?></option>\t\t\t\n\t\t\t<option value='week' <?php if ( 'week' == $instance['datefirst'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last 7 days', 'rehub_framework');?></option>\n\t\t\t<option value='month' <?php if ( 'month' == $instance['datefirst'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last month', 'rehub_framework');?></option>\n\t\t\t<option value='year' <?php if ( 'year' == $instance['datefirst'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last year', 'rehub_framework');?></option>\n\t\t</select>\n\t\t</p>\t\t\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'metafirst' ); ?>\"><?php _e('Enter meta for first tab', 'rehub_framework'); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'metafirst' ); ?>\" name=\"<?php echo $this->get_field_name( 'metafirst' ); ?>\" value=\"<?php echo $instance['metafirst']; ?>\" />\n\t\t</p>\n\t\t<p style=\"font-style: italic;\">\n\t\t\t<?php _e('Some important meta keys: <br /><strong>rehub_review_overall_score</strong> - key for overall review score, <br /><strong>post_hot_count</strong> - hot or thumb counter, <br /><strong>post_user_average</strong> - user rating score(based on full review criterias), <br /><strong>rehub_views</strong> - post view counter', 'rehub_framework')?>\t\t\t\t\t\t\t\n\t\t</p>\t\t\n\t\t<hr style=\"margin: 30px 0\" />\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'titlesecond' ); ?>\"><?php _e('Enter title for second tab', 'rehub_framework'); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'titlesecond' ); ?>\" name=\"<?php echo $this->get_field_name( 'titlesecond' ); ?>\" value=\"<?php echo $instance['titlesecond']; ?>\" />\n\t\t\t<span><em><?php _e('Required', 'rehub_framework');?></em></span>\n\t\t</p>\n\t\t<p>\n\t\t<label for=\"<?php echo $this->get_field_id('datesecond'); ?>\"><?php _e('Show posts for second tab published:', 'rehub_framework');?></label> \n\t\t<select id=\"<?php echo $this->get_field_id('datesecond'); ?>\" name=\"<?php echo $this->get_field_name('datesecond'); ?>\" style=\"width:100%;\">\n\t\t\t<option value='all' <?php if ( 'all' == $instance['datesecond'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('all time', 'rehub_framework');?></option>\n\t\t\t<option value='day' <?php if ( 'day' == $instance['datesecond'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last 24 hours', 'rehub_framework');?></option>\t\t\t\n\t\t\t<option value='week' <?php if ( 'week' == $instance['datesecond'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last 7 days', 'rehub_framework');?></option>\n\t\t\t<option value='month' <?php if ( 'month' == $instance['datesecond'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last month', 'rehub_framework');?></option>\n\t\t\t<option value='year' <?php if ( 'year' == $instance['datesecond'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last year', 'rehub_framework');?></option>\n\t\t</select>\n\t\t</p>\t\t\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'metasecond' ); ?>\"><?php _e('Enter meta for second tab', 'rehub_framework'); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'metasecond' ); ?>\" name=\"<?php echo $this->get_field_name( 'metasecond' ); ?>\" value=\"<?php echo $instance['metasecond']; ?>\" />\t\t\t\n\t\t</p>\n\t\t<p style=\"font-style: italic;\">\n\t\t\t<?php _e('Some important meta keys: <br /><strong>rehub_review_overall_score</strong> - key for overall review score, <br /><strong>post_hot_count</strong> - hot or thumb counter, <br /><strong>post_user_average</strong> - user rating score(based on full review criterias), <br /><strong>rehub_views</strong> - post view counter', 'rehub_framework')?>\t\t\t\t\t\t\t\n\t\t</p>\t\t\n\t\t\n\t\t<hr style=\"margin: 30px 0\" />\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'titlethird' ); ?>\"><?php _e('Enter title for third tab', 'rehub_framework'); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'titlethird' ); ?>\" name=\"<?php echo $this->get_field_name( 'titlethird' ); ?>\" value=\"<?php echo $instance['titlethird']; ?>\" />\n\t\t</p>\n\t\t<p>\n\t\t<label for=\"<?php echo $this->get_field_id('datethird'); ?>\"><?php _e('Show posts for third tab published:', 'rehub_framework');?></label> \n\t\t<select id=\"<?php echo $this->get_field_id('datethird'); ?>\" name=\"<?php echo $this->get_field_name('datethird'); ?>\" style=\"width:100%;\">\n\t\t\t<option value='all' <?php if ( 'all' == $instance['datethird'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('all time', 'rehub_framework');?></option>\n\t\t\t<option value='day' <?php if ( 'day' == $instance['datethird'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last 24 hours', 'rehub_framework');?></option>\t\t\t\n\t\t\t<option value='week' <?php if ( 'week' == $instance['datethird'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last 7 days', 'rehub_framework');?></option>\n\t\t\t<option value='month' <?php if ( 'month' == $instance['datethird'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last month', 'rehub_framework');?></option>\n\t\t\t<option value='year' <?php if ( 'year' == $instance['datethird'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last year', 'rehub_framework');?></option>\n\t\t</select>\n\t\t</p>\t\t\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'metathird' ); ?>\"><?php _e('Enter meta for third tab', 'rehub_framework'); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'metathird' ); ?>\" name=\"<?php echo $this->get_field_name( 'metathird' ); ?>\" value=\"<?php echo $instance['metathird']; ?>\" />\t\t\t\n\t\t</p>\n\t\t<p style=\"font-style: italic;\">\n\t\t\t<?php _e('Some important meta keys: <br /><strong>rehub_review_overall_score</strong> - key for overall review score, <br /><strong>post_hot_count</strong> - hot or thumb counter, <br /><strong>post_user_average</strong> - user rating score(based on full review criterias), <br /><strong>rehub_views</strong> - post view counter', 'rehub_framework')?>\t\t\t\t\t\t\t\t\n\t\t</p>\t\t\n\t\t\n\t\t<hr style=\"margin: 30px 0\" />\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'titlefourth' ); ?>\"><?php _e('Enter title for fourth tab', 'rehub_framework'); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'titlefourth' ); ?>\" name=\"<?php echo $this->get_field_name( 'titlefourth' ); ?>\" value=\"<?php echo $instance['titlefourth']; ?>\" />\n\t\t</p>\n\t\t<p>\n\t\t<label for=\"<?php echo $this->get_field_id('datefourth'); ?>\"><?php _e('Show posts for fourth tab published:', 'rehub_framework');?></label> \n\t\t<select id=\"<?php echo $this->get_field_id('datefourth'); ?>\" name=\"<?php echo $this->get_field_name('datefourth'); ?>\" style=\"width:100%;\">\n\t\t\t<option value='all' <?php if ( 'all' == $instance['datefourth'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('all time', 'rehub_framework');?></option>\n\t\t\t<option value='day' <?php if ( 'day' == $instance['datefourth'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last 24 hours', 'rehub_framework');?></option>\t\t\t\n\t\t\t<option value='week' <?php if ( 'week' == $instance['datefourth'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last 7 days', 'rehub_framework');?></option>\n\t\t\t<option value='month' <?php if ( 'month' == $instance['datefourth'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last month', 'rehub_framework');?></option>\n\t\t\t<option value='year' <?php if ( 'year' == $instance['datefourth'] ) : echo 'selected=\"selected\"'; endif; ?>><?php _e('For last year', 'rehub_framework');?></option>\n\t\t</select>\n\t\t</p>\t\t\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'metafourth' ); ?>\"><?php _e('Enter meta for fourth tab', 'rehub_framework'); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat\" id=\"<?php echo $this->get_field_id( 'metafourth' ); ?>\" name=\"<?php echo $this->get_field_name( 'metafourth' ); ?>\" value=\"<?php echo $instance['metafourth']; ?>\" />\t\t\t\n\t\t</p>\n\t\t<p style=\"font-style: italic;\">\n\t\t\t<?php _e('Some important meta keys: <br /><strong>rehub_review_overall_score</strong> - key for overall review score, <br /><strong>post_hot_count</strong> - hot or thumb counter, <br /><strong>post_user_average</strong> - user rating score(based on full review criterias), <br /><strong>rehub_views</strong> - post view counter', 'rehub_framework')?>\t\t\t\t\t\t\t\t\n\t\t</p>\t\t\n\t\t\t\t\t\t\t\t\n\t\t\n\t\t</div>\n\t<?php\n\t}", "private function createFormsTab()\n {\n $tab = $this->createTab(\n 'forms_tab',\n '__responsive_tab_forms__',\n [\n 'attributes' => [\n 'autoScroll' => true,\n ],\n ]\n );\n\n $attributes = array_merge($this->fieldSetDefaults, ['height' => 90]);\n $fieldSetLabels = $this->createFieldSet(\n 'labels_fieldset',\n '__responsive_tab_forms_fieldset_labels__',\n ['attributes' => $attributes]\n );\n\n $fieldSetLabels->addElement(\n $this->createTextField(\n 'label-font-size',\n '@label-font-size',\n $this->themeFontDefaults['label-font-size']\n )\n );\n $fieldSetLabels->addElement(\n $this->createColorPickerField(\n 'label-color',\n '@label-color',\n $this->themeColorDefaults['label-color']\n )\n );\n\n $tab->addElement($fieldSetLabels);\n\n $attributes = array_merge($this->fieldSetDefaults, ['height' => 160]);\n $fieldSetFormBase = $this->createFieldSet(\n 'form_base_fieldset',\n '__responsive_tab_forms_fieldset_global__',\n ['attributes' => $attributes]\n );\n\n $fieldSetFormBase->addElement(\n $this->createTextField(\n 'input-font-size',\n '@input-font-size',\n $this->themeFontDefaults['input-font-size']\n )\n );\n $fieldSetFormBase->addElement(\n $this->createColorPickerField(\n 'input-bg',\n '@input-bg',\n $this->themeColorDefaults['input-bg']\n )\n );\n $fieldSetFormBase->addElement(\n $this->createColorPickerField(\n 'input-color',\n '@input-color',\n $this->themeColorDefaults['input-color']\n )\n );\n $fieldSetFormBase->addElement(\n $this->createColorPickerField(\n 'input-placeholder-color',\n '@input-placeholder-color',\n $this->themeColorDefaults['input-placeholder-color']\n )\n );\n $fieldSetFormBase->addElement(\n $this->createColorPickerField(\n 'input-border',\n '@input-border',\n $this->themeColorDefaults['input-border']\n )\n );\n\n $tab->addElement($fieldSetFormBase);\n\n $attributes = array_merge($this->fieldSetDefaults, ['height' => 240]);\n $fieldSetFormStates = $this->createFieldSet(\n 'form_states_fieldset',\n '__responsive_tab_forms_fieldset_states__',\n ['attributes' => $attributes]\n );\n\n $fieldSetFormStates->addElement(\n $this->createColorPickerField(\n 'input-focus-bg',\n '@input-focus-bg',\n $this->themeColorDefaults['input-focus-bg']\n )\n );\n $fieldSetFormStates->addElement(\n $this->createColorPickerField(\n 'input-focus-border',\n '@input-focus-border',\n $this->themeColorDefaults['input-focus-border']\n )\n );\n $fieldSetFormStates->addElement(\n $this->createColorPickerField(\n 'input-focus-color',\n '@input-focus-color',\n $this->themeColorDefaults['input-focus-color']\n )\n );\n $fieldSetFormStates->addElement(\n $this->createColorPickerField(\n 'input-error-bg',\n '@input-error-bg',\n $this->themeColorDefaults['input-error-bg']\n )\n );\n $fieldSetFormStates->addElement(\n $this->createColorPickerField(\n 'input-error-border',\n '@input-error-border',\n $this->themeColorDefaults['input-error-border']\n )\n );\n $fieldSetFormStates->addElement(\n $this->createColorPickerField(\n 'input-error-color',\n '@input-error-color',\n $this->themeColorDefaults['input-error-color']\n )\n );\n $fieldSetFormStates->addElement(\n $this->createColorPickerField(\n 'input-success-bg',\n '@input-success-bg',\n $this->themeColorDefaults['input-success-bg']\n )\n );\n $fieldSetFormStates->addElement(\n $this->createColorPickerField(\n 'input-success-border',\n '@input-success-border',\n $this->themeColorDefaults['input-success-border']\n )\n );\n $fieldSetFormStates->addElement(\n $this->createColorPickerField(\n 'input-success-color',\n '@input-success-color',\n $this->themeColorDefaults['input-success-color']\n )\n );\n\n $tab->addElement($fieldSetFormStates);\n\n return $tab;\n }", "abstract protected function _setNewForm();", "function onGetFormHead($output = false) {\n\t\t\n\t\t$html = '<div id=\"bf_previewform_div_' . $this->_FORM_CONFIG ['id'] . '\"></div>';\n\t\t//$html .= '<div id=\"bf_pleasewait_preview\"><h2>' . bfText::_ ( 'Please wait a moment, while we validate your submission...' ) . '</h2><br/><img src=\"' . bfCompat::getLiveSite () . '/' . bfCompat::mambotsfoldername () . '/system/blueflame/view/images/check_throbber.gif\" alt=\"throbber\" /></div>';\n\t\t//$html .= '<div id=\"bf_pleasewait_submit\"><h2>' . bfText::_ ( 'Please wait a moment, while we validate &amp; submit your submission...' ) . '</h2><br/><img src=\"' . bfCompat::getLiveSite () . '/' . bfCompat::mambotsfoldername () . '/system/blueflame/view/images/check_throbber.gif\" alt=\"throbber\" /></div>';\n\t\t$html .= \"\\n\\n\" . '<form %s>';\n\t\t\n\t\t$JMenu = JMenu::getInstance ( 'site' );\n\t\t$activeMenu = $JMenu->getActive ();\n\t\t$activeMenu === null ? $Itemid = 1 : $Itemid = $activeMenu->id;\n\t\t\n\t\t$attributes = array ();\n\t\t$attributes ['method'] = 'method=\"' . strtolower ( $this->_FORM_CONFIG ['method'] ) . '\"';\n\t\t$attributes ['action'] = 'action=\"' . ($this->_FORM_CONFIG ['processorurl'] ? $this->_FORM_CONFIG ['processorurl'] : bfCompat::getLiveSite () . '/index.php?Itemid=' . ($Itemid ? $Itemid : '1')) . '\"';\n\t\t$attributes ['name'] = 'name=\"' . 'BF_FORM_' . $this->_FORM_CONFIG ['id'] . '\"';\n\t\t$attributes ['id'] = 'id=\"' . 'BF_FORM_' . $this->_FORM_CONFIG ['id'] . '\"';\n\t\t$attributes ['enctype'] = 'enctype=\"' . $this->_FORM_CONFIG ['enctype'] . '\"';\n\t\t$attributes ['class'] = ' class=\"bfform ' . $this->_FORM_CONFIG ['layout'] . 'form\"';\n\t\t$attributes ['target'] = ' target=\"' . ($this->_FORM_CONFIG ['target'] ? $this->_FORM_CONFIG ['target'] : '_self') . '\"';\n\t\t\n\t\tksort ( $attributes );\n\t\t\n\t\t$attributes = implode ( ' ', $attributes );\n\t\t\n\t\t$html = sprintf ( $html, $attributes );\n\t\t\n\t\tswitch ($output) {\n\t\t\tcase true :\n\t\t\t\techo $html;\n\t\t\t\tbreak;\n\t\t\tcase false :\n\t\t\t\treturn $html;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}", "function form( $instance ) {\r\n\r\n\t\t/* Set up some default widget settings. */\r\n\t\t$defaults = array( 'title' => __('Good Reads', 'gr'), 'name' => __('John Doe', 'gr'), 'sex' => 'male', 'show_sex' => true, 'sort_type' => 'Publish Date', 'window_action' => 'new tab' );\r\n\t\t$instance = wp_parse_args( (array) $instance, $defaults ); ?>\r\n\r\n\t\t<!-- Widget Title: Text Input -->\r\n\t\t<p>\r\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e('Title:', 'hybrid'); ?></label>\r\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" value=\"<?php echo $instance['title']; ?>\" />\r\n\t\t</p>\r\n\t\t<p>\r\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'sort_type' ); ?>\"><?php _e('Sort Method:', 'gr'); ?></label>\r\n\t\t\t<select id=\"<?php echo $this->get_field_id( 'sort_type' ); ?>\" name=\"<?php echo $this->get_field_name( 'sort_type' ); ?>\">\r\n\t\t\t\t<option <?php if ( 'Publish Date' == $instance['format'] ) echo 'selected=\"selected\"'; ?>>Publish Date</option>\r\n\t\t\t\t<option <?php if ( 'Alpha' == $instance['format'] ) echo 'selected=\"selected\"'; ?>>Site Title</option>\r\n\t\t\t</select>\r\n\t\t</p>\r\n\t\t<p>\r\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'window_action' ); ?>\"><?php _e('Open links in:', 'gr'); ?></label>\r\n\t\t\t<select id=\"<?php echo $this->get_field_id( 'window_action' ); ?>\" name=\"<?php echo $this->get_field_name( 'window_action' ); ?>\">\r\n\t\t\t\t<option <?php if ( 'new tab' == $instance['format'] ) echo 'selected=\"selected\"'; ?>>new tab</option>\r\n\t\t\t\t<option <?php if ( 'same tab' == $instance['format'] ) echo 'selected=\"selected\"'; ?>>same tab</option>\r\n\t\t\t</select>\r\n\t\t</p>\r\n\r\n\t<?php\r\n\t}", "public function add_modal_form() {\n\t\t$current_screen = get_current_screen();\n\t\tif ( ! isset( $current_screen->parent_base ) || $current_screen->parent_base != 'edit' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine if we should use CMB or generic form callback\n\t\t$callback = $this->form_callback();\n\t\t$cmb_config = $this->get_cmb_config();\n\t\t$is_callable = is_callable( $callback );\n\t\t$is_cmb = ! empty( $cmb_config );\n\n\t\tif ( ! $is_callable && ! $is_cmb ) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n\t\t<div class=\"wp-sc-buttons-form\" style=\"display: none; padding: 0 10px 20px;\" id=\"<?php echo esc_attr( $this->button_slug ); ?>-form\" title=\"<?php echo esc_attr( $this->button_data['button_tooltip'] ); ?>\">\n\t\t\t<?php if ( $is_cmb ) {\n\t\t\t\t$this->do_cmb_form();\n\t\t\t} else {\n\t\t\t\techo call_user_func( $callback, $this->button_data, $this->args );\n\t\t\t} ?>\n\t\t</div>\n\t\t<?php\n\t}", "private function _createTab()\r\n {\r\n $response = true;\r\n\r\n // First check for parent tab\r\n $parentTabID = Tab::getIdFromClassName('AdminFieldMenu');\r\n\r\n if ($parentTabID) {\r\n $parentTab = new Tab($parentTabID);\r\n } else {\r\n $parentTab = new Tab();\r\n $parentTab->active = 1;\r\n $parentTab->name = array();\r\n $parentTab->class_name = \"AdminFieldMenu\";\r\n foreach (Language::getLanguages() as $lang){\r\n $parentTab->name[$lang['id_lang']] = \"FIELDTHEMES\";\r\n }\r\n $parentTab->id_parent = 0;\r\n $parentTab->module = '';\r\n $response &= $parentTab->add();\r\n }\r\n// Check for parent tab2\r\n\t\t\t$parentTab_2ID = Tab::getIdFromClassName('AdminFieldMenuSecond');\r\n\t\t\tif ($parentTab_2ID) {\r\n\t\t\t\t$parentTab_2 = new Tab($parentTab_2ID);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$parentTab_2 = new Tab();\r\n\t\t\t\t$parentTab_2->active = 1;\r\n\t\t\t\t$parentTab_2->name = array();\r\n\t\t\t\t$parentTab_2->class_name = \"AdminFieldMenuSecond\";\r\n\t\t\t\tforeach (Language::getLanguages() as $lang) {\r\n\t\t\t\t\t$parentTab_2->name[$lang['id_lang']] = \"FieldThemes Configure\";\r\n\t\t\t\t}\r\n\t\t\t\t$parentTab_2->id_parent = $parentTab_2->id;\r\n\t\t\t\t$parentTab_2->module = '';\r\n\t\t\t\t$response &= $parentTab_2->add();\r\n\t\t\t}\r\n\t\t\t// Created tab\r\n $tab = new Tab();\r\n $tab->active = 1;\r\n $tab->class_name = \"AdminFieldBrandSlider\";\r\n $tab->name = array();\r\n foreach (Language::getLanguages() as $lang){\r\n $tab->name[$lang['id_lang']] = \"Configuge brands\";\r\n }\r\n $tab->id_parent = $parentTab_2->id;\r\n $tab->module = $this->name;\r\n $response &= $tab->add();\r\n\r\n return $response;\r\n }", "private function weblinkContent_form() {\n\n // Textarea Settings\n if (!fusion_get_settings(\"tinymce_enabled\")) {\n $ExtendedSettings = [\n 'required' => ($this->weblinksSettings['links_extended_required'] ? TRUE : FALSE),\n 'preview' => TRUE,\n 'html' => TRUE,\n 'autosize' => TRUE,\n 'placeholder' => $this->locale['WLS_0255'],\n 'error_text' => $this->locale['WLS_0270'],\n 'form_name' => \"weblinkform\",\n \"wordcount\" => TRUE\n ];\n } else {\n $ExtendedSettings = [\n 'required' => ($this->weblinksSettings['links_extended_required'] ? TRUE : FALSE),\n 'type' => \"tinymce\",\n 'tinymce' => \"advanced\",\n 'error_text' => $this->locale['WLS_0270']];\n }\n\n // Start Form\n echo openform('weblinkform', 'post', $this->form_action);\n echo form_hidden('weblink_id', '', $this->weblink_data['weblink_id']);\n ?>\n\n <!-- Display Form -->\n <div class=\"row\">\n\n <!-- Display Left Column -->\n <div class=\"col-xs-12 col-sm-12 col-md-7 col-lg-8\">\n <?php\n\n echo form_text('weblink_name', $this->locale['WLS_0201'], $this->weblink_data['weblink_name'], [\n 'required' => TRUE,\n 'placeholder' => $this->locale['WLS_0201'],\n 'error_text' => $this->locale['WLS_0252']\n ]);\n\n echo form_text('weblink_url', $this->locale['WLS_0253'], $this->weblink_data['weblink_url'], [\n 'required' => TRUE,\n 'type' => 'url',\n 'placeholder' => 'http://'\n ]);\n\n echo form_textarea('weblink_description', $this->locale['WLS_0254'], $this->weblink_data['weblink_description'], $ExtendedSettings);\n ?>\n </div>\n\n <!-- Display Right Column -->\n <div class=\"col-xs-12 col-sm-12 col-md-5 col-lg-4\">\n <?php\n\n openside($this->locale['WLS_0260']);\n\n echo form_select_tree('weblink_cat', $this->locale['WLS_0101'], $this->weblink_data['weblink_cat'], [\n 'required' => TRUE,\n 'no_root' => TRUE,\n 'placeholder' => $this->locale['choose'],\n 'query' => (multilang_table(\"WL\") ? \"WHERE \".in_group('weblink_cat_language', LANGUAGE) : \"\")\n ], DB_WEBLINK_CATS, \"weblink_cat_name\", \"weblink_cat_id\", \"weblink_cat_parent\");\n\n echo form_select('weblink_visibility', $this->locale['WLS_0103'], $this->weblink_data['weblink_visibility'], [\n 'options' => fusion_get_groups(),\n 'placeholder' => $this->locale['choose']\n ]);\n\n if (multilang_table(\"WL\")) {\n echo form_select('weblink_language[]', $this->locale['language'], $this->weblink_data['weblink_language'], [\n 'options' => fusion_get_enabled_languages(),\n 'placeholder' => $this->locale['choose'],\n 'multiple' => TRUE,\n 'delimeter' => '.'\n ]);\n } else {\n echo form_hidden('weblink_language', '', $this->weblink_data['weblink_language']);\n }\n\n echo form_hidden('weblink_status', '', 1);\n echo form_hidden('weblink_datestamp', '', $this->weblink_data['weblink_datestamp']);\n\n if (!empty($_GET['action']) && $_GET['action'] == 'edit') {\n echo form_checkbox('update_datestamp', $this->locale['WLS_0259'], '');\n }\n\n closeside();\n\n ?>\n\n </div>\n </div>\n <?php\n self::display_weblinkButtons('formend', FALSE);\n echo closeform();\n }", "public function displayPageAddForm(){\n\n // Vérifie les données de champs dupliqués\n $this->handleDuplicateFields();\n\n // Vérifie les données post envoyées\n $this->handleAdd();\n\n // If there ia a modify var\n if(isset($_GET['modify']) && !empty($_GET['modify'])){\n\n $form = get_post($_GET['modify']);\n if($this->isForm($_GET['modify'])){\n\n $formMetas = get_post_meta($_GET['modify']);\n $formArgs = get_post_meta($_GET['modify'],'form-args');\n $formFields = get_post_meta($_GET['modify'],'form-fields');\n $submitArgs = get_post_meta($_GET['modify'],'form-submit-args');\n $formSendArgs = get_post_meta($_GET['modify'],'form-send-args');\n }else\n unset($form);\n\n }\n require_once __DIR__ . '/templates/add.php';\n\n }", "public function createPlaceholdersAndDeleteLiveParentPage() {}", "function ds_block_edit_form($form, &$form_submit)\n{\n\n switch ($form_submit['build_info']['args'][0]) {\n case 'ds_social':\n $form += _social_block_form();\n $form_title = 'Block Widget - Social';\n break;\n case 'ds_about':\n $form += _about_block_form();\n $form_title = 'Block Widget - About';\n break;\n case 'ds_about_teaser':\n $form += _about_block_teaser_form();\n $form_title = 'Block Widget - About Teaser';\n break;\n case 'ds_copy_rights':\n $form += _copy_rights_block_form();\n $form_title = 'Block Widget - Copy Rights';\n break;\n case 'ds_contact_info':\n $form += _contact_info_block_form();\n $form_title = 'Block Widget - Contact Info';\n break;\n case 'ds_announcement':\n $form += _announcement_block_form();\n $form_title = 'Block Widget - Announcement';\n break;\n case 'ds_recent_tweets':\n $form += _recent_tweets_block_form();\n $form_title = 'Block Widget - Recent Tweets';\n break;\n case 'ds_blog_categories':\n $form += _blog_categories_block_form();\n $form_title = 'Block Widget - Categories';\n break;\n case 'ds_blog_archive':\n $form += _blog_archive_block_form();\n $form_title = 'Block Widget - Archive';\n break;\n case 'ds_blog_recent_posts_sidebar':\n $form += _blog_recent_posts_block_form();\n $form_title = 'Block Widget - Recent Posts';\n break;\n case 'ds_testimonial':\n $form += _testimonial_block_form();\n $form_title = 'Block Widget - Testimonial';\n break;\n }\n\n $form['form_header'] = array(\n '#markup' => '<h2>' . $form_title . '</h2>',\n '#weight' => -15,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => 'Submit',\n );\n return $form;\n}", "function ezp_upload_tab_ezpupload() {\n\t\t$id = get_the_ID();\n\t\tglobal $post_id, $tab, $style;\n\t\t$enctype = $id ? '' : ' enctype=\"multipart/form-data\"';\n\t?>\n\t\t<form<?php echo $enctype; ?> id=\"upload-file\" method=\"post\" action=\"<?php echo get_option('siteurl') . \"/wp-admin/upload.php?style=$style&amp;tab=ezpupload&amp;post_id=$post_id\"; ?>\">\n\t<?php\n\t\tif ( $id ) :\n\t\t\t$attachment = get_post_to_edit( $id );\n\t\t\t$attachment_data = wp_get_attachment_metadata( $id );\n\t?>\n\t\t\t<div id=\"file-title\">\n\t\t\t\t<h2><?php if ( !isset($attachment_data['width']) && 'inline' != $style )\n\t\t\t\t\t\techo \"<a href='\" . wp_get_attachment_url() . \"' title='\" . __('Direct link to file') . \"'>\";\n\t\t\t\t\tthe_title();\n\t\t\t\t\tif ( !isset($attachment_data['width']) && 'inline' != $style )\n\t\t\t\t\t\techo '</a>';\n\t\t\t\t?></h2>\n\t\t\t\t<span><?php\n\t\t\t\t\techo '[&nbsp;';\n\t\t\t\t\techo '<a href=\"' . get_permalink() . '\">' . __('view') . '</a>';\n\t\t\t\t\techo '&nbsp;|&nbsp;';\n\t\t\t\t\t\techo '<a href=\"' . attribute_escape(add_query_arg('action', 'view')) . '\">' . __('links') . '</a>';\n\t\t\t\t\techo '&nbsp;|&nbsp;';\n\t\t\t\t\techo '<a href=\"' . attribute_escape(remove_query_arg(array('action','ID'))) . '\" title=\"' . __('Browse your files') . '\">' . __('cancel') . '</a>';\n\t\t\t\t\techo '&nbsp;]'; ?></span>\n\t\t\t</div>\n\n\t\t<div id=\"upload-file-view\" class=\"alignleft\">\n\t<?php\t\tif ( isset($attachment_data['width']) && 'inline' != $style )\n\t\t\t\techo \"<a href='\" . wp_get_attachment_url() . \"' title='\" . __('Direct link to file') . \"'>\";\n\t\t\techo wp_upload_display( array(171, 128) );\n\t\t\tif ( isset($attachment_data['width']) && 'inline' != $style )\n\t\t\t\techo '</a>'; ?>\n\t\t</div>\n\t<?php\tendif; ?>\n\t\t\t<table><col /><col class=\"widefat\" />\n\t<?php\tif ( $id ): ?>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\"><label for=\"url\"><?php _e('URL'); ?></label></th>\n\t\t\t\t\t<td><input type=\"text\" id=\"url\" class=\"readonly\" value=\"<?php echo wp_get_attachment_url(); ?>\" readonly=\"readonly\" /></td>\n\t\t\t\t</tr>\n\t<?php\telse : ?>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\"><label for=\"upload\"><?php _e('File', 'easyphoto'); ?></label></th>\n\t\t\t\t\t<td><input type=\"file\" id=\"upload\" name=\"image\" /></td>\n\t\t\t\t</tr>\n\t<?php\tendif; ?>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\"><label for=\"post_title\"><?php _e('Title', 'easyphoto'); ?></label></th>\n\t\t\t\t\t<td><input type=\"text\" id=\"post_title\" name=\"post_title\" value=\"<?php echo $attachment->post_title; ?>\" /><br><?php _e('Title will be used to rename the file', 'easyphoto'); ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\"><label for=\"post_content\"><?php _e('Description'); ?></label></th>\n\t\t\t\t\t<td><textarea name=\"post_content\" id=\"post_content\"><?php echo $attachment->post_content; ?></textarea></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"buttons\" class=\"submit\">\n\t\t\t\t\t<td colspan='2'>\n\t<?php\tif ( $id ) : ?>\n\t\t\t\t\t\t<input type=\"submit\" name=\"delete\" id=\"delete\" class=\"delete alignleft\" value=\"<?php _e('Delete File'); ?>\" />\n\t<?php\tendif; ?>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"from_tab\" value=\"<?php echo $tab; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"<?php echo $id ? 'save' : 'upload'; ?>\" />\n\t<?php\tif ( $post_id ) : ?>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"post_id\" value=\"<?php echo $post_id; ?>\" />\n\t<?php\tendif; if ( $id ) : ?>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"ID\" value=\"<?php echo $id; ?>\" />\n\t<?php\tendif; ?>\n\t\t\t\t\t\t<?php wp_nonce_field( 'inlineuploading' ); ?>\n\t\t\t\t\t\t<div class=\"submit\">\n\t\t\t\t\t\t\t<input type=\"submit\" value=\"<?php $id ? _e('Save') : _e('Upload'); ?> &raquo;\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</form>\n\t<?php\n\t}", "public function render_page() {\n $form_id=str_replace(' ','',$this->form_name).'Form';\n $form_field_ids=array();\n $html='';\n $associated_upload_field=NULL;\n foreach ($this->page_fields as $single_group) {\n foreach($single_group['fields'] as $single_field) {\n if($single_field['field_type']==\"upload\") {\n $associated_upload_field=$single_field;\n \n }\n }\n }\n \n //sort out the dialog first\n if($this->id_field != '') {\n \n $sql_result=$this->db->query($this->selector_query);\n $table_data=\"\";\n \n foreach($sql_result as $row) {\n $table_data.=\"<tr id='\".$row[$this->id_field].\"'>\";\n foreach($this->selector_field_list as $selector_field) {\n $table_data.=\"<td>\".$row[$selector_field].\"</td>\";\n }\n $table_data.=\"</tr>\";\n }\n \n $html.='<div id=\"'.str_replace(' ','_',$this->form_name).'_dialog\" title=\"Dialog Title\">';\n //put the html together for the selector and send it off with the JS\n $html.='<table id=\"'.str_replace(' ','_',$this->form_name).'_'.$this->id_field.'_selector\" class=\"display\" cellspacing=\"0\"\" width=\"100%\"><thead><tr>';\n foreach($this->selector_field_list as $field) {\n $html.='<th>'.$field.'</th>';\n }\n $html.='</tr></thead></tbody>'.$table_data.\"</tbody></table>\";\n $html.='</div>';\n }\n \n \n \n \n \n //add the start of the form using a table for layout\n $upload_warning_field_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),str_replace(' ','_',$associated_upload_field['field_name'])));\n $html.='\n <form id=\"'.$form_id.'\" method=\"POST\" >';\n if (!is_null($associated_upload_field)) {\n $html.='<div id=\"'.$upload_warning_field_id.'_dialog\"></div>';\n }\n $html.='\n <table class=\"page_container\">\n <tr><td colspan=\"2\"><h1>'.$this->form_name.'</h1></td></tr>';\n \n //iterate over the fields, and groups of fields, and render the form\n foreach ($this->page_fields as $single_group) {\n $sub_heading=ucwords($single_group['sub_heading']);\n \n //add the sub heading for this group of fields\n $html.='<tr><th colspan=\"2\" class=\"sub_heading\"><h2>'.$sub_heading.'</h2></th></tr>';\n \n //add the fields, including the sub headings, for this grouping\n foreach($single_group['fields'] as $single_field) {\n \n //set the id that will be used to extract data from this field in JS and define it on the page\n $input_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),str_replace(' ','_',$single_field['field_name'])));\n $form_field_ids[str_replace(' ','_',$single_field['field_name'])]=$input_id;\n //add each field into the HTML\n switch ($single_field['field_type']) {\n //for a text field, that is to be on a single row\n case 'text':\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).'</th><td><input id=\"'.$input_id.'\" type=\"text\" style=\"width:'.$single_field['length'].'px;\" /></td></tr>\n <tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n break;\n \n //for a text field, that is to be on a single row\n case 'currency':\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).' $</th><td><input id=\"'.$input_id.'\" type=\"text\" style=\"width:'.$single_field['length'].'px;\" /></td></tr>\n <tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n break;\n \n //for a text area which is supposed to be multiple rows and columns\n case 'textarea':\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).'</th><td><textarea id=\"'.$input_id.'\" cols=\"'.$single_field['columns'].'\" rows=\"'.$single_field['rows'].'\"></textarea></td></tr>\n <tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n break;\n \n //for a label area which gets its content from another field\n case 'annotation':\n //TODO: test annotation types on something other than an upload field\n //'field_name'=>$field_name,\n //'field_type'=>'annotation',\n //'length'=>$field_length,\n //'lookup_no_match'=>$no_match_value,\n //'lookup_query'=>$lookup_query,\n //'anchor'=>$anchor\n $anchors=explode('|',$single_field['anchor']);\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).'</th><td><input id=\"'.$input_id.'\" disabled type=\"text\" style=\"width:'.$single_field['length'].'px;\" /></td></tr>\n <tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n $lookup_data=$this->db->query($single_field['lookup_query']);\n \n if ($anchors[2]==\"mime_type\") {\n $anchor_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),str_replace(' ','_',$anchors[1]),'fileToUpload'));\n $annotation_js='\n var mime_type=$(\"#'.$anchor_id.'\")[0].files[0].type;\n var document_lookup={';\n foreach($lookup_data as $single_entry) {\n $annotation_js.='\"'.$single_entry['data_key'].'\":\"'.$single_entry['data_value'].'\",';\n }\n $annotation_js.='};\n var converted_type=document_lookup[mime_type];\n if (converted_type==null) {\n converted_type=\"'.$single_field['lookup_no_match'].'\";\n }\n $(\"#'.$input_id.'\").val(converted_type);';\n \n $this->annotations[]=$annotation_js;\n }\n \n \n break;\n \n //for an upload field which gets its content with a file input\n case 'upload':\n $html.='<tr><td>\n <input style=\"display:none\" type=\"file\" id=\"'.$input_id.'_fileToUpload\" />\n <label class=\"file_upload_label\" for=\"'.$input_id.'_fileToUpload\">'.$single_field['upload_button_text'].'</label>\n </td><td>\n <input id=\"'.$input_id.'_filename\" disabled type=\"text\" placeholder=\"'.$single_field['placeholder'].'\" style=\"width: '.$single_field['length'].'px;\" />\n </td></tr>';\n //need a maximum upload size hidden field somewhere\n $html.='<input type=\"hidden\" id=\"'.$input_id.'_max_filesize\" value=\"'.$single_field['max_size'].'\" />';\n \n //also need an error message container here\n $html.='<tr><td colspan=\"2\">\n <div id=\"'.$input_id.'_error_message_container\" class=\"ui-widget\">\n <div class=\"ui-state-error ui-corner-all\" style=\"padding: 0 .7em;\"> \n <p><span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: .3em;\"></span><strong>Alert:</strong><span id=\"'.$input_id.'_error_message\"></span></p>\n </div></div></td></tr>';\n \n break;\n \n //for a combo or drop down box which should have a lookup defined\n case 'combo':\n //'combodata'=>'salutation|salutation_id|description'\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).'</th><td><select id=\"'.$input_id.'\">';\n $combo_fields=explode('|',$single_field['combodata']);\n $queryResult=$this->db->query(\"select * from \".$combo_fields[0]);\n foreach ($queryResult as $row) {\n $html.='<option value=\"'.$row[$combo_fields[1]].'\">'.ucwords($row[$combo_fields[2]]).'</option>';\n }\n $html.='</select></td></tr><tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n break;\n }\n }\n }\n \n //add the buttons\n $counter=1;\n foreach($this->buttons as $button) {\n \n //at the start, if the column count is odd, start a new line for the buttons\n if($counter%2!=0) {\n $html.='<tr>';\n }\n \n //right column check and set TD class\n $this_class='left_col button_row';\n if ($counter%2==0) {\n $this_class='right_col button_row';\n }\n \n //place the button\n $this_button_id=implode('',array(str_replace(' ','',$this->form_name), $button, 'Button')); //clientDeleteCancelButton\n if (in_array($button,$this->available_buttons)) {\n $html.='<td class=\"'.$this_class.'\"><button type=\"button\" id=\"'.$this_button_id.'\">'.ucwords($button).'</button></td>';\n }\n else {\n error_log(\"BasicForm: Unable to interpret button request from basic_form->render_page call, button requested was: \".$button);\n }\n \n //after the counter increases, if the counter is odd, we need to close this line of buttons\n $counter+=1;\n if($counter%2!=0) {\n $html.='</tr>';\n }\n }\n \n //finish off the button rows if there were an odd number of buttons, and the row ender above (inside the loop) didnt fire\n if($counter%2==0) {\n $html.='</tr>';\n }\n \n //close the table, set an identifier field if required, ie, a hidden id field for updates or removes from the DB and close the form.\n $html.='</table>';\n if($this->id_field != '') {\n $this_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),$this->id_field));\n $html.='<input id=\"'.$this_id.'\" type=\"hidden\" value=\"'.$this->id_field_value.'\" />';\n }\n $html.='</form>';\n \n //make the javascript part of the response\n $js='<script>\n $(document).ready(function () {\n ';\n \n //if a hidden id field has been added and a value set, then we need to render a selector window to populate the table correctly\n if($this->id_field != '') {\n $js.='\n \n //define the data table\n var table=$(\"#'.str_replace(' ','_',$this->form_name).'_'.$this->id_field.'_selector\").DataTable({paging: true, searching: true, destroy: true});\n \n //setup the dialog box for this use case\n $( \"#'.str_replace(' ','_',$this->form_name).'_dialog\" ).dialog({autoOpen: false,width: 700,modal: true,\n buttons: [\n {\n text: \"Select\",\n click: function() {\n var rowSelected=$(\".selected\").attr(\"id\");\n if (!rowSelected) {\n alert(\"You need to select a row by clicking on it first.\");\n }\n else {\n load_data_into_form(rowSelected);\n }\n }\n },\n {\n text: \"Cancel\",\n click: function() {\n $( this ).dialog( \"destroy\" ).remove();\n close_current_tab();\n }\n }\n ]\n });\n \n //toggle selected row\n $(\"#'.str_replace(' ','_',$this->form_name).'_'.$this->id_field.'_selector tbody\").on( \"click\", \"tr\", function () {\n if ( $(this).hasClass(\"selected\") ) {\n $(this).removeClass(\"selected\");\n }\n else {\n table.$(\"tr.selected\").removeClass(\"selected\");\n $(this).addClass(\"selected\");\n }\n });\n \n //load the record into the form\n function load_data_into_form(selected_id) {\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data:{\n page:\"'.$this->feature.'_Load_'.str_replace(' ','_',$this->form_name).'_Data\",\n '.$this->id_field.':selected_id,\n }\n })\n .done(function(e) {\n var data=JSON.parse(e);';\n \n \n \n \n \n $first_done=false;\n foreach($this->full_field_list as $field) {\n if($field==$this->id_field) {\n $js.='\n $(\"#content_'.$this->feature.'_'.str_replace(' ','_',$this->form_name).'_'.$field.'\").val(data[\"'.$field.'\"]);\n $(\"#content_'.$this->feature.'_'.str_replace(' ','_',$this->form_name).'_'.$field.'\").trigger(\"change\");';\n }\n else {\n $js.='$(\"#content_'.$this->feature.'_'.str_replace(' ','_',$this->form_name).'_'.$field.'\").val(data[\"'.$field.'\"]);';\n }\n $first_done=true;\n }\n $js.='$(\"#'.str_replace(' ','_',$this->form_name).'_dialog\").dialog( \"destroy\" ).remove();\n });\n }';\n \n $js.='\n $(\"#'.str_replace(' ','_',$this->form_name).'_dialog\").dialog(\"option\",\"title\",\"'.$this->selector_title.'\");\n $(\"#'.str_replace(' ','_',$this->form_name).'_dialog\").dialog(\"open\");\n ';\n }\n \n \n \n //add the validation function, if required\n $validate_page_name=implode('_',array($this->feature,'Validate',str_replace(' ','_',ucwords($this->form_name))));\n if (count($this->validators)>0) {\n $js.='\n function '.$validate_page_name.'_validate() {\n //hide all validation fields, in case they were populated last time\n ';\n foreach($form_field_ids as $field_name=>$field_id) {\n if (in_array($field_name,$this->validators)) {\n $js.='$(\"#'.$field_id.'_error\").hide();';\n }\n }\n $js.='\n var id_lookups={';\n foreach($form_field_ids as $field_name=>$field_id) {\n if (in_array($field_name,$this->validators)) {\n $js.='\"'.$field_name.'\":\"'.$field_id.'\",';\n }\n }\n $js.='};\n \n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data: \n {\n page:\"'.$validate_page_name.'\",';\n foreach($form_field_ids as $field_name=>$field_id) {\n if (in_array($field_name,$this->validators)) {\n $js.=$field_name.':$(\"#'.$field_id.'\").val(),';\n }\n }\n $js.=' }\n })\n .done(function(e){\n //if e is true, then there is nothing to do, otherwise, \n var errors=JSON.parse(e);\n //if theres no errors, return true\n if (Object.keys(errors).length==0) {\n blind_submit();\n }\n //populate the error messages, and return false\n for (var error in errors) {\n if (errors.hasOwnProperty(error)) {\n var this_id=id_lookups[error];\n $(\"#\"+this_id+\"_error\").html(\"<p style=\\'color:red;\\'>\"+errors[error]+\"</p>\");\n $(\"#\"+this_id+\"_error\").show();\n }\n }\n });\n }\n ';\n }\n \n //add any button responders needed\n foreach ($this->buttons as $button) {\n if (in_array($button,$this->available_buttons)) {\n $button_id=implode('',array(str_replace(' ','',$this->form_name), $button, 'Button'));;\n \n //javascript response to the CANCEL button\n if ($button=='cancel') {\n $js.='\n $(\"#'.$button_id.'\").click(function() {\n close_current_tab();\n });';\n }\n //javascript response to the SAVE button\n if ($button=='save') {\n $page_string=implode('_',array($this->feature,'Submit',str_replace(' ','_',ucwords($this->form_name))));\n $js.='//handle the save button\n $(\"#'.$button_id.'\").click(function() {\n ';\n //if there is validation on this form, use the validation function generated above, otherwise use the blind submit\n if (count($this->validators)>0) {\n $js.=$validate_page_name.'_validate();\n });';\n }\n else {\n $js.='blind_submit();\n });';\n }\n \n //define the blind submit function\n $js.='\n function blind_submit() {\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data: \n {\n page:\"'.$page_string.'\",';\n foreach($form_field_ids as $field_name=>$field_id) {\n $js.=$field_name.':$(\"#'.$field_id.'\").val(),';\n }\n $js.=' }\n })\n .done(function(e){\n var tabs=$(\"div#tabs ul\").children();\n for (var i=0; i<tabs.length; i++) {\n if ($(\"div#tabs ul\").children()[i].getAttribute(\"aria-controls\")==\"about\") {\n $(\"div#about\").append(e);\n }\n }\n close_current_tab();\n });\n }';\n \n }\n \n //javascript repsponse to the DELETE button\n if ($button=='delete') {\n $page_string=implode('_',array($this->feature,'Delete',str_replace(' ','_',ucwords($this->form_name))));\n $js.='//handle the delete button\n $(\"#'.$button_id.'\").click(function() {\n ';\n //if there is validation on this form, use the validation function generated above, otherwise use the blind submit\n if (count($this->validators)>0) {\n $js.=$validate_page_name.'_validate();\n });';\n }\n else {\n $js.='blind_submit();\n });';\n } \n //define the blind submit function\n $js.='\n function blind_submit() {\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data: \n {\n page:\"'.$page_string.'\",';\n $js.=$this->id_field.':$(\"#'.implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),$this->id_field)).'\").val(),';\n $js.=' }\n })\n .done(function(e){\n var tabs=$(\"div#tabs ul\").children();\n for (var i=0; i<tabs.length; i++) {\n if ($(\"div#tabs ul\").children()[i].getAttribute(\"aria-controls\")==\"about\") {\n $(\"div#about\").append(e);\n }\n }\n close_current_tab();\n });\n }';\n }\n \n //javascript response to an UPLOAD button, meant to be used in conjunction with a form containing a file upload field\n if($button=='upload') {\n $associated_upload_field=NULL;\n foreach ($this->page_fields as $single_group) {\n foreach($single_group['fields'] as $single_field) {\n if($single_field['field_type']==\"upload\") {\n $associated_upload_field=$single_field;\n \n }\n }\n }\n $field_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name)));//,str_replace(' ','_',$associated_upload_field['field_name'])\n $upload_field_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),str_replace(' ','_',$associated_upload_field['field_name'])));\n $this_button_id=implode('',array(str_replace(' ','',$this->form_name), $button, 'Button'));\n $js.='\n //hide the error container at page load\n $(\"#'.$upload_field_id.'_error_message_container\").hide();\n \n //handle any hooks in the filename update changes\n $(\"#'.$upload_field_id.'_fileToUpload\").change(function(){\n if ($(\"#'.$upload_field_id.'_fileToUpload\")[0].files.length>0) {\n $(\"#'.$upload_field_id.'_filename\").val($(\"#'.$upload_field_id.'_fileToUpload\")[0].files[0].name);';\n \n //check for annotations\n foreach($this->annotations as $single_hook) {\n $js.=$single_hook;\n }\n \n $js.='}\n $(\"#'.$upload_field_id.'_error_message_container\").hide();\n });\n \n //handle the upload button\n $(\"#'.$button_id.'\").click(function(e) {\n e.preventDefault();\n if ($(\"#'.$upload_field_id.'_fileToUpload\")[0].files.length>0) {\n var file_size=$(\"#'.$upload_field_id.'_fileToUpload\")[0].files[0].size;\n var allowed_filesize=parseInt($(\"#'.$upload_field_id.'_max_filesize\").val());\n if(file_size<=allowed_filesize) {\n var mydata=new FormData();\n mydata.append(\"page\",\"'.implode('_',array($this->feature,'Submit',str_replace(' ','_',ucwords($this->form_name)))).'\");\n ';\n \n //add field submission data\n foreach ($this->page_fields as $single_group) {\n foreach($single_group['fields'] as $single_field) {\n if ($single_field['field_type']=='text' or $single_field['field_type']=='currency' or $single_field['field_type']=='textarea' or $single_field['field_type']=='annotation' or $single_field['field_type']=='combo') {\n $js.='mydata.append(\"'.str_replace(' ','_',$single_field['field_name']).'\",$(\"#'.$field_id.'_'.str_replace(' ','_',$single_field['field_name']).'\").val());';\n }\n if ($single_field['field_type']=='upload') {\n $js.='mydata.append(\"datafile\",$(\"#'.$upload_field_id.'_fileToUpload\")[0].files[0]);';\n }\n \n }\n }\n \n $js.='\n $( \"#'.$upload_field_id.'_dialog\" ).dialog({\n autoOpen: true,\n closeOnEscape: false,\n title: \"File uploading in progress...\",\n width: 400,\n height: 0,\n modal: true,\n });\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n enctype: \"multipart/form-data\",\n data: mydata,\n cache: false,\n processData: false,\n contentType: false,\n })\n .done(function(e){\n //the response may start with an error string, or success string, we need to handle wither case appropriately\n $( \"#'.$upload_field_id.'_dialog\" ).dialog( \"destroy\" ).remove();\n if (e.length>=5 && e.substr(0,5)==\"error\") {\n $(\"#'.$upload_field_id.'_error_message\").html(e.substr(5));\n $(\"#'.$upload_field_id.'_error_message_container\").show();\n }\n else if (e.length>=7 && e.substr(0,7)==\"success\") {\n var tabs=$(\"div#tabs ul\").children();\n for (var i=0; i<tabs.length; i++) {\n if ($(\"div#tabs ul\").children()[i].getAttribute(\"aria-controls\")==\"about\") {\n $(\"div#about\").append(e.substr(7));\n }\n }\n close_current_tab();\n }\n });\n }\n else {\n var reported_file_size=file_size;\n if (file_size>1000 && file_size<=1000000) {\n reported_file_size=Math.round(file_size/1000);\n reported_file_size+=\"KB\";\n }\n else if(file_size>1000000 && file_size<=1000000000) {\n reported_file_size=(file_size/1000000).toFixed(1);\n reported_file_size+=\"MB\";\n }\n else if(file_size>1000000000 && file_size<=1000000000000) {\n reported_file_size=(file_size/1000000000).toFixed(1);\n reported_file_size+=\"GB\";\n }\n $(\"#'.$field_id.'_error_message\").html(\"Filesize of \"+reported_file_size+\" is too big\");\n $(\"#'.$field_id.'_error_message_container\").show();\n }\n }\n else {\n alert(\"Choose a file to upload first\");\n }\n });';\n }\n \n //javascript response to the UPDATE button\n if ($button=='update') {\n $page_string=implode('_',array($this->feature,'Update',str_replace(' ','_',ucwords($this->form_name))));\n $js.='//handle the update button\n $(\"#'.$button_id.'\").click(function() {\n ';\n //if there is validation on this form, use the validation function generated above, otherwise use the blind submit\n if (count($this->validators)>0) {\n $js.=$validate_page_name.'_validate();\n });';\n }\n else {\n $js.='blind_submit();\n });';\n } \n //define the blind submit function\n $js.='\n function blind_submit() {\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data: \n {\n page:\"'.$page_string.'\",';\n foreach($form_field_ids as $field_name=>$field_id) {\n $js.=$field_name.':$(\"#'.$field_id.'\").val(),';\n }\n $js.=$this->id_field.':$(\"#'.implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),$this->id_field)).'\").val(),';\n $js.=' }\n })\n .done(function(e){\n var tabs=$(\"div#tabs ul\").children();\n for (var i=0; i<tabs.length; i++) {\n if ($(\"div#tabs ul\").children()[i].getAttribute(\"aria-controls\")==\"about\") {\n $(\"div#about\").append(e);\n }\n }\n close_current_tab();\n });\n };';\n }\n }\n else {\n error_log(\"BasicForm: Unable to interpret button request from basic_form->render_page call, button requested was: \".$button);\n }\n }\n \n //close off and finalise the JS\n $js.='});</script>';\n return $js.$html;\n }", "public function createPlaceholdersAndDeleteDraftParentPage() {}", "function getForm($form, &$form_state, $disabled, $myvalues)\n {\n $oPS = new \\raptor\\ProtocolSettings();\n $metainfo = $oPS->getProtocolMetaInformation($this->m_protocol_shortname);\n $usedcount = count($metainfo['usedbyinfo']);\n if($usedcount > 0)\n {\n $tickets = array();\n foreach($metainfo['usedbyinfo'] as $key=>$details)\n {\n $tickets[] = $key;\n }\n $userinfomsg = \"Cannot delete this protocol because already in use by the following $usedcount tickets: \" \n . implode(', ', $tickets);\n drupal_set_message($userinfomsg, 'warning');\n $disabled = TRUE;\n }\n \n $form = $this->m_oPageHelper->getForm('D',$form, $form_state, TRUE, $myvalues, 'protocol_container_styles');\n \n $form['data_entry_area1']['toppart']['protocol_shortname'] = array(\n '#type' => 'textfield', \n '#title' => t('Short Name'), \n '#value' => $this->m_protocol_shortname, \n '#size' => 20, \n '#maxlength' => 20, \n '#required' => TRUE,\n '#description' => t('The unique short name for this protocol'),\n '#disabled' => TRUE,\n ); \n \n \n //Replace the buttons\n $form[\"data_entry_area1\"]['create'] = array('#type' => 'submit'\n , '#attributes' => array('class' => array('admin-action-button'))\n , '#value' => t('Delete Protocol From System')\n , '#disabled' => $disabled\n );\n\n global $base_url;\n $goback = $this->getGobacktoFullURL();\n /*\n $form['data_entry_area1']['action_buttons']['cancel'] = array('#type' => 'item'\n , '#markup' => '<input class=\"admin-cancel-button\" id=\"user-cancel\"'\n . ' type=\"button\" value=\"Cancel\"'\n . ' data-redirect=\"'.$goback.'\">');\n */\n $form['data_entry_area1']['action_buttons']['cancel'] = $this->getExitButtonMarkup($goback);\n return $form;\n }", "public function form()\n\t{\n\t?>\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t<?php foreach( (array) $this->InstanceRegistred as $id => $args ) : ?>\n\t\t\t<tr>\n\t\t\t\t<th><?php echo $args['title'];?></th>\n\t\t\t\t<td>\n\t\t\t\t<?php \n\t\t\t\t\twp_dropdown_pages(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'name' \t\t\t\t=> $args['name'],\n\t\t\t\t\t\t\t'post_type' \t\t=> $args['post_type'],\n\t\t\t\t\t\t\t'selected' \t\t\t=> $args['selected'],\n\t\t\t\t\t\t\t'sort_column' \t\t=> $args['listorder'],\n\t\t\t\t\t\t\t'show_option_none' \t=> $args['show_option_none']\t\t\t\t\t\t\t\n\t\t\t\t\t\t)\n\t\t\t\t\t);\t\t\t\t\n\t\t\t\t?>\t\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php endforeach;?>\n\t\t</tbody>\n\t</table>\n\t<?php\t\t\n\t}", "function storyForm($op) {\n // Generate new form object based on operation.\n if ($op == 'add') {\n $this->form = new HTML_QuickForm('add_story', 'POST', '/story/add');\n $btnLabel = 'Add';\n }\n elseif ($op == 'edit') {\n $this->form = new HTML_QuickForm('edit_story', 'POST', $this->f3->get('PATH'));\n $btnLabel = 'Save';\n }\n elseif ($op == 'delete') {\n $this->form = new HTML_QuickForm('deleteStory', 'POST', $this->f3->get('PATH'));\n $btnLabel = 'Delete';\n }\n\n // These fields only apply to add and edit operations.\n if ($op == 'add' || $op == 'edit') {\n // Add form elements\n $this->form->addElement('text', 'title', 'Title', ['class' => 'form-control']);\n $this->form->addElement('text', 'authors', 'Author(s)', ['class' => 'form-control']);\n $this->form->addElement('text', 'shortTitle', 'URL Friendly Title', ['class' => 'form-control']);\n\n // Set max size for file upload\n $this->form->setMaxFileSize($this->f3->get('maxFileSize'));\n $this->form->addElement('file', 'titlePage', 'Title Page', ['class' => 'form-control']);\n $this->form->addElement('radio', 'publish', 'Publish', 'Now', true, ['class' => 'form-check-input', 'id' => 'publish1']);\n $this->form->addElement('radio', 'publish', null, 'Later', false, ['class' => 'form-check-input', 'id' => 'publish2']);\n $this->form->addElement('text', 'date', 'Publish Date', ['class' => 'form-control', 'id' => 'datepicker']);\n }\n\n // Display buttons for all operations.\n $this->form->addElement('submit', 'btnSubmit', $btnLabel, ['class' => 'btn btn-primary']);\n $this->form->addElement('button','btnCancel','Cancel',['onClick' => \"window.location.href='/stories'\", 'class' => 'btn btn-outline-primary']);\n\n // Rules only apply for add and edit operations.\n if ($op == 'add' || $op == 'edit') {\n // Add validation.\n $this->form->addRule('title', 'Title is required', 'required');\n $this->form->addRule('shortTitle', 'Require field', 'required');\n\n // Only require a file upload on the add form.\n if ($op == 'add') {\n $this->form->addRule('titlePage', 'File is required', 'uploadedfile');\n }\n\n // Add custom validation rules found in \\Validation.\n $this->form->registerRule('uniqueShortTitle', 'function', 'validateShortTitle', $this->validation);\n $this->form->addRule('shortTitle', 'Short Title already exists', 'uniqueShortTitle', $this->identifier);\n // Picture dimensions must be specific size before upload\n $this->form->registerRule('pictureDimensions', 'function', 'validatePictureDimensions', $this->validation);\n $ruleMsg = 'Picture Dimensions are too small! Min Width: ' . $this->f3->get('imgLarge') . ' Min Height: ' . $this->f3->get('imgMinHeight');\n $this->form->addRule('titlePage', $ruleMsg, 'pictureDimensions');\n\n // Picture Mime Type must be of type jpg.\n $this->form->registerRule('pictureMimeType', 'function', 'validateMimeType', $this->validation);\n $this->form->addRule('titlePage', 'Picture file type not supported', 'pictureMimeType');\n\n }\n }", "private function _createTab()\r\n {\r\n $response = true;\r\n\r\n // First check for parent tab\r\n $parentTabID = Tab::getIdFromClassName('AdminFieldMenu');\r\n\r\n if ($parentTabID) {\r\n $parentTab = new Tab($parentTabID);\r\n } else {\r\n $parentTab = new Tab();\r\n $parentTab->active = 1;\r\n $parentTab->name = array();\r\n $parentTab->class_name = \"AdminFieldMenu\";\r\n foreach (Language::getLanguages() as $lang){\r\n $parentTab->name[$lang['id_lang']] = \"Fieldthemes\";\r\n }\r\n $parentTab->id_parent = 0;\r\n $parentTab->module = '';\r\n $response &= $parentTab->add();\r\n }\r\n\t// Check for parent tab2\r\n\t\t\t$parentTab_2ID = Tab::getIdFromClassName('AdminFieldMenuSecond');\r\n\t\t\tif ($parentTab_2ID) {\r\n\t\t\t\t$parentTab_2 = new Tab($parentTab_2ID);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$parentTab_2 = new Tab();\r\n\t\t\t\t$parentTab_2->active = 1;\r\n\t\t\t\t$parentTab_2->name = array();\r\n\t\t\t\t$parentTab_2->class_name = \"AdminFieldMenuSecond\";\r\n\t\t\t\tforeach (Language::getLanguages() as $lang) {\r\n\t\t\t\t\t$parentTab_2->name[$lang['id_lang']] = \"FieldThemes Configure\";\r\n\t\t\t\t}\r\n\t\t\t\t$parentTab_2->id_parent = $parentTab->id;\r\n\t\t\t\t$parentTab_2->module = '';\r\n\t\t\t\t$response &= $parentTab_2->add();\r\n\t\t\t}\r\n\t\t\t// Created tab\r\n $tab = new Tab();\r\n $tab->active = 1;\r\n $tab->class_name = \"AdminFieldFeaturedProductSlider\";\r\n $tab->name = array();\r\n foreach (Language::getLanguages() as $lang){\r\n $tab->name[$lang['id_lang']] = \"Configure featured products\";\r\n }\r\n $tab->id_parent = $parentTab_2->id;\r\n $tab->module = $this->name;\r\n $response &= $tab->add();\r\n\r\n return $response;\r\n }", "private function _createTab()\r\n {\r\n $response = true;\r\n\r\n // First check for parent tab\r\n $parentTabID = Tab::getIdFromClassName('AdminFieldMenu');\r\n\r\n if ($parentTabID) {\r\n $parentTab = new Tab($parentTabID);\r\n } else {\r\n $parentTab = new Tab();\r\n $parentTab->active = 1;\r\n $parentTab->name = array();\r\n $parentTab->class_name = \"AdminFieldMenu\";\r\n foreach (Language::getLanguages() as $lang){\r\n $parentTab->name[$lang['id_lang']] = \"Fieldthemes\";\r\n }\r\n $parentTab->id_parent = 0;\r\n $parentTab->module = '';\r\n $response &= $parentTab->add();\r\n }\r\n// Check for parent tab2\r\n\t\t\t$parentTab_2ID = Tab::getIdFromClassName('AdminFieldMenuSecond');\r\n\t\t\tif ($parentTab_2ID) {\r\n\t\t\t\t$parentTab_2 = new Tab($parentTab_2ID);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$parentTab_2 = new Tab();\r\n\t\t\t\t$parentTab_2->active = 1;\r\n\t\t\t\t$parentTab_2->name = array();\r\n\t\t\t\t$parentTab_2->class_name = \"AdminFieldMenuSecond\";\r\n\t\t\t\tforeach (Language::getLanguages() as $lang) {\r\n\t\t\t\t\t$parentTab_2->name[$lang['id_lang']] = \"FieldThemes Configure\";\r\n\t\t\t\t}\r\n\t\t\t\t$parentTab_2->id_parent = $parentTab->id;\r\n\t\t\t\t$parentTab_2->module = '';\r\n\t\t\t\t$response &= $parentTab_2->add();\r\n\t\t\t}\r\n\t\t\t// Created tab\r\n $tab = new Tab();\r\n $tab->active = 1;\r\n $tab->class_name = \"AdminFieldSpecialProduct\";\r\n $tab->name = array();\r\n foreach (Language::getLanguages() as $lang){\r\n $tab->name[$lang['id_lang']] = \"Configure specials products\";\r\n }\r\n $tab->id_parent = $parentTab_2->id;\r\n $tab->module = $this->name;\r\n $response &= $tab->add();\r\n\r\n return $response;\r\n }", "private function show_manage_tab() {\n\n\t\t// setup 'Manage Pre-Orders' list table and prepare the data\n\t\t$manage_table = $this->get_pre_orders_list_table();\n\t\t$manage_table->prepare_items();\n\n\t\t?><form method=\"get\" id=\"mainform\" action=\"\" enctype=\"multipart/form-data\"><?php\n\t\t// title/search result string\n\t\techo '<h2>' . __( 'Manage Pre-Orders', WC_Pre_Orders::TEXT_DOMAIN );\n\t\tif ( isset( $_GET['s'] ) && $_GET['s'] )\n\t\t\techo '<span class=\"subtitle\">' . sprintf( __( 'Search results for \"%s\"', WC_Pre_Orders::TEXT_DOMAIN ), $_GET['s'] ) . '</span>';\n\t\techo '</h2>';\n\n\t\t// display any action messages\n\t\t$manage_table->render_messages();\n\n\t\t// Display the views\n\t\t$manage_table->views();\n\t\t$manage_table->search_box( __( 'Search Pre-Orders', WC_Pre_Orders::TEXT_DOMAIN ), 'pre_order' );\n\n\t\tif ( ! empty( $_REQUEST['pre_order_status'] ) )\n\t\t\techo '<input type=\"hidden\" name=\"pre_order_status\" value=\"' . esc_attr( $_REQUEST['pre_order_status'] ) . '\" />';\n\n\t\techo '<input type=\"hidden\" name=\"page\" value=\"' . esc_attr( $_REQUEST['page'] ) . '\" />';\n\n\t\t// display the list table\n\t\t$manage_table->display();\n\t\t?></form><?php\n\t}", "public function uultra_load_links_addition_form()\r\n\t{\r\n\t\t$html = '';\r\n\t\t$html .= '<div class=\"uultra-adm-links-cont-add-new\" >';\r\n \r\n\t\t$html .= '<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Name: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_add_mod_link_title\" type=\"text\" id=\"uultra_add_mod_link_title\" style=\"width:120px\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Type:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_add_mod_link_type\" id=\"uultra_add_mod_link_type\" size=\"1\">\r\n\t\t\t\t <option value=\"\" selected=\"selected\">'.__(\"Select Type: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"Text: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"2\">Shortcode</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t<td>'.__('Content:','xoousers').'</td>\r\n\t\t\t\t<td>&nbsp;</textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t\r\n\t\t\t\t<td colspan=\"2\"><textarea name=\"uultra_add_mod_links_content\" id=\"uultra_add_mod_links_content\" style=\"width:98%;\" rows=\"5\"></textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr> \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t</table> '; \t\t\t\r\n\t\t\t \r\n\t\t\t$html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button uultra-links-add-new-close\" value=\"'.__('Close','xoousers').'\" /> <input type=\"button\" name=\"submit\" class=\"button button-primary uultra-links-add-new-confirm\" value=\"'.__('Submit','xoousers').'\" /> <span id=\"uultra-add-new-links-m-w\" ></span>\r\n\t\t\t\t</p> ';\r\n\t\t\t\t\r\n\t\t\t$html .= '</div>';\r\n\t\t\t\t\r\n\t\t\techo $html;\r\n\t\t\tdie();\r\n\t\r\n\t}", "function courier_connector_queue_form($form, &$form_state) {\n\n $form['courier-requests'] = array('#type' => 'vertical_tabs');\n\n $form['current_requests'] = array(\n '#type' => 'fieldset',\n '#title' => t('Current Requests'),\n '#group' => 'courier-requests',\n '#weight' => -2,\n '#theme' => 'courier_connector_request_table',\n '#tree' => TRUE,\n );\n\n $result = db_query(\"select * from courier_requests where processed != 1\");\n\n foreach ($result as $row) {\n $form['current_requests']['job_date'][$row->job_id] = array('#markup' => check_plain($row->job_date));\n\n $form['current_requests']['job_id'][$row->job_id] = array('#markup' => \"{$row->job_id}\");\n $form['current_requests']['request_method'][$row->job_id] = array('#markup' => \"{$row->request_method}\");\n\n $request_data = var_export(unserialize($row->request_data), TRUE);\n\n $form['current_requests']['request_data'][$row->job_id] = array('#markup' => \"{$request_data}\");\n\n $form['current_requests']['remove_job'][$row->job_id] = array(\n '#type' => 'button',\n //'#default_value' => ($row->qb_field == \"Custom\" ? $row->custom_value : ''),\n '#value' => \"Remove\"\n );\n }\n\n $form['submit_read_request'] = array(\n '#type' => 'fieldset',\n '#title' => t('Submit Read Request'),\n '#group' => 'courier-requests',\n '#weight' => -1,\n );\n\n// $form['submit_request']['request_type'] = array(\n// '#type' => 'select',\n// '#title' => t('Request Type'),\n// '#default_value' => t('read'),\n// '#options' => array(\"read\" => \"Read Request\", \"write\" => \"Write Request\"), \n// ); \n\n $form['submit_read_request']['request_method'] = array(\n '#type' => 'select',\n '#title' => t('Request Method'),\n '#default_value' => t('AssemblyItem'),\n '#options' => array(\n \"AssemblyItem\" => \"Assembly Item Request\",\n \"Customer\" => \"Customer Request\",\n \"DiscountItem\" => \"Discount Item Request\",\n \"ItemInventory\" => \"Inventory Item Request\",\n \"Invoice\" => \"Invoice Request\",\n \"NonInventoryItem\" => \"Non Inventory Item Request\",\n \"PurchaseOrder\" => \"Purchase Order Request\",\n \"ReceivePayment\" => \"Receive Payment Request\",\n \"SalesOrder\" => \"Sales Order Request\",\n \"SalesReceipt\" => \"Sales Receipt Request\",\n \"ServiceItem\" => \"Service Item Request\",\n ),\n );\n\n $form['submit_read_request']['from_date'] = array(\n '#type' => 'textfield',\n '#title' => t('From Time Modified'),\n '#default_value' => t('1/1/2001'),\n '#size' => 20,\n '#description' => t('Format the date as 1/1/2001 HH:MM:SS or just 1/1/2001'),\n );\n\n// $form['submit_read_request']['to_date'] = array(\n// '#type' => 'textfield',\n// '#title' => t('To Time Modified'),\n// '#default_value' => t(''), \n// '#size' => 20,\n// '#description' => t('Format the date as 1/1/2001 HH:MM:SS or just 1/1/2001'),\n// ); \n\n// $form['submit_read_request']['active'] = array(\n// '#type' => 'select',\n// '#title' => t('Active Status'),\n// '#default_value' => t(''),\n// '#options' => array(\"\" => \"Any\",\n// \"true\" => \"Active Only\",\n// \"false\" => \"Deactive Only\", \n// ), \n// ); \n\n $form['submit_read_request']['ids'] = array(\n '#type' => 'textfield',\n '#title' => t('Specific ID'),\n '#default_value' => t(''),\n '#size' => 100,\n '#description' => t('Specific Item ID to Request'),\n );\n\n $form['submit_read_request']['desc1'] = array(\n '#type' => 'textfield',\n '#title' => t('Description 1'),\n '#default_value' => t(''),\n '#size' => 100,\n '#description' => t('The description 1 value of the item'),\n );\n\n $form['submit_read_request']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit Request to Queue'),\n );\n\n $form['submit_write_order_request'] = array(\n '#type' => 'fieldset',\n '#title' => t('Submit Write Order Request'),\n '#group' => 'courier-requests',\n '#weight' => 0,\n );\n\n $form['submit_write_order_request']['order_type'] = array(\n '#type' => 'select',\n '#title' => t('Order Type'),\n '#default_value' => t('SalesReceipt'),\n '#options' => array(\n \"Invoice\" => \"Invoice\",\n \"PurchaseOrder\" => \"Purchase Order\",\n \"SalesOrder\" => \"Sales Order\",\n \"SalesReceipt\" => \"Sales Receipt\",\n ),\n );\n\n $form['submit_write_order_request']['orders'] = array(\n '#type' => 'fieldset',\n '#group' => 'submit_write_order_request',\n '#title' => t('Select Order(s) to Download'),\n '#theme' => 'courier_connector_order_table',\n '#tree' => TRUE,\n );\n\n //$result = db_query(\"select order_id, order_total, created, order_status, concat(billing_first_name, ' ', billing_last_name) as customer from uc_orders\");\n\n// $d = array();\n//\n// foreach ($result as $row) \n// { \n// $form['submit_write_order_request']['orders']['add'][$row->order_id] = array( \n// '#type' => 'checkbox', \n// );\n// $form['submit_write_order_request']['orders']['order_id'][$row->order_id] = array('#markup' => check_plain($row->order_id));\n// $form['submit_write_order_request']['orders']['customer'][$row->order_id] = array('#markup' => check_plain($row->customer)); \n// $form['submit_write_order_request']['orders']['total'][$row->order_id] = array('#markup' => check_plain($row->order_total));\n// $form['submit_write_order_request']['orders']['purchase_date'][$row->order_id] = array('#markup' => check_plain(gmdate(\"M d Y H:i:s\", $row->created)));\n// $form['submit_write_order_request']['orders']['status'][$row->order_id] = array('#markup' => check_plain($row->order_status));\n// }\n\n $form['submit_write_order_request']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit Request to Queue'),\n );\n\n $form['submit_write_payment_request'] = array(\n '#type' => 'fieldset',\n '#title' => t('Submit Payment Request'),\n '#group' => 'courier-requests',\n '#weight' => 1,\n );\n\n $form['submit_write_payment_request']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit Request to Queue'),\n );\n\n $form['submit_write_product_request'] = array(\n '#type' => 'fieldset',\n '#title' => t('Submit Write Product Request'),\n '#group' => 'courier-requests',\n '#weight' => 2,\n );\n\n $form['submit_write_product_request']['product_type'] = array(\n '#type' => 'select',\n '#title' => t('Product Type'),\n '#default_value' => t('SalesReceipt'),\n '#options' => array(\n \"AssemblyItem\" => \"Assembly Item Request\",\n \"DiscountItem\" => \"Discount Item Request\",\n \"InventoryItem\" => \"Inventory Item Request\",\n \"NonInventoryItem\" => \"Non Inventory Item Request\",\n \"ServiceItem\" => \"Service Item Request\",\n ),\n );\n\n $form['submit_write_product_request']['products'] = array(\n '#type' => 'fieldset',\n '#group' => 'submit_write_product_request',\n '#title' => t('Select Products(s) to Download'),\n '#theme' => 'courier_connector_product_table',\n '#tree' => TRUE,\n );\n\n// $result = db_query(\"select uc_products.nid, title, `sell_price`, `model` from uc_products inner join node on node.nid = uc_products.nid\");\n//\n// $d = array();\n//\n// foreach ($result as $row) \n// { \n// $form['submit_write_product_request']['products']['add'][$row->nid] = array( \n// '#type' => 'checkbox', \n// );\n// $form['submit_write_product_request']['products']['nid'][$row->nid] = array('#markup' => check_plain($row->nid));\n// $form['submit_write_product_request']['products']['title'][$row->nid] = array('#markup' => check_plain($row->title)); \n// $form['submit_write_product_request']['products']['sell_price'][$row->nid] = array('#markup' => check_plain($row->sell_price));\n// $form['submit_write_product_request']['products']['model'][$row->nid] = array('#markup' => check_plain($row->model)); \n// }\n\n $form['submit_write_product_request']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit Request to Queue'),\n );\n\n $form['submit_write_customer_request'] = array(\n '#type' => 'fieldset',\n '#title' => t('Submit Write Customer Request'),\n '#group' => 'courier-requests',\n '#weight' => 3,\n );\n\n $form['submit_write_customer_request']['customers'] = array(\n '#type' => 'fieldset',\n '#group' => 'submit_write_customer_request',\n '#title' => t('Select Customer(s) to Download'),\n '#theme' => 'courier_connector_customer_table',\n '#tree' => TRUE,\n );\n\n// $result = db_query(\"select distinct users.uid, concat(uc_orders.billing_first_name, ' ', uc_orders.billing_last_name) as name, mail, concat(billing_city, ', ', uc_zones.zone_name) as location from users inner join uc_orders on uc_orders.uid = users.uid inner join uc_zones on uc_orders.billing_zone = uc_zones.zone_id\");\n//\n// $d = array();\n//\n// foreach ($result as $row) \n// { \n// $form['submit_write_customer_request']['customers']['add'][$row->uid] = array( \n// '#type' => 'checkbox', \n// );\n// $form['submit_write_customer_request']['customers']['uid'][$row->uid] = array('#markup' => check_plain($row->uid));\n// $form['submit_write_customer_request']['customers']['name'][$row->uid] = array('#markup' => check_plain($row->name)); \n// $form['submit_write_customer_request']['customers']['email'][$row->uid] = array('#markup' => check_plain($row->mail));\n// $form['submit_write_customer_request']['customers']['location'][$row->uid] = array('#markup' => check_plain($row->location)); \n// }\n\n $form['submit_write_customer_request']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit Request to Queue'),\n );\n\n //$form['#validate'][] = 'courier_connector_queue_validate';\n\n return $form;\n}", "function InputForm()\n\t{\t\n\t\tif (!$data = $this->details)\n\t\t{\t$data = $_POST;\n\t\t\tif (!$data)\n\t\t\t{\t$data = array('live'=>1);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$form = new Form('pageedit.php?id=' . (int)$this->id, 'pageedit');\n\t\t$form->AddTextInput('Page title', 'pagetitle', $this->InputSafeString($data['pagetitle']), '', 50);\n\t\t$form->AddCheckBox('Hide title on page', 'hideheader', 1, $data['hideheader']);\n\t\t\n\t\tif ($parents = $this->GetPossibleParents())\n\t\t{\t$form->AddSelectWithGroups('Parent page', 'parentid', $data['parentid'], '', $parents, 1, 0, '');\n\t\t\t$form->AddCheckBox('Display as section of parent', 'inparent', 1, $data['inparent']);\n\t\t}\n\t\t\n\t\t$form->AddTextInput('Order in menu', 'pageorder', (int)$data['pageorder'], 'num', 4);\n\t\tif ($this->CanAdminUser('technical'))\n\t\t{\t$form->AddTextInput('Extra page to include', 'includefile', $this->InputSafeString($data['includefile']), '', 50);\n\t\t\t$form->AddCheckBox('Allow galleries', 'galleries', 1, $data['galleries']);\n\t\t}\n\t\t$form->AddCheckBox('Make live', 'pagelive', 1, $data['pagelive']);\n\t\t$form->AddCheckBox('Leave out of search results', 'nosearch', 1, $data['nosearch']);\n\t\t$form->AddCheckBox('Show social media links?', 'socialbar', 1, $data['socialbar']);\n\t\t$form->AddCheckBox('In header menu?', 'headermenu', 1, $data['headermenu']);\n\t\tif ($this->CanAdminUser('technical'))\n\t\t{\t$form->AddTextInput('Class for header menu', 'menuclass', $this->InputSafeString($data['menuclass']), '', 50);\n\t\t}\n\t\t$form->AddCheckBox('In footer menu?', 'footermenu', 1, $data['footermenu']);\n\t\t$form->AddCheckBox('Header only (no content)', 'headeronly', 1, $data['headeronly']);\n\t\t$form->AddTextInput('Redirect link (full address if external)', 'redirectlink', $this->InputSafeString($data['redirectlink']), 'long', 255);\n\t\t\n\t\tif ($this->id)\n\t\t{\t$form->AddTextInput('Slug (for URL)', 'pagename', $this->InputSafeString($data['pagename']), 'long', 255);\n\t\t\tif ($link = $this->Link())\n\t\t\t{\t$form->AddRawText('<p><label>Link to page</label><span><a href=\"' . $link . '\" target=\"_blank\">' . $link . '</a></span><br /></p>');\n\t\t\t}\n\t\t}\n\t\t$form->AddCheckBox('Display block link in parent (if any)', 'blocklink', 1, $data['blocklink']);\n\t\t$form->AddTextArea('Block link text', $name = 'pageintro', stripslashes($data['pageintro']), 'tinymce', 0, 0, 10, 60);\n\t\t$form->AddTextArea('Page content', $name = 'pagetext', stripslashes($data['pagetext']), 'tinymce', 0, 0, 50, 60);\n\t\t$form->AddRawText('<p><label></label><a href=\"#\" onclick=\"javascript:window.open(\\'newsimagelist.php\\', \\'newsimages\\', \\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=550\\'); return false;\">view available images</a></p>');\n\t\t$form->AddFileUpload('Subpage image:', 'imagefile');\n\t\tif ($src = $this->HasImage('thumbnail'))\n\t\t{\t$form->AddRawText('<label>Current image</label><img src=\"' . $src . '?' . time() . '\" height=\"200px\" /><br />');\n\t\t\t$form->AddCheckBox('Delete this', 'delphoto');\n\t\t}\n\t\t\n\t\tob_start();\n\t\techo '<label>Banner:</label><br /><label id=\"bannerPicked\">', ($data['banner'] && ($banner = new BannerSet($data['banner'])) && $banner->id) ? $this->InputSafeString($banner->details['title']) : 'none','</label><input type=\"hidden\" name=\"banner\" id=\"bannerValue\" value=\"', (int)$data['banner'], '\" /><span class=\"dataText\"><a onclick=\"BannerPicker();\">change this</a></span><br />';\n\t\t$form->AddRawText(ob_get_clean());\n\n\n\t\t$form->AddSubmitButton('', $this->id ? 'Save' : 'Create', 'submit');\n\t\techo $this->BannerPickerPopUp();\n\t\t\n\t\t$form->Output();\n\t}", "public function action_edit_form_after_title() {\n\n if ( 'pedestal_story' == get_current_screen()->post_type ) {\n $this->pedestal_headline_context->render_meta_box( get_post( get_the_ID() ) );\n }\n\n }", "public function admin_render()\n {\n $output = $this->admin_form_before();\n $output .= $this->admin_form_start();\n $output .= $this->default_fields();\n $widget_saved_values = $this->get_settings();\n\n $output .= $this->admin_language_tab(); //have to start language tab from here on\n $output .= $this->admin_language_tab_start();\n\n $all_languages = LanguageHelper::all_languages();\n foreach ($all_languages as $key => $lang) {\n $output .= $this->admin_language_tab_content_start([\n 'class' => $key == 0 ? 'tab-pane fade show active' : 'tab-pane fade',\n 'id' => \"nav-home-\" . $lang->slug\n ]);\n $output .= Text::get([\n 'name' => 'title_'.$lang->slug,\n 'label' => __('Title'),\n 'value' => $widget_saved_values['title_' . $lang->slug] ?? null,\n ]);\n $output .= $this->admin_language_tab_content_end();\n }\n\n $output .= $this->admin_language_tab_end(); //have to end language tab\n\n $output .= Text::get([\n 'name' => 'location',\n 'label' => __('Location'),\n 'value' => $widget_saved_values['location'] ?? null,\n ]);\n $output .= Select::get([\n 'name' => 'custom_form_id',\n 'label' => __('Custom Form'),\n 'placeholder' => __('Select form'),\n 'options' => FormBuilder::all()->pluck('title','id')->toArray(),\n 'value' => $widget_saved_values['custom_form_id'] ?? []\n ]);\n $output .= Slider::get([\n 'name' => 'padding_top',\n 'label' => __('Padding Top'),\n 'value' => $widget_saved_values['padding_top'] ?? 50,\n 'max' => 200,\n ]);\n $output .= Slider::get([\n 'name' => 'padding_bottom',\n 'label' => __('Padding Bottom'),\n 'value' => $widget_saved_values['padding_bottom'] ?? 50,\n 'max' => 200,\n ]);\n $output .= $this->admin_form_submit_button();\n $output .= $this->admin_form_end();\n $output .= $this->admin_form_after();\n\n return $output;\n }", "public function render_sub_menu_form()\n {\n $tabs_list_html = $this->utility->build_settings_tabs_html($this->plugin_data);\n $tab_classes = FREEMIUS_NAVIGATION === 'tabs' ? ' fs-section fs-full-size-wrapper' : ' no-tabs';\n $is_premium = $this->custom_plugin_data->is_premium;\n\t\t\t\t$plugin_lbl = $this->custom_plugin_data->main_menu_label;\n\t\t\t\t$more_features = $is_premium ? 'View the full set of <a href=\"https://wpgoplugins.com/document/svg-flags-documentation/#svg-flags-shortcodes\" target=\"_blank\">shortcode attributes</a> available.' : 'See the <a href=\"' . $this->custom_plugin_data->main_settings_url . '\">main settings</a> page for a list of shortcode attributes available in the free version (expand the <strong>Shortcode Attributes & Default Values</strong> section).';\n\t\t\t\t$block_settings = $is_premium ? 'pro version.<p><img src=\"' . $this->module_roots['uri'] . '/assets/images/svg-flag-block-test-pro-settings.png\"></p>' : 'free version.<p><img src=\"' . $this->module_roots['uri'] . '/assets/images/svg-flag-block-test-free-settings.png\"></p>';\n ?>\n\t\t\t\t<div class=\"wrap welcome<?php echo $tab_classes; ?>\">\n\t\t\t\t\t<?php echo $tabs_list_html; ?>\n\t\t\t\t\t<div class=\"wpgo-settings-inner\">\n\t\t\t\t\t\t<div class=\"welcome-header\">\n\t\t\t\t\t\t\t<div style=\"margin-right:60px;\">\n\t\t\t\t\t\t\t\t<h1 class=\"heading\">Welcome to <?php _e($plugin_lbl . ' &nbsp;' . $this->plugin_data['Version'], 'svg-flags');?></h1>\n\t\t\t\t\t\t\t\t<p style=\"font-size:20px;\">This is a very exciting release for us! Lots of things have been updated since the last version (0.8) and the plugin is really starting to take shape now. Let's dig in and see what's new, and how you can quickly get started adding SVG flags to your site.</p>\n\t\t\t\t\t\t\t\t<?php if(!$is_premium) : ?>\n\t\t\t\t\t\t\t\t\t<p><a href=\"<?php echo $this->freemius_discount_upgrade_url; ?>\"><button class=\"button\"><strong>Upgrade To PRO >> <span style=\"color:green;\">30% OFF</span></strong></button></a>&nbsp; <span style=\"font-size: 16px;font-style: italic;\">Exclusive discount offer! Get immediate access to all pro features version at a reduced price!</span></p>\n\t\t\t\t\t\t\t\t<?php endif; ?>\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<img style=\"width:100px;height:100px;\" src=\"<?php echo $this->module_roots['uri'] . '/assets/images/svg-flags.png'; ?>\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<h2>What's New in <?php echo $this->plugin_data['Version']; ?>?</h2>\n\t\t\t\t\t\t<p>In the free version more attributes were added for the <code>[svg-flag]</code> shortcode: <code>size</code>, <code>size_unit</code>, <code>caption</code>, <code>random</code>, and <code>inline</code>. The <code>size_unit</code> attribute has been introduced to replace <code>width</code> and <code>height</code>.</p>\n\t\t\t\t\t\t<p>We've also added a new <code>[svg-flag-image]</code> shortcode to the free version which displays the flag inside an <code>&lt;img&gt;</code> element. This in contrast to the <code>[svg-flag]</code> shortcode which displays the flag as the background image of a <code>&lt;div&gt;</code> element.</p>\n\t\t\t\t\t\t<p>Finally for the free version in this release we've added a dedicated editor block as a direct alternative to the <code>[svg-flag]</code> shortcode. This allows you to add flags to a page visually without the need for a shortcode!</p>\n\t\t\t\t\t\t<p>As for the pro version we've extended the <code>[svg-flag-image]</code> shortcode in this release to include more attributes: <code>id</code>, <code>flag_class</code>, <code>tooltip</code>, <code>custom_tooltip</code>, <code>custom_caption</code>, <code>border</code>, <code>border_radius</code>, <code>padding</code>, <code>margin</code>.</p>\n\t\t\t\t\t\t<p>The <code>[svg-flag]</code> has just had a single (<code>custom_caption</code>) attribute added in the pro version. Plus we've added id, custom CSS class, tooltip, and custom tooltip support to the editor block to bring it inline with the <code>[svg-flag]</code> pro shortcode.</p>\n\n\t\t\t\t\t\t<p>These are just the highlights though. Click the button below to head on over to the New Features page to learn more.</p>\n\t\t\t\t\t\t<a href=\"<?php echo $this->custom_plugin_data->new_features_url; ?>\"><button class=\"button\"><strong>Show Me All New Features</strong></button></a>\n\t\t\t\t\t\t<div id=\"getting-started\" style=\"padding-bottom:2px;\"></div>\n\n\t\t\t\t\t\t<h2 style=\"margin-top:35px;\">Getting Started Using <?php echo $plugin_lbl; ?></h2>\n\t\t\t\t\t\t<p>If this is your first time using the plugin or you just need a quick refresher then this section gives you all the information you need to get up to speed.</p>\n\t\t\t\t\t\t<p>Basically, this plugin allows you to add high quality SVG flags to your site via two shortcodes and an editor block as shown below.</p>\n\t\t\t\t\t\t<h3 style=\"margin-top:25px;\">Using the <code>[svg-flag]</code> Shortcode</h3>\n\t\t\t\t\t\t<p>The <code>[svg-flag]</code> shortcode displays the flag as the background image of a <code>&lt;div&gt;</code> element.</p>\n\t\t\t\t\t\t<ul class=\"welcome-getting-started\">\n\t\t\t\t\t\t\t<li><span>Step #1:</span> &nbsp;Create a new post or page, or edit an existing one.</li>\n\t\t\t\t\t\t\t<li><span>Step #2:</span> &nbsp;In the editor enter the <code>[svg-flag]</code> shortcode along with a two-letter <code>flag</code> attribute for a <a href=\"https://flagicons.lipis.dev/\" target=\"_blank\">specific country</a>.<p><img src=\"<?php echo $this->module_roots['uri']; ?>/assets/images/svg-flag-shortcode-test.png\"></p></li>\n\t\t\t\t\t\t\t<li><span>Step #3:</span> &nbsp;Save the page and view on the frontend.<p><img src=\"<?php echo $this->module_roots['uri']; ?>/assets/images/svg-flag-shortcode-test-frontend.png\"></p></li>\n\t\t\t\t\t\t\t<li><span>Step #4:</span> &nbsp;Add other shortcode attributes as required. <?php echo $more_features; ?></li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<h3 style=\"margin-top:25px;\">Using the <code>[svg-flag-image]</code> Shortcode</h3>\n\t\t\t\t\t\t<p>The <code>[svg-flag-image]</code> shortcode displays the flag inside an <code>&lt;img&gt;</code> element. It generally allows more flexibility if you need to modify the flags general appearance (border, rounded corners, margin, padding etc.).</p>\n\t\t\t\t\t\t<ul class=\"welcome-getting-started\">\n\t\t\t\t\t\t\t<li><span>Step #1:</span> &nbsp;Create a new post or page, or edit an existing one.</li>\n\t\t\t\t\t\t\t<li><span>Step #2:</span> &nbsp;In the editor enter the <code>[svg-flag-image]</code> shortcode along with a two-letter <code>flag</code> attribute for a <a href=\"https://flagicons.lipis.dev/\" target=\"_blank\">specific country</a>.<p><img src=\"<?php echo $this->module_roots['uri']; ?>/assets/images/svg-flag-image-shortcode-test.png\"></p></li>\n\t\t\t\t\t\t\t<li><span>Step #3:</span> &nbsp;Save the page and view on the frontend.<p><img src=\"<?php echo $this->module_roots['uri']; ?>/assets/images/svg-flag-image-shortcode-test-frontend.png\"></p></li>\n\t\t\t\t\t\t\t<li><span>Step #4:</span> &nbsp;Add other shortcode attributes as required. <?php echo $more_features; ?></li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<h3 style=\"margin-top:25px;\">Using the <?php echo $plugin_lbl; ?> Editor Block</h3>\n\t\t\t\t\t\t<p>There's also a dedicated editor block available which is direct alternative to the <code>[svg-flag]</code> shortcode to add a flag visually inside the editor window.</p>\n\t\t\t\t\t\t<ul class=\"welcome-getting-started\">\n\t\t\t\t\t\t\t<li><span>Step #1:</span> &nbsp;Create a new post or page, or edit an existing one.</li>\n\t\t\t\t\t\t\t<li><span>Step #2:</span> &nbsp;In the editor click the 'plus' icon to add a block. Start typing 'svg' in the search box and click to insert the SVG Flag block when it appears.<p><img src=\"<?php echo $this->module_roots['uri']; ?>/assets/images/svg-flag-block-test-insert.png\"></p></li>\n\t\t\t\t\t\t\t<li><span>Step #3:</span> &nbsp;By default the GB flag will be selected. To change this click on the 'Select a flag' dropdown in block settings to choose a different flag.<p><img src=\"<?php echo $this->module_roots['uri']; ?>/assets/images/svg-flag-block-test-change.png\"></p></li>\n\t\t\t\t\t\t\t<li><span>Step #4:</span> &nbsp;When the block is selected other flag settings are visible. The following screenshot shows the SVG flag block settings currently available in the <?php echo $block_settings; ?></li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<p>For full instructions on all the available shortcodes and attributes, as well as editor blocks check out the official plugin documentation.</p>\n\t\t\t\t\t\t<a href=\"https://wpgoplugins.com/document/svg-flags-documentation/\" target=\"_blank\"><button class=\"button\"><strong>Take Me To Plugin Docs</strong></button></a>\n\n\t\t\t\t\t\t<h2 style=\"margin-top:35px;\">Coming Soon</h2>\n\t\t\t\t\t\t<p>We're not done yet! There's still lot's more feature we want to add to <?php echo $plugin_lbl; ?>! Some of the upcoming features include:</p>\n\t\t\t\t\t\t<ul style=\"list-style:initial;margin-left:18px;\" class=\"welcome-getting-started\">\n\t\t\t\t\t\t\t<li>Add flags to navigation menus.</li>\n\t\t\t\t\t\t\t<li>Add flags to headings.</li>\n\t\t\t\t\t\t\t<li>More shortcodes, and shortcode attributes.</li>\n\t\t\t\t\t\t\t<li>More blocks and block settings.</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<p>If you'd like to be notified of all plugin changes as soon as they are available then please <a href=\"https://us4.list-manage.com/subscribe?u=7ac9d1df68c71b93569502c5c&id=e4929d34d7\" target=\"_blank\">signup to our newsletter</a>.</p>\n\t\t\t\t\t\t<p>Or, if you'd like to see a feature added then why not drop us a line? We always like to hear how our plugins can be improved. Click the button below to send us a message and tell us what's on your mind.</a></p>\n\t\t\t\t\t\t<p><a href=\"<?php echo $this->custom_plugin_data->contact_us_url; ?>\"><button class=\"button\"><strong>Share Your Thoughts</strong></button></a></p>\n\t\t\t\t\t\t<br><br>\n\t\t\t\t\t</div>\n\t\t\t\t<?php\n}", "function tpps_details_tabs(array &$state) {\n $output = '<ul class=\"nav nav-tabs\" role=\"tablist\">\n <li class=\"nav-item\"><a class=\"nav-link active\" role=\"tab\" data-toggle=\"tab\" href=\"#species\">Species</a></li>\n <li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#study\">Study Details</a></li>\n <li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#trees\">Plants</a></li>';\n $p_exist = FALSE;\n $g_exist = FALSE;\n $mass_spectro_exist = FALSE;\n for ($i = 1; $i <= $state['stats']['species_count']; $i++) {\n if (!empty($state['saved_values'][TPPS_PAGE_4][\"organism-$i\"]['phenotype'])) {\n $p_exist = TRUE;\n }\n if (!empty($state['saved_values'][TPPS_PAGE_4][\"organism-$i\"]['genotype'])) {\n $g_exist = TRUE;\n }\n if ($state['saved_values'][TPPS_PAGE_4][\"organism-$i\"]['phenotype']['iso-check'] == TRUE) {\n $mass_spectro_exist = TRUE;\n }\n }\n \n $output .= $p_exist ? '<li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#phenotype\">Phenotypes / Environments</a></li>' : \"\";\n $output .= $g_exist ? '<li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#genotype\">Genotypes</a></li>' : \"\";\n $output .= $mass_spectro_exist ? '<li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#mass_spectrometry\">Mass Spectrometry</a></li>' : \"\";\n $output .= '</ul><div id=\"tab-content\" class=\"tab-content\">';\n\n $output .= \"<div id=\\\"species\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade in active\\\"></div>\";\n $output .= \"<div id=\\\"study\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\";\n $output .= \"<div id=\\\"trees\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\";\n\n $output .= $p_exist ? \"<div id=\\\"phenotype\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\" : \"\";\n $output .= $g_exist ? \"<div id=\\\"genotype\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\" : \"\";\n $output .= $mass_spectro_exist ? \"<div id=\\\"mass_spectrometry\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\" : \"\";\n\n $output .= '</div>';\n return $output;\n}", "public function add_options_html() {\n\n $has_nav = ( count( $this->pre_tabs ) > 1 ) ? true : false;\n $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';\n $ajax_class = ( $this->args['ajax_save'] ) ? ' csf-save-ajax' : '';\n $sticky_class = ( $this->args['sticky_header'] ) ? ' csf-sticky-header' : '';\n $wrapper_class = ( $this->args['framework_class'] ) ? ' '. $this->args['framework_class'] : '';\n\n echo '<div class=\"csf csf-theme-'. $this->args['theme'] .' csf-options'. $wrapper_class .'\" data-slug=\"'. $this->args['menu_slug'] .'\" data-unique=\"'. $this->unique .'\">';\n\n $notice_class = ( ! empty( $this->notice ) ) ? ' csf-form-show' : '';\n $notice_text = ( ! empty( $this->notice ) ) ? $this->notice : '';\n\n echo '<div class=\"csf-form-result csf-form-success'. $notice_class .'\">'. $notice_text .'</div>';\n\n $error_class = ( ! empty( $this->errors ) ) ? ' csf-form-show' : '';\n\n echo '<div class=\"csf-form-result csf-form-error'. $error_class .'\">';\n if( ! empty( $this->errors ) ) {\n foreach ( $this->errors as $error ) {\n echo '<i class=\"csf-label-error\">!</i> '. $error .'<br />';\n }\n }\n echo '</div>';\n\n echo '<div class=\"csf-container\">';\n\n echo '<form method=\"post\" action=\"\" enctype=\"multipart/form-data\" id=\"csf-form\">';\n\n echo '<input type=\"hidden\" class=\"csf-section-id\" name=\"csf_transient[section]\" value=\"1\">';\n wp_nonce_field( 'csf_options_nonce', 'csf_options_nonce' );\n\n echo '<div class=\"csf-header'. esc_attr( $sticky_class ) .'\">';\n echo '<div class=\"csf-header-inner\">';\n\n echo '<div class=\"csf-header-left\">';\n echo '<h1>'. $this->args['framework_title'] .'</h1>';\n echo '</div>';\n\n echo '<div class=\"csf-header-right\">';\n\n echo ( $has_nav && $this->args['show_all_options'] ) ? '<div class=\"csf-expand-all\" title=\"'. esc_html__( 'show all options', 'csf' ) .'\"><i class=\"fa fa-outdent\"></i></div>' : '';\n\n echo ( $this->args['show_search'] ) ? '<div class=\"csf-search\"><input type=\"text\" placeholder=\"'. esc_html__( 'Search option(s)', 'csf' ) .'\" /></div>' : '';\n\n echo '<div class=\"csf-buttons\">';\n echo '<input type=\"submit\" name=\"'. $this->unique .'[_nonce][save]\" class=\"button button-primary csf-save'. $ajax_class .'\" value=\"'. esc_html__( 'Save', 'csf' ) .'\" data-save=\"'. esc_html__( 'Saving...', 'csf' ) .'\">';\n echo ( $this->args['show_reset_section'] ) ? '<input type=\"submit\" name=\"csf_transient[reset_section]\" class=\"button button-secondary csf-reset-section csf-confirm\" value=\"'. esc_html__( 'Reset Section', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'\">' : '';\n echo ( $this->args['show_reset_all'] ) ? '<input type=\"submit\" name=\"csf_transient[reset]\" class=\"button button-secondary csf-warning-primary csf-reset-all csf-confirm\" value=\"'. esc_html__( 'Reset All', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'\">' : '';\n echo '</div>';\n\n echo '</div>';\n\n echo '<div class=\"clear\"></div>';\n echo '</div>';\n echo '</div>';\n\n echo '<div class=\"csf-wrapper'. $show_all .'\">';\n\n if( $has_nav ) {\n echo '<div class=\"csf-nav csf-nav-options\">';\n\n echo '<ul>';\n\n $tab_key = 1;\n\n foreach( $this->pre_tabs as $tab ) {\n\n $tab_error = $this->error_check( $tab );\n $tab_icon = ( ! empty( $tab['icon'] ) ) ? '<i class=\"'. $tab['icon'] .'\"></i>' : '';\n\n if( ! empty( $tab['subs'] ) ) {\n\n echo '<li class=\"csf-tab-depth-0\">';\n\n echo '<a href=\"#tab='. $tab_key .'\" class=\"csf-arrow\">'. $tab_icon . $tab['title'] . $tab_error .'</a>';\n\n echo '<ul>';\n\n foreach ( $tab['subs'] as $sub ) {\n\n $sub_error = $this->error_check( $sub );\n $sub_icon = ( ! empty( $sub['icon'] ) ) ? '<i class=\"'. $sub['icon'] .'\"></i>' : '';\n\n echo '<li class=\"csf-tab-depth-1\"><a id=\"csf-tab-link-'. $tab_key .'\" href=\"#tab='. $tab_key .'\">'. $sub_icon . $sub['title'] . $sub_error .'</a></li>';\n\n $tab_key++;\n }\n\n echo '</ul>';\n\n echo '</li>';\n\n } else {\n\n echo '<li class=\"csf-tab-depth-0\"><a id=\"csf-tab-link-'. $tab_key .'\" href=\"#tab='. $tab_key .'\">'. $tab_icon . $tab['title'] . $tab_error .'</a></li>';\n\n $tab_key++;\n }\n\n }\n\n echo '</ul>';\n\n echo '</div>';\n\n }\n\n echo '<div class=\"csf-content\">';\n\n echo '<div class=\"csf-sections\">';\n\n $section_key = 1;\n\n foreach( $this->pre_sections as $section ) {\n\n $onload = ( ! $has_nav ) ? ' csf-onload' : '';\n $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class=\"csf-icon '. $section['icon'] .'\"></i>' : '';\n\n echo '<div id=\"csf-section-'. $section_key .'\" class=\"csf-section'. $onload .'\">';\n echo ( $has_nav ) ? '<div class=\"csf-section-title\"><h3>'. $section_icon . $section['title'] .'</h3></div>' : '';\n echo ( ! empty( $section['description'] ) ) ? '<div class=\"csf-field csf-section-description\">'. $section['description'] .'</div>' : '';\n\n if( ! empty( $section['fields'] ) ) {\n\n foreach( $section['fields'] as $field ) {\n\n $is_field_error = $this->error_check( $field );\n\n if( ! empty( $is_field_error ) ) {\n $field['_error'] = $is_field_error;\n }\n\n $value = ( ! empty( $field['id'] ) && isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : '';\n\n CSF::field( $field, $value, $this->unique, 'options' );\n\n }\n\n } else {\n\n echo '<div class=\"csf-no-option csf-text-muted\">'. esc_html__( 'No option provided by developer.', 'csf' ) .'</div>';\n\n }\n\n echo '</div>';\n\n $section_key++;\n }\n\n echo '</div>';\n\n echo '<div class=\"clear\"></div>';\n\n echo '</div>';\n\n echo '<div class=\"csf-nav-background\"></div>';\n\n echo '</div>';\n\n if( ! empty( $this->args['show_footer'] ) ) {\n\n echo '<div class=\"csf-footer\">';\n\n echo '<div class=\"csf-buttons\">';\n echo '<input type=\"submit\" name=\"csf_transient[save]\" class=\"button button-primary csf-save'. $ajax_class .'\" value=\"'. esc_html__( 'Save', 'csf' ) .'\" data-save=\"'. esc_html__( 'Saving...', 'csf' ) .'\">';\n echo ( $this->args['show_reset_section'] ) ? '<input type=\"submit\" name=\"csf_transient[reset_section]\" class=\"button button-secondary csf-reset-section csf-confirm\" value=\"'. esc_html__( 'Reset Section', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'\">' : '';\n echo ( $this->args['show_reset_all'] ) ? '<input type=\"submit\" name=\"csf_transient[reset]\" class=\"button button-secondary csf-warning-primary csf-reset-all csf-confirm\" value=\"'. esc_html__( 'Reset All', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'\">' : '';\n echo '</div>';\n\n echo ( ! empty( $this->args['footer_text'] ) ) ? '<div class=\"csf-copyright\">'. $this->args['footer_text'] .'</div>' : '';\n\n echo '<div class=\"clear\"></div>';\n echo '</div>';\n\n }\n\n echo '</form>';\n\n echo '</div>';\n\n echo '<div class=\"clear\"></div>';\n\n echo ( ! empty( $this->args['footer_after'] ) ) ? $this->args['footer_after'] : '';\n\n echo '</div>';\n\n }", "public function beforeFormDisplay ($form, $isNew)\n {\n if ($this->useTabbedForms || $form instanceof \\Gems_Form_TableForm) {\n //If needed, add a row of link buttons to the bottom of the form\n if ($links = $this->createMenuLinks($isNew ? $this->menuCreateIncludeLevel : $this->menuEditIncludeLevel)) {\n $linkContainer = \\MUtil_Html::create()->div(array('class' => 'element-container-labelless'));\n $linkContainer[] = $links;\n\n $element = $form->createElement('html', 'formLinks');\n $element->setValue($linkContainer);\n $element->setOrder(999);\n if ($form instanceof \\Gems_TabForm) {\n $form->resetContext();\n }\n $form->addElement($element);\n $form->addDisplayGroup(array('formLinks'), 'form_buttons');\n }\n } else {\n if (\\MUtil_Bootstrap::enabled() !== true) {\n $table = new \\MUtil_Html_TableElement(array('class' => 'formTable'));\n $table->setAsFormLayout($form, true, true);\n $table['tbody'][0][0]->class = 'label'; // Is only one row with formLayout, so all in output fields get class.\n\n if ($links = $this->createMenuLinks($isNew ? $this->menuCreateIncludeLevel : $this->menuEditIncludeLevel)) {\n $table->tf(); // Add empty cell, no label\n $linksCell = $table->tf($links);\n }\n } elseif ($links = $this->createMenuLinks($isNew ? $this->menuCreateIncludeLevel : $this->menuEditIncludeLevel)) {\n $element = $form->createElement('html', 'menuLinks');\n $element->setValue($links);\n $element->setOrder(999);\n $form->addElement($element);\n }\n }\n\n return $form;\n }", "public function FormAction()\n {\n return Controller::join_links($this->_widgetEditor->Link('field'), str_replace('\\\\', '_', $this->_widget->ClassName), '');\n }", "protected function _prepareForm()\r\n\t{\r\n\t\t$model = Mage::helper('slider')->getBannerItemInstance();\r\n\t\t\r\n\t\t/**\r\n\t\t * Checking if users have permission to save information\r\n\t\t */\r\n\t\tif (Mage::helper('slider/admin')->isActionAllowed('save')) {\r\n\t\t\t$isElementDisabled = false;\r\n\t\t} else {\r\n\t\t\t$isElementDisabled = true;\r\n\t\t}\r\n\t\t\r\n\t\t$form = new Varien_Data_Form();\r\n\t\t\r\n\t\t$form->setHtmlIdPrefix('banner_main_');\r\n\t\t\r\n\t\t$fieldset = $form->addFieldset('base_fieldset', array(\r\n\t\t\t'legend' => Mage::helper('slider')->__('Banner Item Info')\r\n\t\t));\r\n\t\t\r\n\t\tif ($model->getId()) {\r\n\t\t\t$fieldset->addField('banner_id', 'hidden', array(\r\n\t\t\t\t'name' => 'banner_id'\r\n\t\t\t));\r\n\t\t}\r\n\t\t\r\n\t\t$fieldset->addField('title', 'text', array(\r\n\t\t\t'name'\t\t=> 'title',\r\n\t\t\t'label'\t\t=> Mage::helper('slider')->__('Banner Title'),\r\n\t\t\t'title'\t\t=> Mage::helper('slider')->__('Banner Title'),\r\n\t\t\t'required'\t=> true,\r\n\t\t\t'disabled'\t=> $isElementDisabled\r\n\t\t));\r\n\t\t\r\n\t\t$fieldset->addField('link', 'text', array(\r\n\t\t\t'name'\t\t=> 'link',\r\n\t\t\t'label'\t\t=> Mage::helper('slider')->__('Link'),\r\n\t\t\t'title'\t\t=> Mage::helper('slider')->__('Link'),\r\n\t\t\t'required'\t=> false,\r\n\t\t\t'disabled'\t=> $isElementDisabled\r\n\t\t));\r\n\t\t\r\n\t\tMage::dispatchEvent('adminhtml_banner_edit_tab_main_prepare_form',\r\n\t\t\t\tarray('form' => $form));\r\n\t\t\r\n\t\t$form->setValues($model->getData());\r\n\t\t$this->setForm($form);\r\n\t\t\r\n\t\treturn parent::_prepareForm();\r\n\t}", "public function onAddField()\n {\n return $this->makePartial('create_field_form');\n }", "function getHtmlStep2View()\r\n\t{\r\n\t\treturn '';\r\n\t}", "function showPreviewForm()\n {\n $ok = $this->preview();\n if (!$ok) {\n // @todo FIXME maybe provide a cancel button or link back?\n return;\n }\n\n $this->elementStart('div', 'entity_actions');\n $this->elementStart('ul');\n $this->elementStart('li', 'entity_subscribe');\n $this->elementStart('form', array('method' => 'post',\n 'id' => 'form_ostatus_sub',\n 'class' => 'form_remote_authorize',\n 'action' =>\n $this->selfLink()));\n $this->elementStart('fieldset');\n $this->hidden('token', common_session_token());\n $this->hidden('profile', $this->profile_uri);\n if ($this->oprofile->isGroup()) {\n // TRANS: Button text.\n $this->submit('submit', _m('Join'), 'submit', null,\n // TRANS: Tooltip for button \"Join\".\n _m('BUTTON','Join this group'));\n } else {\n // TRANS: Button text.\n $this->submit('submit', _m('BUTTON','Confirm'), 'submit', null,\n // TRANS: Tooltip for button \"Confirm\".\n _m('Subscribe to this user'));\n }\n $this->elementEnd('fieldset');\n $this->elementEnd('form');\n $this->elementEnd('li');\n $this->elementEnd('ul');\n $this->elementEnd('div');\n }", "public function form( $instance ) {\n\n $title = !empty($instance['title']) ? $instance['title'] : 'Related content';\n $limit = isset($instance['limit']) ? $instance['limit'] : -1;\n $type = isset($instance['type']) ? $instance['type'] : 'dataset';\n\t\t$template = isset($instance['template']) ? $instance['template'] : 'default';\n $max_height = isset($instance['max_height']) ? $instance['max_height'] : '200';\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id('title');?>\"><?php _e('Title:');?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('title');?>\" name=\"<?php echo $this->get_field_name('title');?>\" type=\"text\" value=\"<?php _e($title,'odm');?>\">\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'type' ); ?>\"><?php _e( 'Select content type:' ); ?></label>\n\t\t\t<select class='widefat type' id=\"<?php echo $this->get_field_id('type'); ?>\" name=\"<?php echo $this->get_field_name('type'); ?>\" type=\"text\">\n\t\t\t\t<?php foreach ( $this->types as $key => $available_type ): ?>\n\t\t\t\t\t<option <?php if ($type == $available_type[\"label\"]) { echo \" selected\"; } ?> value=\"<?php echo $key ?>\"><?php echo $available_type[\"label\"] ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'template' ); ?>\"><?php _e( 'Select layout:' ); ?></label>\n\t\t\t<select class='widefat template' id=\"<?php echo $this->get_field_id('template'); ?>\" name=\"<?php echo $this->get_field_name('template'); ?>\" type=\"text\">\n\t\t\t\t<?php\n $current_type = $this->types[$type];\n foreach ( $current_type[\"templates\"] as $key => $available_template ): ?>\n\t\t\t\t\t<option <?php if ($template == $available_template) { echo \" selected\"; } ?> value=\"<?php echo $available_template ?>\"><?php echo $available_template ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t</p>\n\t\t<?php $limit = !empty($instance['limit']) ? $instance['limit'] : -1 ?>\n\t\t<p class=\"<?php echo $this->get_field_id('limit');?>\">\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'limit' ); ?>\"><?php _e( 'Select max number of posts to list (-1 to show all):' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('limit');?>\" name=\"<?php echo $this->get_field_name('limit');?>\" type=\"number\" value=\"<?php echo $limit;?>\">\n\t\t</p>\n\t\t\t<?php $max_height = !empty($instance['max_height']) ? $instance['max_height'] : '200' ?>\n\t\t<p class=\"<?php echo $this->get_field_id('max_height');?>\">\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'max_height' ); ?>\"><?php _e( 'Define the max height of container:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('max_height');?>\" name=\"<?php echo $this->get_field_name('max_height');?>\" type=\"number\" value=\"<?php echo $max_height;?>\">\n\t\t</p>\n\n\t\t<script type=\"text/javascript\">\n\t\t\tjQuery(function($) {\n\t\t\t\tvar $select_template = \"<?php echo $this->get_field_id('template'); ?>\";\n\t\t\t\tdisplay_max_height();\n\t\t\t\t$('#'+$select_template).change(function(){\n\t\t\t\t\tdisplay_max_height();\n\t\t\t\t});\n\n\t\t\t\tfunction display_max_height (){\n\t\t\t\t\tvar $p_limit = \"<?php echo $this->get_field_id('limit');?>\";\n\t\t\t\t\tvar $p_max_height = \"<?php echo $this->get_field_id('max_height');?>\";\n\t\t\t\t\tif($('#'+$select_template).val() == \"html\"){\n\t\t\t\t\t\t$('.'+$p_limit).hide();\n\t\t\t\t\t\t$('.'+$p_max_height).show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$('.'+$p_limit).show();\n\t\t\t\t\t\t$('.'+$p_max_height).hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t </script>\n\n\t\t<?php\n\t}", "public function meta_box_switch_form() {\n\t\tglobal $wpdb;\n\n\t\t// Query to get all forms\n\t\t$order = sanitize_sql_orderby( 'form_id ASC' );\n\t\t$where = apply_filters( 'vfb_pre_get_forms_switcher', '' );\n\t\t$forms = $wpdb->get_results( \"SELECT * FROM $this->form_table_name WHERE 1=1 $where ORDER BY $order\" );\n\n\t\t$form_nav_selected_id = ( isset( $_REQUEST['form'] ) ) ? $_REQUEST['form'] : $forms[0]->form_id;\n\t\t?>\n\t\t<select id=\"switcher_form\">\n\t\t<?php\n\t\t\tforeach ( $forms as $form ) {\n\t\t\t\techo sprintf( '<option value=\"%1$d\"%2$s id=\"%4$s\">%1$d - %3$s</option>',\n\t\t\t\t\t$form->form_id,\n\t\t\t\t\tselected( $form->form_id, $form_nav_selected_id, 0 ),\n\t\t\t\t\t$form->form_title,\n\t\t\t\t\t$form->form_key\n\t\t\t\t);\n\t\t\t}\n\t\t?>\n\t\t</select>\n\t\t<?php\n\t}", "function block_skinChooser(){\n //Show first part\n echo '<form action=\"php/profile/form_skinChooser.php\" method=\"post\" id=\"columnBack\">';\n echo '<h1 class=\"title is-4\">- Custom skin chooser -</h1>';\n showSuccess(2);\n\n block_skinChooser_body();\n \n //Show last part\n echo <<<EOF\n <br>\n <br>\n <input type=\"submit\" value=\"Save all modifications\" class=\"button is-light\"/>\n </form>\nEOF;\n}", "protected function _loadTmplBottom(&$form)\r\n\t{\r\n\t\t$app = JFactory::getApplication();\r\n\t\t$menuItem = $app->getMenu('site')->getActive();\r\n\t\t$Itemid\t= $menuItem ? $menuItem->id : 0;\r\n\t\t$model = $this->getModel();\r\n\t\t$listModel = $model->getListModel();\r\n\t\t$canDelete = $listModel->canDelete($model->_data);\r\n\t\t$params = $model->getParams();\r\n\t\t$task = 'form.process';\r\n\t\t$reffer = JRequest::getVar('HTTP_REFERER', '', 'server');\r\n\t\t// $$$rob - if returning from a failed validation then we should use the fabrik_referrer post var\r\n\t\t$reffer =str_replace('&', '&amp;', JRequest::getVar('fabrik_referrer', $reffer));\r\n\r\n\t\t$this_rowid = is_array($model->_rowId)? implode('|', $model->_rowId) : $model->_rowId;\r\n\t\t$fields = array('<input type=\"hidden\" name=\"listid\" value=\"'.$listModel->getId().'\" />',\r\n\t\t'<input type=\"hidden\" name=\"listref\" value=\"'.$listModel->getId().'\" />',\r\n\t\t'<input type=\"hidden\" name=\"rowid\" value=\"'.$this_rowid.'\" />',\r\n\t\t'<input type=\"hidden\" name=\"Itemid\" value=\"'.$Itemid.'\" />',\r\n\t\t'<input type=\"hidden\" name=\"option\" value=\"com_fabrik\" />',\r\n '<input type=\"hidden\" name=\"task\" value=\"'.$task.'\" />',\r\n '<input type=\"hidden\" name=\"isMambot\" value=\"'.$this->isMambot.'\" />',\r\n\t\t'<input type=\"hidden\" name=\"formid\" value=\"'.$model->get('id').'\" />',\r\n\t\t'<input type=\"hidden\" name=\"returntoform\" value=\"0\" />',\r\n\t\t'<input type=\"hidden\" name=\"fabrik_referrer\" value=\"'.$reffer.'\" />',\r\n\t\t'<input type=\"hidden\" name=\"fabrik_ajax\" value=\"'.(int)$model->isAjax().'\" />');\r\n\r\n\t\t$fields[] = '<input type=\"hidden\" name=\"_packageId\" value=\"'.$model->packageId.'\" />';\r\n\r\n\t\t//if ($usekey = JRequest::getVar('usekey')) {\r\n\t\tif ($usekey = FabrikWorker::getMenuOrRequestVar('usekey', '')) {\r\n\r\n\t\t\t// $$$rob v's been set from -1 to the actual row id - so ignore usekyey not sure if we should comment this out\r\n\t\t\t// see http://fabrikar.com/forums/showthread.php?t=10297&page=5\r\n\r\n\t\t\t$fields[] = '<input type=\"hidden\" name=\"usekey\" value=\"'.$usekey.'\" />';\r\n\t\t\t$pk_val = JArrayHelper::getValue($model->_data, FabrikString::safeColNameToArrayKey($listModel->getTable()->db_primary_key));\r\n\t\t\tif (empty($pk_val)) {\r\n\t\t\t\t$fields[] = '<input type=\"hidden\" name=\"usekey_newrecord\" value=\"1\" />';\r\n\t\t\t}\r\n\t\t}\r\n\t\t// $$$ hugh - testing a fix for pagination issue when submitting a 'search form'.\r\n\t\t// If this is a search form, we need to clear 'limitstart', otherwise ... say we\r\n\t\t// were last on page 4 of the (unfiltered) target table, and the search yields less than 4 pages,\r\n\t\t// we end up with a blank table 'cos the wrong LIMIT's are applied to the query\r\n\t\t$save_insessions = $params->get('save_insession', '');\r\n\t\tif (is_array($save_insessions)) {\r\n\t\t\tforeach ($save_insessions as $save_insession) {\r\n\t\t\t\tif ($save_insession == '1') {\r\n\t\t\t\t\t$fields[] = '<input type=\"hidden\" name=\"limitstart\" value=\"0\" />';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$fields[] = JHTML::_('form.token');\r\n\r\n\t\t$form->resetButton = $params->get('reset_button', 0) && $this->editable == \"1\" ?\t'<input type=\"reset\" class=\"button\" name=\"Reset\" value=\"' . $params->get('reset_button_label') . '\" />' : '';\r\n\t\t$form->copyButton = $params->get('copy_button', 0) && $this->editable && $model->_rowId != '' ?\t'<input type=\"submit\" class=\"button\" name=\"Copy\" value=\"'.$params->get('copy_button_label').'\" />' : '';\r\n\t\t$applyButtonType = $model->isAjax() ? 'button' : 'submit';\r\n\t\t$form->applyButton = $params->get('apply_button', 0) && $this->editable ? '<input type=\"'.$applyButtonType.'\" class=\"button\" name=\"apply\" value=\"'.$params->get('apply_button_label').'\" />' : '';\r\n\t\t$form->deleteButton = $params->get('delete_button', 0) && $canDelete && $this->editable && $this_rowid != 0 ? '<input type=\"submit\" value=\"'.$params->get('delete_button_label', 'Delete').'\" class=\"button\" name=\"delete\" />' : '';\r\n\t\t$form->gobackButton = $params->get('goback_button', 0) == \"1\" ?\t'<input type=\"button\" class=\"button\" name=\"Goback\" '.FabrikWorker::goBackAction().' value=\"'.$params->get('goback_button_label').'\" />' : '';\r\n\t\tif ($model->_editable && $params->get('submit_button', 1)) {\r\n\t\t\t$button = $model->isAjax() ? \"button\" : \"submit\";\r\n\t\t\t$submitClass = FabrikString::clean($form->submit_button_label);\r\n\t\t\t$form->submitButton = '<input type=\"'.$button.'\" class=\"button '.$submitClass.'\" name=\"submit\" value=\"'.$form->submit_button_label.'\" />';\r\n\t\t} else {\r\n\t\t\t$form->submitButton = '';\r\n\t\t}\r\n\t\tif ($this->isMultiPage) {\r\n\t\t\t$form->prevButton = '<input type=\"button\" class=\"fabrikPagePrevious button\" name=\"fabrikPagePrevious\" value=\"'.JText::_('COM_FABRIK_PREVIOUS').'\" />';\r\n\t\t\t$form->nextButton = '<input type=\"button\" class=\"fabrikPageNext button\" name=\"fabrikPageNext\" value=\"'.JText::_('COM_FABRIK_NEXT').'\" />';\r\n\t\t} else {\r\n\t\t\t$form->nextButton = '';\r\n\t\t\t$form->prevButton = '';\r\n\t\t}\r\n\t\t$format = $model->isAjax() ? 'raw' : 'html';\r\n\t\t$fields[] = '<input type=\"hidden\" name=\"format\" value=\"'.$format.'\" />';\r\n\r\n\t\t$groups = $model->getGroupsHiarachy();\r\n\t\tforeach ($groups as $groupModel) {\r\n\t\t\t$group = $groupModel->getGroup();\r\n\t\t\t$c = $groupModel->repeatTotal;\r\n\t\t\t//used for validations\r\n\t\t\t$fields[] = '<input type=\"hidden\" name=\"fabrik_repeat_group['.$group->id.']\" value=\"'.$c.'\" id=\"fabrik_repeat_group_'.$group->id.'_counter\" />';\r\n\t\t}\r\n\r\n\t\t$this->_cryptQueryString($aHiddenFields);\r\n\t\t$this->_cryptViewOnlyElements($aHiddenFields);\r\n\t\t$this->hiddenFields = implode(\"\\n\", $fields);\r\n\t}", "public function admin_render()\n {\n $output = $this->admin_form_before();\n $output .= $this->admin_form_start();\n $output .= $this->default_fields();\n $widget_saved_values = $this->get_settings();\n\n $output .= $this->admin_language_tab(); //have to start language tab from here on\n $output .= $this->admin_language_tab_start();\n\n $all_languages = LanguageHelper::all_languages();\n foreach ($all_languages as $key => $lang) {\n $output .= $this->admin_language_tab_content_start([\n 'class' => $key == 0 ? 'tab-pane fade show active' : 'tab-pane fade',\n 'id' => \"nav-home-\" . $lang->slug\n ]);\n $output .= Text::get([\n 'name' => 'title_'.$lang->slug,\n 'label' => __('Title'),\n 'value' => $widget_saved_values['title_' . $lang->slug] ?? null,\n ]);\n $output .= $this->admin_language_tab_content_end();\n }\n\n $output .= $this->admin_language_tab_end(); //have to end language tab\n\n $output .= Repeater::get([\n 'multi_lang' => true,\n 'settings' => $widget_saved_values,\n 'id' => 'contact_page_contact_info_01',\n 'fields' => [\n [\n 'type' => RepeaterField::TEXT,\n 'name' => 'title',\n 'label' => __('Title')\n ],\n [\n 'type' => RepeaterField::TEXTAREA,\n 'name' => 'description',\n 'label' => __('Details'),\n 'info' => __('new line count as a separate text')\n ],\n [\n 'type' => RepeaterField::ICON_PICKER,\n 'name' => 'icon',\n 'label' => __('Icon')\n ]\n ]\n ]);\n $output .= Select::get([\n 'name' => 'custom_form_id',\n 'label' => __('Custom Form'),\n 'placeholder' => __('Select form'),\n 'options' => FormBuilder::all()->pluck('title','id')->toArray(),\n 'value' => $widget_saved_values['custom_form_id'] ?? []\n ]);\n $output .= Slider::get([\n 'name' => 'padding_top',\n 'label' => __('Padding Top'),\n 'value' => $widget_saved_values['padding_top'] ?? 120,\n 'max' => 500,\n ]);\n $output .= Slider::get([\n 'name' => 'padding_bottom',\n 'label' => __('Padding Bottom'),\n 'value' => $widget_saved_values['padding_bottom'] ?? 120,\n 'max' => 500,\n ]);\n $output .= $this->admin_form_submit_button();\n $output .= $this->admin_form_end();\n $output .= $this->admin_form_after();\n\n return $output;\n }", "public function getForm()\n {\n return $this->getLayout()\n ->createBlock('adminhtml/newsletter_template_edit_form')\n ->toHtml();\n }", "function wpgnv_display_form() {\n?>\n\t<div style='display: none;' class='row idea-form-row'>\n\t\t<div class='idea sixteen columns alpha omega border-radius-4 box-shadow-5-light'>\n\t\t\t<form method=\"post\" action=\"\" class='idea-form'>\n\t\t\t\t<h1 class='tk-nimbus-sans-condensed'>Add your own idea!</h1>\n\t\t\t\t<p>First, make sure that none of the ideas already submitted contain your idea. You can just fill out the form below to enter your own idea for a MeetUp topic. These topics will be moderated and then added to the list.</p>\n\t\t\t\t<label for=\"title\">TITLE</label>\n\t\t\t\t<textarea placeholder=\"enter your idea here\" type=\"text\" name=\"post-title\"></textarea>\n\t\t\t\t<?php wp_nonce_field( 'wpgnv_new_idea', 'wpgnv_new_idea' ); ?>\n\t\t\t\t<button type=\"submit\">Submit Your Idea</button>\n\t\t\t</form><!-- end .idea-form -->\n\t\t</div><!-- end .sixteen -->\n\t</div>\n<?php\n}", "private function addEditFormAfterContent() {\n\t\t// this div is opened when encapsulating the default editor in addEditFormBeforeContent.\n\t\treturn '</div><div style=\"clear: both\"></div>';\n\t}", "public function edit_form_after_title() {\n\t\twp_nonce_field( 'papi_save_data', 'papi_meta_nonce' );\n\n\t\tif ( $value = esc_attr( papi_get_entry_type_id() ) ) {\n\t\t\tpapi_render_html_tag( 'input', [\n\t\t\t\t'data-papi-page-type-key' => true,\n\t\t\t\t'name' => esc_attr( papi_get_page_type_key() ),\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'value' => $value\n\t\t\t] );\n\t\t}\n\t}", "public function build_menu_page() {\n\n\t\t\t$tabindex = 0;\n\t\t\t$temp = array();\n\t\t\t$hidden = array();\n\t\t\t$this->data = get_option($this->slug.'_fields');\n\t\t\t\n\t\t\t$output = '';\n\t\t\t$output .= '<!-- wrap starts -->'.\"\\n\";\n\t\t\t$output .= \"\\t\".'<div class=\"wrap\">'.\"\\n\";\n\n\t\t\t$output .= '<h1>'.$this->options['title'].'</h1>'.\"\\n\";\n\n\t\t\t$output .= \"\\t\".'<form method=\"post\" action=\"'.$_SERVER['REQUEST_URI'].'\" enctype=\"multipart/form-data\">'.\"\\n\\n\";\n\n\t\t\tforeach ($this->data as $section => $fields) {\n\n\t\t\t\t$output .= \"\\t\".'<h2 class=\"title\" id=\"'.sanitize_title($section).'\">'.$section.'</h2>'.\"\\n\\n\";\n\n\t\t\t\t$output .= \"\\t\".'<table class=\"form-table theme-form-table\">'.\"\\n\";\n\t\t\t\t$output .= \"\\t\".'<tbody>'.\"\\n\";\n\n\t\t\t\tforeach ($fields as $id => $field) {\n\n\t\t\t\t\tif ($field['type'] != 'hidden') {\n\n\t\t\t\t\t\t$tabindex += 1;\n\t\t\t\t\t\t$temp += array($field['label'] => isset($field['value']) ? $field['value'] : '');\n\t\t\t\t\t\t$value = isset($_POST['updating']) ? Save::save_page($this->slug, $field) : Save::set_default_value($this->slug, $temp, $field);\n\n\t\t\t\t\t\t$description = (isset($field['description']) && !empty($field['description'])) ? '<span class=\"description\" id=\"'.Field::get_label_name($field['label']).'-info\">'.$field['description'].'</span>' : '';\n\t\t\t\t\t\t$toggle = (isset($field['description']) && !empty($field['description'])) ? '<a class=\"toggle\" data-toggle=\"form-description\" data-target=\"'.Field::get_label_name($field['label']).'-info\" title=\"'.__('Show info.', 'admin translation').'\">'.__('[+] Info', 'admin translation').'</a>' : '';\n\n\t\t\t\t\t\t$output .= \"\\t\".'<tr valign=\"top\">'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<th class=\"scope-one\" scope=\"row\"><label'.Field::get_label_error($field['label']).' for=\"'.Field::get_label_name($field['label']).'\">'.$field['name'].' <cite></cite></label></th>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<td class=\"scope-two\">'.Field::get_field($this->slug, $field, $value).'<div class=\"field-info\">'.$description.'</div></td>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<td class=\"scope-three\">'.$toggle.'</td>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<td>&nbsp;</td>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'</tr>'.\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\tarray_push($hidden, $field);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$output .= \"\\t\".'</tbody>'.\"\\n\";\n\t\t\t\t$output .= \"\\t\".'</table>'.\"\\n\\n\";\n\t\t\t\t$output .= \"\\t\".'<hr />'.\"\\n\\n\";\n\t\t\t}\n\n\t\t\t$output .= isset($_REQUEST['page']) ? \"\\t\".wp_nonce_field($_REQUEST['page']).\"\\n\" : '';\n\n\t\t\tforeach ($hidden as $id => $field) {\n\n\t\t\t\t$temp += array($field['label'] => isset($field['value']) ? $field['value'] : '');\n\t\t\t\t$value = isset($_POST['updating']) ? Save::save_page($this->slug, $field) : Save::set_default_value($this->slug, $temp, $field);\n\t\t\t\t\n\t\t\t\t$output .= Field::get_field($this->slug, $field, $value);\n\t\t\t}\n\t\t\t\n\t\t\t$output .= \"\\t\".'<input type=\"hidden\" id=\"updating\" name=\"updating\" value=\"1\" />'.\"\\n\";\n\t\t\t$output .= \"\\t\".'<p class=\"submit\"><input type=\"submit\" name=\"submit\" id=\"submit\" class=\"button button-primary\" value=\"'.__('Save Changes', 'admin translation').'\" /></p>'.\"\\n\";\n\t\t\t$output .= \"\\t\".'</form>'.\"\\n\";\n\n\t\t\t$output .= \"\\t\".'</div>'.\"\\n\";\n\t\t\t$output .= '<!-- wrap ends -->'.\"\\n\\n\";\n\n\t\t\t$output .= Field::get_form_feedback();\n\t\t\t\n\t\t\tValidation::reset_error();\n\n\t\t\techo $output;\n\t\t}", "protected function createComponentEditForm() {\r\n\t\t$form = new Form;\r\n\t\t$form->getElementPrototype()->class(\"formWide\");\r\n\t\t$options = array(0 => \"Default\", 1 => \"Odkaz na obsah\", 3 => \"Odkaz na položku menu\");\r\n\t\t// easy way how to create url slug\r\n\t\t$form->addText(\"title\", \"Název:\")\r\n\t\t\t\t->setAttribute('onchange', '\r\n\t\t\t\t\t\t\tvar nodiac = { \"á\": \"a\", \"č\": \"c\", \"ď\": \"d\", \"é\": \"e\", \"ě\": \"e\", \"í\": \"i\", \"ň\": \"n\", \"ó\": \"o\", \"ř\": \"r\", \"š\": \"s\", \"ť\": \"t\", \"ú\": \"u\", \"ů\": \"u\", \"ý\": \"y\", \"ž\": \"z\" };\r\n\t\t\t\t\t\t\ts = $(\"#frmeditForm-title\").val().toLowerCase();\r\n\t\t\t\t\t\t\tvar s2 = \"\";\r\n\t\t\t\t\t\t\tfor (var i=0; i < s.length; i++) {\r\n\t\t\t\t\t\t\t\ts2 += (typeof nodiac[s.charAt(i)] != \"undefined\" ? nodiac[s.charAt(i)] : s.charAt(i));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresult=s2.replace(/[^a-z0-9_]+/g, \"-\").replace(/^-|-$/g, \"\");\r\n\t\t\t\t\t\t\t$(\"#frmeditForm-url\").val(result);\r\n\t\t\t\t\t\t');\r\n\t\t$form->addText(\"url\", \"url:\")->setAttribute(\"readonly\", \"readonly\");\r\n\t\tif (!$this->onlyTree) {\r\n\t\t\t$form->addSelect(\"target_type\", \"Cíl:\", $options);\r\n\t\t\t$content = $this->prepareContentSelectBox();\r\n\t\t\t$menuContent = $this->prepareMenuContentSelectBox();\r\n\t\t\t$form->addSelect(\"target_id\", \"Odkazovaný obsah:\", $content)->setPrompt(\"Pouze při zvolení výše\");\r\n\t\t\t$form->addSelect(\"target_menu\", \"Odk. položka menu:\", $menuContent)->setPrompt(\"Pouze při zvolení výše\");\r\n\t\t}\r\n\t\t$form->addHidden(\"parent_id\", $this->parent_id);\r\n\t\t$form->addHidden(\"edit_id\", $this->edit_id);\r\n\t\t//filling form\r\n\t\tif ($this->edit_id or $this->edit_id === \"0\") {\r\n\t\t\t$defFromDb = $this->closureModel->getItemById($this->edit_id);\r\n\t\t\t$defaults = new \\Nette\\ArrayHash;\r\n\t\t\tforeach ($defFromDb as $key => $value) {\r\n\t\t\t\t$defaults->$key = $value;\r\n\t\t\t}\r\n\t\t\tif ($this->edit_id === \"0\") {\r\n\t\t\t\t$form[\"title\"]->setDisabled();\r\n\t\t\t}\r\n\t\t\tif (!$this->onlyTree) {\r\n\t\t\t\t$t = $defaults->target;\r\n\t\t\t\tif (!Validators::isNumericInt($t)) {\r\n\t\t\t\t\t$menuItem = $this->checkTargetMenuItemExists($t);\r\n\t\t\t\t\tif ($menuItem) {\r\n\t\t\t\t\t\t$defaults->target_type = 3;\r\n\t\t\t\t\t\t$defaults->target_menu = $menuItem;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$contentId = $this->checkTargetContentExists($t);\r\n\t\t\t\t\t\t$defaults->target_type = 1;\r\n\t\t\t\t\t\t$defaults->target_id = $contentId;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$form[\"target_menu\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t} elseif ($t <= 0) {\r\n\t\t\t\t\t$defaults->target_type = 0;\r\n\t\t\t\t\t$form[\"target_menu\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t\t$form[\"target_id\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$defaults->target = null;\r\n\t\t\t$form->setDefaults($defaults);\r\n\t\t}\r\n\r\n\t\t$form->addSubmit('save', 'Save')\r\n\t\t\t\t\t\t->setAttribute('onclick', '$(\"#frmeditForm-title\").trigger(\"change\")')\r\n\t\t\t\t->onClick[] = callback($this, 'editFormSubmitted');\r\n\t\t$form->setRenderer(new \\Kdyby\\BootstrapFormRenderer\\BootstrapRenderer());\r\n\t\treturn $form;\r\n\t}", "function edit_form_after_title()\n {\n }", "function edit_form_after_title()\n {\n }", "function create_form(){\n\t\n\t$table =\"<html>\";\n\t$table.=\"<head>\";\n\t$table.=\"\t<title>New Article Entry Page</title>\";\n\t$table.=\"</head>\";\n\t\n\t// URL for the wordpress post handling page\n\t$link_admin_post = admin_url('admin-post.php');\n\t$table.=\"<form name = 'myform' method=\\\"POST\\\" action='\" . $link_admin_post . \"' id = \\\"form1\\\">\";\n\n\t// Input for Faculty member\n\t$table.= \"\t<br>\";\n\t$table.= \" <div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Tag\\\">Faculty Member/Tag: </label></p>\";\n\t$list_of_names = wp_post_tag_names();\n\t$table.=\"\t<select name=\\\"Tag\\\">\" . $list_of_names . \"</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for PMID\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"PMID\\\">PMID*: </label></p>\";\n\t$table.=\"\t<input type=\\\"number\\\" name=\\\"PMID\\\" id=\\\"PMID\\\" required>\";\n\t\n\t//autofill button\n\t$table.=' <a class=\"pmid\" data-test=\"hi\"><button id=\"autofill_btn\" type=\"button\" >Auto-Fill</button></a>';\n\t$table.=\"\t</div>\";\n\t\t\n\t// Input for Journal Issue\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label style=\\\"width: 200px;\\\" for=\\\"Journal_Issue\\\">Journal Issue: </label></p>\";\n\t$table.=\"\t<input id = 'issue' type=\\\"number\\\" name=\\\"Journal_Issue\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Volume\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Volume\\\">Journal Volume: </label></p>\";\n\t$table.=\"\t<input id = 'journal_volume' type=\\\"number\\\" name=\\\"Journal_Volume\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Title\\\">Journal Title: </label></p>\";\n\t$table.=\"\t<input id = 'journal_title' type=\\\"text\\\" name=\\\"Journal_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Year\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Year\\\">Journal Year: </label></p>\";\n\t$table.=\"\t<input id = 'year' value=\\\"2000\\\" type=\\\"number\\\" name=\\\"Journal_Year\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Month\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Month\\\">Journal Month: </label></p>\";\n\t$table.=\"\t<select id='journal_month' name=\\\"Journal Month\\\">\";\n\t$table.=\"\t\t<option value=\\\"01\\\">Jan</option>\";\n\t$table.=\"\t\t<option value=\\\"02\\\">Feb</option>\";\n\t$table.=\"\t\t<option value=\\\"03\\\">Mar</option>\";\n\t$table.=\"\t\t<option value=\\\"04\\\">Apr</option>\";\n\t$table.=\"\t\t<option value=\\\"05\\\">May</option>\";\n\t$table.=\"\t\t<option value=\\\"06\\\">Jun</option>\";\n\t$table.=\"\t\t<option value=\\\"07\\\">Jul</option>\";\n\t$table.=\"\t\t<option value=\\\"08\\\">Aug</option>\";\n\t$table.=\"\t\t<option value=\\\"09\\\">Sep</option>\";\n\t$table.=\"\t\t<option value=\\\"10\\\">Oct</option>\";\n\t$table.=\"\t\t<option value=\\\"11\\\">Nov</option>\";\n\t$table.=\"\t\t<option value=\\\"12\\\">Dec</option>\";\n\t$table.=\"\t</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Day\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Day\\\">Journal Day: </label></p>\";\n\t$table.=\"\t<input id = 'journal_day' type=\\\"text\\\" name=\\\"Journal_Day\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Date\\\">Journal Date: </label></p>\";\n\t$table.=\"\t<input id = 'journal_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Journal_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Abbreviation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Abbreviation\\\">Journal Abbreviation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_ab' type=\\\"text\\\" name=\\\"Journal_Abbreviation\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Journal Citation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Citation\\\">Journal Citation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_citation' type=\\\"text\\\" name=\\\"Journal_Citation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Title\\\">Article Title: </label></p>\";\n\t$table.=\"\t<input id=\\\"article_title\\\" type=\\\"text\\\" name=\\\"Article_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for article abstract\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Abstract\\\">Article Abstract: </label></p>\";\n\t$table.=\" <textarea id='abstract' rows = '4' cols = '60' name=\\\"Article_Abstract\\\"></textarea>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article URL\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_URL\\\">Article URL: </label></p>\";\n\t$table.=\"\t<input id = 'article_url' type=\\\"text\\\" name=\\\"Article_URL\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Pagination\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Pagination\\\">Article Pagination: </label></p>\";\n\t$table.=\"\t<input id='pages' type=\\\"text\\\" name=\\\"Article_Pagination\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Date\\\">Article Date: </label></p>\";\n\t$table.=\"\t<input id='article_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Article_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Authors\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Authors\\\">Article Authors: </label></p>\";\n\t$table.=\"\t<input id='article_authors' type=\\\"text\\\" name=\\\"Article_Authors\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Affiliations\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Affiliation\\\">Article Affiliation: </label></p>\";\n\t$table.=\"\t<input id = 'article_affiliation' type=\\\"text\\\" name=\\\"Article_Affiliation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Created\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Created\\\">Date Created: </label></p>\";\n\t$table.=\"\t<input id='date_created' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Created\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Completed\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Completed\\\">Date Completed: </label></p>\";\n\t$table.=\"\t<input id='date_completed' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Completed\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Date Revised\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Revised\\\">Date Revised: </label></p>\";\n\t$table.=\"\t<input id='date_revised' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Revised\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Hidden input (for specifying hook)\n\t$table.=\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"new_article_form\\\">\";\n\t\n\t// Submit and reset buttons\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div id=\\\"form_btns\\\">\"; \n\t$table.=\"\t<button class=\\\"form_btn\\\"><input type=\\\"reset\\\" value=\\\"Reset!\\\" onclick=\\\"window.location.reload()\\\"></button>\";\n\t$table.=\"\t<input class=\\\"form_btn\\\" type=\\\"submit\\\" value=\\\"Submit\\\">\"; \n\t$table.=\"\t</div>\";\n\t$table.=\"</form>\";\n\n\t// Styling of the form (needs to be put in a seperate stylesheet)\n\t$table.=\"<style type=\\\"text/css\\\">\";\n\t$table.=\"\t#form_btns {\";\n\t$table.=\"\t\tmargin-left: 150px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.form_btn {\";\n\t$table.=\"\t\twidth: 80px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.label {\";\n\t$table.=\"\t\twidth: 150px;\";\n\t$table.=\"\t\tmargin: 0;\";\n\t$table.=\"\t\tfloat: left;\";\n\t$table.=\"\t}\";\n\t$table.=\"\tinput::placeholder {\";\n\t$table.=\"\t\tcolor: #a4a4a4;\";\n\t$table.=\"\t}\";\n\t$table.=\"</style>\";\n\t\n\t$table.=\"<script type='text/javascript' src=\" . plugin_dir_url(__FILE__) . \"js/autofill_ajax.js></script>\";\n\n \techo $table;\n}", "public function onBackForm()\n {\n // Load another page\n AdiantiCoreApplication::loadPage('MultiStepMultiFormView', 'onLoadFromSession');\n }", "function vistaportal_education_form($form, &$form_state) {\n include_once ('vistaportal.fields.inc');\n include_once ('vistaportal_functions.inc');\n drupal_add_library('system', 'drupal.ajax');\n drupal_add_library('system', 'jquery.form');\n //Set this to tree so we can access all dynamic form values\n $form['#tree'] = TRUE;\n $form['#attributes'] = array('enctype' => array(\"multipart/form-data\"));\n $date = date('Y-m-d H:m:s');\n $format = 'Y-m';\n $format1 = 'Y-m-d';\n //This is the pre-med education form\n $form['premed'] = array(\n '#type' => 'fieldset',\n '#title' => t('PRE-MEDICAL EDUCATION (OPTIONAL)'),\n '#collapsible' => FALSE,\n '#prefix' => '<div id=\"premed-fieldset-wrapper\">',\n '#suffix' => '</div>',\n );\n\n //This counter will be used to determine how many premed sections to add\n if (empty($form_state['p_num_schools'])) {\n $form_state['p_num_schools'] = 1;\n }\n\n for ($i = 0; $i < $form_state['p_num_schools']; $i++) {\n if ($i > 0) {\n $form['premed'][$i]['title-txt' . $i]['#prefix'] = '<div class=\"line-solid\"></div><h2> Pre-Medical Education ' . ($i + 1) . '</h2><br/>';\n }\n $form['premed'][$i]['school' . $i] = textfield('School of Graduation');\n $form['premed'][$i]['school' . $i]['#maxlength'] = 40;\n $form['premed'][$i]['school' . $i]['#prefix'] = '<div class = \"premed-school\">';\n $form['premed'][$i]['school' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['school' . $i]['#required'] = FALSE;\n $form['premed'][$i]['country' . $i] = country('Country');\n $form['premed'][$i]['country' . $i]['#prefix'] = '<div class = \"premed-country\">';\n $form['premed'][$i]['country' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['country' . $i]['#required'] = FALSE;\n $form['premed'][$i]['state' . $i] = state('State');\n $form['premed'][$i]['state' . $i]['#prefix'] = '<div class = \"premed-state\">';\n $form['premed'][$i]['state' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['state' . $i]['#required'] = FALSE;\n $form['premed'][$i]['city' . $i] = textfield('City');\n $form['premed'][$i]['city' . $i]['#maxlength'] = 20;\n $form['premed'][$i]['city' . $i]['#required'] = FALSE;\n $form['premed'][$i]['city' . $i]['#prefix'] = '<div class = \"premed-city\">';\n $form['premed'][$i]['city' . $i]['#suffix'] = '</div>';\n //This is the date\n $form['premed'][$i]['date' . $i] = array(\n '#prefix' => '<div class=\"premed-date\">',\n '#markup' => 'Dates Attended',\n '#suffix' => '</div>',\n );\n $form['premed'][$i]['date_from' . $i] = date_my('From');\n $form['premed'][$i]['date_from' . $i]['#required'] = FALSE;\n $form['premed'][$i]['date_from' . $i]['#prefix'] = '<div class = \"premed-date-from\">';\n $form['premed'][$i]['date_from' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['date_to' . $i] = date_my('To');\n $form['premed'][$i]['date_to' . $i]['#required'] = FALSE;\n $form['premed'][$i]['date_to' . $i]['#prefix'] = '<div class = \"premed-date-to\">';\n $form['premed'][$i]['date_to' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['degree' . $i] = edu('Degree');\n $form['premed'][$i]['degree' . $i]['#required'] = FALSE;\n $form['premed'][$i]['degree' . $i]['#prefix'] = '<div class = \"premed-degree\">';\n $form['premed'][$i]['degree' . $i]['#suffix'] = '</div>';\n }\n\n //Only allow 3 schools for the premed form\n if ($form_state['p_num_schools'] < 3) {\n $form['premed']['add_another'] = array(\n //'#prefix' => '<div class=\"edu-btn\">',\n '#type' => 'submit',\n '#value' => t('+ Add Pre-Medical Institution'),\n '#submit' => array('vistaportal_form_premed_add'),\n '#limit_validation_errors' => array(),\n '#ajax' => array(\n 'callback' => 'vistaportal_premed_form_add_school_callback',\n 'wrapper' => 'premed-fieldset-wrapper',\n 'method' => 'replaceWith',\n 'speed' => 'fast',\n ),\n );\n }\n\n //First school is mandatory\n if ($form_state['p_num_schools'] > 1) {\n $form['premed']['remove_school'] = array(\n '#type' => 'submit',\n '#value' => t('- Remove Pre-medical Institution'),\n '#submit' => array('vistaportal_form_premed_remove'),\n '#limit_validation_errors' => array(),\n '#ajax' => array(\n 'callback' => 'vistaportal_premed_form_add_school_callback',\n 'wrapper' => 'premed-fieldset-wrapper',\n ),\n );\n }\n\n //This is the line separator\n $form['p']['line3'] = array(\n '#prefix' => '<div class=\"line-solid\">',\n //'#markup' => '<hr>',\n '#attributes' => array('class' => array('line-solid')),\n '#suffix' => '</div>',\n );\n\n //This is the medical school form\n $form['med'] = array(\n '#type' => 'fieldset',\n '#title' => t('MEDICAL EDUCATION'),\n '#collapsible' => FALSE,\n '#prefix' => '<div id=\"med-fieldset-wrapper\">',\n '#suffix' => '</div>',\n );\n\n //This counter will be used to determine how many medical school sections to add\n if (empty($form_state['m_num_schools'])) {\n $form_state['m_num_schools'] = 1;\n }\n\n for ($i = 0; $i < $form_state['m_num_schools']; $i++) {\n if ($i > 0) {\n $form['med'][$i]['title-txt' . $i]['#prefix'] = '<div class=\"line-solid2\"></div><h2> Medical Education ' . ($i + 1) . '</h2><br/>';\n }\n $form['med'][$i]['school' . $i] = textfield('School of Graduation');\n $form['med'][$i]['school' . $i]['#maxlength'] = 40;\n $form['med'][$i]['school' . $i]['#prefix'] = '<div class = \"med-school\">';\n $form['med'][$i]['school' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['country' . $i] = country('Country');\n $form['med'][$i]['country' . $i]['#prefix'] = '<div class = \"med-country\">';\n $form['med'][$i]['country' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['state' . $i] = state('State');\n $form['med'][$i]['state' . $i]['#prefix'] = '<div class = \"med-state\">';\n $form['med'][$i]['state' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['city' . $i] = textfield('City');\n $form['med'][$i]['city' . $i]['#maxlength'] = 20;\n $form['med'][$i]['city' . $i]['#prefix'] = '<div class = \"med-city\">';\n $form['med'][$i]['city' . $i]['#suffix'] = '</div>';\n\n //This is the date\n $form['med'][$i]['date' . $i] = array(\n '#prefix' => '<div class=\"med-date\">',\n '#markup' => 'Dates Attended',\n '#suffix' => '</div>',\n );\n $form['med'][$i]['date_from' . $i] = date_my('From');\n $form['med'][$i]['date_from' . $i]['#prefix'] = '<div class = \"med-date-from\">';\n $form['med'][$i]['date_from' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['date_to' . $i] = date_my('To');\n $form['med'][$i]['date_to' . $i]['#prefix'] = '<div class = \"med-date-to\">';\n $form['med'][$i]['date_to' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['degree' . $i] = edu('Degree');\n $form['med'][$i]['degree' . $i]['#prefix'] = '<div class = \"med-degree\">';\n $form['med'][$i]['degree' . $i]['#suffix'] = '</div>';\n /* $form['med'][$i]['ecfmg' . $i] = textfield('ECFMG CERTIFICATE #');\n $form['med'][$i]['ecfmg' . $i]['#maxlength'] = 20;\n $form['med'][$i]['ecfmg' . $i]['#attributes'] = array('class' => array('textfield-license'));\n $form['med'][$i]['ecfmg' . $i]['#prefix'] = '<div class = \"med-ecfmg\">';\n $form['med'][$i]['ecfmg' . $i]['#suffix'] = '</div>';*/\n\n //added fields\n $form['med'][$i]['valid' . $i] = array(\n '#prefix' => '<div class=\"var_label\">',\n '#markup' => t('Valid Indefinitely'),\n '#required' => TRUE,\n '#suffix' => '</div>',\n );\n $form['med'][$i]['valid-indef' . $i] = radios_yesno();\n $form['med'][$i]['valid-indef' . $i]['#prefix'] = '<div class = \"med-yes-no\">';\n $form['med'][$i]['valid-indef' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['exp_date' . $i] = date_my('If no, state expiration date');\n $form['med'][$i]['exp_date' . $i]['#prefix'] = '<div class = \"med-exp-date\">';\n $form['med'][$i]['exp_date' . $i]['#suffix'] = '</div>';\n\n }\n\n //Only allow 3 schools for the med form\n if ($form_state['m_num_schools'] < 3) {\n $form['med']['add_another'] = array(\n '#type' => 'submit',\n '#value' => t('+ Add Medical Institution'),\n '#submit' => array('vistaportal_form_med_add'),\n '#limit_validation_errors' => array(),\n '#ajax' => array(\n 'callback' => 'vistaportal_med_form_add_school_callback',\n 'wrapper' => 'med-fieldset-wrapper',\n 'method' => 'replaceWith',\n ),\n );\n }\n\n //First school is mandatory\n if ($form_state['m_num_schools'] > 1) {\n $form['med']['remove_school'] = array(\n '#type' => 'submit',\n '#value' => t('- Remove Medical Institution'),\n '#submit' => array('vistaportal_form_med_remove'),\n '#limit_validation_errors' => array(),\n '#ajax' => array(\n 'callback' => 'vistaportal_med_form_add_school_callback',\n 'wrapper' => 'med-fieldset-wrapper',\n ),\n );\n }\n\n //this is a line at the bottom\n $form['last']['line'] = array(\n '#prefix' => '<div class=\"line_left\">',\n //'#markup' => '<hr>',\n '#suffix' => '</div>',\n );\n\n $form['last']['required_field'] = array(\n '#prefix' => '<div class=\"required_field2\">',\n '#markup' => 'Required Field',\n '#required' => TRUE,\n '#suffix' => '</div>',\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit'),\n '#name' => 'next',\n '#submit' => array('vistaportal_education_form_submit'),\n '#attributes' => array('class' => array('education-submit')),\n );\n\t\t\n\t\t$form['next'] = array(\n '#type' => 'submit',\n '#value' => t('Next'),\n '#limit_validation_errors' => array(),\n '#attributes' => array('class' => array('button')),\n '#submit' => array('vistaportal_next'),\n );\n\t\t$form['next']['#attributes'] = array('class' => array('next'));\n\t\t\n $form['save_logout'] = array(\n '#type' => 'submit',\n '#value' => t('Save & Logout'),\n '#limit_validation_errors' => array(),\n '#attributes' => array('class' => array('button')),\n '#submit' => array('vistaportal_save_logout'),\n );\n\n $form['prev'] = array(\n '#type' => 'submit',\n '#value' => t('Previous'),\n '#limit_validation_errors' => array(),\n '#attributes' => array('class' => array('button prev')),\n '#submit' => array('vistaportal_education_previous'),\n );\n\n $form['prev']['#attributes'] = array('class' => array('prev'));\n\n $form['#after_build'][] = 'vistaportal_education_form_afterbuild';\n return $form;\n }", "function plugin_options_form() {\n?>\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"save_metaboxes_general\" />\n<?php\n\t\t settings_fields( 'subpages_as_tabs_options' );\n\t\t do_settings_sections( 'subpage_tabs_plugin' );\n?>\n\n\t\t <input name=\"Submit\" type=\"submit\" value=\"<?php esc_attr_e( 'Save Changes' ); ?>\" />\n<?php\n\t\t}", "public function form( $instance ) {\n\n\t\t$title \t\t\t\t = ( isset( $instance['title'] ) ) ? $instance['title'] : __( 'New title', 'idaho-webmaster' );\n\t\t$title_link\t\t = ( isset( $instance['title_link'] ) ) ? $instance['title_link'] : '';\n\t\t$nav_menu \t\t = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';\n\t\t$sub_menu \t\t = isset( $instance['sub_menu'] ) ? $instance['sub_menu'] : '';\n\t\t$include_links = isset( $instance['include_links'] ) ? $instance['include_links'] : '';\n\t\t$get_nav_menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) );\n\n\t\t/** Admin Form */\n\t\t?>\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_html( $this->get_field_id( 'title' ) ); ?>\"><?php echo esc_html__( 'Title:', 'idaho-webmaster' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo esc_html( $this->get_field_id( 'title' ) ); ?>\" name=\"<?php echo esc_html( $this->get_field_name( 'title' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" />\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_html( $this->get_field_id( 'title_link' ) ); ?>\"><?php echo esc_html__( 'Title Link:', 'idaho-webmaster' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo esc_html( $this->get_field_id( 'title_link' ) ); ?>\" name=\"<?php echo esc_html( $this->get_field_name( 'title_link' ) ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title_link ); ?>\" />\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_html( $this->get_field_id( 'nav_menu' ) ); ?>\"><?php echo esc_html_e( 'Select Menu:', 'idaho-webmaster' ); ?></label>\n\t\t\t<select id=\"<?php echo esc_html( $this->get_field_id( 'nav_menu' ) ); ?>\" name=\"<?php echo esc_html( $this->get_field_name( 'nav_menu' ) ); ?>\">\n\n\t\t\t<?php\n\t\t\tforeach ( $get_nav_menus as $menu ) {\n\t\t\t\techo '<option value=\"' . esc_attr( $menu->term_id ) . '\"' . selected( $nav_menu, $menu->term_id, false ) . '>'. esc_attr( $menu->name ) . '</option>';\n\t\t\t}\n\t\t\t?>\n\t </select>\n\t </p>\n\t <p>\n\t\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'sub_menu' ) ); ?>\"><?php esc_html_e( 'Sub Menu:', 'idaho-webmaster' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'sub_menu' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'sub_menu' ) ); ?>\" type=\"checkbox\" <?php checked( $sub_menu, 'on' ); ?> />\n\t </p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_attr( $this->get_field_id( 'include_links' ) ); ?>\"><?php esc_html_e( 'Include Security &amp; Privacy:', 'idaho-webmaster' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo esc_attr( $this->get_field_id( 'include_links' ) ); ?>\" name=\"<?php echo esc_attr( $this->get_field_name( 'include_links' ) ); ?>\" type=\"checkbox\" <?php checked( $include_links, 'on' ); ?> />\n\t </p>\n\t\t<?php\n\t}", "function recommends_req_wizard_schools_info($form, &$form_state) {\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['schreq'] = array(\n '#type' => 'fieldset',\n '#title' => variable_get('recommends_req_student_professor'),\n );\n $form['schreq']['description'] = array(\n '#type' => 'item',\n '#title' => t('Enter each school which is to receive the recommendation.'),\n );\n\n if (empty($form_state['num_schools'])) {\n $form_state['num_schools'] = 1;\n }\n\n // Build the number of name fieldsets indicated by $form_state['num_schools']\n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n $form['schname'][$i] = array(\n '#type' => 'fieldset',\n '#title' => t('School #@num', array('@num' => $i)),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n\n $form['schname'][$i]['schoolname'] = array(\n '#type' => 'textfield',\n '#title' => t('School/Business'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['schoolname']) ? $form_state['values']['schoolname'] : '',\n\n );\n $form['schname'][$i]['schoolprogram'] = array(\n '#type' => 'textfield',\n '#title' => t('School Program/Position'),\n '#size' => 25,\n '#maxlength' => 50,\n '#description' => '<br/><b>Note: </b>If you have any special forms required by the school, email hard copy to <br/>via the \"Email Professor\" link or mail a soft copy to the professor. ',\n '#default_value' => !empty($form_state['values']['schoolname']) ? $form_state['values']['schoolname'] : '',\n\n );\n \n // School contact information.\n $form['schname'][$i]['school_contact_info'] = array(\n '#type' => 'checkboxes',\n '#options' => drupal_map_assoc(array(t('Contact Email'), t('Contact Postal Address'))),\n '#title' => t('School contact information, if known'),\n // This #states rule says that this checkboxes array will be visible only\n // when $form['student_type'] is set to t('High School').\n // It uses the jQuery selector :input[name=student_type] to choose the\n // element which triggers the behavior, and then defines the \"High School\"\n // value as the one that triggers visibility.\n\n \n );\n\n $form['schname'][$i]['school_contact_email'] = array(\n '#type' => 'textfield',\n '#title' => t('School email:'),\n '#size' => 25,\n\n // This #states rule limits visibility to when the $form['tests_taken']\n // 'school_contact_email' checkbox is checked.\"\n '#states' => array(\n 'visible' => array( // action to take.\n ':input[name=\"schname[' . $i . '][school_contact_info][Contact Email]\"]' => array('checked' => TRUE),\n ),\n ),\n );\n $form['schname'][$i]['school_contact_postal'] = array(\n '#type' => 'textarea',\n '#title' => t('Contact Postal address:'),\n '#size' => 4,\n\n // Set this element visible if the postal checkbox above is checked.\n '#states' => array(\n 'visible' => array( // action to take.\n ':input[name=\"schname[' . $i . '][school_contact_info][Contact Postal Address]\"]' => array('checked' => TRUE),\n ),\n ),\n );\n \n $form['schname'][$i]['r_date_due'] = array(\n '#type' => 'date',\n '#title' => t('Last Date due'),\n '#required' => TRUE,\n '#size' => 10,\n \n );\n \n }\n\n // Adds \"Add another school\" button\n $form['add_school'] = array(\n '#type' => 'submit',\n '#value' => t('Add another school'),\n '#submit' => array('recommends_req_schtut_9_add_school'),\n );\n\n // If we have more than one school, this button allows removal of the\n // last name.\n if ($form_state['num_schools'] > 1) {\n $form['remove_school'] = array(\n '#type' => 'submit',\n '#value' => t('Remove latest school'),\n '#submit' => array('recommends_req_schtut_9_remove_school'),\n // Since we are removing a name, don't validate until later.\n '#limit_validation_errors' => array(),\n );\n }\n\n return $form;\n}", "function to_accordion_tab($form)\n {\n return $this->object->render_partial('photocrati-nextgen_admin#accordion_tab', array('id' => $form->get_id(), 'title' => $form->get_title(), 'content' => $form->render(TRUE)), TRUE);\n }", "public function settings_page()\n {\n\n // Build page HTML\n $html = '<div class=\"wrap\" id=\"' . $this->parent->_token . '_settings\">' . \"\\n\";\n $html .= '<h2>' . __('SUAPI Settings', 'wp-suapi') . '</h2>' . \"\\n\";\n\n $tab = '';\n if (isset($_GET['tab']) && $_GET['tab']) {\n $tab .= $_GET['tab'];\n }\n\n // Show page tabs\n if (is_array($this->settings) && 1 < count($this->settings)) {\n\n $html .= '<h2 class=\"nav-tab-wrapper\">' . \"\\n\";\n\n $c = 0;\n foreach ($this->settings as $section => $data) {\n\n // Set tab class\n $class = 'nav-tab';\n if (!isset($_GET['tab'])) {\n if (0 == $c) {\n $class .= ' nav-tab-active';\n }\n } else {\n if (isset($_GET['tab']) && $section == $_GET['tab']) {\n $class .= ' nav-tab-active';\n }\n }\n\n // Set tab link\n $tab_link = add_query_arg(array('tab' => $section));\n if (isset($_GET['settings-updated'])) {\n $tab_link = remove_query_arg('settings-updated', $tab_link);\n }\n\n // Output tab\n $html .= '<a href=\"' . $tab_link . '\" class=\"' . esc_attr($class) . '\">' . esc_html($data['title']) . '</a>' . \"\\n\";\n\n ++$c;\n }\n\n $html .= '</h2>' . \"\\n\";\n }\n\n $html .= '<form method=\"post\" action=\"options.php\" enctype=\"multipart/form-data\">' . \"\\n\";\n\n // Get settings fields\n ob_start();\n settings_fields($this->parent->_token . '_settings');\n do_settings_sections($this->parent->_token . '_settings');\n $html .= ob_get_clean();\n\n $html .= '<p class=\"submit\">' . \"\\n\";\n $html .= '<input type=\"hidden\" name=\"tab\" value=\"' . esc_attr($tab) . '\" />' . \"\\n\";\n $html .= '<input name=\"Submit\" type=\"submit\" class=\"button-primary\" value=\"' . esc_attr(__('Save Settings', 'wp-suapi')) . '\" />' . \"\\n\";\n $html .= '</p>' . \"\\n\";\n $html .= '</form>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n\n echo $html;\n }", "function getForm($form, &$form_state, $disabled, $myvalues)\n {\n $form[\"data_entry_area1\"] = array(\n '#prefix' => \"\\n<section class='protocollib-admin raptor-dialog-table'>\\n\",\n '#suffix' => \"\\n</section>\\n\",\n );\n $form[\"data_entry_area1\"]['table_container'] = array(\n '#type' => 'item', \n '#prefix' => '<div class=\"raptor-dialog-table-container\">',\n '#suffix' => '</div>', \n '#tree' => TRUE,\n );\n\n \n $oDD = new \\raptor\\DashboardData($this->m_oContext);\n $oPSD = new \\raptor\\ProtocolSupportingData($this->m_oContext);\n $radiology_reports_detail = $oPSD->getRadiologyReportsDetail();\n $raptor_protocoldashboard = $oDD->getDashboardDetails();\n \n $patientDFN=$raptor_protocoldashboard['PatientID'];\n $patientICN=$raptor_protocoldashboard['mpiPid'];\n \n $rows = '';\n foreach($radiology_reports_detail as $data_row) \n {\n $reportID=$data_row['ReportID'];\n $caseNumber=$data_row['CaseNumber']; \n $rows .= \"\\n\".'<tr>'\n . '<td>'.$data_row[\"Title\"].'</td>'\n . '<td>'.$data_row[\"ReportedDate\"].'</td>'\n . '<td><a href=\"#\" class=\"raptor-details\">'.$data_row[\"Snippet\"].'</a>'.GetRadiologyReportsTab::raptor_print_details($data_row[\"Details\"]).'</td>'\n . '<td>'.GetRadiologyReportsTab::getImageInfoAsHTML($this->m_oContext, $patientDFN, $patientICN, $reportID, $caseNumber).'</td>'\n . '</tr>';\n }\n \n $form[\"data_entry_area1\"]['table_container']['reports'] = array('#type' => 'item',\n '#markup' => '<table id=\"my-raptor-dialog-table\" class=\"dataTable\">'\n . '<thead>'\n . '<tr>'\n . '<th>Title</th>'\n . '<th>Date</th>'\n . '<th>Details</th>'\n . '<th>Existing Images</th>'\n . '</tr>'\n . '</thead>'\n . '<tbody>'\n . $rows\n . '</tbody>'\n . '</table>');\n \n return $form;\n }", "function getForm($form, &$form_state, $disabled, $myvalues)\n {\n $form[\"data_entry_area1\"] = array(\n '#prefix' => \"\\n<section class='protocollib-admin raptor-dialog-table'>\\n\",\n '#suffix' => \"\\n</section>\\n\",\n );\n $form[\"data_entry_area1\"]['table_container'] = array(\n '#type' => 'item', \n '#prefix' => '<div class=\"raptor-dialog-table-container\">',\n '#suffix' => '</div>', \n '#tree' => TRUE,\n );\n\n\tglobal $base_url;\n $language_infer = new \\raptor_formulas\\LanguageInference();\n\t\t\n $showDeleteOption = $this->m_oUserInfo->hasPrivilege('REP1');\n $showAddOption = $this->m_oUserInfo->hasPrivilege('UNP1');\n \n $rows = \"\\n\";\n $result = db_select('raptor_protocol_lib', 'p')\n ->fields('p')\n ->orderBy('protocol_shortname')\n ->execute();\n foreach($result as $item) \n {\n $protocol_shortname = $item->protocol_shortname;\n if($item->original_file_upload_dt == NULL)\n {\n $docuploadedmarkup = 'No';\n } else {\n $docuploadedmarkup = '<span class=\"hovertips\" title=\"uploaded '\n .$item->original_filename\n .' on '\n .$item->original_file_upload_dt.'\">Yes</span>';\n }\n $keywords = $this->getFormattedKeywordsForTable($protocol_shortname);\n $active_markup = $item->active_yn == 1 ? '<b>Yes</b>' : 'No';\n $declaredHasContrast = $item->contrast_yn == 1 ? TRUE : FALSE;\n $hasSedation = $item->sedation_yn == 1 ? '<b>Yes</b>' : 'No';\n $hasRadioisotope = $item->sedation_yn == 1 ? '<b>Yes</b>' : 'No';\n $fullname = $item->name;\n $infered_hasContrast = $language_infer->inferContrastFromPhrase($fullname);\n $hasContrastMarkup = $declaredHasContrast ? '<b>Yes</b>' : 'No';\n if($infered_hasContrast !== NULL)\n {\n if(!(\n ($declaredHasContrast && $infered_hasContrast) || \n (!$declaredHasContrast && !$infered_hasContrast))\n )\n {\n if($infered_hasContrast)\n {\n $troublemsg = \"protocol long name implies YES contrast\";\n } else {\n $troublemsg = \"protocol long name implies NO contrast\";\n }\n $hasContrastMarkup = \"<span class='medical-health-warn' title='$troublemsg'>!!! $hasContrastMarkup !!!</span>\";\n }\n }\n if(!$showAddOption)\n {\n $addActionMarkup = '';\n $editActionMarkup = '';\n } else {\n $addActionMarkup = '<a href=\"'.$base_url.'/raptor/viewprotocollib?protocol_shortname='.$item->protocol_shortname.'\">View</a>';\n $editActionMarkup = '<a href=\"'.$base_url.'/raptor/editprotocollib?protocol_shortname='.$item->protocol_shortname.'\">Edit</a>';\n }\n if(!$showDeleteOption)\n {\n $deleteActionMarkup = '';\n } else {\n $deleteActionMarkup = '<a href=\"'.$base_url.'/raptor/deleteprotocollib?protocol_shortname='.$item->protocol_shortname.'\">Delete</a>';\n }\n $rows .= \"\\n\".'<tr>'\n . '<td>'.$protocol_shortname.'</td>'\n . '<td>'.$fullname.'</td>'\n . '<td>'.$active_markup.'</td>'\n . '<td>'.$hasContrastMarkup.'</td>'\n . '<td>'.$hasSedation.'</td>'\n . '<td>'.$hasRadioisotope.'</td>'\n . '<td>'.$item->modality_abbr.'</td>'\n . '<td>'.$item->version.'</td>'\n . '<td>'.$docuploadedmarkup.'</td>'\n . '<td>'.$keywords.'</td>'\n . \"<td>$addActionMarkup</td>\"\n . \"<td>$editActionMarkup</td>\"\n . \"<td>$deleteActionMarkup</td>\"\n . '</tr>';\n }\n\n $form[\"data_entry_area1\"]['table_container']['protocols'] = array('#type' => 'item',\n '#markup' => '<table id=\"my-raptor-dialog-table\" class=\"dataTable\">'\n . '<thead>'\n . '<tr>'\n . '<th title=\"System unique identifier for the protocol\">Short Name</th>'\n . '<th title=\"Full name of the protocol\">Long Name</th>'\n . '<th title=\"Only active protocols are available for use on new exams\">Is Active</th>'\n . '<th title=\"Has contrast\">C</th>'\n . '<th title=\"Has sedation\">S</th>'\n . '<th title=\"Has radioisotope\">R</th>'\n . '<th title=\"The equipment context for this protocol\">Modality</th>'\n . '<th title=\"Value increases with each saved edit\">Version</th>'\n . '<th title=\"The scanned document\">Doc Uploaded</th>'\n . '<th title=\"Keywords used for matching this protocol programatically\">Keywords</th>'\n . '<th title=\"Just view the protocol\">View</th>'\n . '<th title=\"Edit the protocol details\">Edit</th>'\n . '<th title=\"Remove this protocol from the library\">Delete</th>'\n . '</tr>'\n . '</thead>'\n . '<tbody>'\n . $rows\n . '</tbody>'\n . '</table>');\n \n $form['data_entry_area1']['action_buttons'] = array(\n '#type' => 'item', \n '#prefix' => '<div class=\"raptor-action-buttons\">',\n '#suffix' => '</div>', \n '#tree' => TRUE,\n );\n $form['data_entry_area1']['action_buttons']['createlink'] \n = array('#type' => 'item'\n , '#markup' => '<a class=\"button\" href=\"'\n .$base_url.'/raptor/addprotocollib\">Add Protocol</a>');\n\n $form['data_entry_area1']['action_buttons']['cancel'] = array('#type' => 'item'\n , '#markup' => '<input class=\"raptor-dialog-cancel\" type=\"button\" value=\"Exit\" />'); \n \n \n return $form;\n }", "function renderFilterCreationForm() {\n\t\t$this->pi_loadLL();\n\t\t$markerArray = array();\n\t\t$content = tslib_CObj::getSubpart($this->fileContent, '###NEWFILTER###');\n\n\t\t$markerList = array('SAVE', 'CANCEL', 'FILTER_TITLE_LABEL', 'FILTER_DESCRIPTION_LABEL');\n\t\tforeach ($markerList as $marker) {\n\t\t\t$markerArray[$marker] = $this->cObj->stdWrap($this->pi_getLL($marker, $marker, false), $this->conf['newfilter.'][strtolower($marker) . '.']);\n\t\t}\n\n\t\t// FORM URL\n\t\tif (!isset($this->conf['newfilter.']['form_url.']['parameter'])) {\n\t\t\t$this->conf['newfilter.']['form_url.']['parameter'] = $GLOBALS['TSFE']->id;\n\t\t}\n\t\t$this->conf['newfilter.']['form_url.']['returnLast'] = 'url';\n\t\t$markerArray['FORM_URL'] = $this->cObj->typolink('', $this->conf['newfilter.']['form_url.']);\n\n\t\t$content = tslib_CObj::substituteMarkerArray($content, $markerArray, '###|###');\n\n\t\treturn $content;\n\t}", "public function form( $instance ) {\r\n\t\tif ( isset( $instance[ 'ssId' ] ) ) {\r\n\t\t\t$ssId = $instance[ 'ssId' ];\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ssId = __( 'SlideShow1', 'text_domain' );\r\n\t\t}\r\n\t\t?>\r\n <div>\r\n\t\t<p>\r\n\t\t<label for=\"<?php echo $this->get_field_id( 'ssId' ); ?>\"><?php _e( 'Slide Show Id:' ); ?></label> \r\n\t\t<select class=\"widefat syx-slide-id\" id=\"<?php echo $this->get_field_id( 'ssId' ); ?>\" name=\"<?php echo $this->get_field_name( 'ssId' ); ?>\">\r\n <option value=\"_CreateNew_\">Create New...</option>\r\n\t\t<?php \r\n $list = syx_getExistingSlideShowIds();\r\n foreach($list as $sshow) {\r\n echo '<option value=\"' . $sshow['id'] . '\" ';\r\n if($sshow['id'] == $ssId)\r\n echo ' selected=\"selected\"';\r\n echo '>'.$sshow['title'].'</option>';\r\n }\r\n ?>\r\n </select>\r\n </p>\r\n <div class=\"syx-new-slide-id\" style=\"display: none;\">\r\n <p>\r\n\t\t <label for=\"<?php echo $this->get_field_id( 'newssId' ); ?>\"><?php _e( 'New Id:' ); ?></label> \r\n\t\t <input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'newssId' ); ?>\" name=\"<?php echo $this->get_field_name( 'newssId' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $newssId ); ?>\" />\r\n </p>\r\n </div>\r\n\t\t</div>\r\n\t\t<?php \r\n\t}", "protected function form()\n {\n $form = new Form(new Category);\n\n// dump(Category::root(request()->segment(3)));\n\n $form->tab('Конструктор страницы', function($form){\n $form->sortable('source','Страница');\n $form->select('blocks','Добавить блок')->options(Block::where('static',0)->pluck('name','url'))->attribute(['rel' => 'blocks']);\n $form->select('static','Добавить статический блок')->options(Block::where('static',1)->pluck('name','url'))->attribute(['rel' => 'static']);\n });\n $form->tab('Настройки', function($form){\n $form->display('id');\n $form->alias('alias','Алиас');\n $form->text('link');\n $form->select('hook')->options(Resource::all()->pluck('name','id'));\n $form->text('name','Название');\n });\n $form->tab('SEO', function($form){\n $form->textarea('seo_title','seo title');\n $form->textarea('seo_desc','seo description');\n $form->textarea('seo_key','seo keywords');\n\n });\n\n return $form;\n }", "protected function renderFormAdvanced()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n // helper->submit_action = 'submitDoofinderModuleAdvanced';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n . '&configure=' . $this->name . '&adv=1&tab_module=' . $this->tab . '&module_name=' . $this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = [\n 'fields_value' => $this->getConfigFormValuesAdvanced(),\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n ];\n $this->context->smarty->assign('id_tab', 'advanced_tab');\n $html = $this->context->smarty->fetch($this->local_path . 'views/templates/admin/dummy/pre_tab.tpl');\n $html .= $this->renderFeedURLs();\n $html .= $helper->generateForm([$this->getConfigFormAdvanced()]);\n $html .= $this->context->smarty->fetch($this->local_path . 'views/templates/admin/dummy/after_tab.tpl');\n\n return $html;\n }", "public function postSetupForm() {\r\n\r\n $l = $this->bootstrap->getLocalization();\r\n // ugyanaz submitnak mint title-nek\r\n $this->form->submit =\r\n $this->controller->toSmarty['title'] = $l('users', 'login_title');\r\n if ( $this->application->getParameter('nolayout') )\r\n $this->controller->toSmarty['nolayout'] = true;\r\n\r\n $this->controller->toSmarty['formclass'] = 'halfbox centerformwrap';\r\n $this->controller->toSmarty['titleclass'] = 'center';\r\n parent::postSetupForm();\r\n\r\n }", "protected function _prepareForm()\r\n {\r\n \t/* @var $model Lanot_EasyBanner_Model_Category */\r\n $model = $this->_getHelper()->getCategoryItemInstance();\r\n\r\n /**\r\n * Checking if user have permissions to save information\r\n */\r\n if (Mage::helper('lanot_easybanner/admin')->isActionAllowed('manage_category/save')) {\r\n $isElementDisabled = false;\r\n } else {\r\n $isElementDisabled = true;\r\n }\r\n\r\n $form = new Varien_Data_Form();\r\n\r\n $form->setHtmlIdPrefix('category_main_');\r\n\r\n $fieldset = $form->addFieldset('base_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Category Item Info')\r\n ));\r\n\r\n if ($model->getId()) {\r\n $fieldset->addField('category_id', 'hidden', array(\r\n 'name' => 'id',\r\n ));\r\n }\r\n\r\n //Add main elements to the category\r\n $fieldset->addField('title', 'text', array(\r\n 'name' => 'title',\r\n 'label' => $this->_getHelper()->__('Title'),\r\n 'title' => $this->_getHelper()->__('Title'),\r\n 'required' => true,\r\n 'disabled' => $isElementDisabled\r\n ));\r\n\r\n $fieldset->addField('description', 'textarea', array(\r\n \t'name' => 'description',\r\n \t'label' => $this->_getHelper()->__('Description'),\r\n \t'title' => $this->_getHelper()->__('Description'),\r\n \t'required' => false,\r\n \t'disabled' => $isElementDisabled,\r\n \t'style' => 'height: 100px',\t\r\n ));\r\n \r\n $fieldset->addField('is_active', 'select', array(\r\n \t'name' => 'is_active',\r\n \t'label' => $this->_getHelper()->__('Is Active'),\r\n \t'title' => $this->_getHelper()->__('Is Active'),\r\n \t'required' => true,\r\n \t'disabled' => $isElementDisabled,\r\n \t'options' => $model->getAvailableStatuses(),\r\n ));\r\n\r\n /*\r\n //Add layout updates elements to the category\r\n $lBlock = $this->getLayout()->createBlock('lanot_easybanner/adminhtml_widget_instance_edit_tab_main_layout');\r\n $fieldset = $form->addFieldset('layout_updates_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Layout Updates')\r\n ));\r\n\r\n $fieldset->addField('layout_updates', 'note', array());\r\n $form->getElement('layout_updates_fieldset')->setRenderer($lBlock);\r\n */\r\n\r\n $form->setValues($model->getData());\r\n \r\n Mage::dispatchEvent('adminhtml_easybanner_category_edit_tab_main_prepare_form', array('form' => $form));\r\n\r\n $this->setForm($form);\r\n\r\n return parent::_prepareForm();\r\n }", "public function handle_tab() {\n\t\t$screen = get_current_screen();\n\t\t// Run only when post_id is present\n\t\tif (( ! isset( $_GET['post'] ) || ! is_numeric( $_GET['post'])) && $screen->id != 'toplevel_page_acf-options' ) {\n\t\t\treturn;\n\t\t}\n\t\tif ($screen->id != 'toplevel_page_acf-options') {\n\t\t\t$post_id = sanitize_key( $_GET['post'] );\n\t\t} else {\n\t\t\t$post_id = $screen->id;\n\t\t}\n\t\t// Check for existing transient\n\t\t$current_tab = get_transient( $this->_transient_name );\n\t\t// Use value only once, delete transient right away\n\t\tdelete_transient( $this->_transient_name );\n\t\t// The first tab is selected by default\n\t\t$tab_index = 0;\n\t\t// Get tab index for current post\n\t\tif ( $current_tab['post_id'] === $post_id ) {\n\t\t\t$tab_index = $current_tab['tab_index'];\n\t\t}\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\t(function($) {\n\t\t\t\t/**\n\t\t\t\t * Global to save the current index of selected tab\n\t\t\t\t * @type int\n\t\t\t\t */\n\t\t\t\twindow.acf_current_tab_index = null;\n\t\t\t\tacf.add_action('ready', function( $el ){\n\t\t\t\t\tvar tabIndex = <?php echo $tab_index; ?>\n\t\t\t\t\t// Get tab element by index\n\t\t\t\t\tvar $li = $('.acf-tab-group').find('li:eq(<?php echo $tab_index; ?>)');\n\t\t\t\t\t// Select tab only when it’s not the first tab, which is selected by default\n\t\t\t\t\tif (0 !== tabIndex) {\n\t\t\t\t\t\t$li.find('a').click();\n\t\t\t\t\t}\n\t\t\t\t\twindow.acf_current_tab_index = tabIndex;\n\t\t\t\t});\n\t\t\t\tacf.add_action('refresh', function($tabGroup) {\n\t\t\t\t\tvar $currentTab;\n\t\t\t\t\tvar currentTabIndex = window.acf_current_tab_index;\n\t\t\t\t\tvar newTabIndex;\n\t\t\t\t\t// Bail out if we have no jQuery object\n\t\t\t\t\tif (false === $tabGroup instanceof jQuery) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$currentTab = $tabGroup.find('li.active');\n\t\t\t\t\t// Bail out if no active tab was found\n\t\t\t\t\tif ($currentTab.length === 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Get index of active tab\n\t\t\t\t\tnewTabIndex = $currentTab.index();\n\n\t\t\t\t\t// Bail out if index is initial or previously selected tab is the same\n\t\t\t\t\tif (null === currentTabIndex || newTabIndex === currentTabIndex) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\twindow.acf_current_tab_index = newTabIndex;\n\t\t\t\t\t// Send tabIndex to backend to save transient\n\t\t\t\t\t$.ajax(ajaxurl, {\n\t\t\t\t method: 'post',\n\t\t\t\t data: {\n\t\t\t\t\t\t\taction: 'acf_save_current_tab',\n\t\t\t\t\t\t\ttab_index: newTabIndex,\n\t\t\t\t\t\t\tpost_id: '<?php echo $post_id; ?>'\n\t\t\t\t }\n\t\t\t });\n\t\t\t\t});\n\t\t\t})(jQuery);\n\t\t</script>\n\t\t<?php\n\t}", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitKushkipagosModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n if(Currency::getDefaultCurrency()->iso_code=='COP'){\n return $helper->generateForm(array($this->getConfigFormCOP()));\n }else{\n return $helper->generateForm(array($this->getConfigForm()));\n }\n\n }", "function do_form(){\n\t\tob_start();\n\t\t\n\t\t$op = ($this->id_base == $this->id)? __('Add', JCF_TEXTDOMAIN) : __('Edit', JCF_TEXTDOMAIN);\n\t\t?>\n\t\t<div class=\"jcf_edit_field\">\n\t\t\t<h3 class=\"header\"><?php echo $op . ' ' . $this->title; ?></h3>\n\t\t\t<div class=\"jcf_inner_content\">\n\t\t\t\t<form action=\"#\" method=\"post\" id=\"jcform_edit_field\">\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_id\" value=\"<?php echo $this->id; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_number\" value=\"<?php echo $this->number; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_id_base\" value=\"<?php echo $this->id_base; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"fieldset_id\" value=\"<?php echo $this->fieldset_id; ?>\" />\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->form( $this->instance );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// need to add slug field too\n\t\t\t\t\t\t\t$slug = esc_attr($this->slug);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<label for=\"<?php echo $this->get_field_id('slug'); ?>\"><?php _e('Slug:', JCF_TEXTDOMAIN); ?></label>\n\t\t\t\t\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('slug'); ?>\" name=\"<?php echo $this->get_field_name('slug'); ?>\" type=\"text\" value=\"<?php echo $slug; ?>\" />\n\t\t\t\t\t\t\t<br/><small><?php _e('Machine name, will be used for postmeta field name.', JCF_TEXTDOMAIN); ?></small>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t// enabled field\n\t\t\t\t\t\t\tif( $this->is_new ){\n\t\t\t\t\t\t\t\t$this->instance['enabled'] = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<label for=\"<?php echo $this->get_field_id('enabled'); ?>\">\n\t\t\t\t\t\t\t\t<input class=\"checkbox\" type=\"checkbox\" \n\t\t\t\t\t\t\t\t\t\tid=\"<?php echo $this->get_field_id('enabled'); ?>\"\n\t\t\t\t\t\t\t\t\t\tname=\"<?php echo $this->get_field_name('enabled'); ?>\"\n\t\t\t\t\t\t\t\t\t\tvalue=\"1\" <?php checked(true, @$this->instance['enabled']); ?> />\n\t\t\t\t\t\t\t\t<?php _e('Enabled', JCF_TEXTDOMAIN); ?></label>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"field-control-actions\">\n\t\t\t\t\t\t\t<div class=\"alignleft\">\n\t\t\t\t\t\t\t\t<?php if( $op != __('Add', JCF_TEXTDOMAIN) ) : ?>\n\t\t\t\t\t\t\t\t<a href=\"#remove\" class=\"field-control-remove\"><?php _e('Delete', JCF_TEXTDOMAIN); ?></a> |\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t<a href=\"#close\" class=\"field-control-close\"><?php _e('Close', JCF_TEXTDOMAIN); ?></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"alignright\">\n\t\t\t\t\t\t\t\t<?php echo print_loader_img(); ?>\n\t\t\t\t\t\t\t\t<input type=\"submit\" value=\"<?php _e('Save', JCF_TEXTDOMAIN); ?>\" class=\"button-primary\" name=\"savefield\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<br class=\"clear\"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\t\t\n\t\t$html = ob_get_clean();\n\t\treturn $html;\n\t}", "public function panel_content() {\n\n\t\t$core_templates = apply_filters( 'wpforms_form_templates_core', array() );\n\t\t$additional_templates = apply_filters( 'wpforms_form_templates', array() );\n\t\t$additional_count = count( $additional_templates );\n\t\t?>\n\t\t<div id=\"wpforms-setup-form-name\">\n\t\t\t<span><?php esc_html_e( 'Form Name', 'wpforms-lite' ); ?></span>\n\t\t\t<input type=\"text\" id=\"wpforms-setup-name\" placeholder=\"<?php esc_attr_e( 'Enter your form name here&hellip;', 'wpforms-lite' ); ?>\">\n\t\t</div>\n\n\t\t<div class=\"wpforms-setup-title core\">\n\t\t\t<?php esc_html_e( 'Select a Template', 'wpforms-lite' ); ?>\n\t\t</div>\n\n\t\t<p class=\"wpforms-setup-desc core\">\n\t\t\t<?php\n\t\t\techo wp_kses(\n\t\t\t\t__( 'To speed up the process, you can select from one of our pre-made templates or start with a <strong><a href=\"#\" class=\"wpforms-trigger-blank\">blank form.</a></strong>', 'wpforms-lite' ),\n\t\t\t\tarray(\n\t\t\t\t\t'strong' => array(),\n\t\t\t\t\t'a' => array(\n\t\t\t\t\t\t'href' => array(),\n\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\n\t\t<?php $this->template_select_options( $core_templates, 'core' ); ?>\n\n\t\t<div class=\"wpforms-setup-title additional\">\n\t\t\t<?php esc_html_e( 'Additional Templates', 'wpforms-lite' ); ?>\n\t\t\t<?php echo ! empty( $additional_count ) ? '<span class=\"count\">(' . $additional_count . ')</span>' : ''; ?>\n\t\t</div>\n\n\t\t<?php if ( ! empty( $additional_count ) ) : ?>\n\n\t\t\t<p class=\"wpforms-setup-desc additional\">\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\twp_kses(\n\t\t\t\t\t\t/* translators: %1$s - WPForms.com URL to a template suggestion, %2$s - WPForms.com URL to a doc about custom templates. */\n\t\t\t\t\t\t__( 'Have a suggestion for a new template? <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">We\\'d love to hear it</a>. Also, you can <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">create your own templates</a>!', 'wpforms-lite' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'a' => array(\n\t\t\t\t\t\t\t\t'href' => array(),\n\t\t\t\t\t\t\t\t'target' => array(),\n\t\t\t\t\t\t\t\t'rel' => array(),\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'https://wpforms.com/form-template-suggestion/',\n\t\t\t\t\t'https://wpforms.com/docs/how-to-create-a-custom-form-template/'\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\n\t\t\t<div class=\"wpforms-setup-template-search-wrap\">\n\t\t\t\t<i class=\"fa fa-search\" aria-hidden=\"true\"></i>\n\t\t\t\t<input type=\"text\" id=\"wpforms-setup-template-search\" value=\"\" placeholder=\"<?php esc_attr_e( 'Search additional templates...', 'wpforms-lite' ); ?>\">\n\t\t\t</div>\n\n\t\t\t<?php $this->template_select_options( $additional_templates, 'additional' ); ?>\n\n\t\t<?php else : ?>\n\n\t\t\t<p class=\"wpforms-setup-desc additional\">\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\twp_kses(\n\t\t\t\t\t\t/* translators: %1$s - WPForms.com URL to an addon page, %2$s - WPForms.com URL to a docs article. */\n\t\t\t\t\t\t__( 'More are available in the <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">Form Templates Pack addon</a> or by <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">creating your own</a>.', 'wpforms-lite' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'a' => array(\n\t\t\t\t\t\t\t\t'href' => array(),\n\t\t\t\t\t\t\t\t'target' => array(),\n\t\t\t\t\t\t\t\t'rel' => array(),\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'https://wpforms.com/addons/form-templates-pack-addon/',\n\t\t\t\t\t'https://wpforms.com/docs/how-to-create-a-custom-form-template/'\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\n\t\t<?php\n\t\tendif;\n\t\tdo_action( 'wpforms_setup_panel_after' );\n\t}", "function form( $instance ) {\n\t\t\n\t\tTrends()->view->load(\n\t\t\t'/view/backend',\n\t\t\tarray(\n\t\t\t\t'widget' => $this,\n\t\t\t\t'instance' => $instance\n\t\t\t),\n\t\t\tfalse,\n\t\t\tdirname( __FILE__ )\n\t\t);\n\t\t\n\t}", "public function form( $instance ) {\n\t\t global $jobcareer_form_fields, $jobcareer_html_fields;\n\t\t$title = isset( $instance['title'] ) ? $instance['title'] : '';\n\t\t$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';\n\n\t\t// Get menus\n\t\t$menus = wp_get_nav_menus();\n\n\t\t// If no menus exists, direct the user to go and create some.\n\t\t?>\n\t\t<p class=\"nav-menu-widget-no-menus-message\" <?php if ( ! empty( $menus ) ) { echo ' style=\"display:none\" '; } ?>>\n\t\t\t<?php\n\t\t\tif ( isset( $GLOBALS['wp_customize'] ) && $GLOBALS['wp_customize'] instanceof WP_Customize_Manager ) {\n\t\t\t\t$url = 'javascript: wp.customize.panel( \"nav_menus\" ).focus();';\n\t\t\t} else {\n\t\t\t\t$url = admin_url( 'nav-menus.php' );\n\t\t\t}\n\t\t\t?>\n\t\t\t<?php echo sprintf( __( 'No menus have been created yet. <a href=\"%s\">Create some</a>.', 'jobcareer' ), esc_attr( $url ) ); ?>\n\t\t</p>\n\t\t<div class=\"nav-menu-widget-form-controls\" <?php if ( empty( $menus ) ) { echo ' style=\"display:none\" '; } ?>>\n\t\t\t\n\t\t\t\n\t\t\t<?php\n\t\t\t $title = isset($instance['title']) ? $title = $instance['title']:'';\n\t\t\t $cs_opt_array = array(\n 'name' => esc_html__('Title', 'jobcareer'),\n 'desc' => '',\n 'hint_text' => esc_html__(\"Enter your element title here.\", 'jobcareer'),\n 'echo' => true,\n 'field_params' => array(\n 'std' => esc_attr($title),\n 'cust_id' => '',\n 'cust_name' => jobcareer_special_char($this->get_field_name('title')),\n 'return' => true,\n ),\n );\n\n $jobcareer_html_fields->cs_text_field($cs_opt_array);\n\t\t\t?>\n\t\t\t\n\t\t\t\n\t\t\t<?php\n\t\t\tif(!empty($menus)):\n\t\t\t$cs_menu_all=array();\t\n\t\t\tforeach ( $menus as $menu ) : \n\t\t\t\t\t$cs_menu_all[$menu->slug]=$menu->name;\n\t\t\t\t\t\n\t\t\t\t\tendforeach;\n\t\t\t//$cs_title = isset($instance['description']) ? esc_attr($instance['description']) : '';\n $cs_menu_label = isset($instance['nav_menu']) ? esc_attr($instance['nav_menu']) : '';\n\t\t\t\n\t\t\t$cs_opt_array = array(\n 'name' => esc_html__('Select Menu:', 'jobcareer'),\n 'desc' => '',\n 'hint_text' => '',\n 'echo' => true,\n 'field_params' => array(\n 'std' => $cs_menu_label,\n 'id' => jobcareer_special_char($this->get_field_id('select_view')),\n 'cust_name' => jobcareer_special_char($this->get_field_name('nav_menu')),\n 'classes' => 'dropdown',\n 'options' => $cs_menu_all,\n 'return' => true,\n ),\n );\n\n echo jobcareer_special_char($jobcareer_html_fields->cs_select_field($cs_opt_array));\n\t\t\tendif;\n\t\t\t\n\t\t\t?>\n\t\t\t\n\t\t\t\n\t\t</div>\n\t\t<?php\n\t}", "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 form1( $instance ) {\n\n\t\t\t// Merge with defaults.\n\t\t\t$instance = wp_parse_args( (array) $instance, $this->defaults );\n\t\t\t?>\n <p>\n <label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title', 'wps' ); ?>\n :</label>\n <input type=\"text\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>\"\n value=\"<?php echo esc_attr( $instance['title'] ); ?>\" class=\"widefat\"/>\n </p>\n\n <div class=\"genesis-widget-column\">\n\n <div class=\"genesis-widget-column-box genesis-widget-column-box-top\">\n\t\t\t\t\t<?php\n\t\t\t\t\t$taxonomies = get_object_taxonomies( $this->post_type, 'objects' );\n\t\t\t\t\tif ( count( $taxonomies ) > 0 ) :\n\t\t\t\t\t\t?>\n <p>\n <label for=\"<?php echo esc_attr( $this->get_field_id( 'taxonomy' ) ); ?>\"><?php _e( 'Taxonomy', 'wps' ); ?>\n :</label>\n <select id=\"<?php echo esc_attr( $this->get_field_id( 'taxonomy' ) ); ?>\"\n onchange=\"wpsWidgetSave(this)\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'taxonomy' ) ); ?>\">\n <option value=\"\">- <?php _e( 'None', 'wps' ); ?> -</option>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( (array) $taxonomies as $taxonomy ) {\n\t\t\t\t\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $taxonomy->name ), selected( $taxonomy->name, $instance['taxonomy'], false ), esc_html( $taxonomy->label ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n </select>\n </p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$terms = get_terms( $instance['taxonomy'], array(\n\t\t\t\t\t\t\t'hide_empty' => false,\n\t\t\t\t\t\t) );\n\n\t\t\t\t\t\tif ( $instance['taxonomy'] ) :\n\t\t\t\t\t\t\t?>\n <p>\n <label for=\"<?php echo esc_attr( $this->get_field_id( 'term' ) ); ?>\"><?php _e( 'Term', 'wps' ); ?>\n :</label>\n <select id=\"<?php echo esc_attr( $this->get_field_id( 'term' ) ); ?>\"\n onchange=\"wpsWidgetSave(this)\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'term' ) ); ?>\">\n <option value=\"\">- <?php _e( 'None', 'wps' ); ?> -</option>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tforeach ( (array) $terms as $term ) {\n\t\t\t\t\t\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', esc_attr( $term->term_id ), selected( $term->term_id, $instance['term'], false ), esc_html( $term->name ) );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t?>\n </select>\n </p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendif;\n\t\t\t\t\t?>\n <p>\n <label for=\"<?php echo esc_attr( $this->get_field_id( 'posts_num' ) ); ?>\"><?php _e( 'Number of Posts to Show', 'wps' ); ?>\n :</label>\n <input type=\"text\" id=\"<?php echo esc_attr( $this->get_field_id( 'posts_num' ) ); ?>\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'posts_num' ) ); ?>\"\n value=\"<?php echo esc_attr( $instance['posts_num'] ); ?>\" size=\"2\" placeholder=\"1\"/>\n </p>\n\n <p>\n <label for=\"<?php echo esc_attr( $this->get_field_id( 'posts_offset' ) ); ?>\"><?php _e( 'Number of Posts to Offset', 'wps' ); ?>\n :</label>\n <input type=\"text\" id=\"<?php echo esc_attr( $this->get_field_id( 'posts_offset' ) ); ?>\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'posts_offset' ) ); ?>\"\n value=\"<?php echo esc_attr( $instance['posts_offset'] ); ?>\" size=\"2\"/>\n </p>\n\n <p>\n <label for=\"<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>\"><?php _e( 'Order By', 'wps' ); ?>\n :</label>\n <select id=\"<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>\"\n onchange=\"wpsWidgetSave(this)\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'orderby' ) ); ?>\">\n <option value=\"date\" <?php selected( 'date', $instance['orderby'] ); ?>><?php _e( 'Date', 'wps' ); ?></option>\n <option value=\"title\" <?php selected( 'title', $instance['orderby'] ); ?>><?php _e( 'Title', 'wps' ); ?></option>\n <option value=\"parent\" <?php selected( 'parent', $instance['orderby'] ); ?>><?php _e( 'Parent', 'wps' ); ?></option>\n <option value=\"ID\" <?php selected( 'ID', $instance['orderby'] ); ?>><?php _e( 'ID', 'wps' ); ?></option>\n <option value=\"comment_count\" <?php selected( 'comment_count', $instance['orderby'] ); ?>><?php _e( 'Comment Count', 'wps' ); ?></option>\n <option value=\"rand\" <?php selected( 'rand', $instance['orderby'] ); ?>><?php _e( 'Random', 'wps' ); ?></option>\n </select>\n </p>\n\n <p>\n <label for=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\"><?php _e( 'Sort Order', 'wps' ); ?>\n :</label>\n <select id=\"<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>\"\n onchange=\"wpsWidgetSave(this)\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>\">\n <option value=\"DESC\" <?php selected( 'DESC', $instance['order'] ); ?>><?php _e( 'Descending (3, 2, 1)', 'wps' ); ?></option>\n <option value=\"ASC\" <?php selected( 'ASC', $instance['order'] ); ?>><?php _e( 'Ascending (1, 2, 3)', 'wps' ); ?></option>\n </select>\n </p>\n\n <p>\n <input id=\"<?php echo esc_attr( $this->get_field_id( 'exclude_displayed' ) ); ?>\"\n type=\"checkbox\"\n onchange=\"wpsWidgetSave(this)\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'exclude_displayed' ) ); ?>\"\n value=\"1\" <?php checked( $instance['exclude_displayed'] ); ?>/>\n <label for=\"<?php echo esc_attr( $this->get_field_id( 'exclude_displayed' ) ); ?>\"><?php _e( 'Exclude Previously Displayed Posts?', 'wps' ); ?></label>\n </p>\n\n <p>\n <input id=\"<?php echo esc_attr( $this->get_field_id( 'exclude_sticky' ) ); ?>\" type=\"checkbox\"\n onchange=\"wpsWidgetSave(this)\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'exclude_sticky' ) ); ?>\"\n value=\"1\" <?php checked( $instance['exclude_sticky'] ); ?>/>\n <label for=\"<?php echo esc_attr( $this->get_field_id( 'exclude_sticky' ) ); ?>\"><?php _e( 'Exclude Sticky Posts?', 'wps' ); ?></label>\n </p>\n\n </div>\n\n </div>\n\n <div class=\"genesis-widget-column genesis-widget-column-right\">\n\n <div class=\"genesis-widget-column-box genesis-widget-column-box-top\">\n\n <p>\n <label for=\"<?php echo esc_attr( $this->get_field_id( 'class' ) ); ?>\"><?php _e( 'Column Class', 'wps' ); ?>\n :</label>\n <select id=\"<?php echo esc_attr( $this->get_field_id( 'class' ) ); ?>\" style=\"max-width: 100%;\"\n onchange=\"wpsWidgetSave(this)\"\n name=\"<?php echo esc_attr( $this->get_field_name( 'class' ) ); ?>\">\n <option value=\"\">- <?php _e( 'None', 'wps' ); ?> -</option>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach (\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'one-half' => __( 'One-Half (Two-Fourths, Three-Sixths)', 'wps' ),\n\t\t\t\t\t\t\t\t\t'one-third' => __( 'One-Third (Two-Sixths)', 'wps' ),\n\t\t\t\t\t\t\t\t\t'one-fourth' => __( 'One-Fourth', 'wps' ),\n\t\t\t\t\t\t\t\t\t'one-sixth' => __( 'One-Sixth', 'wps' ),\n\t\t\t\t\t\t\t\t\t'two-thirds' => __( 'Four-Sixths', 'wps' ),\n\t\t\t\t\t\t\t\t\t'three-fourths' => __( 'Three-Fourths', 'wps' ),\n\t\t\t\t\t\t\t\t\t'five-sixths' => __( 'Five-Sixths', 'wps' ),\n\t\t\t\t\t\t\t\t) as $value => $class\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t'<option value=\"%s\" %s>%s</option>',\n\t\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t\tselected( $value, $instance['class'] ),\n\t\t\t\t\t\t\t\t\t$class\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n </select>\n </p>\n\n </div>\n\n </div>\n\t\t\t<?php\n\n\t\t}" ]
[ "0.5820625", "0.5792812", "0.56628263", "0.55820626", "0.5450527", "0.54472023", "0.5398867", "0.5376441", "0.533629", "0.5321032", "0.53112996", "0.5301038", "0.5282201", "0.52742237", "0.5274073", "0.5271789", "0.5268261", "0.5254349", "0.52370733", "0.523299", "0.5202378", "0.51878685", "0.51800257", "0.5169442", "0.5169165", "0.5166682", "0.5154033", "0.51386243", "0.5132786", "0.5129623", "0.51242703", "0.5109828", "0.50932235", "0.50799394", "0.50788367", "0.5059226", "0.50444186", "0.50340235", "0.5025993", "0.5025793", "0.5022735", "0.5017662", "0.5017637", "0.5016883", "0.5012304", "0.50051075", "0.50009173", "0.49987504", "0.49977827", "0.49928343", "0.49750754", "0.49668288", "0.49635988", "0.49632797", "0.49534637", "0.49422163", "0.49313676", "0.492625", "0.49251378", "0.49142963", "0.4914034", "0.49133766", "0.49057025", "0.49056834", "0.4902168", "0.49014685", "0.48991877", "0.48955813", "0.48935154", "0.4891603", "0.48897192", "0.48880434", "0.48826006", "0.48822224", "0.4880241", "0.48770776", "0.48770776", "0.48741424", "0.4869706", "0.48693576", "0.48681483", "0.48673692", "0.48671535", "0.48630702", "0.48512205", "0.48452172", "0.48433214", "0.4833914", "0.4832618", "0.48265296", "0.48263216", "0.48262075", "0.48256958", "0.48233342", "0.4820982", "0.48207018", "0.4811639", "0.48071352", "0.48067558", "0.48000458", "0.47996998" ]
0.0
-1
reload the page after initial save show parent sample so we can enter the transect data.
protected static function getMode($args, $nid) { if (!empty($_GET['id']) && !empty($_GET['table']) && $_GET['table']==='sample') $_GET['sample_id']=$_GET['id']; return parent::getMode($args, $nid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reeditSurvey() {\n $this->layout = 'survey'; // use the more basic survey layout\n $this->Session->write('Survey.progress', GDTA_ENTRY); // change the progress back to GDTA entry\n $this->redirect(array('action' => 'enterGdta'));\n }", "function parent_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'parent_add';\n $page_data['page_title'] = get_phrase('add_parent');\n $this->load->view('backend/index', $page_data);\n }", "protected function _afterLoad()\n {\n $this->performAfterLoad('cms_page_store', 'page_id');\n $this->_previewFlag = false;\n\n return parent::_afterLoad();\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('traineedoc')) {\n try {\n $data = $this->_filterDates($data, array('trainee_doc_date'));\n\n $traineedoc = $this->_initTraineedoc();\n $traineedoc->addData($data);\n $traineeDocFileName = $this->_uploadAndGetName(\n 'trainee_doc_file',\n Mage::helper('bs_traineedoc/traineedoc')->getFileBaseDir(),\n $data\n );\n $traineedoc->setData('trainee_doc_file', $traineeDocFileName);\n $trainees = $this->getRequest()->getPost('trainees', -1);\n if ($trainees != -1) {\n $traineedoc->setTraineesData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($trainees));\n }else {\n if(isset($data['hidden_trainee_id']) && $data['hidden_trainee_id'] > 0){\n $traineedoc->setTraineesData(\n array(\n $data['hidden_trainee_id'] => array(\n 'position' => \"\"\n )\n )\n );\n }\n }\n $traineedoc->save();\n\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.location.reload(); window.close()</script>';\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_traineedoc')->__('Trainee Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $traineedoc->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['trainee_doc_file']['value'])) {\n $data['trainee_doc_file'] = $data['trainee_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setTraineedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['trainee_doc_file']['value'])) {\n $data['trainee_doc_file'] = $data['trainee_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineedoc')->__('There was a problem saving the trainee document.')\n );\n Mage::getSingleton('adminhtml/session')->setTraineedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineedoc')->__('Unable to find trainee document to save.')\n );\n $this->_redirect('*/*/');\n }", "public function reload() {\n $this->store->reload();\n }", "function savepage()\r\n\t{\r\n\t\t$model\t\t=& $this->getModel( 'Formsession' );\r\n\t\t$model->savePage();\r\n\t}", "function redirectToParent()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t$t = ilSkillTreeNode::_lookupType((int) $_GET[\"obj_id\"]);\n\n\t\tswitch ($t)\n\t\t{\n\t\t\tcase \"skrt\":\n\t\t\t\t$ilCtrl->setParameterByClass(\"ilskillrootgui\", \"obj_id\", (int) $_GET[\"obj_id\"]);\n\t\t\t\t$ilCtrl->redirectByClass(\"ilskillrootgui\", \"listSkills\");\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tparent::redirectToParent();\n\t}", "public function reload ()\r\n {\r\n $this->_load();\r\n }", "function show()\n {\n if (!$this->loaded)\n {\n $this->onReload( func_get_arg(0) );\n }\n parent::show();\n }", "public function createPageAndCopyLiveParentPage() {}", "function editQuoteFinalStepAction()\n\t{\n\t\tif($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')\n\t\t{\n\t\t\t$quote_id=$this->_request->getParam('quote_id');\n\n\t\t\tif($quote_id)\n\t\t\t{\n\t\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\t\t\t\tif($quoteDetails)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t//Quote documents added to sesssion\n\t\t\t\t\t$files = \"\";\n\t\t\t\t\t$documents_path = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t$documents_name = explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t$k =0;\n\t\t\t\t\tforeach($documents_path as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=quote&quote_id='.$quote_id.'&index='.$k.'\">'.utf8_encode($documents_name[$k]).'</a><span class=\"delete\" rel=\"'.$k.'_'.$quote_id.'\"> <i class=\"splashy-error_x\"></i></span> </div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\t\t\t\t\t$quoteDetails[0]['documents'] = $files;\n\n\n\t\t\t\t\t$this->_view->send_quote=$quoteDetails[0];\n\t\t\t\t\t$this->render(\"popup-edit-finalstep-details\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function Reload()\n\t{\n\t\t$this->load->view('reload');\n\t}", "function add_parent_data(){\n\t\t$this->load->helper('form');\n\t\t$this->data['student_id'] = '';\n\t\tif(isset($_REQUEST['student_id'])){\n\t\t\t$this->data['student_id'] = $_REQUEST['student_id'];\n\t\t}\n\t\telseif(isset($_GET['student_id'])){\n\t\t\t$this->data['student_id'] = $_GET['student_id'];\n\t\t}\n\t\t$this->data['not_popup'] = FALSE;\n\t\t$this->data['country_list'] = Base_model::get_country_list();\n\t\t$this->load->view('settings/students/add_parent_detail',$this->data);\n\t}", "public function reload() {\n $this->init();\n redirect('./');\n }", "public function createNestedPagesAndCopyLiveParentPage() {}", "function subchap()\n\t{\n\t\tglobal $tree, $ilCtrl, $lng, $ilUser;\n\n\t\t$this->setTabs();\n\n\t\t$this->tpl->addBlockFile(\"ADM_CONTENT\", \"adm_content\", \"tpl.structure_edit.html\", \"Modules/LearningModule\");\n\t\t$num = 0;\n\n\t\t$this->tpl->setCurrentBlock(\"form\");\n\t\t$this->ctrl->setParameter($this, \"backcmd\", \"subchap\");\n\t\t$this->tpl->setVariable(\"FORMACTION\", $this->ctrl->getFormAction($this));\n\t\t$this->tpl->setVariable(\"HEADER_TEXT\", $this->lng->txt(\"cont_subchapters\"));\n\t\t$this->tpl->setVariable(\"CHECKBOX_TOP\", IL_FIRST_NODE);\n\n\t\t$cnt = 0;\n\t\t$childs = $this->tree->getChilds($this->obj->getId());\n\t\tforeach ($childs as $child)\n\t\t{\n\t\t\tif($child[\"type\"] != \"st\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->tpl->setCurrentBlock(\"table_row\");\n\t\t\t// color changing\n\t\t\t$css_row = ilUtil::switchColor($cnt++,\"tblrow1\",\"tblrow2\");\n\n\t\t\t// checkbox\n\t\t\t$this->tpl->setVariable(\"CHECKBOX_ID\", $child[\"obj_id\"]);\n\t\t\t$this->tpl->setVariable(\"CSS_ROW\", $css_row);\n\t\t\t$this->tpl->setVariable(\"IMG_OBJ\", ilUtil::getImagePath(\"icon_st.svg\"));\n\n\t\t\t// type\n\t\t\t$this->ctrl->setParameterByClass(\"ilStructureObjectGUI\", \"obj_id\", $child[\"obj_id\"]);\n\t\t\t$link = $this->ctrl->getLinkTargetByClass(\"ilStructureObjectGUI\", \"view\");\n\t\t\t$this->tpl->setVariable(\"LINK_TARGET\", $link);\n\n\t\t\t// title\n\t\t\t$this->tpl->setVariable(\"TEXT_CONTENT\",\n\t\t\t\tilStructureObject::_getPresentationTitle($child[\"obj_id\"],\n\t\t\t\t\t$this->content_object->isActiveNumbering()));\n\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t}\n\t\tif($cnt == 0)\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"notfound\");\n\t\t\t$this->tpl->setVariable(\"NUM_COLS\", 3);\n\t\t\t$this->tpl->setVariable(\"TXT_OBJECT_NOT_FOUND\", $this->lng->txt(\"obj_not_found\"));\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t}\n\t\t//else\n\t\t//{\n\t\t\t// SHOW VALID ACTIONS\n\t\t\t$this->tpl->setVariable(\"NUM_COLS\", 3);\n\t\t\t$acts = array(\"delete\" => \"delete\", \"cutChapter\" => \"cut\",\n\t\t\t\t\"copyChapter\" => \"copyChapter\");\n\t\t\tif ($ilUser->clipboardHasObjectsOfType(\"st\"))\n\t\t\t{\n\t\t\t\t$acts[\"pasteChapter\"] = \"pasteChapter\";\n\t\t\t}\n\t\t\t$this->showActions($acts);\n\t\t//}\n\n\t\t// SHOW POSSIBLE SUB OBJECTS\n\t\t$this->tpl->setVariable(\"NUM_COLS\", 3);\n\t\t//$this->showPossibleSubObjects(\"st\");\n\t\t$subobj = array(\"st\");\n\t\t$opts = ilUtil::formSelect(12,\"new_type\",$subobj);\n\t\t//$this->tpl->setVariable(\"IMG_ARROW\", ilUtil::getImagePath(\"arrow_downright.svg\"));\n\t\t$this->tpl->setCurrentBlock(\"add_object\");\n\t\t$this->tpl->setVariable(\"SELECT_OBJTYPE\", $opts);\n\t\t//$this->tpl->setVariable(\"FORMACTION_OBJ_ADD\", \"adm_object.php?cmd=create&ref_id=\".$_GET[\"ref_id\"]);\n\t\t$this->tpl->setVariable(\"BTN_NAME\", \"create\");\n\t\t$this->tpl->setVariable(\"TXT_ADD\", $this->lng->txt(\"insert\"));\n\t\t$this->tpl->parseCurrentBlock();\n\n\t\t//$this->tpl->setVariable(\"NUM_COLS\", 2);\n\t\t//$this->showPossibleSubObjects(\"st\");\n\n\t\t$this->tpl->setCurrentBlock(\"form\");\n\t\t$this->tpl->parseCurrentBlock();\n\n\t\t$ilCtrl->setParameter($this, \"obj_id\", $_GET[\"obj_id\"]);\n\n\t}", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('curriculumdoc')) {\n try {\n $data = $this->_filterDates($data, array('cdoc_date'));\n $curriculumdoc = $this->_initCurriculumdoc();\n $curriculumdoc->addData($data);\n $cdocFileName = $this->_uploadAndGetName(\n 'cdoc_file',\n Mage::helper('bs_curriculumdoc/curriculumdoc')->getFileBaseDir(),\n $data\n );\n $curriculumId = null;\n\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0) {\n $curriculumId = $data['hidden_curriculum_id'];\n }elseif($this->getRequest()->getParam('curriculum_id')){\n $curriculumId = $this->getRequest()->getParam('curriculum_id');\n }\n $curriculumdoc->setData('cdoc_file', $cdocFileName);\n $curriculums = $this->getRequest()->getPost('curriculums', -1);\n if ($curriculums != -1) {\n $curriculumdoc->setCurriculumsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($curriculums));\n }else {\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0){\n $curriculumId = $data['hidden_curriculum_id'];\n $curriculumdoc->setCurriculumsData(\n array(\n $data['hidden_curriculum_id'] => array(\n 'position' => \"\"\n )\n )\n );\n }\n }\n\n $curriculumdoc->save();\n\n $add = '';//traininglist_curriculum/edit/id/1/back/edit/tab/curriculum_info_tabs_curriculumdocs/\n $backUrl = $this->getUrl('*/traininglist_curriculum/edit/', array('back'=>'edit','id' => $curriculumId, 'tab'=>'curriculum_info_tabs_curriculumdocs'));\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.location.href=\\''.$backUrl.'\\'; window.close()</script>';//window.opener.location.reload()\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_curriculumdoc')->__('Curriculum Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $curriculumdoc->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('There was a problem saving the curriculum doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('Unable to find curriculum doc to save.')\n );\n $this->_redirect('*/*/');\n }", "public function reloadSubmissionTable(){\r\n\t\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t\t\t$data[\"formlist\"] = $this->AB->list_of_admission_form2();\r\n\t\t\t$this->load->view('gs_admission/submission/right_side_table',$data);\r\n\t\t}", "protected function ReloadCurrentStep()\n {\n $this->getRedirect()->redirect($this->getOrderStepPageService()->getLinkToOrderStepPageRelative($this));\n }", "public function onRun()\n {\n $this->page['visible'] = $this->property('visible');\n $this->page['button'] = $this->property('button');\n }", "function goToFormReinit(){\n\n require('view/frontend/formReinitMdpView.php');\n }", "function runShowAction() {\n // Fetch data from database and pass it to the template\n $dao = new sample_SampleDAO;\n $this->samples = $dao->find(); // Get all 'samples'\n\n $this->title = \"'Show' Action\"; // Set the page (<h1>) title, and append to the document <title>\n $this->addNotice(\"Something happened.\"); // Send a notice to the user\n $this->greeting = \"Hello, world!\"; // Send some data to the template\n }", "public function actionDivDataOld()\n\t{\n\t\tYii::app()->divDataImporter->update();\n\t\t//$this->redirect(Yii::app()->homeUrl);\n\t}", "function parent_edit_view($param1 = '')\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['code'] = $param1;\n $page_data['page_name'] = 'parent_edit';\n $page_data['page_title'] = get_phrase('edit_parent');\n $this->load->view('backend/index', $page_data);\n }", "public function save( $data ){\n\t\t\t$args['numToShow'] \t = (int) $data['numToShow'];\n $args['displayBeneath'] = (int) $data['displayBeneath'];\n $args['parentPageID'] = (int) $data['parentPageID'];\n\t\t\tparent::save( $args );\n\t\t}", "protected function setSuccessContent()\n {\n $this->title = 'Meditation Restored';\n \n $content = $this->getTitle();\n $content .= \"Your meditation time on <b>\";\n $content .= $this->data['long_date'];\n $content .= \"</b> has been restored.</p>\";\n \n $content .= '<p><a href=\"/journal\">Back to Journal</a></p>';\n \n $this->content = $content;\n }", "function displayPage()\n {\n $this->getState()->template = 'transition-page';\n }", "public function show_action() {\n if (Request::submitted('save')) {\n CSRFProtection::verifyUnsafeRequest();\n $this->setBody(Request::get('body'));\n }\n $this->actionHeader();\n $this->renderBodyTemplate('show');\n }", "function outputReloadParentCode()\n {\n global $application;\n\n if ($this -> _ReloadParentWindow != 1)\n return '';\n\n return $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'reload-parent-js.tpl.html',\n array()\n );\n }", "public function refresh() {\n \tif( $this->fetchData ) {\n \t\t\n \t\t// send data to view\n \t\t$this->set(array(\n \t\t\t'data' => $this->Reading->find('all'),\n \t\t\t'_serialize', array('data')));\n \t}\n\n }", "public function refreshFormSubmission(){\r\n\t\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t\t\t$data[\"school_lists\"] = $this->AB->school_id();\r\n\t\t\t$data[\"grade_lists\"] = $this->AB->grade_id();\r\n\t\t\t$this->load->view('gs_admission/submission/empty_form',$data);\r\n\t\t}", "public function setLoadControllerMenuSub()\r\n {\r\n add_submenu_page(\r\n $_SESSION['controller_data_sub']['page_slug_current'],\r\n $_SESSION['controller_data_sub']['page_title'], // Title of the page\r\n $_SESSION['controller_data_sub']['page_menu_text'], // Text to show on the menu link\r\n $_SESSION['controller_data_sub']['page_capability'], // Capability requirement to see the link\r\n $_SESSION['controller_data_sub']['page_slug'],\r\n $_SESSION['controller_data_sub']['page_render'],\r\n $_SESSION['controller_data_sub']['page_menu_position']\r\n );\r\n }", "public function onBackForm()\n {\n // Load another page\n AdiantiCoreApplication::loadPage('MultiStepMultiFormView', 'onLoadFromSession');\n }", "public function reload() {\n $this->sessionData = null;\n $this->getAllValues();\n }", "static public function showOnParentPageCallback(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\tswitch($r->show_on_parent_page){\r\n\t\t\tcase \"box\": $r->show($params->layout(), \"box\"); break;\r\n\t\t\tcase \"announce\": $r->show($params->layout(), \"announce\"); break;\r\n\t\t\tcase \"content\": $r->show($params->layout(), \"content\"); break;\r\n\t\t}\r\n\t}", "public function editAction()\n {\n $traineedocId = $this->getRequest()->getParam('id');\n $traineedoc = $this->_initTraineedoc();\n if ($traineedocId && !$traineedoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_traineedoc')->__('This trainee document no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getTraineedocData(true);\n if (!empty($data)) {\n $traineedoc->setData($data);\n }\n Mage::register('traineedoc_data', $traineedoc);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_traineedoc')->__('Trainee Document'))\n ->_title(Mage::helper('bs_traineedoc')->__('Trainee Document'));\n if ($traineedoc->getId()) {\n $this->_title($traineedoc->getTraineeDocName());\n } else {\n $this->_title(Mage::helper('bs_traineedoc')->__('Add trainee document'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }", "public function reloadTableData(){\r\n\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t \t$data[\"formlist\"] = $this->AB->list_of_admission_form();\r\n\t\t$user_id = $this->session->userdata(\"user_id\");\r\n\t\t$data[\"myttl\"] = $this->AB->getUserUploadedForm($user_id);\r\n\t\t$data[\"ttl\"] = $this->AB->getUserUploadedForm($user_id=NULL);\r\n\t\t$this->load->view('gs_admission/issuance/form_list',$data);\r\n\t\t}", "function BeforeShowEdit(&$xt,&$templatefile,$values,&$pageObject)\n{\n\n\t\t$_SESSION['pid'] = $values['pid'];\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n;\t\t\n}", "public function main()\n {\n $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/AjaxDataHandler');\n\n $this->moduleTemplate->addJavaScriptCode(\n 'RecordListInlineJS',\n '\n\t\t\t\tfunction jumpExt(URL,anchor) {\t//\n\t\t\t\t\tvar anc = anchor?anchor:\"\";\n\t\t\t\t\twindow.location.href = URL+(T3_THIS_LOCATION?\"&returnUrl=\"+T3_THIS_LOCATION:\"\")+anc;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tfunction jumpSelf(URL) {\t//\n\t\t\t\t\twindow.location.href = URL+(T3_RETURN_URL?\"&returnUrl=\"+T3_RETURN_URL:\"\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tfunction jumpToUrl(URL) {\n\t\t\t\t\twindow.location.href = URL;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tfunction setHighlight(id) {\t//\n\t\t\t\t\ttop.fsMod.recentIds[\"web\"]=id;\n\t\t\t\t\ttop.fsMod.navFrameHighlightedID[\"web\"]=\"pages\"+id+\"_\"+top.fsMod.currentBank;\t// For highlighting\n\n\t\t\t\t\tif (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {\n\t\t\t\t\t\ttop.content.nav_frame.refresh_nav();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfunction editRecords(table,idList,addParams,CBflag) {\t//\n\t\t\t\t\twindow.location.href=\"' . BackendUtility::getModuleUrl('record_edit', array('returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'))) . '&edit[\"+table+\"][\"+idList+\"]=edit\"+addParams;\n\t\t\t\t}\n\t\t\t\tfunction editList(table,idList) {\t//\n\t\t\t\t\tvar list=\"\";\n\n\t\t\t\t\t\t// Checking how many is checked, how many is not\n\t\t\t\t\tvar pointer=0;\n\t\t\t\t\tvar pos = idList.indexOf(\",\");\n\t\t\t\t\twhile (pos!=-1) {\n\t\t\t\t\t\tif (cbValue(table+\"|\"+idList.substr(pointer,pos-pointer))) {\n\t\t\t\t\t\t\tlist+=idList.substr(pointer,pos-pointer)+\",\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpointer=pos+1;\n\t\t\t\t\t\tpos = idList.indexOf(\",\",pointer);\n\t\t\t\t\t}\n\t\t\t\t\tif (cbValue(table+\"|\"+idList.substr(pointer))) {\n\t\t\t\t\t\tlist+=idList.substr(pointer)+\",\";\n\t\t\t\t\t}\n\n\t\t\t\t\treturn list ? list : idList;\n\t\t\t\t}\n\n\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';\n\t\t\t\tT3_THIS_LOCATION = ' . GeneralUtility::quoteJSvalue(rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))) . ';\n\t\t\t'\n );\n\n switch ($this->MOD_SETTINGS['function']) {\n case 'listRedirects':\n $this->content .= $this->listRedirects();\n break;\n }\n // Setting up the buttons and markers for docheader\n $this->getButtons();\n }", "function add_previous_data(){\n\t\t$this->load->helper('form');\n\t\t$this->data['student_id'] = '';\n\t\tif(isset($_REQUEST['student_id'])){\n\t\t\t$this->data['student_id'] = $_REQUEST['student_id'];\n\t\t}\n\t\t$this->data['not_popup'] = FALSE;\n\t\t$this->load->view('settings/students/add_previous_detail',$this->data);\n\t}", "public function createPlaceholdersAndDeleteLiveParentPage() {}", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('coursedoc')) {\n\n try {\n $data = $this->_filterDates($data, array('doc_date'));\n $coursedoc = $this->_initCoursedoc();\n $coursedoc->addData($data);\n $courseDocFileName = $this->_uploadAndGetName(\n 'course_doc_file',\n Mage::helper('bs_coursedoc/coursedoc')->getFileBaseDir(),\n $data\n );\n\n $coursedoc->setData('course_doc_file', $courseDocFileName);\n $products = $this->getRequest()->getPost('products', -1);\n if ($products != -1) {\n $coursedoc->setProductsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($products));\n }else {\n if(isset($data['hidden_course_id']) && $data['hidden_course_id'] > 0){\n $coursedoc->setProductsData(\n array(\n $data['hidden_course_id'] => array(\n 'position' => \"\"\n )\n )\n );\n\n\n }\n }\n $coursedoc->save();\n\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.document.location.href = \\''.$this->getUrl('*/catalog_product/edit', array('id'=>$data['hidden_course_id'], 'back'=>'edit', 'tab'=>'product_info_tabs_coursedocs')).'\\'; window.close()</script>';\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_coursedoc')->__('Course Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n if($add != ''){\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId(), 'tab' => 'product_info_tabs_coursedocs'));\n }else {\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId()));\n }\n\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was a problem saving the course doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Unable to find course doc to save.')\n );\n $this->_redirect('*/*/');\n }", "function pastIntro() {\n // move progress forward and redirect to the runSurvey action\n $this->autoRender = false; // turn off autoRender\n $this->Session->write('Survey.progress', RIGHTS);\n $this->redirect(array('action' => 'runSurvey'));\n\n }", "public function testParentRelationshipIsSaved(): void\n {\n $items = Category::factory()->count(1)->create();\n $parent = Category::factory()->create();\n\n Livewire::actingAs(User::factory()->admin()->create())\n ->test(CategoriesTable::class, ['items' => $items])\n ->emit('edit', $items[0]->id)\n ->set('editValues.parent_id', $parent->id)\n ->emit('save')\n ->assertHasNoErrors()\n ->assertOk()\n ->assertDispatchedBrowserEvent('notify', function ($name, $data) {\n return data_get($data, 'level') === 'success';\n });\n\n $this->assertEquals(1, $items[0]->fresh()->parent()->count());\n }", "public function updraft_ajaxrestore() {\n\t\t$this->prepare_restore();\n\t\tdie();\n\t}", "function editPage( &$outPage )\n {\n #echo \"eZNewsFlowerArticleViewer::editPage( \\$outPage = $outPage )<br />\\n\";\n $value = false;\n\n global $form_preview;\n #echo \"\\$form_preview = $form_preview<br />\\n\";\n #echo \"\\$this->Item->id() = \" . $this->Item->id() . \"<br />\\n\";\n $this->Item = new eZNewsArticle( $this->Item->id() );\n \n $this->IniObject->readAdminTemplate( \"eznewsflower/article\", \"view.php\" );\n\n if( !empty( $form_preview ) )\n {\n // OK, we need to store the changes.\n global $Story;\n global $Price;\n global $Name;\n global $ImageID;\n global $ParentID;\n \n $this->IniObject->set_file( array( \"article\" => \"preview.tpl\" ) );\n $this->IniObject->set_block( \"article\", \"go_to_parent_template\", \"go_to_parent\" );\n $this->IniObject->set_block( \"article\", \"go_to_self_template\", \"go_to_self\" );\n $this->IniObject->set_block( \"article\", \"upload_picture_template\", \"upload_picture\" );\n $this->IniObject->set_block( \"article\", \"picture_uploaded_template\", \"picture_uploaded\" );\n $this->IniObject->set_block( \"article\", \"picture_template\", \"picture\" );\n $this->IniObject->set_block( \"article\", \"article_image_template\", \"article_image\" );\n\n $newStory = \"<?xml version=\\\"1.0\\\"?>\\n\";\n $newStory = $newStory . \"<ezflower>\\n\";\n $newStory = $newStory . \"<name>\";\n $newStory = $newStory . htmlspecialchars( trim( $Name ) );\n $newStory = $newStory . \"</name>\\n\";\n $newStory = $newStory . \"<description>\";\n $newStory = $newStory . htmlspecialchars( trim( $Story ) );\n $newStory = $newStory . \"</description>\\n\";\n $newStory = $newStory . \"<price>\";\n $newStory = $newStory . htmlspecialchars( trim( $Price ) );\n $newStory = $newStory . \"</price>\\n\";\n $newStory = $newStory . \"</ezflower>\\n\";\n\n $this->Item->setParent( $ParentID, true );\n $this->Item->setStory( $newStory );\n $this->Item->setName( $Name );\n\n $file = new eZImageFile();\n\n if( $file->getUploadedFile( 'Image' ) )\n {\n $Picture = $file->name();\n\n $image = new eZImage();\n $image->setName( $file );\n $image->setCaption( \"Article picture: \" . $this->Item->name() );\n\n $image->setImage( $file );\n\n $image->store();\n $id = $image->ID();\n $PictureID = $id;\n }\n\n $this->Item->setImage( $PictureID, true );\n $this->Item->store( $outID );\n $this->doThis();\n }\n else\n {\n $this->IniObject->set_file( array( \"article\" => \"edit.tpl\" ) );\n $this->IniObject->set_block( \"article\", \"go_to_parent_template\", \"go_to_parent\" );\n $this->IniObject->set_block( \"article\", \"go_to_self_template\", \"go_to_self\" );\n $this->IniObject->set_block( \"article\", \"item_template\", \"item\" );\n $this->IniObject->set_block( \"article\", \"upload_picture_template\", \"upload_picture\" );\n $this->IniObject->set_block( \"article\", \"picture_uploaded_template\", \"picture_uploaded\" );\n $this->IniObject->set_block( \"article\", \"picture_template\", \"picture\" );\n $this->IniObject->set_block( \"article\", \"article_image_template\", \"article_image\" );\n $this->fillInCategories();\n $this->doThis( true );\n \n \n }\n \n\n $this->IniObject->setAllStrings();\n $outPage = $this->IniObject->parse( \"output\", \"article\" );\n\n $value = true;\n \n return $value;\n }", "public function restoreAction() {\n\n $blockVersionDatas = $this->getRequest()->getParams();\n\n //On charge la page correspondante\n $block = Mage::getModel('cms/block')->load($blockVersionDatas['block_id']);\n\n // On mets à jour les données avec les valeurs de notre version de page\n $block->setTitle($blockVersionDatas['title']);\n $block->setIdentifier($blockVersionDatas['identifier']);\n $block->setContent($blockVersionDatas['page_content']);\n\n if (preg_match(',', $blockVersionDatas['stores']))\n $block->setStores(explode(',', $blockVersionDatas['stores']));\n else\n $block->setStores(array($blockVersionDatas['stores']));\n\n try {\n $block->save();\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n die();\n }\n\n //Ajout du message de confirmation et redirection\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('Hhennes_CmsVersions')->__('Block version restored with success'));\n $this->_redirect('*/*/');\n }", "protected function after_load(){\n\n\n }", "public function reload();", "public function reload();", "public function reload();", "public function reload();", "public function beforeSave()\n {\n $this->rebuildTree();\n }", "function init()\t{\n\t\tglobal $BACK_PATH;\n\t\t$this->strExtKey = 'tx_pbsurvey';\n\t\t$this->arrWizardParameters = GeneralUtility::_GP('P');\n\t\t$this->arrTableParameters = GeneralUtility::_GP($this->strExtKey);\n\t\t$this->objDoc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');\n\t\t$this->objDoc->backPath = $BACK_PATH;\n\t\t$this->objDoc->JScode=$this->objDoc->wrapScriptTags('\n\t\t\tfunction jumpToUrl(URL,formEl)\t{\t//\n\t\t\t\tdocument.location = URL;\n\t\t\t}\n\t\t');\n\t\tlist($strRequestUri) = explode('#', GeneralUtility::getIndpEnv('REQUEST_URI'));\n\t\t$this->objDoc->form ='<form action=\"'.htmlspecialchars($strRequestUri).'\" method=\"post\" name=\"wizardConditions\">';\n\t\tif ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n\t\t\t$this->include_once[] = PATH_t3lib.'class.t3lib_tcemain.php';\n\t\t}\n\t}", "public function refresh();", "public function refresh();", "public function initCursedPage() {\n parent::setMedia();\n parent::initHeader();\n parent::initContent();\n parent::initFooter();\n parent::display();\n die();\n }", "function ajaLoadPage($url, $div)\n{\n //window.parent.document.getElementById(\"ajax-div-person-add\").inner\n}", "function newItemAfter()\r\n\t{\r\n\t\t$this->content_obj->newItemAfter();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function refresh()\n {\n }", "function newItemBefore()\r\n\t{\r\n\t\t$this->content_obj->newItemBefore();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function autosaved()\n {\n }", "public function successUpdate() {\n $this->loadFrontView('profile/after_update');\n }", "function load_edit_report($id , $add_visit = null, $close_report = null, $edit = null)\n {\n $lock_document = false;\n //check for add visit \n //print_r('before : '.$lock_document);\n if(null === ($add_visit))\n {\n $add_visit = false;\n }\n if(null === ($close_report))\n {\n $close_report = false;\n }\n if(null ===($edit))\n {\n $lock_document = true;\n }\n //print_r('after : '.$lock_document);\n $init['load_form_data'] = $lock_document;\n $init['reportID']= $id;\n $init['loaded_report_entries'] = $this->Report_model->load_report_entries($id);\n \n $sicknessID = $init['loaded_report_entries']['sickness_id'];\n \n //prepare animal data\n \n $animal = $this->prepare_view_animal($lock_document,$init['loaded_report_entries']['animal_id']);\n //all treatment data\n $treatmentdata['treatment_selected']= $init['loaded_report_entries']['treatment_for_sickness_id'];\n $treatmentdata = $this->prepare_view_treatment($treatmentdata,$lock_document,$sicknessID);\n \n //data for the disease, prepare dropdown arrays\n $form_data = $this->prepare_view_sickness($lock_document, $id);\n $this->load->view('templates/header');\n \n //check if this is a edit call and \"place\" button if it is \n if(!$lock_document)\n {\n \n $this->load->view('reports/form_open_edit_case',$init);\n }\n $closing_report['report_id'] = $id;\n if($close_report)\n {\n $closing_report['new'] = $close_report;\n $closing_report['load_form_data'] = false;\n //$closing_report['entrie'] = $this->Report_model->load_report_closure($id);\n $this->load->view('reports/closing',$closing_report);\n }\n //print_r($init['loaded_report_entries']['status']);\n if($init['loaded_report_entries']['status'] == 3)\n {\n $closing_report['load_form_data'] = false;\n $closing_report['entrie'] = $this->Report_model->load_report_closure($id);\n $this->load->view('reports/closing',$closing_report);\n }\n // create different views\n $this->load->view('reports/animal',$animal);\n $this->load->view('reports/sickness',$form_data);\n $this->load->view('reports/treatment',$treatmentdata);\n \n $visit_count = $this->Report_model->get_visit_count($id);\n //$count_existing_visits= $count_existing_visits['visit_count'];\n //print_r($visit_count);\n if($visit_count > 0)\n {\n $this->show_created_visits($lock_document,$id,$edit);\n }\n //add Visit\n if($add_visit)\n {\n $this->create_new_visit($id,$visit_count,$sicknessID);\n }\n if(!$lock_document)\n {\n //todo after edit of treatment\n $edit_data['this_report_id'] = $id;\n $edit_data['this_visit_count'] = $visit_count;\n //$edit_data[''] = ;\n $this->load->view('reports/form_submit_edit_case',$edit_data);\n }\n $this->load->view('templates/footer');\n }", "public function transition(): void\n\t{\n\t\t$params = ['title', 'referer'];\n\t\tforeach ($params as $param) {\n\t\t\t$$param = $_GET[$param] ?? null;\n\t\t}\n\t\t\n\t\tif (empty($this->client)) {\n\t\t\t$this->client = $this->setInitData($referer);\n\t\t\tif (!$title) $title = $_SERVER['HTTP_REFERER'];\n\t\t\t$this->client['referer'] .= ', на страницу <a href=\"'.$_SERVER['HTTP_REFERER'].'\">'.$title.'</a>';\n\t\t}\n\t\t\n\t\tif (!$this->isRefresh(end($this->client['history'])['url'])) {\n\t\t\t$this->client['history'][] = [\n\t\t\t\t'ts' \t=> time(),\n\t\t\t\t'url' \t=> $_SERVER['HTTP_REFERER'],\n\t\t\t\t'title' => $title\n\t\t\t];\n\t\t}\n\t\t\n\t\t$this->save(false);\n\t}", "public function refresh()\n {\n // Several refresh() calls might happen during one request. If that is the case, the Resource Manager can't know\n // that the first created resource object doesn't have to be persisted / published anymore. Thus we need to\n // delete the resource manually in order to avoid orphaned resource objects:\n if ($this->resource !== null) {\n $this->resourceManager->deleteResource($this->resource);\n }\n\n parent::refresh();\n $this->renderResource();\n }", "function home()\n {\n $data=$this->model->getProfes();\n $this->addData($data);\n //rebuilding with new data\n $this->view->__construct($this->dataView,$this->dataTable);\n $this->view->show();\n \t\t}", "private function loadPage()\n\t{\n\t $data = $this->getData();\n \t \n\t $this->load->view('index', $data);\n\t}", "protected function postLoad(){\n\t\t\t\n\t\t}", "public function editAction(){\n \t /**\n * retrieving existing brand data if an ID was specified,\n * if not we will have an empty Brand entity ready to be populated.\n */\n $accordion = Mage::getModel('bhargav_accordion/accordion');\n if ($accordionId = $this->getRequest()->getParam('id', false)) {\n $accordion->load($accordionId);\n\n if ($accordion->getId() < 1) {\n $this->_getSession()->addError(\n $this->__('This accordion no longer exists.')\n );\n return $this->_redirect(\n 'bhargav_accordion_admin/accordion/index'\n );\n }\n}\n // process $_POST data if the form was submitted\nif($postData = $this->getRequest()->getPost('accordionData')){\n try {\n\n if( isset($postData['page']) ) {\n $postData['page_id'] = $postData['page'];\n if( in_array('0', $postData['page_id']) ){\n $postData['page'] = '0';\n } else {\n $postData['page'] = join(\",\", $postData['page_id']);\n }\n unset($postData['page_id']);\n }\n if( isset($postData['store_id']) ) {\n $postData['stores'] = $postData['store_id'];\n if( in_array('0', $postData['stores']) ){\n $postData['store_id'] = '0';\n } else {\n $postData['store_id'] = join(\",\", $postData['stores']);\n }\n unset($postData['stores']);\n }\n $accordion->addData($postData);\n $accordion->save();\n $this->_getSession()->addSuccess($this->__('The accordion is saved.'));\n return $this->_redirect('bhargav_accordion_admin/accordion/edit',array('id' => $accordion->getId()));\n\n} catch (Exception $e) {\n Mage::logException($e);\n $this->_getSession()->addError($e->getMessage());\n}\n}\n\nMage::register('current_accordion', $accordion);\n\n\n$accordionEditBlock = $this->getLayout()->createBlock('bhargav_accordion_adminhtml/accordion_edit');\n$this->loadLayout()\n->_addContent($accordionEditBlock)\n->renderLayout();\n\n\n}", "public function init() {\n parent::init();\n $this->removeElement('staff_id');\n $this->getElement('sub')->setLabel('Save');\n }", "public function run() {\n $this->render('dataSaved', array());\n }", "public function createPageAndCopyDraftParentPage() {}", "public function hapus_judul_sub_det()\n {\n $id_det_pros = $this->uri->segment(3);\n $id_pros = $this->uri->segment(4);\n $id_sub_det_judul = $this->uri->segment(5);\n\n $this->M_prospektus->proses_hapus_sub_judul_det('sub_detail_pros', array('id_sub_detail_pros' => $id_sub_det_judul));\n\n $this->session->set_flashdata('pesan', '<div class=\"alert alert-inv alert-inv-danger alert-wth-icon alert-dismissible fade show\" role=\"alert\"><span class=\"alert-icon-wrap\"><i class=\"fa fa-check\" style=\"margin-top: -10px\"></i></span>\n Data Sukses Dihapus\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>');\n\n redirect(\"prospektus/tambah_sub_detail/$id_det_pros/$id_pros/detail\");\n\n }", "public function autosave() {\n\t $this->use_layout=false;\n\t $this->use_view=false;\n\t $content = new $this->model_class(Request::get(\"id\"));\n\t if($content->primval) {\n\t $content->update_attributes($_POST[\"cms_content\"]);\n\t echo date(\"H:i:s\");\n\t }else{\n\t throw new WXRoutingException('Tried to save in a non-existing database entry!', \"Page not found\", '404');\n\t }\n\t exit;\n\t}", "public function createPlaceholdersAndDeleteDraftParentPage() {}", "function show_new_record() {\r\n if ($this->allow_new) {\r\n #~ echo \"<p><a href='{$_SERVER['PHP_SELF']}?m={$this->module}&amp;act=new&amp;go=\".urlencode($GLOBALS['full_self_url']).\"'>Insert new row</a>\";\r\n echo '<form method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n echo '<input type=hidden name=\"m\" value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=\"act\" value=\"new\">';\r\n echo '<input type=hidden name=\"go\" value=\"'.htmlentities($GLOBALS['full_self_url']).'\">'; # url to go after successful submitation\r\n # if i'm a detail, get master-detail field's value and pass it to new-form\r\n if ($this->logical_parent) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->parentkey) { # foreign key always int\r\n echo '<input type=hidden name=\"sugg_field['.$colvar.']\" value=\"'.htmlentities($col->parentkey_value).'\">';\r\n }\r\n }\r\n }\r\n echo '<p>'.lang('Add').' <input type=text name=\"num_row\" size=2 value=\"1\"> '.lang($this->unit).' <input type=submit value=\"'.lang('Go').'\">';\r\n echo '</form>';\r\n }\r\n }", "private function Reload(){\t\t\t\t\r\n\t $this->valueLatestPeriod();\t \r\n\t $this->prepareGridData(); //ADDING TO OUTPUT\t\t\r\n\t}", "public function startup() {\n parent::startup(); \n self::renderShow(); \n }", "public function plant_gate_pass()\n {\n $plant_name = $this->session->userdata('plant_name');\n $data['nestedView']['heading']=\"$plant_name Gate Pass\";\n $data['nestedView']['pageTitle'] = \"$plant_name Gate Pass\";\n $data['nestedView']['cur_page'] = 'gate_pass';\n $data['nestedView']['parent_page'] = 'gate_pass';\n\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['js_includes'][] = '<script type=\"text/javascript\" src=\"'.assets_url().'pages/scripts/gate_pass.js\"></script>';\n $data['nestedView']['css_includes'] = array();\n\n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array(array('label' => 'Home', 'class' => '', 'url' => SITE_URL . 'home'));\n $data['nestedView']['breadCrumbOptions'][] = array('label' => \"$plant_name Gate Pass\", 'class' => '', 'url' =>'');\n \n\n $data['flag']=1;\n $this->session->unset_userdata('gate_pass1');\n $this->load->view('plant_gate_pass/plant_gate_pass',$data);\n }", "public function createNestedPagesAndCopyDraftParentPage() {}", "function show()\n {\n // carrega os dados no datagrid\n $this->onReload();\n //chama o metodo show da super classe\n parent::show();\n\n }", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function rollback_invoice_delete()\n {\n $data['nestedView']['pageTitle'] = 'Invoice Delete Details';\n $data['nestedView']['heading'] = \"Invoice Delete Details\";\n $data['nestedView']['cur_page'] = 'Invoice Delete Details';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Delete','class'=>'active','url'=>SITE_URL.'delete_invoice'); \n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Delete Details','class'=>'active','url'=>'');\n\n $invoice_number=$this->input->post('invoice_id',TRUE);\n $invoice_id=$this->Rollback_invoice_m->get_invoice_id($invoice_number);\n $count_receipt_invoice = $this->Common_model->get_data('receipt_invoice',array('invoice_id'=>$invoice_id));\n $count_gatepass = $this->Common_model->get_data('gatepass_invoice',array('invoice_id'=>$invoice_id));\n if(count($count_receipt_invoice)>0 || count($count_gatepass)>0)\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice is involved in Gatepass/StockReceiving. Please Check! </div>');\n redirect(SITE_URL.'delete_invoice'); exit();\n }\n $invoice_type=$this->Rollback_invoice_m->get_invoice_type($invoice_id);\n if($invoice_type['type'] == 2)\n {\n \n $invoice_plant_products=$this->Rollback_invoice_m->get_invoice_do_product($invoice_id);\n \n if(count($invoice_plant_products)!='')\n {\n \n foreach($invoice_plant_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['from']=$value['from'];\n $results['to']=$value['to'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n //echo \"<pre>\"; print_r($invoice_plant_products); exit;\n $col=array_column($invoice_plant_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n $data['tin_num']=37280114257;\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_plant_product']=$invoice_plant_products;\n $data['flag']=3;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n }\n elseif($invoice_type['type']== 1)\n {\n $invoice_dist_products=$this->Rollback_invoice_m->get_invoice_do_distributor_product($invoice_id);\n \n if(count($invoice_dist_products)!='')\n {\n foreach($invoice_dist_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['distributor_code']=$value['distributor_code'];\n $results['tin_num']=$value['vat_no'];\n $results['mobile']=$value['mobile'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['amount']=$value['amount'];\n $results['agency_name']=$value['agency_name'];\n $results['address']=$value['address'];\n $results['lifting']=$value['lifting'];\n $results['location']=$value['distributor_place'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n $col=array_column($invoice_dist_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_dist_product']=$invoice_dist_products;\n $data['flag']=2;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n \n \n \n $this->load->view('rollback_invoice/rollback_invoice_delete_view',$data);\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "public function refreshFormData(){\r\n\t\t\t$data[\"campus\"] = $this->input->post(\"campus\");\r\n\t\t\t$this->load->view('gs_admission/issuance/IssueAdmissionForm2',$data);\r\n\t\t}", "protected function finalize()\n\t{\n\t\t$presenter = $this->getPresenter();\n\n\t\tif ($this->presenter->isAjax()) {\n\n\t\t\t$presenter->payload->snippets = array();\n\n\t\t\t$html = $this->__toString();\n\n\t\t\t// Remove snippet-div to emulate native snippets... No extra support on client side is needed...\n\t\t\t$snippet = 'snippet-' . $this->getUniqueId() . '-grid';\n\t\t\t$start = strlen('<div id=\"' . $snippet . '\">');\n\t\t\t$stop = -strlen('</div>');\n\t\t\t$html = trim(mb_substr($html, $start, $stop));\n\n\t\t\t// Send snippet\n\t\t\t$presenter->payload->snippets[$snippet] = $html;\n\t\t\t$presenter->sendPayload();\n\t\t\t$presenter->terminate();\n\n\t\t} else {\n\n\t\t\t$presenter->redirect('this');\n\t\t}\n\t}", "public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function main()\n {\n $lang = $this->getLanguageService();\n // Access check...\n // The page will show only if there is a valid page and if this page may be viewed by the user\n $access = is_array($this->pageinfo) ? 1 : 0;\n // Content\n $content = '';\n if ($this->id && $access) {\n // Initialize permission settings:\n $this->CALC_PERMS = $this->getBackendUser()->calcPerms($this->pageinfo);\n $this->EDIT_CONTENT = $this->contentIsNotLockedForEditors();\n\n $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);\n\n // override the default jumpToUrl\n $this->moduleTemplate->addJavaScriptCode('jumpToUrl', '\n function jumpToUrl(URL,formEl) {\n if (document.editform && TBE_EDITOR.isFormChanged) { // Check if the function exists... (works in all browsers?)\n if (!TBE_EDITOR.isFormChanged()) {\n window.location.href = URL;\n } else if (formEl) {\n if (formEl.type==\"checkbox\") formEl.checked = formEl.checked ? 0 : 1;\n }\n } else {\n window.location.href = URL;\n }\n }\n ');\n $this->moduleTemplate->addJavaScriptCode('mainJsFunctions', '\n if (top.fsMod) {\n top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';\n top.fsMod.navFrameHighlightedID[\"web\"] = \"pages' . (int)$this->id . '_\"+top.fsMod.currentBank; ' . (int)$this->id . ';\n }\n ' . ($this->popView ? BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)) : '') . '\n function deleteRecord(table,id,url) { //\n window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[')\n . ' + table + \"][\" + id + \"][delete]=1&redirect=\" + encodeURIComponent(url) + \"&prErr=1&uPT=1\";\n return false;\n }\n ');\n\n // Find backend layout / columns\n $backendLayout = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);\n if (!empty($backendLayout['__colPosList'])) {\n $this->colPosList = implode(',', $backendLayout['__colPosList']);\n }\n // Removing duplicates, if any\n $this->colPosList = array_unique(GeneralUtility::intExplode(',', $this->colPosList));\n // Accessible columns\n if (isset($this->modSharedTSconfig['properties']['colPos_list']) && trim($this->modSharedTSconfig['properties']['colPos_list']) !== '') {\n $this->activeColPosList = array_unique(GeneralUtility::intExplode(',', trim($this->modSharedTSconfig['properties']['colPos_list'])));\n // Match with the list which is present in the colPosList for the current page\n if (!empty($this->colPosList) && !empty($this->activeColPosList)) {\n $this->activeColPosList = array_unique(array_intersect(\n $this->activeColPosList,\n $this->colPosList\n ));\n }\n } else {\n $this->activeColPosList = $this->colPosList;\n }\n $this->activeColPosList = implode(',', $this->activeColPosList);\n $this->colPosList = implode(',', $this->colPosList);\n\n $content .= $this->getHeaderFlashMessagesForCurrentPid();\n\n // Render the primary module content:\n if ($this->MOD_SETTINGS['function'] == 1 || $this->MOD_SETTINGS['function'] == 2) {\n $content .= '<form action=\"' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->id, 'imagemode' => $this->imagemode])) . '\" id=\"PageLayoutController\" method=\"post\">';\n // Page title\n $content .= '<h1 class=\"t3js-title-inlineedit\">' . htmlspecialchars($this->getLocalizedPageTitle()) . '</h1>';\n // All other listings\n $content .= $this->renderContent();\n }\n $content .= '</form>';\n $content .= $this->searchContent;\n // Setting up the buttons for the docheader\n $this->makeButtons();\n // @internal: This is an internal hook for compatibility7 only, this hook will be removed without further notice\n if ($this->MOD_SETTINGS['function'] != 1 && $this->MOD_SETTINGS['function'] != 2) {\n $renderActionHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['renderActionHook'];\n if (is_array($renderActionHook)) {\n foreach ($renderActionHook as $hook) {\n $params = [\n 'deleteButton' => $this->deleteButton,\n ''\n ];\n $content .= GeneralUtility::callUserFunction($hook, $params, $this);\n }\n }\n }\n // Create LanguageMenu\n $this->makeLanguageMenu();\n } else {\n $this->moduleTemplate->addJavaScriptCode(\n 'mainJsFunctions',\n 'if (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';'\n );\n $content .= '<h1>' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '</h1>';\n $view = GeneralUtility::makeInstance(StandaloneView::class);\n $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));\n $view->assignMultiple([\n 'title' => $lang->getLL('clickAPage_header'),\n 'message' => $lang->getLL('clickAPage_content'),\n 'state' => InfoboxViewHelper::STATE_INFO\n ]);\n $content .= $view->render();\n }\n // Set content\n $this->moduleTemplate->setContent($content);\n }", "public function init() {\n parent::init();\n $this->pageTitle = \"ニューギンスクエア\";\n if (Yii::app()->request->cookies['id'] == \"\" || Yii::app()->request->cookies['id'] == \"null\") {\n $this->redirect(array('newgin/'));\n }\n }", "public function inPageEdit() {\n\t\t\n\t\t$output = array();\n\t\t$context = Request::post('context');\n\t\t$postData = Request::post('data');\n\t\t$url = Request::post('url');\n\t\t\n\t\tif ($context) {\n\t\t\n\t\t\t// Check if page actually exists.\n\t\t\tif ($Page = $this->Automad->getPage($context)) {\n\t\t\t\t\n\t\t\t\t// If data gets received, merge and save.\n\t\t\t\t// Else send back form fields.\n\t\t\t\tif ($postData && is_array($postData)) {\n\t\t\t\t\t\n\t\t\t\t\t// Merge and save data.\n\t\t\t\t\t$data = array_merge(Core\\Parse::textFile($this->getPageFilePath($Page)), $postData);\n\t\t\t\t\tFileSystem::writeData($data, $this->getPageFilePath($Page));\n\t\t\t\t\tCore\\Debug::log($data, 'saved data');\n\t\t\t\t\tCore\\Debug::log($this->getPageFilePath($Page), 'data file');\n\t\t\t\t\t\n\t\t\t\t\t// If the title has changed, the page directory has to be renamed as long as it is not the home page.\n\t\t\t\t\tif (!empty($postData[AM_KEY_TITLE]) && $Page->url != '/') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Move directory.\n\t\t\t\t\t\t$newPagePath = FileSystem::movePageDir(\n\t\t\t\t\t\t\t$Page->path, \n\t\t\t\t\t\t\tdirname($Page->path), \n\t\t\t\t\t\t\t$this->extractPrefixFromPath($Page->path), \n\t\t\t\t\t\t\t$postData[AM_KEY_TITLE]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\tCore\\Debug::log($newPagePath, 'renamed page');\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Clear cache to reflect changes.\n\t\t\t\t\t$this->clearCache();\n\t\t\t\t\t\n\t\t\t\t\t// If the page directory got renamed, find the new URL.\n\t\t\t\t\tif ($Page->url == $url && isset($newPagePath)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// The page has to be redirected to a new url in case the edited context is actually \n\t\t\t\t\t\t// the requested page and the title of the page and therefore the URL has changed.\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Rebuild Automad object, since the file structure has changed.\n\t\t\t\t\t\t$Automad = new Core\\Automad();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Find new URL and return redirect URL.\n\t\t\t\t\t\tforeach ($Automad->getCollection() as $key => $Page) {\n\n\t\t\t\t\t\t\tif ($Page->path == $newPagePath) {\n\t\t\t\t\t\t\t\t$output['redirect'] = AM_BASE_INDEX . $key;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// There are two cases where the currently requested page has to be\n\t\t\t\t\t\t// simply reloaded without redirection:\n\t\t\t\t\t\t// \n\t\t\t\t\t\t// 1.\tThe context of the edits is not the current page and another\n\t\t\t\t\t\t// \t\tpages gets actually edited.\n\t\t\t\t\t\t// \t\tThat would be the case for edits of pages displayed in pagelists or menus.\n\t\t\t\t\t\t// \t\n\t\t\t\t\t\t// 2.\tThe context is the current page, but the title didn't change and\n\t\t\t\t\t\t// \t\ttherefore the URL stays the same.\n\t\t\t\t\t\t$output['redirect'] = AM_BASE_INDEX . $url;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Append query string if not empty.\n\t\t\t\t\t$queryString = Request::post('query');\n\n\t\t\t\t\tif ($queryString) {\n\t\t\t\t\t\t$output['redirect'] .= '?' . $queryString;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t// Return form fields if key is defined.\n\t\t\t\t\tif ($key = Request::post('key')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!empty($Page->data[$key])) {\n\t\t\t\t\t\t\t$value = $Page->data[$key];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Note that $Page->path has to be added to make image previews work in CodeMirror.\n\t\t\t\t\t\t$output['html'] = Components\\InPage\\Edit::render($this->Automad, $key, $value, $context, $Page->path);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t\n\t}", "public function date_change_details()\n {\n $data['nestedView']['pageTitle'] = 'Invoice Date Change Details';\n $data['nestedView']['heading'] = \"Invoice Date Change Details\";\n $data['nestedView']['cur_page'] = 'Invoice Date Change Details';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Date Change','class'=>'active','url'=>SITE_URL.'date_change'); \n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Date Change Details','class'=>'active','url'=>'');\n\n $invoice_number=$this->input->post('invoice_id',TRUE);\n $invoice_id=$this->Rollback_invoice_m->get_invoice_id($invoice_number);\n $count_receipt_invoice = $this->Common_model->get_data('receipt_invoice',array('invoice_id'=>$invoice_id));\n $count_gatepass = $this->Common_model->get_data('gatepass_invoice',array('invoice_id'=>$invoice_id));\n if(count($count_receipt_invoice)>0 || count($count_gatepass)>0)\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice is involved in Gatepass/StockReceiving. Please Check! </div>');\n redirect(SITE_URL.'date_change'); exit();\n }\n $invoice_type=$this->Rollback_invoice_m->get_invoice_type($invoice_id);\n //print_r($invoice_type) ; exit;\n if($invoice_type['type'] == 2)\n {\n \n $invoice_plant_products=$this->Rollback_invoice_m->get_invoice_do_product($invoice_id);\n \n if(count($invoice_plant_products)!='')\n {\n \n foreach($invoice_plant_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['from']=$value['from'];\n $results['to']=$value['to'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id'] = $value['invoice_id'];\n \n }\n //echo \"<pre>\"; print_r($invoice_plant_products); exit;\n $col=array_column($invoice_plant_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n $data['tin_num']=37280114257;\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_plant_product']=$invoice_plant_products;\n $data['flag']=3;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'date_change');\n }\n }\n \n elseif($invoice_type['type']== 1)\n {\n $invoice_dist_products=$this->Rollback_invoice_m->get_invoice_do_distributor_product($invoice_id);\n \n if(count($invoice_dist_products)!='')\n {\n foreach($invoice_dist_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['distributor_code']=$value['distributor_code'];\n $results['tin_num']=$value['vat_no'];\n $results['mobile']=$value['mobile'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['amount']=$value['amount'];\n $results['agency_name']=$value['agency_name'];\n $results['address']=$value['address'];\n $results['lifting']=$value['lifting'];\n $results['location']=$value['distributor_place'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id'] = $value['invoice_id'];\n \n }\n $col=array_column($invoice_dist_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_dist_product']=$invoice_dist_products;\n $data['flag']=2;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'date_change');\n }\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'date_change');\n }\n \n \n \n $this->load->view('rollback_invoice/rollback_invoice_view',$data);\n }", "public function edit() {\n\t $this->id = WaxUrl::get(\"id\");\n\t\tif(!$this->id) $this->id = $this->route_array[0];\n\n\t\tif(($lang_id = Request::get(\"lang\")) && (!$this->languages[$lang_id])){\n\t Session::add_message(\"That language isn't allowed on your system. Here's the {$this->languages[0]} version instead.\");\n\t $this->redirect_to(\"/admin/\".$this->module_name.\"/edit/$this->id\");\n }\n\n $master = new $this->model_class($this->id);\n if($master->status == 4) $this->redirect_to(\"/admin/\".$this->module_name.\"/edit/$master->preview_master_id\"); //this isn't a master, jump to the right url\n if($master->language) $this->redirect_to(\"/admin/\".$this->module_name.\"/edit/$master->preview_master_id?lang=\".$master->language);\n \n if($lang_id) $master = $this->get_language_model($master, $lang_id);\n\n\t $preview = new $this->model_class;\n\t //preview revision - create a copy of the content if needed or use the existing copy\n\t\tif(($master->status == 1) || ($master->status == 6)){\n\t\t if(!($preview = $preview->filter(array(\"preview_master_id\" => $master->primval, \"status\" => 4))->first())){\n\t\t //if a preview entry doesn't exist create one\n \t\t foreach($master->columns as $col => $params)\n \t\t if($master->$col) $copy_attributes[$col] = $master->$col;\n \t\t $copy_attributes = array_diff_key($copy_attributes,array($this->model->primary_key => false)); //take out ID\n \t $preview = new $this->model_class;\n\t\t\t\t$preview->status = 4;\n \t $preview->save();\n \t\t $preview->set_attributes($copy_attributes);\n \t\t $preview->status = 4;\n \t\t $preview->url = $master->url;\n \t\t $preview->master = $master->primval;\n \t\t $preview->save();\n\t }\n $this->model = $preview;\n\t\t}else{\n\t\t $this->model = $master;\n\t\t}\n\t\t\n\t\tif($this->model->is_posted()){\n \t\tif($_POST['publish']){\n \t\t if(($master->status != 1) && ($master->status != 6)){\n \t\t $master->set_attributes($_POST[$master->table]);\n \t\t if($master->status == 5) $master->status = 6;\n \t\t else $master->status = 1;\n \t\t $master->save();\n\t }else{\n\t $this->update_master($preview, $master);\n\t if($preview->primval) $preview->delete();\n\t }\n\t\t Session::add_message($this->display_name.\" \".\"Successfully Published\");\n\t\t $this->redirect_to(\"/admin/$this->module_name/\");\n \t\t}elseif($_POST['close']){\n\t\t //delete the preview if it has no changes from the master\n\t\t if($preview->equals($master) && $preview->primval) $preview->delete();\n \t\t $this->redirect_to(Session::get(\"list_refer\"));\n \t }else{ //save button is default post, as it's the least destructive thing to do\n \t if($preview->primval && (($_POST[$this->model->table]['status'] == 0) || ($_POST[$this->model->table]['status'] == 5))){\n $this->update_master($preview, $master);\n if($preview->primval) $preview->delete();\n $this->save($master, \"/admin/$this->module_name/edit/\".$master->id.\"/\");\n \t }else $this->save($this->model, \"/admin/$this->module_name/edit/\".$master->id.\"/\");\n \t }\n }\n\n\t\t//images\n if(!$this->attached_images = $this->model->images) $this->attached_images=array();\n \n\t\t//categories assocaited\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\t//all categories\n\t\tif(!$this->all_categories = $cat->order(\"name ASC\")->all() ) $this->all_categories=array();\n\t\t$this->image_model = new WildfireFile;\n\t\t//partials\n\t\t$this->image_partial = $this->render_partial(\"page_images\");\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\n\t\t$this->category_partial = $this->render_partial(\"apply_categories\");\n\t\t$files = new WildfireFile();\n\t\t$this->all_links = $files->find_all_files();\n\t\t$this->link_partial = $this->render_partial(\"apply_links\");\n\t\t$this->extra_content_partial = $this->render_partial(\"extra_content\");\n\t\t$this->flash_files = $files->flash_files();\n\t\t$this->video_partial = $this->render_partial(\"apply_video\");\n\t\t$this->table_partial = $this->render_partial(\"wysi_tables\");\n\t\t$this->form = $this->render_partial(\"form\");\n\t\t\n\t}", "function titel_show()\n{\n global $tpl;\n global $db;\n $sFormTitle = \"Brochure aanvraag beheer\";\n\n//-------------------------------\n// titel Open Event begin\n// titel Open Event end\n//-------------------------------\n\n//-------------------------------\n// Set URLs\n//-------------------------------\n//-------------------------------\n// titel Show begin\n//-------------------------------\n\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n\n//-------------------------------\n// titel BeforeShow Event begin\n// titel BeforeShow Event end\n//-------------------------------\n\n//-------------------------------\n// Show fields\n//-------------------------------\n $tpl->parse(\"Formtitel\", false);\n\n//-------------------------------\n// titel Show end\n//-------------------------------\n}", "public function savesubmit(){\n\t\t$this->autoRender = false;\n\t\t if($this->request->is('POST')){ \n\t\t\t //\n\t\t \n\t\t\t$this->Session->write('project.aftersave', 'sent');\n//\t\t\t$this->Session->write('brief.type', $this->name);\n\t\t\t$this->Session->write('brief.type', $this->params['controller']);\n\t\t\t$this->Session->write('brief.id', $this->Email->id);\n\t\t\t \n\t\t\t \n\t\t\t//echo 'aftersave';\t\n\t\t\t //$this->redirect(array('controller'=>'projects', 'action' => 'view', $this->Session->read('project.id') ));\n\n\t\t }\t\t\n\t}", "public function restore() {\n self::restoreAll($this->chapterID);\n }", "public function refresh() {}", "public static function use_parent_template() {\n add_action('save_post', array('core_admin', 'switch_page_template'));\n }", "public function ee_breakouts_page_load() {}" ]
[ "0.5612769", "0.54697454", "0.54483396", "0.5438584", "0.54202765", "0.540775", "0.5407571", "0.53850156", "0.53848875", "0.5345823", "0.5313987", "0.53090984", "0.53062284", "0.5302938", "0.5254672", "0.52392924", "0.52292204", "0.51982474", "0.5195093", "0.51925135", "0.5191553", "0.5173361", "0.5171073", "0.51703316", "0.5163515", "0.51257366", "0.51180017", "0.51028925", "0.5087718", "0.5076611", "0.50703144", "0.5058135", "0.505803", "0.5057281", "0.50512576", "0.5047076", "0.50395226", "0.50357926", "0.5023512", "0.501781", "0.5010495", "0.5002253", "0.49991482", "0.49801734", "0.49727002", "0.49691266", "0.4966984", "0.49662685", "0.49533686", "0.49533686", "0.49533686", "0.49533686", "0.49506405", "0.49490348", "0.49448082", "0.49448082", "0.49395344", "0.4931721", "0.4930717", "0.49290943", "0.49288112", "0.49255472", "0.49207148", "0.49148753", "0.4913451", "0.49102333", "0.49093238", "0.49056447", "0.4899517", "0.48976582", "0.48959237", "0.48913804", "0.4883657", "0.48820603", "0.48743412", "0.4870444", "0.4860929", "0.4858749", "0.4857863", "0.48558134", "0.48521623", "0.4851187", "0.4845729", "0.48402014", "0.4838249", "0.4838249", "0.4838249", "0.48334163", "0.48301244", "0.48259097", "0.4825051", "0.48247993", "0.48244703", "0.4816167", "0.4810768", "0.48103908", "0.48082903", "0.4804801", "0.48012838", "0.47991452", "0.47927132" ]
0.0
-1
Save button takes us to the next transect.
public static function get_redirect_on_success($values, $args) { if (!empty($values['next-zone']) && !empty($values['next-transect'])) return $args['redirect_on_success'] . '?' . data_entry_helper::array_to_query_string(array( 'table' => 'sample', 'id'=>$values['sample:parent_id'], 'zone'=>$values['next-zone'], 'transect'=>$values['next-transect'] )); else return $args['front_page_path']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save() {\n\t\t$this->data[] = $this->current();\n\t}", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('traineedoc')) {\n try {\n $data = $this->_filterDates($data, array('trainee_doc_date'));\n\n $traineedoc = $this->_initTraineedoc();\n $traineedoc->addData($data);\n $traineeDocFileName = $this->_uploadAndGetName(\n 'trainee_doc_file',\n Mage::helper('bs_traineedoc/traineedoc')->getFileBaseDir(),\n $data\n );\n $traineedoc->setData('trainee_doc_file', $traineeDocFileName);\n $trainees = $this->getRequest()->getPost('trainees', -1);\n if ($trainees != -1) {\n $traineedoc->setTraineesData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($trainees));\n }else {\n if(isset($data['hidden_trainee_id']) && $data['hidden_trainee_id'] > 0){\n $traineedoc->setTraineesData(\n array(\n $data['hidden_trainee_id'] => array(\n 'position' => \"\"\n )\n )\n );\n }\n }\n $traineedoc->save();\n\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.location.reload(); window.close()</script>';\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_traineedoc')->__('Trainee Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $traineedoc->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['trainee_doc_file']['value'])) {\n $data['trainee_doc_file'] = $data['trainee_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setTraineedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['trainee_doc_file']['value'])) {\n $data['trainee_doc_file'] = $data['trainee_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineedoc')->__('There was a problem saving the trainee document.')\n );\n Mage::getSingleton('adminhtml/session')->setTraineedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineedoc')->__('Unable to find trainee document to save.')\n );\n $this->_redirect('*/*/');\n }", "public function savesubmit(){\n\t\t$this->autoRender = false;\n\t\t if($this->request->is('POST')){ \n\t\t\t //\n\t\t \n\t\t\t$this->Session->write('project.aftersave', 'sent');\n//\t\t\t$this->Session->write('brief.type', $this->name);\n\t\t\t$this->Session->write('brief.type', $this->params['controller']);\n\t\t\t$this->Session->write('brief.id', $this->Email->id);\n\t\t\t \n\t\t\t \n\t\t\t//echo 'aftersave';\t\n\t\t\t //$this->redirect(array('controller'=>'projects', 'action' => 'view', $this->Session->read('project.id') ));\n\n\t\t }\t\t\n\t}", "function checkSaveButtons() {\n if ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n $tce = GeneralUtility::makeInstance('t3lib_TCEmain');\n $tce->stripslashes_values=0;\n if (count($this->arrTableParameters['grps'])) {\n\t $arrSave['grps'] = $this->arrTableParameters['grps'];\n\t $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = serialize($arrSave);\n } else {\n \t$arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = '';\n }\n $tce->start($arrData,array());\n\t $tce->process_datamap();\n if ($this->arrTableParameters['saveandclosedok']) {\n header('Location: ' . GeneralUtility::locationHeaderUrl($this->arrWizardParameters['returnUrl']));\n\t\t\t\texit;\n }\n }\n }", "public function saveAction() {\n parent::saveAction();\n }", "public function clickSaveButton()\n {\n $this->_webui->clickButton('.btn.btn-xs.btn-info.pull-right.mr20.btn-save');\n\n sleep(1);\n }", "function save()\n\t{\n\t\t$this->store() ;\n\t\t$link = 'index.php?option=com_arts_curriculum';\n\t\t$this->setRedirect( $link, $this->msg);\n\t}", "function savepage()\r\n\t{\r\n\t\t$model\t\t=& $this->getModel( 'Formsession' );\r\n\t\t$model->savePage();\r\n\t}", "public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('traineecert')) {\n try {\n $data = $this->_filterDates($data, array('issue_date'));\n $traineecert = $this->_initTraineecert();\n $traineecert->addData($data);\n $traineecert->save();\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.'.$this->getJsObjectName().'.reload(); window.close()</script>';\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_traineecert')->__('Trainee Certificate was successfully saved. %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $traineecert->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setTraineecertData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineecert')->__('There was a problem saving the trainee certificate.')\n );\n Mage::getSingleton('adminhtml/session')->setTraineecertData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineecert')->__('Unable to find trainee certificate to save.')\n );\n $this->_redirect('*/*/');\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "protected function _getSaveAndContinueUrl() \n {\n\treturn $this->getUrl('Brituy_SimpleBlog/*/save', ['_current' => true, 'back' => 'edit', 'active_tab' => '{{tab_id}}']);\n }", "public function save()\r\n {\r\n \r\n }", "protected function saving() {\n // This will get reimplemented by children when necessary\n }", "public function action_save()\n {\n // clear old reject info\n $this->setRejectInfo(null);\n\n if (isset($this->m_partial) && !empty($this->m_partial)) {\n $this->partial($this->m_partial);\n\n return;\n } else {\n $this->doSave();\n }\n }", "function save()\n {\n }", "function save()\n {\n }", "public final function save() {\n }", "function clickSaveButton()\n {\n $this->browser->webui()->clickButton(\n WebDriverBy::cssSelector('.btn.btn-xs.btn-info.pull-right.mr20')\n );\n\n // TODO: Add Try/Catch\n // TODO: Validate Data (via API)\n\n print(\"ACTION : Clicked SAVE Button\".PHP_EOL);\n }", "public function save()\n {\n return;\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function save() {\n\t\t\t\n\t\t}", "function saveOrderingAndIndentObject()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\n\t\t$this->checkPermission(\"write\");\n\n\t\t$this->object->saveOrderingAndIndentation($_POST[\"ord\"], $_POST[\"indent\"]);\n\t\tilUtil::sendSuccess($lng->txt(\"wiki_ordering_and_indent_saved\"), true);\n\t\t$ilCtrl->redirect($this, \"editImportantPages\");\n\t}", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "function save() {\n\t\t// If every question is answered, save to the db. Otherwise, to session.\n\t\tif($this->isComplete()) {\n\t\t\t$this->saveToRecord();\n\t\t} else {\n\t\t\t$this->saveToSession();\n\t\t}\n\t}", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('curriculumdoc')) {\n try {\n $data = $this->_filterDates($data, array('cdoc_date'));\n $curriculumdoc = $this->_initCurriculumdoc();\n $curriculumdoc->addData($data);\n $cdocFileName = $this->_uploadAndGetName(\n 'cdoc_file',\n Mage::helper('bs_curriculumdoc/curriculumdoc')->getFileBaseDir(),\n $data\n );\n $curriculumId = null;\n\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0) {\n $curriculumId = $data['hidden_curriculum_id'];\n }elseif($this->getRequest()->getParam('curriculum_id')){\n $curriculumId = $this->getRequest()->getParam('curriculum_id');\n }\n $curriculumdoc->setData('cdoc_file', $cdocFileName);\n $curriculums = $this->getRequest()->getPost('curriculums', -1);\n if ($curriculums != -1) {\n $curriculumdoc->setCurriculumsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($curriculums));\n }else {\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0){\n $curriculumId = $data['hidden_curriculum_id'];\n $curriculumdoc->setCurriculumsData(\n array(\n $data['hidden_curriculum_id'] => array(\n 'position' => \"\"\n )\n )\n );\n }\n }\n\n $curriculumdoc->save();\n\n $add = '';//traininglist_curriculum/edit/id/1/back/edit/tab/curriculum_info_tabs_curriculumdocs/\n $backUrl = $this->getUrl('*/traininglist_curriculum/edit/', array('back'=>'edit','id' => $curriculumId, 'tab'=>'curriculum_info_tabs_curriculumdocs'));\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.location.href=\\''.$backUrl.'\\'; window.close()</script>';//window.opener.location.reload()\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_curriculumdoc')->__('Curriculum Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $curriculumdoc->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('There was a problem saving the curriculum doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('Unable to find curriculum doc to save.')\n );\n $this->_redirect('*/*/');\n }", "public function save()\n {\n }", "public final function save()\n {\n }", "protected function finishSave()\n {\n $this->fireModelEvent('saved', false);\n $this->syncOriginal();\n }", "function save();", "function save();", "public function actionSaveInline()\n\t{\n\t\t$redirect = parent::actionSaveInline();\n\t\t\n\t\tif (!empty($redirect))\n\t\t{\n\t\t\tif (!$this->_input->inRequest('more_options'))\n\t\t\t{\n\t\t\t\t// send bookmark alert\n\t\t\t\t$postId = $this->_input->filterSingle('post_id', XenForo_Input::UINT);\n\t\t\t\t$bookmarksModel = $this->_getBookmarksModel();\n\t\t\t\t$bookmarksModel->sendBookmarkAlerts('post', $postId, 'content_edit', 'edit');\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $redirect;\n\t}", "public function actionSave()\n\t{\n\t\t$redirect = parent::actionSave();\n\t\t\n\t\tif (!empty($redirect))\n\t\t{\n\t\t\t// send bookmark alert\n\t\t\t$postId = $this->_input->filterSingle('post_id', XenForo_Input::UINT);\n\t\t\t$bookmarksModel = $this->_getBookmarksModel();\n\t\t\t$bookmarksModel->sendBookmarkAlerts('post', $postId, 'content_edit', 'edit');\n\t\t}\n\t\t\n\t\treturn $redirect;\n\t}", "public function afterSave()\n\t{\n\t\t//annoying on every edit, move to a checkbox on form and handle in controller\n\t}", "public function save()\r\n {\r\n //\r\n }", "protected function save() {\n $saved = parent::save();\n if ($saved !== false) {\n $message = \"This record has been saved.\";\n I2CE::getConfig()->setIfIsSet( $message, \"/modules/forms/page_feedback_messages/person_child_save\" );\n } else {\n $message = \"This record has not been saved.\";\n I2CE::getConfig()->setIfIsSet( $message, \"/modules/forms/page_feedback_messages/person_child_not_save\" ); \n }\n $this->userMessage($message);\n $this->setRedirect( \"view?id=\" . $this->getPrimary()->getParent() );\n return $saved;\n }", "public function toggleSave() : void\n {\n }", "public function save()\n {\n // For V2.0\n }", "function save_button()\n\t\t{\n\t\t\t$output = '<span class=\"ace_style_wrap\"><a href=\"#\" class=\"ace_button ace_button_inactive ace_submit\">Save all changes</a></span>';\n\t\t\treturn $output;\n\t\t}", "public function saveAttribute()\n {\n $this->getFormPageActionsBlock()->save();\n }", "public function save()\n\t{\n\n\t}", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('ifeedback')) {\n try {\n $ifeedback = $this->_initIfeedback();\n $ifeedback->addData($data);\n $ifeedback->save();\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.'.$this->getJsObjectName().'.reload(); window.close()</script>';\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_kst')->__('Instructor Feedback was successfully saved. %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $ifeedback->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setIfeedbackData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('There was a problem saving the instructor feedback.')\n );\n Mage::getSingleton('adminhtml/session')->setIfeedbackData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('Unable to find instructor feedback to save.')\n );\n $this->_redirect('*/*/');\n }", "function save()\n {\n /* remove objectclass GOhard if this is an ogroup tab */\n if(isset($this->parent->by_object['ogroup'])){\n $this->objectclasses = array();\n }\n\n plugin::save();\n\n /* Strip out 'default' values */\n foreach(array(\"gotoXMethod\",\"gotoXDriver\", \"gotoXResolution\", \"gotoXColordepth\",\n \"gotoLpdServer\", \"gotoXKbModel\", \"gotoXKbLayout\",\n \"gotoXKbVariant\", \"gotoXMouseType\", \"gotoXMouseport\") as $val){\n\n if ($this->attrs[$val] == \"default\"){\n $this->attrs[$val]= array();\n }\n }\n\n if($this->gotoXMethod == \"default\"){\n $this->attrs['gotoXdmcpServer'] = array();\n $this->attrs['gotoXMethod'] = array();\n }else{\n $this->attrs['gotoXdmcpServer'] = array_values($this->selected_xdmcp_servers);\n }\n\n\n if($this->AutoSync){\n $this->attrs['gotoXHsync'] = \"30+55\";\n $this->attrs['gotoXVsync'] = \"50+70\";\n }\n\n /* Write back to ldap */\n $ldap= $this->config->get_ldap_link();\n $ldap->cd($this->dn);\n $this->cleanup();\n $ldap->modify ($this->attrs); \n new log(\"modify\",\"terminal/\".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());\n\n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));\n }\n $this->handle_post_events(\"modify\");\n\n /* Send goto reload event */\n if(count($this->attrs)){\n $this->send_goto_reload();\n }\n }", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "public function save():void;", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function saveAction()\n {\n //the data for the thing\n $_consumerId = $this->getRequest()->getParam('consumer_id');\n \n //the post data\n $_data = $this->getRequest()->getPost();\n if ($_data) {\n $_artist = $this->_initConsumerSave();\n \n try {\n $_artist->save();\n \n $_redirectBack = false;\n $this->_getSession()->addSuccess($this->__('The consumer has been saved.'));\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage())\n ->setArtistData($_data);\n $_redirectBack = true;\n } catch (Exception $e) {\n Mage::logException($e);\n $this->_getSession()->addError($e->getMessage());\n $_redirectBack = true;\n }\n }\n \n if ($_redirectBack) {\n $this->_redirect(\n '*/*/edit', array(\n 'id' => $_consumerId,\n '_current' => true\n )\n );\n } else {\n $this->_redirect('*/*/');\n }\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('coursedoc')) {\n\n try {\n $data = $this->_filterDates($data, array('doc_date'));\n $coursedoc = $this->_initCoursedoc();\n $coursedoc->addData($data);\n $courseDocFileName = $this->_uploadAndGetName(\n 'course_doc_file',\n Mage::helper('bs_coursedoc/coursedoc')->getFileBaseDir(),\n $data\n );\n\n $coursedoc->setData('course_doc_file', $courseDocFileName);\n $products = $this->getRequest()->getPost('products', -1);\n if ($products != -1) {\n $coursedoc->setProductsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($products));\n }else {\n if(isset($data['hidden_course_id']) && $data['hidden_course_id'] > 0){\n $coursedoc->setProductsData(\n array(\n $data['hidden_course_id'] => array(\n 'position' => \"\"\n )\n )\n );\n\n\n }\n }\n $coursedoc->save();\n\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.document.location.href = \\''.$this->getUrl('*/catalog_product/edit', array('id'=>$data['hidden_course_id'], 'back'=>'edit', 'tab'=>'product_info_tabs_coursedocs')).'\\'; window.close()</script>';\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_coursedoc')->__('Course Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n if($add != ''){\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId(), 'tab' => 'product_info_tabs_coursedocs'));\n }else {\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId()));\n }\n\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was a problem saving the course doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Unable to find course doc to save.')\n );\n $this->_redirect('*/*/');\n }", "public function saveAction()\n {\n return $this->dispatcher->forward(array('controller' => 'people', 'action' => 'index'));\n }", "public function save()\n {\n if($this->id != -1)\n {\n $this->update_subject();\n }\n else\n {\n $this->insert_subject();\n }\n }", "function Save();", "function okra_form_single_save() {\n\n\tif ($_POST[\"action\"] === \"okra_form_single_save\") {\n\n\t\tglobal $wpdb;\n\t\t$id = $_POST[\"id\"];\n\t\t//echo $id;\n\t\t$name = sanitize_text_field($_POST[\"name\"]);\n\t\t$page = sanitize_text_field($_POST[\"page\"]);\n\t\t$btn_text = sanitize_text_field($_POST[\"btn_text\"]);\n\t\t$short_code = sanitize_text_field($_POST[\"short_code\"]);\n\n\t\t$array = array(\n\t\t\t\"name\" => $name,\n\t\t\t\"page\" => $page,\n\t\t\t\"btn_text\"=>$btn_text,\n\t\t\t\"short_code\" => $short_code\n\t\t);\n\n\t\t$wpdb->update($wpdb->prefix . \"okra_all_forms\", $array, array(\"id\" => $id));\n\t\twp_redirect(admin_url() . \"?page=okra_wordpress_plugin&&update=true\");\n\n\t}\n}", "public function save() {}", "public function save() {}", "public function single_save()\n {\n //Logger::getInstance()->po_log(\"PO:single_save \" . get_class($this));\n PersistentManager::getInstance()->save_object( $this, 0 );\n }", "public function save() {}", "public function saveDetails() \n {\n // Save the author list.\n $this->authorList->setValue('bookId', $this->bookId);\n $this->authorList->save();\n \n // Save the booklanguage list.\n $this->bookLanguageList->setValue('bookId', $this->bookId);\n $this->bookLanguageList->save();\n }", "function Save()\n\t{\n\t\treturn RecentPageOperations::InsertPage($this);\n\t}", "public function save(){\n }", "public function autosaved()\n {\n }", "public function store()\n {\n $this->model->load('TacGia');\n $this->model->TacGia->anh = $_POST['anh'];\n $this->model->TacGia->ten = $_POST['ten'];\n $this->model->TacGia->thongtin = $_POST['thongtin'];\n $this->model->TacGia->save();\n\n go_back();\n }", "public function save() {\n }", "public function save() {\n }", "public function saveData()\r\n {\r\n \r\n }", "public function actionAutoSave()\n {\n if(isset($_POST[\"Story\"][\"title\"]) && isset($_POST[\"ID\"]))\n {\n $return=Helpers::storySession(\"set\", $_POST[\"ID\"], NULL);\n echo json_encode([\"return_data\"=>$return]);\n }\n }", "public function save()\n {\n }", "public function save()\n {\n }", "public function save() {\n }", "function save()\n\t{\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t$user = JFactory::getUser();\n\t\t$post\t= JRequest::get('post');\n\t\tif (!($user->authorise('core.create', 'com_gmapfp') and empty($post['id'])) and !($user->authorise('core.edit', 'com_gmapfp') and !empty($post['id'])))\n\t\t{\n\t\t\t$this->setMessage(JText::_('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED'), 'error');\n\t\t} else {\n\t\t\t$model = $this->getModel('gmapfp');\n\t\t\t$returnid=$model->store($post);\n\t\t\tif ($returnid>0) {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED' );\n\t\t\t} else {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED_ERROR' );\n\t\t\t}\n\t\t}\n\n\t\t$link = 'index.php?option=com_gmapfp&controller=gmapfp&task=view';\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$this->setRedirect($link, $msg);\n\t}", "public function saveAll() {\n\t\t$originalCaret = $this->caret;\n\t\tforeach($this as $key => $row) {\n\t\t\t$this->save();\n\t\t}\n\t\t$this->caret = $originalCaret;\n\t}", "public function saveAction() :void\n {\n $data = $this->request->getPost();\n $record = ModuleTemplate::findFirst();\n if ($record === null) {\n $record = new ModuleTemplate();\n }\n $this->db->begin();\n foreach ($record as $key => $value) {\n switch ($key) {\n case 'id':\n break;\n case 'checkbox_field':\n case 'toggle_field':\n if (array_key_exists($key, $data)) {\n $record->$key = ($data[$key] === 'on') ? '1' : '0';\n } else {\n $record->$key = '0';\n }\n break;\n default:\n if (array_key_exists($key, $data)) {\n $record->$key = $data[$key];\n } else {\n $record->$key = '';\n }\n }\n }\n\n if ($record->save() === FALSE) {\n $errors = $record->getMessages();\n $this->flash->error(implode('<br>', $errors));\n $this->view->success = false;\n $this->db->rollback();\n return;\n }\n\n $this->flash->success($this->translation->_('ms_SuccessfulSaved'));\n $this->view->success = true;\n $this->db->commit();\n }", "public function save()\n {\n //\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "function editQuoteFinalStepAction()\n\t{\n\t\tif($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')\n\t\t{\n\t\t\t$quote_id=$this->_request->getParam('quote_id');\n\n\t\t\tif($quote_id)\n\t\t\t{\n\t\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\t\t\t\tif($quoteDetails)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t//Quote documents added to sesssion\n\t\t\t\t\t$files = \"\";\n\t\t\t\t\t$documents_path = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t$documents_name = explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t$k =0;\n\t\t\t\t\tforeach($documents_path as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=quote&quote_id='.$quote_id.'&index='.$k.'\">'.utf8_encode($documents_name[$k]).'</a><span class=\"delete\" rel=\"'.$k.'_'.$quote_id.'\"> <i class=\"splashy-error_x\"></i></span> </div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\t\t\t\t\t$quoteDetails[0]['documents'] = $files;\n\n\n\t\t\t\t\t$this->_view->send_quote=$quoteDetails[0];\n\t\t\t\t\t$this->render(\"popup-edit-finalstep-details\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t\n\t}", "function saveEstimateSignDetailsAction()\n\t{\n\t\tif($this->_request->isPost())\n\t\t{\n\t\t\t$signParams = $this->_request->getParams();\n\n\t\t\t$quote_id=$signParams['quote_id'];\n\n\t\t\tif($quote_id)\n\t\t\t{\n\t\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\n\t\t\t\t$status=$quoteDetails[0]['sales_review'];\n\t\t\t\tif($status=='not_done')\n\t\t\t\t\t$status='';\n\n\t\t\t\t\n\t\t\t\t$quote_update['estimate_sign_percentage']=$signParams['estimate_sign_percentage'];\n\t\t\t\t$quote_update['estimate_sign_date']=$signParams['estimate_sign_date'];\n\t\t\t\t$quote_update['estimate_sign_comments']=$signParams['estimate_sign_comments'];\n\n\n\t\t\t\t//echo \"<pre>\";print_r($_SERVER);exit;\t\t\t\t\n\t\t\t\t$quoteObj->updateQuote($quote_update,$quote_id);\n\n\t\t\t\t$this->_helper->FlashMessenger('Details updated successfully');\n\t\t\t}\t\n\n\n\t\t\t$this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2&active=\".$status);\n\t\t}\n\t\t\n\t}", "function save()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$post\t= JRequest::get('post');\n\t\t$cid\t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\t\t$post['id'] = (int) $cid[0];\n\n\t\t$model = $this->getModel('weblink');\n\n\t\tif ($model->store($post)) {\n\t\t\t$msg = JText::_( 'Weblink Saved' );\n\t\t} else {\n\t\t\t$msg = JText::_( 'Error Saving Weblink' );\n\t\t}\n\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$model->checkin();\n\t\t$link = 'index.php?option=com_weblinks';\n\t\t$this->setRedirect($link, $msg);\n\t}", "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }", "public function save()\n {\n JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n $userId = JFactory::getUser()->get(\"id\");\n if (!$userId) {\n $redirectOptions = array(\n \"force_direction\" => \"index.php?option=com_users&view=login\"\n );\n $this->displayNotice(JText::_(\"COM_CROWDFUNDING_ERROR_NOT_LOG_IN\"), $redirectOptions);\n\n return;\n }\n\n $params = JComponentHelper::getParams(\"com_crowdfunding\");\n /** @var $params Joomla\\Registry\\Registry */\n\n // Get the data from the form POST\n $projectId = $this->input->post->get('id', 0, 'int');\n\n // Check if rewards are enabled.\n if (!$params->get(\"rewards_enabled\", 1)) {\n $redirectOptions = array(\n \"view\" => \"project\",\n \"layout\" => \"manager\",\n \"id\" => $projectId\n );\n $this->displayNotice(JText::_(\"COM_CROWDFUNDING_ERROR_REWARDS_DISABLED\"), $redirectOptions);\n return;\n }\n\n $data = $this->input->post->get('rewards', array(), 'array');\n $actionSubmit = $this->input->post->getCmd('btn_submit', 'save');\n\n $images = $this->input->files->get('images', array(), 'array');\n\n // Get wizard type\n $wizardType = $params->get(\"project_wizard_type\", \"five_steps\");\n $fiveStepsWizard = (strcmp($wizardType, \"five_steps\") == 0) ? true : false;\n\n // If it is five steps wizard type, redirect to manager.\n // If it is six steps wizard type, redirect to extras.\n if (!$fiveStepsWizard) {\n $layout = (strcmp($actionSubmit, \"save_continue\") == 0) ? \"extras\" : \"rewards\";\n } else {\n $layout = (strcmp($actionSubmit, \"save_continue\") == 0) ? \"manager\" : \"rewards\";\n }\n\n $redirectOptions = array(\n \"view\" => \"project\",\n \"layout\" => $layout,\n \"id\" => $projectId\n );\n\n // Validate project owner.\n $validator = new Crowdfunding\\Validator\\Project\\Owner(JFactory::getDbo(), $projectId, $userId);\n if (!$projectId or !$validator->isValid()) {\n $this->displayWarning(JText::_('COM_CROWDFUNDING_ERROR_INVALID_PROJECT'), $redirectOptions);\n return;\n }\n\n $model = $this->getModel();\n /** @var $model CrowdfundingModelRewards */\n\n try {\n\n $validData = $model->validate($data);\n\n $rewardsIds = $model->save($validData, $projectId);\n\n $imagesAllowed = $params->get(\"rewards_images\", 0);\n\n // Upload images.\n if ($imagesAllowed and !empty($images) and !empty($rewardsIds)) {\n\n // Get the folder where the images will be stored\n $imagesFolder = CrowdfundingHelper::getImagesFolder($userId);\n\n jimport(\"joomla.filesystem.folder\");\n if (!JFolder::exists($imagesFolder)) {\n CrowdfundingHelper::createFolder($imagesFolder);\n }\n\n $images = $model->uploadImages($images, $imagesFolder, $rewardsIds);\n\n if (!empty($images)) {\n $model->storeImages($images, $imagesFolder);\n }\n }\n\n } catch (InvalidArgumentException $e) {\n $this->displayWarning($e->getMessage(), $redirectOptions);\n return;\n } catch (RuntimeException $e) {\n $this->displayWarning($e->getMessage(), $redirectOptions);\n return;\n } catch (Exception $e) {\n JLog::add($e->getMessage());\n throw new Exception(JText::_('COM_CROWDFUNDING_ERROR_SYSTEM'));\n }\n\n // Redirect to next page\n $this->displayMessage(JText::_(\"COM_CROWDFUNDING_REWARDS_SUCCESSFULLY_SAVED\"), $redirectOptions);\n }", "protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "public function saveAction()\n {\n $form = $this->getForm();\n $form->setData($_POST);\n try {\n $valid = $form->isValid();\n } catch (\\Exception $e) {\n $valid = false;\n }\n if (!$valid)\n {\n $this->getSessionStorage()->fromArray(['form' => $form]);\n return $this->redirect()->toRoute($this->routeName, ['action' => 'edit']);\n }\n $modelName = $this->modelName;\n $model = new $modelName();\n $model->exchangeArray($this->getDataFromRequest());\n $this->sm->get($this->mainTableFactory)->save($model);\n return $this->redirect()->toRoute($this->routeName);\n }" ]
[ "0.66927737", "0.64809036", "0.6385524", "0.6344733", "0.631074", "0.62367415", "0.61269546", "0.6089459", "0.6073153", "0.6062701", "0.60327435", "0.60327435", "0.60327435", "0.6014939", "0.59839624", "0.59777945", "0.5921623", "0.59169906", "0.59169906", "0.59073347", "0.5902262", "0.58899766", "0.5882647", "0.58790445", "0.58752143", "0.58679986", "0.5847939", "0.5846332", "0.5843225", "0.58396065", "0.58286417", "0.58135414", "0.58135414", "0.58130544", "0.57920104", "0.57622313", "0.57554126", "0.575325", "0.57463497", "0.57421136", "0.57215923", "0.5716622", "0.57100934", "0.5708948", "0.57078767", "0.56933254", "0.5692414", "0.56872267", "0.568401", "0.56729424", "0.56636703", "0.5655363", "0.5636138", "0.5628448", "0.5626018", "0.5626018", "0.5624391", "0.56229794", "0.5621648", "0.56124574", "0.5602319", "0.5595002", "0.5586225", "0.55842155", "0.55842155", "0.5582448", "0.55815804", "0.55787104", "0.55787104", "0.55765635", "0.5573303", "0.55711955", "0.5556495", "0.55547374", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.554732", "0.55462384", "0.5543322", "0.5538562", "0.55201167", "0.5516837", "0.5511123", "0.5504121", "0.549946", "0.54901195" ]
0.0
-1
A variant of the species grid control with just the fixed species categories available.
protected static function get_control_fixedspecies($auth, $args, $tabAlias, $options) { unset($args['extra_list_id']); $options['rowInclusionCheck']='hasData'; $options['id']='fixed-list'; return parent::get_control_species($auth, $args, $tabAlias, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shq_genestrap_categories_grid_shortcode() {\n\t$colNum = 4;\n\t$currentCol = 1;\n\t$categories = get_categories();\n\n\t// Open the row\n\t$output = genesis_markup(\n\t\t[\n\t\t\t'open' => '<div %s>',\n\t\t\t'context' => 'categories-grid',\n\t\t\t'echo' => false,\n\t\t]\n\t);\n\n\tforeach ( $categories as $category ) {\n\t\t// Only print root categories but not the uncategorized one\n\t\tif ( 1 !== $category->term_id && 0 === $category->parent ) {\n\t\t\tif ( 1 === $currentCol ) {\n\t\t\t\t$output .= genesis_markup(\n\t\t\t\t\t[\n\t\t\t\t\t\t'open' => '<div class=\"categories-row row\">',\n\t\t\t\t\t\t'context' => 'categories-row',\n\t\t\t\t\t\t'echo' => false,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$output .= genesis_markup(\n\t\t\t\t[\n\t\t\t\t\t'open' => '<div class=\"category-box col-lg-3\">',\n\t\t\t\t\t'context' => 'category-box',\n\t\t\t\t\t'echo' => false,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$description = false === empty( trim( $category->description ) )\n\t\t\t\t? sprintf( '<p class=\"category-description\">%s</p>', $category->description )\n\t\t\t\t: null;\n\t\t\t$link = sprintf( '<a href=\"%s\"><h3 class=\"category-name\">%s</h3>%s</a>', get_category_link( $category ), $category->name, $description );\n\n\t\t\t$output .= $link;\n\n\t\t\t$output .= genesis_markup(\n\t\t\t\t[\n\t\t\t\t\t'close' => '</div>',\n\t\t\t\t\t'context' => 'category-box',\n\t\t\t\t\t'echo' => false,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\tif ( $colNum === $currentCol ) {\n\t\t\t\t$output .= genesis_markup(\n\t\t\t\t\t[\n\t\t\t\t\t\t'close' => '</div>',\n\t\t\t\t\t\t'context' => 'categories-row',\n\t\t\t\t\t\t'echo' => false,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t\t$currentCol = 0;\n\t\t\t}\n\n\t\t\t$currentCol++;\n\t\t}\n\t}\n\t$output .= genesis_markup(\n\t\t[\n\t\t\t'close' => '</div>',\n\t\t\t'context' => 'categories-grid',\n\t\t\t'echo' => false,\n\t\t]\n\t);\n\n\treturn $output;\n}", "protected function grid()\n {\n $grid = new Grid(new Category());\n $grid->model()->small();\n \n $grid->quickCreate(function (Grid\\Tools\\QuickCreate $create) {\n $create->text('erp_id', 'ERP ID');\n $create->text('name', '小分類名稱');\n $create->select('parent_id', __('中分類'))->options(\n Category::Mid()->pluck('name', 'id')\n );\n $create->text('type','分級(不需改)')->default(3);\n });\n\n $grid->column('erp_id', __('ERP Id'));\n $grid->column('name', __('小分類名稱'));\n $grid->column('parent_id', __('中分類'))->display(function($userId) {\n return Category::find($userId)->name;\n });\n return $grid;\n }", "function sportal_categories()\n{\n\tglobal $context, $scripturl, $txt;\n\n\tloadTemplate('PortalCategories');\n\n\t$context['categories'] = sportal_get_categories(0, true, true);\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=portal;sa=categories',\n\t\t'name' => $txt['sp-categories'],\n\t);\n\n\t$context['page_title'] = $txt['sp-categories'];\n\t$context['sub_template'] = 'view_categories';\n}", "public function getSpecies();", "function fillInCategories()\n {\n #echo \"eZNewsFlowerArticleCreator::fillInCategories()<br />\\n\";\n\n $name = $this->IniObject->GlobalIni->read_var( \"eZNewsCustomer\", \"Name\" );\n $itemType = new eZNewsItemType( \"flowercategory\" );\n $changeType = new eZNewsChangeType( \"publish\" );\n \n $categories = new eZNewsItem( $name );\n $categories->getChildren( &$childrenItems, $count );\n\n $canonicalParent = $this->Item->getIsCanonical();\n\n $i = 0;\n foreach( $childrenItems as $child )\n {\n $child->get( $outID );\n if( $child->ItemTypeID() == $itemType->ID() && $changeType->ID() == $child->status() )\n {\n $this->IniObject->set_var( \"item_id\", $child->ID() );\n $this->IniObject->set_var( \"item_name\", $child->name() );\n $this->IniObject->set_var( \"Selected\", \"\" );\n if( $i == 0 && empty( $canonicalParent ) )\n {\n $this->IniObject->set_var( \"Selected\", \"selected\" );\n }\n\n if( $child->ID() == $canonicalParent || $child->Name() == $canonicalParent ) \n {\n $this->IniObject->set_var( \"Selected\", \"selected\" );\n }\n \n $this->IniObject->parse( \"item\", \"item_template\", true );\n \n $i++;\n }\n }\n }", "public function get_categories()\n {\n return ['sipsy'];\n }", "protected function grid()\n {\n return Admin::grid(Category::class, function (Grid $grid) {\n\t\t\t\n\t\t\t$grid->filter(function ($filter) {\n\t\t\t\t$filter->like('name');\n\t\t\t\n\t\t\t});\n\n $grid->catid('ID')->sortable();\n $grid->name('name');\n $grid->created_at();\n $grid->updated_at();\n\n $script = <<<script\n\n$(document).ready(function(){\n\n \n $('.form-inline').parent().append('<a href=\"category/setunitname/\" class=\"btn btn-sm btn-twitter\" style=\"magin-right:20px\">&nbsp;Set Unit Name</a>');\n $('.form-inline').parent().append('&nbsp;&nbsp;&nbsp;&nbsp;');\n});\n\nscript;\n Admin::script($script);\n\n });\n }", "public function HM_CategoCuentas()\n {\n }", "protected function grid()\n {\n $grid = new Grid(new Category());\n\n $grid->id('ID')->sortable();\n $grid->name('分类名称');\n $grid->level('分类层级');\n\n $grid->is_directory('是否目录')->display(function ($value) {\n return $value ? '是' : '否';\n });\n $grid->path('类目路径');\n\n $grid->actions(function ($actions) {\n /** 不展示 Laravel-admin 默认的查看按钮 */\n $actions->disableView();\n });\n return $grid;\n }", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "protected function grid()\n {\n $grid = new Grid(new Category);\n\n $grid->id('Id');\n\n $grid->name('Имя');\n\n $grid->filter(function ($filter){\n $filter->equal('status')->select(Category::$statuses);\n });\n\n $grid->status('Статус')->display(function ($status){\n return Category::$statuses[$status];\n })->sortable();\n $grid->slug('Slug');\n $grid->created_at('Создана');\n $grid->updated_at('Редактировалась');\n\n return $grid;\n }", "public function get_region_categories()\n\t{\n\t\t\n\t\treturn null;\n\t\t\t\n\t}", "function ShowAtoZCategories()\n\t\t{ \n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$Captions_arr;\n\t\t\t$Captions_arr['SEARCH'] \t= getCaptions('SEARCH'); \n\t\t\t$alpha_str \t\t= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t\t$alpha_len \t\t= strlen($alpha_str);\n\t\t\t$atleast_one\t= 0;\n\t\t\tfor($i=0;$i<$alpha_len;$i++)\n\t\t\t{\n\t\t\t\t$cur_char \t\t\t\t\t= substr($alpha_str,$i,1);\n\t\t\t\t$alpha_arr[$cur_char] \t= array();\n\t\t\t}\n\t\t\t$block_cnt = 0;\n\t\t\t$block_arr = array();\n\t\t\t// Get the list of active categories in site\n\t\t\t$sql_cat = \"SELECT category_id,category_name \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\tproduct_categories \n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\tsites_site_id=$ecom_siteid \n\t\t\t\t\t\t\t\t\tAND category_hide =0 \n\t\t\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\tcategory_name ASC\";\n\t\t\t$ret_cat = $db->query($sql_cat);\n\t\t\tif ($db->num_rows($ret_cat))\n\t\t\t{\n\t\t\t\twhile ($row_cat = $db->fetch_array($ret_cat))\n\t\t\t\t{\n\t\t\t\t\t$first_char = strtoupper(substr(stripslashes($row_cat['category_name']),0,1));\n\t\t\t\t\t//echo 'first'.$first_char.'<br/>';\n\t\t\t\t\tif(array_key_exists($first_char,$alpha_arr))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(count($alpha_arr[$first_char])==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$block_cnt++;\n\t\t\t\t\t\t\t$block_arr[] = $first_char;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t$alpha_arr[$first_char][] = stripslashes($row_cat['category_name']).'~~'.$row_cat['category_id'];\n\t\t\t\t\t\t$atleast_one++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$start \t\t\t= 0; // start index\n\t\t\t$col_limit\t\t= 4; // how many columns in each row\n\t\t\t$block_cnt\t\t= count($block_arr);\n\t\t\t$per_col_limit\t= floor($block_cnt/$col_limit); // how many character heading in each column\n\t\t\t$td_width\t\t= round(100/$col_limit);\n\t\t\t$rem_blk\t\t=$block_cnt%$col_limit; \n\t\t\t$disp_blk_cnt\t= 1;\n\t\t\tif ($rem_blk>0)\n\t\t\t{\n\t\t\t\t$extra_blk = 1;\n\t\t\t\t$extra_cnt\t= $rem_blk;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$extra_blk = 0;\n\t\t\t//if($rem_blk<$col_limit and $rem_blk>0)\n\t\t\t//\t$extra_blk = 1;\n\t\t//\t$per_col_limit += $extra_blk;\n\t\t\tif ($atleast_one>0)\n\t\t\t{\n\t\t?>\n\t\t\t\t<table align = \"center\" width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" class=\"\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"search_noresult_td\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif(trim($_REQUEST['quick_search'])!='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$caption = $Captions_arr['SEARCH']['SEARCH_NO_PRODUCTS_WITH_KEYWORD'];\n\t\t\t\t\t\t\t$caption = str_replace('[keyword]','<strong>'.$_REQUEST['quick_search'].'</strong>',$caption);\n\t\t\t\t\t\t\techo stripslashes($caption);\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\techo stripslashes($Captions_arr['SEARCH']['SEARCH_NO_PRODUCTS_WITH_NO_KEYWORD']);\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\t</td>\n\t\t\t\t\t</tr>\n</table>\n\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"8\" border=\"0\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t<?php \n\t\t\t\t\t\t$alpha_index = 0;\n\t\t\t\t\t\tfor($cols=0;$cols<$col_limit;$cols++) // loop to handle the columns in each row\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t\t\t<td align=\"left\" style=\"width:<?php echo $td_width\t?>%\" valign=\"top\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif($extra_blk and $extra_cnt>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$cur_col_limit = $per_col_limit + $extra_blk;\n\t\t\t\t\t\t\t\t\t--$extra_cnt;\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$cur_col_limit = $per_col_limit;\n\t\t\t\t\t\t\t\t/*if($cols==($col_limit-2))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($disp_blk_cnt==($block_cnt-1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$cur_col_limit = $cur_col_limit - $extra_blk;\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\tfor($i=0;$i<$cur_col_limit;$i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$cur_char \t\t= $block_arr[$alpha_index];\n\t\t\t\t\t\t\t\t\t$alpha_index++;\n\t\t\t\t\t\t\t\t\tif (count($alpha_arr[$cur_char])>0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$disp_blk_cnt++;\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"2\" border=\"0\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td class=\"searchspecial_header\"><?php echo $cur_char?>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t\t\t<?php\t\n\t\t\t\t\t\t\t\t\t\tif (count($alpha_arr[$cur_char]))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach($alpha_arr[$cur_char] as $k=>$v) // loop to handle the display of categories\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cat_arr = explode('~~',$v);\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr onmouseover=\"this.className='searchspecial_content_special'\" onmouseout=\"this.className='searchspecial_content_normal'\" class=\"searchspecial_content_normal\" onclick=\"window.location='<?php echo url_category($cat_arr[1],$cat_arr[0],1)?>'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"searchspecial_td\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php url_category($cat_arr[1],$cat_arr[0])?>\" title=\"<?php echo $cat_arr[0]?>\" class=\"searchspecial_link\"><?php echo $cat_arr[0]?></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\t\t\n\t\t\t\t\t\t\t\t\t<?php\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\t\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t<?php\t\n\t\t\t}\n\t\t}", "function create_isotope_taxonomies()\n{\n // Add new taxonomy, NOT hierarchical (like tags)\n $labels = array(\n 'name' => _x('Select Category', 'taxonomy general name'),\n 'singular_name' => _x('Category', 'taxonomy singular name'),\n 'search_items' => __('Search Categories'),\n 'popular_items' => __('Popular Categories'),\n 'all_items' => null,\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __('Edit'),\n 'update_item' => __('Update'),\n 'add_new_item' => __('Add New'),\n 'new_item_name' => __('New Category'),\n 'separate_items_with_commas' => __('Separate writers with commas'),\n 'add_or_remove_items' => __('Add or remove categories'),\n 'choose_from_most_used' => __('Choose from the most used categories'),\n 'menu_name' => __('Categories')\n );\n \n register_taxonomy('fzproject_categories', 'fzproject_post', array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array(\n 'slug' => 'fzproject_categories'\n )\n ));\n}", "protected function grid()\n {\n $grid = new Grid(new Specialization);\n\n $grid->id('Id');\n $grid->full_name('Полное найменование');\n $grid->short_name('Краткое найменование');\n $grid->code('Код специальности');\n $grid->cathedra_id('Кафедра')->using(Cathedra::all()->pluck('abbreviation', 'id')->toArray());\n $grid->created_at('Создано');\n $grid->updated_at('Обновлено');\n\n return $grid;\n }", "public function gridAction()\n {\n $this->loadLayout();\n $this->getResponse()->setBody(\n $this->getLayout()->createBlock('faq/adminhtml_category_grid')->toHtml()\n );\n }", "function tep_show_category($counter) {\r\n\r\n// BoF - Contribution Category Box Enhancement 1.1\r\n global $tree, $categories_string, $cPath_array, $cat_name;\r\n\r\n for ($i=0; $i<$tree[$counter]['level']; $i++) {\r\n $categories_string .= \"&nbsp;&nbsp;\";\r\n }\r\n $cPath_new = 'cPath=' . $tree[$counter]['path'];\r\n if (isset($cPath_array) && in_array($counter, $cPath_array) && $cat_name == $tree[$counter]['name']) { //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a style=\"color:#874b5a;text-decoration:none\" href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t //Link nicht anklickbar, wenn angewählt\r\n } else {\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 //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\r\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\t\t\t //Link nicht anklickbar, wenn angewählt\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '<b>';\r\n }\r\n\r\n if ($cat_name == $tree[$counter]['name']) {\r\n $categories_string .= '<span class=\"errorText\">';\r\n }\r\n\r\n// display category name\r\n $categories_string .= '<img src=\"'. DIR_WS_IMAGES .'m25.gif\" align=\"absmiddle\" border=0 hspace=\"5\" vspace=\"0\">' . $tree[$counter]['name'];\r\n\r\n\t\tif ($cat_name == $tree[$counter]['name']) {\r\n\t\t\t$categories_string .= '</span>';\r\n }\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '</b>';\r\n }\r\n// \tEoF Category Box Enhancement\r\n\r\n $categories_string .= '</a>';\r\n\r\n if (SHOW_COUNTS == 'true') {\r\n $products_in_category = tep_count_products_in_category($counter);\r\n if ($products_in_category > 0) {\r\n $categories_string .= '&nbsp;(' . $products_in_category . ')';\r\n }\r\n }\r\n\r\n $categories_string .= '<br>';\r\n\r\n if ($tree[$counter]['next_id'] != false) {\r\n\t\t$categories_string .= '<div style=\"height:5px; line-height:5px; background: url('.DIR_WS_IMAGES .'m26.gif) center repeat-x;\"></div>';\r\n tep_show_category($tree[$counter]['next_id']);\r\n }\r\n }", "public function categories()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_category->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_category_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_category_vars($vars);\n\n // Load the file manager for the category image.\n ee()->publisher_helper_cp->load_file_manager();\n\n // Bail if there are no category groups defined.\n if (empty($vars['category_groups']))\n {\n show_error('No category groups found, please <a href=\"'. BASE.AMP .'D=cp&C=admin_content&M=edit_category_group\">create one</a>.');\n }\n\n return ee()->load->view('category/index', $vars, TRUE);\n }", "public function get_categories() {\n return [ 'yx-super-cat' ];\n }", "public function get_categories() {\n return [ 'electro-elements' ];\n }", "public function setSpecies($species);", "public static function settings() {\r\n\t\t$categories_vc = array(\r\n\t\t\tesc_html__( 'Any', 'myhome-core' ) => 0\r\n\t\t);\r\n\t\t$categories = get_categories( array(\r\n\t\t\t'orderby' => 'name',\r\n\t\t\t'order' => 'ASC'\r\n\t\t) );\r\n\r\n\t\tforeach ( $categories as $category ) {\r\n\t\t\t$categories_vc[$category->name] = $category->term_id;\r\n\t\t}\r\n\r\n\t\treturn array(\r\n\t\t\t'name' => esc_html__( 'Post Carousel', 'myhome-core' ),\r\n\t\t\t'base' => 'mh_carousel_post',\r\n 'icon' => plugins_url( 'myhome-core/public/img/vc-icon.png' ),\r\n 'category' => esc_html__( 'MyHome', 'myhome-core' ),\r\n\t\t\t'params' => array(\r\n\t\t\t\t// Visible\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'group' => esc_html__( 'General', 'myhome-core' ),\r\n\t\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t\t'heading' => esc_html__( 'Max Visible', 'myhome-core' ),\r\n\t\t\t\t\t'param_name' => 'owl_visible',\r\n\t\t\t\t\t'value' => array(\r\n\t\t\t\t\t\tesc_html__( 'Default - 3', 'myhome-core' ) => 'owl-carousel--visible-3',\r\n\t\t\t\t\t\tesc_html__( '1 ', 'myhome-core' ) \t\t\t=> 'owl-carousel--visible-1',\r\n\t\t\t\t\t\tesc_html__( '2 ', 'myhome-core' ) \t\t\t=> 'owl-carousel--visible-2',\r\n\t\t\t\t\t\tesc_html__( '3 ', 'myhome-core' ) \t\t\t=> 'owl-carousel--visible-3',\r\n\t\t\t\t\t\tesc_html__( '4 ', 'myhome-core' ) \t\t\t=> 'owl-carousel--visible-4',\r\n\t\t\t\t\t\tesc_html__( '5 ', 'myhome-core' ) \t\t\t=> 'owl-carousel--visible-5',\r\n\t\t\t\t\t),\r\n\t\t\t\t),\r\n\t\t\t\t// Posts limit\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'group' => esc_html__( 'General', 'myhome-core' ),\r\n\t\t\t\t\t'type' => 'textfield',\r\n\t\t\t\t\t'heading' => esc_html__( 'Posts limit', 'myhome-core' ),\r\n\t\t\t\t\t'param_name' => 'posts_limit',\r\n\t\t\t\t\t'value' => 5\r\n\t\t\t\t),\r\n // Read more\r\n array(\r\n 'group' => esc_html__( 'General', 'myhome-core' ),\r\n 'type' => 'textfield',\r\n 'heading' => esc_html__( 'Read more text', 'myhome-core' ),\r\n 'param_name' => 'read_more_text',\r\n 'value' => esc_html__( 'Read more', 'myhome-core')\r\n ),\r\n\t\t\t\t// Style\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'group' => esc_html__( 'General', 'myhome-core' ),\r\n\t\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t\t'heading' => esc_html__( 'Style', 'myhome-core' ),\r\n\t\t\t\t\t'param_name' => 'posts_style',\r\n\t\t\t\t\t'value' => array(\r\n\t\t\t\t\t\tesc_html__( 'Default', 'myhome-core' ) \t\t => '',\r\n\t\t\t\t\t\tesc_html__( 'White Background', 'myhome-core' ) => 'mh-post-grid--white',\r\n\t\t\t\t\t\tesc_html__( 'Dark Background', 'myhome-core' ) => 'mh-post-grid--dark',\r\n\t\t\t\t\t),\r\n\t\t\t\t),\r\n\t\t\t\t// Dots\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'group' => esc_html__( 'General', 'myhome-core' ),\r\n\t\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t\t'heading' => esc_html__( 'Dots', 'myhome-core' ),\r\n\t\t\t\t\t'param_name' => 'owl_dots',\r\n\t\t\t\t\t'value' => array(\r\n\t\t\t\t\t\tesc_html__( 'Yes', 'myhome-core' ) => '',\r\n\t\t\t\t\t\tesc_html__( 'No', 'myhome-core' ) \t=> 'owl-carousel--no-dots',\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 grid()\n {\n return Admin::grid(ArticleCategory::class, function (Grid $grid) {\n\n $grid->id('ID')->sortable();\n // 第二列显示title字段,由于title字段名和Grid对象的title方法冲突,所以用Grid的column()方法代替\n $grid->column('name','分类名称');\n //是否显示\n $grid->is_del('是否启用')->display(function ($released) {\n return $released ? '启用' : '禁止';\n });\n $grid->icon()->image('', 50, 50);\n $grid->sort('排序')->sortable();\n $grid->created_at('创建时间')->sortable();;\n $grid->updated_at('更新时间')->sortable();;\n });\n }", "public function get_categories() {\n return array ( 'general' );\n }", "protected function grid()\n {\n $grid = new Grid(new Category);\n\n $grid->id('ID');\n $grid->name('Название');\n //$grid->intro_img('Превью');\n\n return $grid;\n }", "public static function set_categories($map_controller, $on_backend = false, $group = false)\n\t{\n\t\t// Get locale\n\t\t$l = Kohana::config('locale.language.0');\n\t\n\t\t$parent_categories = array();\n\t\n\t\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t//Check to see if we're dealing with a group, and thus\n\t\t//should show group specific categories\n\t\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\tif($group != false)\n\t\t{\n\t\t\t//check and make sure the simpel groups category is installed\n\t\t\t$plugin = ORM::factory('plugin')\n\t\t\t\t->where('plugin_name', 'simplegroups')\n\t\t\t\t->where('plugin_active', '1')\n\t\t\t\t->find();\n\t\t\tif(!$plugin)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"A group was set in adminmap_helper::set_categories() when the SimpleGroupl plugin is not installed\");\n\t\t\t}\n\t\t\n\t\t\t$cats = ORM::factory('simplegroups_category');\n\t\t\tif(!$on_backend)\n\t\t\t{\t\n\t\t\t\t$cats = $cats->where('category_visible', '1');\n\t\t\t}\n\t\t\t$cats = $cats->where('parent_id', '0');\n\t\t\t$cats = $cats->where('applies_to_report', 1);\n\t\t\t$cats = $cats->where('simplegroups_groups_id', $group->id)\n\t\t\t\t->find_all() ;\n\t\t\tforeach ($cats as $category)\n\t\t\t{\t\t\t\t\n\t\t\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t// Get the children\n\t\t\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\t$children = array();\n\t\t\t\tforeach ($category->children as $child)\n\t\t\t\t{\n\t\t\t\t\t// Check for localization of child category\n\n\t\t\t\t\t$translated_title = Simplegroups_category_lang_Model::simplegroups_category_title($child->id,$l);\n\n\t\t\t\t\tif($translated_title)\n\t\t\t\t\t{\n\t\t\t\t\t\t$display_title = $translated_title;\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$display_title = $child->category_title;\n\t\t\t\t\t}\n\n\t\t\t\t\t$children[\"sg_\".$child->id] = array(\n\t\t\t\t\t\t$display_title,\n\t\t\t\t\t\t$child->category_color,\n\t\t\t\t\t\t$child->category_image\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t$translated_title = Simplegroups_category_lang_Model::simplegroups_category_title($category->id,$l);\n\n\t\t\t\tif($translated_title)\n\t\t\t\t{\n\t\t\t\t\t$display_title = $translated_title;\n\t\t\t\t}else{\n\t\t\t\t\t$display_title = $category->category_title;\n\t\t\t\t}\n\n\t\t\t\t// Put it all together\t\t\t\t\n\t\t\t\t$parent_categories[\"sg_\".$category->id] = array(\n\t\t\t\t\t$display_title,\n\t\t\t\t\t$category->category_color,\n\t\t\t\t\t$category->category_image,\n\t\t\t\t\t$children\n\t\t\t\t);\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n // Get all active top level categories\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\t$cats = ORM::factory('category');\n\t\tif(!$on_backend)\n\t\t{\t\n\t\t\t$cats = $cats->where('category_visible', '1');\n\t\t}\n\t\t$cats = $cats->where('parent_id', '0')\n\t\t\t->orderby('category_position', 'ASC')\n\t\t\t->find_all() ;\n\t\tforeach ($cats as $category)\n\t\t{\n\t\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t// Get the children\n\t\t\t/////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t$children = array();\n\t\t\tforeach ($category->children as $child)\n\t\t\t{\n\t\t\t\t// Check for localization of child category\n\n\t\t\t\t$translated_title = Category_Lang_Model::category_title($child->id,$l);\n\n\t\t\t\tif($translated_title)\n\t\t\t\t{\n\t\t\t\t\t$display_title = $translated_title;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$display_title = $child->category_title;\n\t\t\t\t}\n\n\t\t\t\t$children[$child->id] = array(\n\t\t\t\t\t$display_title,\n\t\t\t\t\t$child->category_color,\n\t\t\t\t\t$child->category_image\n\t\t\t\t);\n\n\t\t\t\tif ($child->category_trusted)\n\t\t\t\t{ // Get Trusted Category Count\n\t\t\t\t\t$trusted = ORM::factory(\"incident\")\n\t\t\t\t\t\t->join(\"incident_category\",\"incident.id\",\"incident_category.incident_id\")\n\t\t\t\t\t\t->where(\"category_id\",$child->id);\n\t\t\t\t\tif ( ! $trusted->count_all())\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($children[$child->id]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$translated_title = Category_Lang_Model::category_title($category->id,$l);\n\n\t\t\tif($translated_title)\n\t\t\t{\n\t\t\t\t$display_title = $translated_title;\n\t\t\t}else{\n\t\t\t\t$display_title = $category->category_title;\n\t\t\t}\n\n\t\t\t// Put it all together\n\t\t\t$parent_categories[$category->id] = array(\n\t\t\t\t$display_title,\n\t\t\t\t$category->category_color,\n\t\t\t\t$category->category_image,\n\t\t\t\t$children\n\t\t\t);\n\n\t\t\tif ($category->category_trusted)\n\t\t\t{ // Get Trusted Category Count\n\t\t\t\t$trusted = ORM::factory(\"incident\")\n\t\t\t\t\t->join(\"incident_category\",\"incident.id\",\"incident_category.incident_id\")\n\t\t\t\t\t->where(\"category_id\",$category->id);\n\t\t\t\tif ( ! $trusted->count_all())\n\t\t\t\t{\n\t\t\t\t\tunset($parent_categories[$category->id]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$map_controller->template->content->categories = $parent_categories;\n\t}", "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}", "protected function grid()\n {\n $grid = new Grid(new Category());\n $grid->model()->where('parent_id', '0');\n $grid->model()->orderBy('sort_order', 'asc');\n\n $grid->column('id', __('Id'));\n $grid->column('name_cn', __('Name cn'));\n $grid->column('name_en', __('Name en'));\n $grid->column('image', __('Image'))->image('',88, 88);\n $grid->column('top_image', __('置顶图'))->image('',88, 88);\n $grid->column('parent_id', '下级')->display(function () {\n return '点击查看下级';\n })->expand(function ($model) {\n $children = $model->children->map(function ($child) {\n return $child->only(['id', 'name_cn','sort_order']);\n });\n $array = $children->toArray();\n foreach ($array as $k => $v) {\n $url = route('admin.shop.categories.edit', $v['id']);\n $del_url = route('admin.shop.categories.destroy', $v['id']);\n $array[$k]['edit'] = '<div class=\"btn\">\n <a class=\"btn btn-sm btn-default pull-right\" href=\"' . $url . '\" rel=\"external\" >\n <i class=\"fa fa-edit\"></i> 编辑</a>\n </div><div class=\"btn\">\n <a class=\"btn btn-sm btn-danger pull-right\" href=\"' . $del_url . '\" >\n <i class=\"fa fa-truck\"></i> 删除</a>\n </div>';\n }\n\n return new Table(['ID', __('名称'), __('Sort order'), '操作'], $array);\n });\n $grid->column('description', __('Description'));\n $grid->column('content', __('Content'))->hide();\n $states = [\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n ];\n $grid->column('is_top', __('Is top'))->switch($states);\n $grid->column('sort_order', __('Sort order'))->sortable()->editable()->help('按数字大小正序排序');\n $grid->column('created_at', __('Created at'))->hide();\n $grid->column('updated_at', __('Updated at'))->hide();\n\n $grid->filter(function ($filter) {\n $filter->like('name_cn', __('Name cn'));\n $status_text = [\n 1 => '是',\n 0 => '否'\n ];\n $filter->equal('is_top', __('Is top'))->select($status_text);\n });\n\n return $grid;\n }", "private function categoriesGet()\n {\n//var_dump(__METHOD__, __LINE__, array_keys($this->confMap));\n//var_dump(__METHOD__, __LINE__, array_keys( $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'points.' ]));\n // RETURN : method is called twice at least\n if ( $this->arrCategories != null )\n {\n return $this->arrCategories;\n }\n // RETURN : method is called twice at least\n // Local array for category labels\n $catLabels = null;\n // Local array for category icons\n $catIcons = null;\n // #54548, 131221, dwildt, 2+\n // Local array for category label css classes\n $catCss = null;\n\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n // Get the field name of the field with the category label\n $fieldForLabel = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'category' ];\n // Get the field name of the field with the category icon\n $fieldForIcon = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n // Get the field name of the field with the category label\n $fieldForLabel = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryTitle' ];\n // #54548, 131221, dwildt, 4+\n // Get the field name of the field with the category label class for a marker category\n $fieldForCssMarker = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryCssMarker' ];\n // Get the field name of the field with the category label class for a path category\n $fieldForCssPath = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryCssPath' ];\n // Get the field name of the field with the category icon\n $fieldForIcon = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Get categories from the rows\n $categoryLabels = array();\n\n // FOREACH row\n foreach ( $this->pObj->rows as $row )\n {\n // RETURN : field for category label is missing\n // 130530, dwildt\n switch ( true )\n {\n case(!$fieldForLabel ):\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'table.field with the category is empty';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n $prompt = 'Please use the TypoScript Constant Editor and maintain map.marker.field.category ';\n t3lib_div :: devLog( '[HELP/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 1 );\n }\n // DRS\n //var_dump(__METHOD__, __LINE__, $fieldForLabel);\n $this->arrCategories = array();\n return $this->arrCategories;\n // #47602, 130911, dwildt, 1+\n case(!array_key_exists( $fieldForLabel, $row ) ):\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'current rows doesn\\'t contain the field \"' . $fieldForLabel . '\"';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS\n //var_dump(__METHOD__, __LINE__, $fieldForLabel, array_keys($row), $this->categoriesGetWoLatLon( $row ) );\n // #i0196, 151022, dwildt, 6+\n if ( $this->categoriesGetWoLatLon( $row ) )\n {\n $this->arrCategories = array();\n return $this->arrCategories;\n }\n $row[ $fieldForLabel ] = '';\n break;\n // #i0196, 151022, dwildt, 6+/2-\n //$this->arrCategories = array();\n //return $this->arrCategories;\n // #i0076, 140721, dwildt, +\n case($this->categoriesGetWoLatLon( $row ) ):\n continue 2;\n default:\n // follow the workflow\n }\n // RETURN : field for category label is missing\n // 4.1.7, dwildt, 1-\n //$categoryLabels = array_merge( $categoryLabels, explode( $this->catDevider, $row[ $fieldForLabel ] ) );\n // 4.1.7, dwildt, 10+\n//var_dump( __METHOD__, __LINE__, $this->catDevider, $fieldForLabel, $row[ $fieldForLabel ]);\n//die();\n $catLabelsOfCurrRow = explode( $this->catDevider, $row[ $fieldForLabel ] );\n foreach ( $catLabelsOfCurrRow as $labelKey => $labelValue )\n {\n // #47602, 130911, dwildt, 4+\n if ( empty( $labelValue ) )\n {\n $labelValue = $this->pObj->pi_getLL( 'phrase_noMapCat' );\n // #i0062, 140714, 1+\n $this->arrWoCategories[ 'rows' ][] = $row[ $this->pObj->arrLocalTable[ 'uid' ] ];\n }\n $categoryLabels[] = $labelValue;\n if ( isset( $row[ $fieldForIcon ] ) )\n {\n $catIconsOfCurrRow = explode( $this->catDevider, $row[ $fieldForIcon ] );\n $categoryIcons[ $labelValue ] = $catIconsOfCurrRow[ $labelKey ];\n }\n // #54548, 131221, dwildt, 13+\n switch ( true )\n {\n case( isset( $row[ $fieldForCssMarker ] ) ):\n $catCssOfCurrRow = explode( $this->catDevider, $row[ $fieldForCssMarker ] );\n $categoryCss[ $labelValue ] = $catCssOfCurrRow[ $labelKey ];\n break;\n case( isset( $row[ $fieldForCssPath ] ) ):\n $catCssOfCurrRow = explode( $this->catDevider, $row[ $fieldForCssPath ] );\n $categoryCss[ $labelValue ] = $catCssOfCurrRow[ $labelKey ];\n break;\n default;\n break;\n }\n }\n // 4.1.7, dwildt, 10+\n }\n // FOREACH row\n // Get categories from the rows\n // #i0120, 150101, dwildt: 4+\n if ( $this->categoriesEmpty( $categoryLabels ) )\n {\n return false;\n }\n // Remove non unique category labels\n $categoryLabels = array_unique( $categoryLabels );\n//var_dump (__METHOD__, __LINE__, $categoryLabels);\n//var_dump(__METHOD__, __LINE__);\n // Order the category labels\n $orderBy = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'orderBy' ];\n switch ( $orderBy )\n {\n case( 'SORT_REGULAR' ):\n sort( $categoryLabels, SORT_REGULAR );\n break;\n case( 'SORT_NUMERIC' ):\n sort( $categoryLabels, SORT_NUMERIC );\n break;\n case( 'SORT_STRING' ):\n sort( $categoryLabels, SORT_STRING );\n break;\n case( 'SORT_LOCALE_STRING' ):\n sort( $categoryLabels, SORT_LOCALE_STRING );\n break;\n default:\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'configuration.categories.orderBy has an unproper value: \"' . $orderBy . '\"';\n t3lib_div :: devLog( '[ERROR/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 3 );\n $prompt = 'categories will ordered by SORT_REGULAR!';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n }\n sort( $categoryLabels, SORT_REGULAR );\n break;\n }\n // Order the category labels\n // Set the keys: keys should correspond with keys of the item colours\n $maxItem = count( $categoryLabels );\n $counter = 0;\n//var_dump(__METHOD__, __LINE__);\n//var_dump(__METHOD__, __LINE__, array_keys($this->confMap));\n foreach ( array_keys( $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'points.' ] ) as $catKey )\n {\n if ( substr( $catKey, -1 ) == '.' )\n {\n continue;\n }\n $catLabels[ $catKey ] = $categoryLabels[ $counter ];\n if ( isset( $row[ $fieldForIcon ] ) )\n {\n $catIcons[ $catKey ] = $categoryIcons[ $categoryLabels[ $counter ] ];\n }\n\n // #i0062, 140714, 4+\n if ( $catLabels[ $catKey ] == $this->pObj->pi_getLL( 'phrase_noMapCat' ) )\n {\n $this->arrWoCategories[ 'iconKey' ] = $catKey;\n }\n // #54548, 131221, dwildt, 9+\n switch ( true )\n {\n case( isset( $row[ $fieldForCssMarker ] ) ):\n case( isset( $row[ $fieldForCssPath ] ) ):\n $catCss[ $catKey ] = $categoryCss[ $categoryLabels[ $counter ] ];\n break;\n default;\n break;\n }\n $counter++;\n if ( $counter >= $maxItem )\n {\n break;\n }\n }\n // Set the keys: keys should correspond with keys of the item colours\n\n $this->arrCategories[ 'labels' ] = $catLabels;\n if ( isset( $row[ $fieldForIcon ] ) )\n {\n $this->arrCategories[ 'icons' ] = $catIcons;\n }\n // #54548, 131221, dwildt, 8+\n if ( !empty( $catCss ) )\n {\n $this->arrCategories[ 'cssClass' ] = $catCss;\n }\n//var_dump(__METHOD__, __LINE__);\n\n return $this->arrCategories;\n }", "protected function grid()\n {\n $grid = new Grid(new Goods);\n\n $cateList = Category::all()->where('is_show',1)->toArray();\n\n $grid->model()->where('hos_id', session('hos_id'));\n $grid->id('ID')->sortable();\n $grid->column('name','商品名称');\n $grid->column('is_valid','是否显示')->display(function ($is){\n return $is ? '<span class=\"label label-success\">是</span>' : '<span class=\"label label-warning\">否</span>';\n });\n\n $grid->column('cate_id','分类')->display(function ($id) use ( $cateList ) {\n foreach ($cateList as $key => $value) {\n if ($id == $value['id']){\n return '<span class=\"label label-success\">'.$value['title'].'</span>';\n }\n }\n });\n\n $grid->created_at(trans('admin.created_at'));\n $grid->updated_at(trans('admin.updated_at'));\n\n //分类树形\n $cateTree = getTree(Category::all()->where('is_show',1)->toArray());\n $cate_map = [];\n foreach ($cateTree as $key => $value) {\n $cate_map[$value['id']] = str_repeat('&#12288;&#12288;',$value['level']).$value['title'];\n }\n\n $grid->actions(function ($actions) {\n $actions->disableDelete(false);\n $actions->disableEdit(false);\n $actions->disableView(false);\n });\n\n $grid->filter(function($filter) use ($cate_map){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n //$filter->equal('department_id','部门')->select($departments);\n $filter->equal('cate_id','分类')->select($cate_map);\n $filter->like('name', '商品');\n\n });\n\n\n return $grid;\n }", "private static function register_block_categories() {\n $names = static::$names;\n add_filter( 'block_categories', function( $categories, $post ) use( $names ) {\n return array_merge( $categories, [\n [ 'slug' => $names['slug_single'], 'title' => $names['label_single'] ],\n ]);\n }, 10, 2);\n }", "public function config_choose()\n {\n // Find all categories\n $hooks = find_all_hooks('systems', 'config');\n $categories = array();\n foreach (array_keys($hooks) as $hook) {\n require_code('hooks/systems/config/' . filter_naughty_harsh($hook));\n $ob = object_factory('Hook_config_' . filter_naughty_harsh($hook));\n $option = $ob->get_details();\n if ((is_null($GLOBALS['CURRENT_SHARE_USER'])) || ($option['shared_hosting_restricted'] == 0)) {\n if (!is_null($ob->get_default())) {\n $category = $option['category'];\n if (!isset($categories[$category])) {\n $categories[$category] = 0;\n }\n $categories[$category]++;\n }\n }\n }\n\n // Show all categories\n $categories_tpl = new Tempcode();\n ksort($categories);\n foreach ($categories as $category => $option_count) {\n // Some are skipped\n if (get_forum_type() != 'cns') {\n if ($category == 'USERS') {\n continue;\n }\n if ($category == 'FORUMS') {\n continue;\n }\n }\n if (has_no_forum()) {\n if ($category == 'FORUMS') {\n continue;\n }\n }\n\n // Put together details...\n\n $url = build_url(array('page' => '_SELF', 'type' => 'category', 'id' => $category), '_SELF');\n\n $_category_name = do_lang('CONFIG_CATEGORY_' . $category, null, null, null, null, false);\n if (is_null($_category_name)) {\n attach_message(do_lang_tempcode('CAT_NOT_FOUND', escape_html($category), 'OPTION_CATEGORY'), 'warn');\n\n $category_name = make_string_tempcode($category);\n } else {\n $category_name = do_lang_tempcode('CONFIG_CATEGORY_' . $category);\n }\n\n $description = do_lang_tempcode('CONFIG_CATEGORY_DESCRIPTION__' . $category);\n\n $count = do_lang_tempcode('CATEGORY_SUBORDINATE_2', escape_html(integer_format($option_count)));\n\n $categories_tpl->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY', array(\n '_GUID' => '6ba2b09432d06e7502c71e7aac2d3527',\n 'COUNT' => $count,\n 'NAME' => $category_name,\n 'TITLE' => '',\n 'DESCRIPTION' => $description,\n 'URL' => $url,\n )));\n }\n\n $categories_tpl->attach(do_template('COMCODE_SUBTITLE', array(\n '_GUID' => '7fde99ae81367fb7405e94b6731a7d9x',\n 'TITLE' => do_lang('DEEPER_CONFIGURATION'),\n 'LEVEL' => '2',\n )));\n\n $categories_tpl->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY', array(\n '_GUID' => '6fde99ae81367fb7405e94b6731a7d9a',\n 'COUNT' => null,\n 'TITLE' => '',\n 'URL' => build_url(array('page' => '_SELF', 'type' => 'base'), '_SELF'),\n 'NAME' => do_lang_tempcode('BASE_CONFIGURATION'),\n 'DESCRIPTION' => do_lang_tempcode('DOC_BASE_CONFIGURATION'),\n )));\n\n $categories_tpl->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY', array(\n '_GUID' => '7fde99ae81367fb7405e94b6731a7d9a',\n 'COUNT' => null,\n 'TITLE' => '',\n 'URL' => build_url(array('page' => '_SELF', 'type' => 'xml_fields'), '_SELF'),\n 'NAME' => do_lang_tempcode('FIELD_FILTERS'),\n 'DESCRIPTION' => do_lang_tempcode('DOC_FIELD_FILTERS'),\n )));\n $categories_tpl->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY', array(\n '_GUID' => '8fde99ae81367fb7405e94b6731a7d9a',\n 'COUNT' => null,\n 'TITLE' => '',\n 'URL' => build_url(array('page' => '_SELF', 'type' => 'xml_breadcrumbs'), '_SELF'),\n 'NAME' => do_lang_tempcode('BREADCRUMB_OVERRIDES'),\n 'DESCRIPTION' => do_lang_tempcode('DOC_BREADCRUMB_OVERRIDES'),\n )));\n $categories_tpl->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY', array(\n '_GUID' => '9fde99ae81367fb7405e94b6731a7d9a',\n 'COUNT' => null,\n 'TITLE' => '',\n 'URL' => build_url(array('page' => '_SELF', 'type' => 'upgrader'), '_SELF'),\n 'NAME' => do_lang_tempcode('FU_UPGRADER_TITLE'),\n 'DESCRIPTION' => do_lang_tempcode('FU_UPGRADER_INTRO'),\n )));\n $categories_tpl->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY', array(\n '_GUID' => '0fde99ae81367fb7405e94b6731a7d9a',\n 'COUNT' => null,\n 'TITLE' => '',\n 'URL' => build_url(array('page' => '_SELF', 'type' => 'backend'), '_SELF'),\n 'NAME' => do_lang_tempcode('_FEEDS'),\n 'DESCRIPTION' => comcode_to_tempcode(do_lang('OPML_INDEX_DESCRIPTION')),\n )));\n $categories_tpl->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY', array(\n '_GUID' => '1fde99ae81367fb7405e94b6731a7d9a',\n 'COUNT' => null,\n 'TITLE' => '',\n 'URL' => build_url(array('page' => '_SELF', 'type' => 'code_editor'), '_SELF'),\n 'NAME' => do_lang_tempcode('CODE_EDITOR'),\n 'DESCRIPTION' => do_lang_tempcode('DOC_CODE_EDITOR'),\n )));\n\n // Wrapper\n return do_template('INDEX_SCREEN_FANCIER_SCREEN', array(\n '_GUID' => 'c8fdb2b481625d58b0b228c897fda72f',\n 'TITLE' => $this->title,\n 'PRE' => paragraph(do_lang_tempcode('CHOOSE_A_CONFIG_CATEGORY')),\n 'CONTENT' => $categories_tpl,\n 'POST' => '',\n ));\n }", "public function get_categories() {\n\t\treturn [ 'siva-plugins' ];\n\t}", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories() {\n\t\treturn array( 'general' );\n\t}", "protected function grid()\n {\n $grid = new Grid(new Facility);\n\n $grid->id('施設ID')->sortable();\n $grid->facility_name('施設名')->sortable();\n $grid->type('タイプ')->sortable();\n $grid->room('部屋数')->sortable();\n $grid->floor('フロア数')->sortable();\n $grid->transaction_status('取引ステータス')->sortable();\n $grid->sales_status('運営状況')->sortable();\n $grid->postalcode('郵便番号')->sortable();\n $grid->prefecture('都道府県')->sortable();\n $grid->address('住所')->sortable();\n $grid->katagaki('方書')->sortable();\n $grid->tel('電話番号')->sortable();\n $grid->manager('支配人')->sortable();\n $grid->manager_phone_number('支配人 携帯電話')->sortable();\n // $grid->division1('担当事業部1')->sortable();\n // $grid->department1('部署1')->sortable();\n // $grid->staff1('担当者名1')->sortable();\n // $grid->staff_phone_number1('担当者携帯1')->sortable();\n // $grid->remarks1('備考1')->sortable();\n // $grid->division2('担当事業部2')->sortable();\n // $grid->department2('部署2')->sortable();\n // $grid->staff2('担当者名2')->sortable();\n // $grid->staff_phone_number2('担当者携帯2')->sortable();\n // $grid->remarks2('備考2')->sortable();\n // $grid->division3('担当事業部3')->sortable();\n // $grid->department3('部署3')->sortable();\n // $grid->staff3('担当者名3')->sortable();\n // $grid->staff_phone_number3('担当者携帯3')->sortable();\n // $grid->remarks3('備考3')->sortable();\n // $grid->customer_id('顧客ID')->sortable();\n // $grid->wifi('WiFi販売')->sortable();\n // $grid->fixtures('備品販売')->sortable();\n // $grid->tv('TV販売')->sortable();\n // $grid->tableware('食器販売')->sortable();\n // $grid->created_at('Created at');\n // $grid->updated_at('Updated at');\n\n $grid->actions(function ($actions) {\n // $actions->disableDelete();\n // $actions->disableEdit();\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Category);\n\n $grid->id('Id');\n $grid->parent_id('父ID');\n $grid->name('名称');\n $grid->order('排序');\n $grid->image('图片');\n $grid->index_template('首页模版');\n $grid->detail_template('详情模版');\n $grid->status('Status')->display(function ($status){\n return $status ? '<p class=\"text-success\">启用</p>' : '<p class=\"text-muted\">禁用</p>';\n });\n $grid->created_at('创建时间');\n\n return $grid;\n }", "public function get_categories()\n {\n return ['general'];\n }", "public function get_categories()\n {\n return ['general'];\n }", "function cpt_casestudy() {\n\n \t$labels = array(\n \t\t'name' => _x( 'Case Studies', 'Post Type General Name', 'case_study' ),\n \t\t'singular_name' => _x( 'Case Study', 'Post Type Singular Name', 'case_study' ),\n \t\t'menu_name' => __( 'Case Studies', 'case_study' ),\n \t\t'name_admin_bar' => __( 'Case Study', 'case_study' ),\n \t\t'archives' => __( 'Case Study Archives', 'case_study' ),\n \t\t'attributes' => __( 'Case Study Attributes', 'case_study' ),\n \t\t'parent_item_colon' => __( 'Parent Case Study:', 'case_study' ),\n \t\t'all_items' => __( 'All Case Studies', 'case_study' ),\n \t\t'add_new_item' => __( 'Add New Case Study', 'case_study' ),\n \t\t'add_new' => __( 'Add New', 'case_study' ),\n \t\t'new_item' => __( 'New Case Study', 'case_study' ),\n \t\t'edit_item' => __( 'Edit Case Study', 'case_study' ),\n \t\t'update_item' => __( 'Update Case Study', 'case_study' ),\n \t\t'view_item' => __( 'View Case Study', 'case_study' ),\n \t\t'view_items' => __( 'View Case Studies', 'case_study' ),\n \t\t'search_items' => __( 'Search Case Study', 'case_study' ),\n \t\t'not_found' => __( 'Not found', 'case_study' ),\n \t\t'not_found_in_trash' => __( 'Not found in Trash', 'case_study' ),\n \t\t'featured_image' => __( 'Business Logo', 'case_study' ),\n \t\t'set_featured_image' => __( 'Set business logo', 'case_study' ),\n \t\t'remove_featured_image' => __( 'Remove business logo', 'case_study' ),\n \t\t'use_featured_image' => __( 'Use as business logo', 'case_study' ),\n \t\t'insert_into_item' => __( 'Insert into Case Study', 'case_study' ),\n \t\t'uploaded_to_this_item' => __( 'Uploaded to this Case Study', 'case_study' ),\n \t\t'items_list' => __( 'Case Studies list', 'case_study' ),\n \t\t'items_list_navigation' => __( 'Case Studies list navigation', 'case_study' ),\n \t\t'filter_items_list' => __( 'Filter Case Studies list', 'case_study' ),\n \t);\n \t$args = array(\n \t\t'label' => __( 'Case Study', 'case_study' ),\n \t\t'labels' => $labels,\n \t\t'supports' => array( 'title', 'thumbnail' ),\n \t\t'taxonomies' => array( 'case_study_categories' ),\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' => 20,\n \t\t'menu_icon' => 'dashicons-analytics',\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' => true,\n \t\t'publicly_queryable' => true,\n \t\t'rewrite' => false,\n \t\t'capability_type' => 'page',\n \t);\n \tregister_post_type( 'case_study', $args );\n\n }", "function showCategoryNames(){\n $this->load->model('pagesortingmodel');\n $data['groups'] = $this->pagesortingmodel->getAllCategories();\n $this->load->view('admin/create_categories',$data);\n }", "private function assignCategoriesAndCities() {\n\t\t$this->view->assign('categories', $this->typeRepository->findAll());\n\t\t$this->view->assign('companies', $this->companyRepository->findAll());\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories()\n\t{\n\t\treturn array('general');\n\t}", "public function get_categories() {\n return [ 'Alita-elements' ];\n }", "public function get_categories() {\n return [ 'Alita-elements' ];\n }", "abstract public function grid();", "protected function grid() {\n\t\t$grid = new Grid(new Country);\n\n\t\t$grid->filter(function ($filter) {\n\t\t\t$filter->disableIdFilter();\n\n\t\t\t$filter->column(3 / 4, function ($filter) {\n\t\t\t\t$continents = Continent::where('parent_id', '0')->pluck('cn_name', 'id');\n\t\t\t\t$filter->expand()->equal('continent_id', '大洲')->select($continents);\n\t\t\t\t$filter->expand()->where(function ($query) {\n\t\t\t\t\t$query->where('cname', 'like', \"%{$this->input}%\")\n\t\t\t\t\t\t->orWhere('full_cname', 'like', \"%{$this->input}%\")\n\t\t\t\t\t\t->orWhere('name', 'like', \"%{$this->input}%\")\n\t\t\t\t\t\t->orWhere('country_code', 'like', \"%{$this->input}%\");\n\t\t\t\t\t// $query->whereHas('country', function ($query){\n\t\t\t\t\t// $query->where('cname', 'like', \"%{$this->input}%\");\n\t\t\t\t\t// });\n\t\t\t\t}, '关键字');\n\t\t\t});\n\t\t});\n\n\t\t$grid->selector(function (Grid\\Tools\\Selector $selector) {\n\t\t\t$selector->select('continent_id', '洲名', [\n\t\t\t\t1 => '亚洲',\n\t\t\t\t2 => '美洲',\n\t\t\t\t3 => '非洲',\n\t\t\t\t4 => '大洋洲',\n\t\t\t\t5 => '南极洲',\n\t\t\t\t6 => '北美洲',\n\t\t\t\t7 => '南美洲',\n\t\t\t]);\n\t\t\t$selector->select('promotion', '推荐', [\n\t\t\t\t0 => '未推荐',\n\t\t\t\t1 => '推荐',\n\t\t\t]);\n\t\t});\n\n\t\t$grid->column('id', __('Id'));\n\t\t// $grid->column('continent_id', __('洲 id'));\n\t\t$grid->column('cname', __('中文名'));\n\t\t$grid->column('continent.cn_name', '洲名');\n\t\t$grid->continentlocation('地理位置')->pluck('cn_name')->label('danger');\n\t\t$grid->column('name', __('英文名称'));\n\t\t// $grid->column('lower_name', __('小写'))->limit(10);\n\t\t$grid->column('country_code', __('国家地区代码'))->limit(10);\n\t\t// $grid->column('full_name', __('英文全称'))->limit(10);\n\t\t$grid->column('full_cname', __('中文全称'))->limit(10);\n\t\t// $grid->column('remark', __('概况'))->limit(30);\n\t\t$grid->column('is_island', __('海岛'))->bool();\n\t\t$states = [\n\t\t\t'on' => ['value' => 1, 'text' => '是', 'color' => 'primary'],\n\t\t\t'off' => ['value' => 0, 'text' => '否', 'color' => 'default'],\n\t\t];\n\t\t$grid->column('promotion', __('推荐'))->switch($states);\n\t\t$grid->column('active', __('激活'))->switch($states);\n\t\t// $grid->column('created_at', __('Created at'));\n\t\t// $grid->column('updated_at', __('Updated at'));\n\n\t\treturn $grid;\n\t}", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "function wp_regenthumbs_stamina_columns($defaults) {\r\n\t$defaults['regenthumbs-stamina'] = 'RegenThumbs Stamina';\r\n\treturn $defaults;\r\n}", "protected function grid()\n {\n $grid = new Grid(new MachinesStyle());\n\n $grid->model()->latest();\n \n $grid->column('id', __('索引'))->sortable();\n\n $grid->column('style_name', __('型号名称'))->help('机具的型号名称');\n\n $grid->column('machines_fact.factory_name', __('所属厂商'))->help('机具型号所属的厂商');\n\n // $grid->column('machines_fact.machines_types.name', __('所属类型'))->help('机具型号所属的类型');\n\n $grid->column('created_at', __('创建时间'))->date('Y-m-d H:i:s')->help('机具型号的创建时间');\n\n $grid->column('updated_at', __('修改时间'))->date('Y-m-d H:i:s')->help('机具型号的最后修改时间');\n\n return $grid;\n }", "public function home_categories() {\n $data['categories'] = $this->settingsRepository->getCategories();\n\n return view('Admin::settings.home-categories', $data);\n }", "function showCategory()\r\n {\r\n }", "protected function grid()\n {\n return Admin::grid(ArticleCategory::class, function (Grid $grid) {\n $grid->id('ID')->sortable();\n $grid->title('文章分类名称');\n $grid->sort('文章分类排序');\n $grid->summary('简介');\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n\n $grid->filter(function ($filter) {\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n });\n $grid->disableFilter();\n $grid->disableExport();\n\n });\n }", "protected function getCategoriesToRegenerate()\n {\n $sets = $this->getItemSets()['image-sets'];\n $childCategories = $this->getChildK2Categories();\n $categories = array();\n foreach ($sets as $set) {\n foreach ($set['k2categories'] as $catId) {\n if (! in_array($catId, $categories)) {\n $categories[] = $catId;\n }\n if ($set['k2selectsubcategories'] == '1') {\n foreach ($childCategories as $child) {\n if ((! in_array($child->id, $categories)) && ($child->parent == $catId)) {\n $categories[] = $child->id;\n }\n }\n }\n }\n }\n return $categories;\n }", "public function get_categories() {\n\t\treturn array( 'listeo' );\n\t}", "private function _get_filters_section_settings() {\r\n\r\n // Get all product categories\r\n $termArgs = array(\r\n 'taxonomy' => 'product_cat',\r\n 'hide_empty' => false\r\n );\r\n $productTermsObject = get_terms( $termArgs );\r\n $productTerms = array();\r\n\r\n if ( !is_wp_error( $productTermsObject ) ) {\r\n\r\n foreach( $productTermsObject as $term )\r\n $productTerms[ $term->slug ] = $term->name;\r\n\r\n }\r\n\r\n foreach ( WWOF_Product_Listing_Helper::get_all_products( 'ID , post_title' ) as $post ){\r\n $product = wc_get_product( $post->ID );\r\n $allProducts[ WWOF_Functions::wwof_get_product_id( $product ) ] = '[ID : ' . WWOF_Functions::wwof_get_product_id( $product ) . '] ' . $post->post_title;\r\n }\r\n\r\n // Add \"None\" category selection for \"no default\" option\r\n $productTerms2 = array_merge( array ('none' => __( 'No Default' , 'woocommerce-wholesale-order-form' ) ), $productTerms );\r\n\r\n return array(\r\n\r\n array(\r\n 'title' => __( 'Filters Options', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'title',\r\n 'desc' => '',\r\n 'id' => 'wwof_filters_main_title'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Product Category Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'multiselect',\r\n 'desc' => __( 'Only display products belonging to the selected category' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_filters_product_category_filter',\r\n 'class' => 'chosen_select',\r\n 'css' => 'min-width:300px;',\r\n 'custom_attributes' => array(\r\n 'multiple' => 'multiple',\r\n 'data-placeholder' => __( 'Select Some Product Categories...' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'options' => $productTerms\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Exclude Product Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'multiselect',\r\n 'desc' => __( 'Exclude selected products' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_filters_exclude_product_filter',\r\n 'class' => 'chosen_select',\r\n 'css' => 'min-width:300px;',\r\n 'custom_attributes' => array(\r\n 'multiple' => 'multiple',\r\n 'data-placeholder' => __( 'Select Some Products...' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'options' => $allProducts\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Default Product Category on Search Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => __( 'Select a product category to which product are under will be loaded by default in the order form.' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_general_default_product_category_search_filter',\r\n 'class' => 'chosen_select',\r\n 'options' => $productTerms2,\r\n 'default' => 'none'\r\n ),\r\n\r\n array(\r\n 'type' => 'sectionend',\r\n 'id' => 'wwof_filters_sectionend'\r\n )\r\n\r\n );\r\n\r\n }", "function silvia_customizer_grid_styles() {\n\n\t// Theme prefix\n\t$prefix = 'silvia-';\n\t\n\t// Image grayscale\n\t$grayscale = silvia_mod( $prefix . 'grid-img-grayscale' );\n\n\tif ( $grayscale !== customizer_library_get_default( $prefix . 'grid-img-grayscale' ) ) {\n\n\t\t$gray = absint( $grayscale );\n\n\t\tCustomizer_Library_Styles()->add( array(\n\t\t\t'selectors' => array(\n\t\t\t\t'.thumbnail-link img'\n\t\t\t),\n\t\t\t'declarations' => array(\n\t\t\t\t'filter' => 'grayscale(' . $gray . '%)',\n\t\t\t\t'-webkit-filter' => 'grayscale(' . $gray . '%)'\n\t\t\t)\n\t\t) );\n\t}\n\n\t// Title color\n\t$title = silvia_mod( $prefix . 'grid-title-color' );\n\n\tif ( $title !== customizer_library_get_default( $prefix . 'grid-title-color' ) ) {\n\n\t\t$color = sanitize_hex_color( $title );\n\n\t\tCustomizer_Library_Styles()->add( array(\n\t\t\t'selectors' => array(\n\t\t\t\t'.thumbnail-detail .entry-title a'\n\t\t\t),\n\t\t\t'declarations' => array(\n\t\t\t\t'color' => $color\n\t\t\t)\n\t\t) );\n\t}\n\n\t// Title hover color\n\t$title_hover = silvia_mod( $prefix . 'grid-title-hover-color' );\n\n\tif ( $title_hover !== customizer_library_get_default( $prefix . 'grid-title-hover-color' ) ) {\n\n\t\t$color = sanitize_hex_color( $title_hover );\n\n\t\tCustomizer_Library_Styles()->add( array(\n\t\t\t'selectors' => array(\n\t\t\t\t'.thumbnail-detail .entry-title a:hover'\n\t\t\t),\n\t\t\t'declarations' => array(\n\t\t\t\t'color' => $color\n\t\t\t)\n\t\t) );\n\t}\n\n\t// Category color\n\t$cat = silvia_mod( $prefix . 'grid-cat-color' );\n\n\tif ( $cat !== customizer_library_get_default( $prefix . 'grid-cat-color' ) ) {\n\n\t\t$color = sanitize_hex_color( $cat );\n\n\t\tCustomizer_Library_Styles()->add( array(\n\t\t\t'selectors' => array(\n\t\t\t\t'.thumbnail-detail .cat-links a'\n\t\t\t),\n\t\t\t'declarations' => array(\n\t\t\t\t'color' => $color\n\t\t\t)\n\t\t) );\n\t}\n\n\t// Category hover color\n\t$cat_hover = silvia_mod( $prefix . 'grid-cat-hover-color' );\n\n\tif ( $cat_hover !== customizer_library_get_default( $prefix . 'grid-cat-hover-color' ) ) {\n\n\t\t$color = sanitize_hex_color( $cat_hover );\n\n\t\tCustomizer_Library_Styles()->add( array(\n\t\t\t'selectors' => array(\n\t\t\t\t'.thumbnail-detail .cat-links a:hover'\n\t\t\t),\n\t\t\t'declarations' => array(\n\t\t\t\t'color' => $color\n\t\t\t)\n\t\t) );\n\t}\n\n}", "protected function grid()\n {\n return Admin::grid(ProductCategory::class, function (Grid $grid) {\n\n $grid->id('ID')->sortable();\n\n $grid->created_at();\n $grid->updated_at();\n });\n }", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "function om_cars_categories() {\n $labels = array(\n 'name' => _x( 'Cars Categories', 'taxonomy general name' ),\n 'singular_name' => _x( 'Cars Category', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Cars Categories' ),\n 'all_items' => __( 'All Cars Categories' ),\n 'parent_item' => __( 'Parent Cars Category' ),\n 'parent_item_colon' => __( 'Parent Cars Category:' ),\n 'edit_item' => __( 'Edit Cars Category' ), \n 'update_item' => __( 'Update Cars Category' ),\n 'add_new_item' => __( 'Add New Cars Category' ),\n 'new_item_name' => __( 'New Cars Category' ),\n 'menu_name' => __( 'Cars Categories' ),\n );\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n );\n register_taxonomy( 'cars_category', 'om-car', $args );\n}", "function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\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\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}", "function shopay_pfc_sec( $section_cat_slugs ) {\n $i = 0;\n foreach( $section_cat_slugs as $section_cat_slug => $cat_value ) :\n $cat_slugs[$i] = $section_cat_slug;\n $i++;\n endforeach;\n $pfc_cat_args = array(\n 'post_status' => 'publish',\n 'post_type' => 'product',\n 'posts_per_page' => -1,\n 'tax_query' => array(\n array(\n 'taxonomy' => 'product_cat',\n 'field' => 'slug',\n 'terms' => $cat_slugs,\n ),\n ),\n );\n $pfc_cat_query = new WP_Query( $pfc_cat_args );\n if ( $pfc_cat_query -> have_posts() ) :\n while ( $pfc_cat_query -> have_posts() ) : $pfc_cat_query -> the_post();\n wc_get_template_part( 'content', 'product' );\n endwhile;\n endif;\n wp_reset_postdata();\n }", "function show_cats_dropdowns($all_cats, $main_cats) {\r\n\t\t\t\t\t\t\t\t$auto_class_cats = get_option('auto_class_cats');\r\n\t\t\t\t\t\t\t\tforeach ($main_cats as $key => $cat) {\r\n\t\t\t\t\t\t\t\t\t$selected = ($cat->term_id == $category_id) ? \" selected\" : \"\";\r\n\t\t\t\t\t\t\t\t\techo '<div data-value=\"'.$cat->term_id.'\" class=\"option'.$selected.'\" data-cat-parent=\"'.$cat->category_parent.'\"><span class=\"icon icon-level-down\"></span> '.$cat->name.'</div>';\r\n\r\n\t\t\t\t\t\t\t\t\tforeach($all_cats as $key => $subcat) {\r\n\t\t\t\t\t\t\t\t\t\tif($subcat->category_parent == $cat->term_id && !in_array($subcat->category_parent, $auto_class_cats)) {\r\n\t\t\t\t\t\t\t\t\t\t\t$sub_cats[] = $subcat;\r\n\t\t\t\t\t\t\t\t\t\t\tunset($all_cats[$key]);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}//foreach $c as $cat\r\n\t\t\t\t\t\t\t\t\techo '<div class=\"sub-cat\" data-subcats-for-cat=\"'.$cat->term_id.'\">';\r\n\t\t\t\t\t\t\t\t\t\tif(count($sub_cats) > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\tshow_cats_dropdowns($all_cats, $sub_cats);\r\n\t\t\t\t\t\t\t\t\t\t\tunset($sub_cats);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\techo '</div>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}", "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 }", "public function get_categories()\n {\n return ['super-cat'];\n }", "function _wb_universe_stylepage_displays(&$form, FormStateInterface $form_state)\n{\n $group = 'stylepage';\n $sous_group = 'displays';\n return $form['wb_universe_' . $group][$sous_group];\n}", "protected function registerDefaultCategorizedTables() {}", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "public static function singularizeProvider(): array\n {\n return [\n ['categoria', 'categorias'],\n ['menu', 'menus'],\n ['news', 'news'],\n ['food_menu', 'food_menus'],\n ['Menu', 'Menus'],\n ['FoodMenu', 'FoodMenus'],\n ['house', 'houses'],\n ['powerhouse', 'powerhouses'],\n ['quiz', 'quizzes'],\n ['Bus', 'Buses'],\n ['bus', 'buses'],\n ['matrix_row', 'matrix_rows'],\n ['matrix', 'matrices'],\n ['vertex', 'vertices'],\n ['index', 'indices'],\n ['index', 'indexes'],\n ['Alias', 'Aliases'],\n ['Alias', 'Alias'],\n ['Media', 'Media'],\n ['NodeMedia', 'NodeMedia'],\n ['alumnus', 'alumni'],\n ['bacillus', 'bacilli'],\n ['cactus', 'cacti'],\n ['focus', 'foci'],\n ['fungus', 'fungi'],\n ['nucleus', 'nuclei'],\n ['octopus', 'octopuses'],\n ['radius', 'radii'],\n ['stimulus', 'stimuli'],\n ['syllabus', 'syllabi'],\n ['terminus', 'termini'],\n ['virus', 'viruses'],\n ['person', 'people'],\n ['glove', 'gloves'],\n ['dove', 'doves'],\n ['life', 'lives'],\n ['knife', 'knives'],\n ['wolf', 'wolves'],\n ['slave', 'slaves'],\n ['shelf', 'shelves'],\n ['taxi', 'taxis'],\n ['tax', 'taxes'],\n ['Tax', 'Taxes'],\n ['AwesomeTax', 'AwesomeTaxes'],\n ['fax', 'faxes'],\n ['wax', 'waxes'],\n ['niche', 'niches'],\n ['cave', 'caves'],\n ['grave', 'graves'],\n ['wave', 'waves'],\n ['bureau', 'bureaus'],\n ['genetic_analysis', 'genetic_analyses'],\n ['doctor_diagnosis', 'doctor_diagnoses'],\n ['paranthesis', 'parantheses'],\n ['Cause', 'Causes'],\n ['colossus', 'colossuses'],\n ['diagnosis', 'diagnoses'],\n ['basis', 'bases'],\n ['analysis', 'analyses'],\n ['curve', 'curves'],\n ['cafe', 'cafes'],\n ['roof', 'roofs'],\n ['foe', 'foes'],\n ['database', 'databases'],\n ['cookie', 'cookies'],\n ['thief', 'thieves'],\n ['potato', 'potatoes'],\n ['hero', 'heroes'],\n ['buffalo', 'buffaloes'],\n ['baby', 'babies'],\n ['tooth', 'teeth'],\n ['goose', 'geese'],\n ['foot', 'feet'],\n ['objective', 'objectives'],\n ['archive', 'archives'],\n ['brief', 'briefs'],\n ['quota', 'quotas'],\n ['curve', 'curves'],\n ['body_curve', 'body_curves'],\n ['metadata', 'metadata'],\n ['files_metadata', 'files_metadata'],\n ['address', 'addresses'],\n ['sieve', 'sieves'],\n ['blue_octopus', 'blue_octopuses'],\n ['chef', 'chefs'],\n ['', ''],\n ['cache', 'caches'],\n ['lens', 'lenses'],\n ['species', 'species'],\n ['animal_species', 'animal_species'],\n ];\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 set_product_categories( $browseNodes=array() )\n\t {\n\t // The woocommerce product taxonomy\n\t $wooTaxonomy = \"product_cat\";\n \n\t // Categories for the product\n\t $createdCategories = array();\n\t \n\t // Category container\n\t $categories = array();\n\t \n\t // Count the top browsenodes\n\t $topBrowseNodeCounter = 0;\n\t\t\t\n\t\t\tif ( !isset($browseNodes['BrowseNode']) ) {\n\t \t// Delete the product_cat_children\n\t \t// This is to force the creation of a fresh product_cat_children\n\t \t//delete_option( 'product_cat_children' );\n\t\t\t\n\t\t\t\treturn array();\n\t\t\t}\n\n\t // Check if we have multiple top browseNode\n\t if( is_array( $browseNodes['BrowseNode'] ) )\n\t {\n\t \t// check if is has only one key\n\t \tif( isset($browseNodes[\"BrowseNode\"][\"BrowseNodeId\"]) && trim($browseNodes[\"BrowseNode\"][\"BrowseNodeId\"]) != \"\" ){\n\t \t\t$_browseNodes = $browseNodes[\"BrowseNode\"];\n\t \t\t$browseNodes = array();\n\t\t\t\t\t$browseNodes['BrowseNode'][0] = $_browseNodes;\n\t\t\t\t\tunset($_browseNodes);\n\t \t}\n \n\t foreach( $browseNodes['BrowseNode'] as $browseNode )\n\t {\n\t // Create a clone\n\t $currentNode = $browseNode;\n\t\n\t // Track the child layer\n\t $childLayer = 0;\n\t\n\t // Inifinite loop, since we don't know how many ancestral levels\n\t while( true )\n\t {\n\t $validCat = true;\n\t \n\t // Replace html entities\n\t $dmCatName = str_replace( '&', 'and', $currentNode['Name'] );\n\t $dmCatSlug = sanitize_title( str_replace( '&', 'and', $currentNode['Name'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$dmCatSlug_id = '';\n\t\t\t\t\t\tif ( is_object($currentNode) && isset($currentNode->BrowseNodeId) )\n\t \t$dmCatSlug_id = ($currentNode->BrowseNodeId);\n\t\t\t\t\t\telse if ( is_array($currentNode) && isset($currentNode['BrowseNodeId']) )\n\t\t\t\t\t\t\t$dmCatSlug_id = ($currentNode['BrowseNodeId']);\n\n\t\t\t\t\t\t// $dmCatSlug = ( !empty($dmCatSlug_id) ? $dmCatSlug_id . '-' . $dmCatSlug : $dmCatSlug );\n\n\t $dmTempCatSlug = sanitize_title( str_replace( '&', 'and', $currentNode['Name'] ) );\n\t \n\t if( $dmTempCatSlug == 'departments' ) $validCat = false;\n\t if( $dmTempCatSlug == 'featured-categories' ) $validCat = false;\n\t \tif( $dmTempCatSlug == 'categories' ) $validCat = false;\n\t\t\t\t\t\tif( $dmTempCatSlug == 'products' ) $validCat = false;\n\t if( $dmTempCatSlug == 'all-products') $validCat = false;\n\t\n\t // Check if we will make the cat\n\t if( $validCat ) {\n\t $categories[0][] = array(\n\t 'name' => $dmCatName,\n\t 'slug' => $dmCatSlug\n\t );\n\t }\n\t\n\t // Check if the current node has a parent\n\t if( isset($currentNode['Ancestors']['BrowseNode']['Name']) )\n\t {\n\t // Set the next Ancestor as the current node\n\t $currentNode = $currentNode['Ancestors']['BrowseNode'];\n\t $childLayer++;\n\t continue;\n\t }\n\t else\n\t {\n\t // There's no more ancestors beyond this\n\t break;\n\t }\n\t } // end infinite while\n\t \n\t // Increment the tracker\n\t $topBrowseNodeCounter++;\n\t } // end foreach\n\t }\n\t else\n\t {\n\t // Handle single branch browsenode\n\t \n\t // Create a clone\n\t $currentNode = isset($browseNodes['BrowseNode']) ? $browseNodes['BrowseNode'] : array();\n\t \n\t // Inifinite loop, since we don't know how many ancestral levels\n\t while (true) \n\t {\n\t // Always true unless proven\n\t $validCat = true;\n\t \n\t // Replace html entities\n\t $dmCatName = str_replace( '&', 'and', $currentNode['Name'] );\n\t $dmCatSlug = sanitize_title( str_replace( '&', 'and', $currentNode['Name'] ) );\n\t\t\t\t\t$dmCatSlug_id = $currentNode['BrowseNodeId'];\n\t // $dmCatSlug = ( !empty($dmCatSlug_id) ? $dmCatSlug_id . '-' . $dmCatSlug : $dmCatSlug ); \n\t \n\t $dmTempCatSlug = sanitize_title( str_replace( '&', 'and', $currentNode['Name'] ) );\n\t \n\t\t\t\t\tif( $dmTempCatSlug == 'departments' ) $validCat = false;\n if( $dmTempCatSlug == 'featured-categories' ) $validCat = false;\n \tif( $dmTempCatSlug == 'categories' ) $validCat = false;\n\t\t\t\t\tif( $dmTempCatSlug == 'products' ) $validCat = false;\n if( $dmTempCatSlug == 'all-products') $validCat = false;\n\t \n\t // Check if we will make the cat\n\t if( $validCat ) {\n\t $categories[0][] = array(\n\t 'name' => $dmCatName,\n\t 'slug' => $dmCatSlug\n\t );\n\t }\n\t\n\t // Check if the current node has a parent\n\t if (isset($currentNode['Ancestors']['BrowseNode']['Name'])) \n\t {\n\t // Set the next Ancestor as the current node\n\t $currentNode = $currentNode['Ancestors']['BrowseNode'];\n\t continue;\n\t } \n\t else \n\t {\n\t // There's no more ancestors beyond this\n\t break;\n\t }\n\t } // end infinite while\n\t \n\t } // end if browsenode is an array\n\t \n\t // Tracker\n\t $catCounter = 0;\n\t \n\t // Make the parent at the top\n\t foreach( $categories as $category )\n\t {\n\t $categories[$catCounter] = array_reverse( $category );\n\t $catCounter++;\n\t }\n\t \n\t // Current top browsenode\n\t $categoryCounter = 0;\n\t \n\t // Import only parent category from Amazon\n\t\t\tif( isset( $this->amz_settings[\"create_only_parent_category\"] ) && $this->amz_settings[\"create_only_parent_category\"] != '' && $this->amz_settings[\"create_only_parent_category\"] == 'yes') {\n\t\t\t\t$categories = array( array( $categories[0][0] ) );\n\t\t\t}\n\t\t\t\n\t\t\t// Loop through each of the top browsenode\n\t foreach( $categories as $category )\n\t {\n\t // The current node\n\t $nodeCounter = 0;\n\t // Loop through the array of the current browsenode\n\t foreach( $category as $node )\n\t {\n\t // Check if we're at parent\n\t if( $nodeCounter === 0 )\n\t { \n\t // Check if term exists\n\t $checkTerm = term_exists( str_replace( '&', 'and', $node['slug'] ), $wooTaxonomy );\n\t if( empty( $checkTerm ) )\n\t {\n\t // Create the new category\n\t $newCat = wp_insert_term( $node['name'], $wooTaxonomy, array( 'slug' => $node['slug'] ) );\n\t \n\t // Add the created category in the createdCategories\n\t // Only run when the $newCat is an error\n\t if( gettype($newCat) != 'object' ) {\n\t \t\t$createdCategories[] = $newCat['term_id'];\n\t } \n\t }\n\t else\n\t {\n\t // if term already exists add it on the createdCats\n\t $createdCategories[] = $checkTerm['term_id'];\n\t }\n\t }\n\t else\n\t { \n\t // The parent of the current node\n\t $parentNode = $categories[$categoryCounter][$nodeCounter - 1];\n\t // Get the term id of the parent\n\t $parent = term_exists( str_replace( '&', 'and', $parentNode['slug'] ), $wooTaxonomy );\n\t \n\t // Check if the category exists on the parent\n\t $checkTerm = term_exists( str_replace( '&', 'and', $node['slug'] ), $wooTaxonomy );\n\t \n\t if( empty( $checkTerm ) )\n\t {\n\t $newCat = wp_insert_term( $node['name'], $wooTaxonomy, array( 'slug' => $node['slug'], 'parent' => $parent['term_id'] ) );\n\t \n\t // Add the created category in the createdCategories\n\t $createdCategories[] = $newCat['term_id'];\n\t }\n\t else\n\t {\n\t $createdCategories[] = $checkTerm['term_id'];\n\t }\n\t }\n\t \n\t $nodeCounter++;\n\t } \n\t \n\t $categoryCounter++;\n\t } // End top browsenode foreach\n\t \n\t // Delete the product_cat_children\n\t // This is to force the creation of a fresh product_cat_children\n\t delete_option( 'product_cat_children' );\n\t \n\t $returnCat = array_unique($createdCategories);\n\t \n\t // return an array of term id where the post will be assigned to\n\t return $returnCat;\n\t }", "public function get_categories() {\n return [ 'custom-category' ];\n }", "function tpps_details_species(array &$state) {\n $query = db_select('chado.organism', 'o');\n $query->join('chado.pub_organism', 'po', 'o.organism_id = po.organism_id');\n $query->join('chado.project_pub', 'pp', 'pp.pub_id = po.pub_id');\n $query->fields('o', array('organism_id', 'genus', 'species', 'common_name'));\n $query->condition('pp.project_id', $state['ids']['project_id']);\n $query = $query->execute();\n $rows = array();\n\n while (($result = $query->fetchObject())) {\n $id = $result->organism_id;\n $common_name = $result->common_name;\n $family = $order = \"\";\n\n if (tpps_chado_prop_exists('organism', $id, 'family')) {\n $family = db_select('chado.organismprop', 'o')\n ->fields('o', array('value'))\n ->condition('organism_id', $id)\n ->condition('type_id', tpps_load_cvterm('family')->cvterm_id)\n ->execute()->fetchObject()->value;\n }\n\n if (tpps_chado_prop_exists('organism', $id, 'order')) {\n $order = db_select('chado.organismprop', 'o')\n ->fields('o', array('value'))\n ->condition('organism_id', $id)\n ->condition('type_id', tpps_load_cvterm('order')->cvterm_id)\n ->execute()->fetchObject()->value;\n }\n\n if (empty($common_name) and tpps_chado_prop_exists('organism', $id, 'common name')) {\n $common_name = db_select('chado.organismprop', 'o')\n ->fields('o', array('value'))\n ->condition('organism_id', $id)\n ->condition('type_id', tpps_load_cvterm('common name')->cvterm_id)\n ->execute()->fetchObject()->value;\n }\n\n $name = \"{$result->genus} {$result->species}\";\n $link = tpps_entity_link($id, $name, 'Organism');\n $rows[$name] = array(\n $order,\n $family,\n $link,\n $common_name,\n );\n }\n \n $vars = array(\n 'header' => array(\n 'Order',\n 'Family',\n 'Species',\n 'Common Name',\n ),\n 'rows' => $rows,\n 'attributes' => array(\n 'class' => array('view'),\n 'id' => 'tpps_table_display',\n ),\n 'caption' => '',\n 'colgroups' => NULL,\n 'sticky' => FALSE,\n 'empty' => '',\n );\n return theme('table', $vars);\n}", "function cpt_combos() {\n\n\t$labels = array(\n\t\t'name' => _x( 'combos', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'combo', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Combos', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Combos', 'text_domain' ),\n\t\t'archives' => __( 'Archivo de Combos', 'text_domain' ),\n\t\t'attributes' => __( 'Atributos de Combo', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Combo Padre', 'text_domain' ),\n\t\t'all_items' => __( 'Todos los Combos', 'text_domain' ),\n\t\t'add_new_item' => __( 'Añadir Nuevo Combo', 'text_domain' ),\n\t\t'add_new' => __( 'Añadir Combo', 'text_domain' ),\n\t\t'new_item' => __( 'Nuevo Combo', 'text_domain' ),\n\t\t'edit_item' => __( 'Editar Combo', 'text_domain' ),\n\t\t'update_item' => __( 'Actualizar Combo', 'text_domain' ),\n\t\t'view_item' => __( 'Ver Combos', 'text_domain' ),\n\t\t'view_items' => __( 'Ver Combos', 'text_domain' ),\n\t\t'search_items' => __( 'Buscar Combos', 'text_domain' ),\n\t\t'not_found' => __( 'No Encontrado', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'No encontrado en la Papelera', 'text_domain' ),\n\t\t'featured_image' => __( 'Imagen Destacada', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Configurar Imagen Destacada', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remover Imagen Destacada', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Usar como imagen destacada', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insertar en el Combo', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Actualizar en este Combo', 'text_domain' ),\n\t\t'items_list' => __( 'Listado de Combos', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Lista Navegable de combos', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filtro de listas de Combos', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'combo', 'text_domain' ),\n\t\t'description' => __( 'Tenemos los mejores combos únicos para ti.', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'page-attributes' ),\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 'menu_icon' => 'dashicons-food',\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'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'combos', $args );\n\n}", "public function newGrid()\n {\n\tforeach($this->cases as $case) {\n $case->figures->unsetAll() ;\n }\n return $this->cases ;\n }", "public function run()\n {\n $categories = [\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Gear', 'slug' => 'gear', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Parts', 'slug' => 'parts', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Casual', 'slug' => 'casual', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'News', 'slug' => 'news', 'sortorder' => 4, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Clothes', 'slug' => 'clothes', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Helmets', 'slug' => 'helmets', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Boots', 'slug' => 'boots', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Suspension', 'slug' => 'suspension', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Maintenance', 'slug' => 'maintenance', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Oils', 'slug' => 'oils', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 3, 'name' => 'T-Sirts', 'slug' => 'tshirts', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 3, 'name' => 'Caps', 'slug' => 'caps', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 5, 'c_group' => 1, 'name' => 'Jerseys', 'slug' => 'jerseys', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 5, 'c_group' => 1, 'name' => 'Pants', 'slug' => 'pants', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 6, 'c_group' => 1, 'name' => 'Adults', 'slug' => 'adults-helmets', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 6, 'c_group' => 1, 'name' => 'Kids', 'slug' => 'kids-helmets', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 7, 'c_group' => 1, 'name' => 'Adults', 'slug' => 'adults-boots', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 7, 'c_group' => 1, 'name' => 'Kids', 'slug' => 'kids-boots', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 8, 'c_group' => 2, 'name' => 'Fork', 'slug' => 'fork-parts', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 8, 'c_group' => 2, 'name' => 'Shock', 'slug' => 'shock-parts', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Airfilter', 'slug' => 'airfilter', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Oilfilter', 'slug' => 'oilfilter', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Brakepads', 'slug' => 'brakepads', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Engine Oils', 'slug' => 'engine-oils', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Suspension Oils', 'slug' => 'suspension-oils', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Maintenance', 'slug' => 'bike-maintenance', 'sortorder' => 3, 'active' => 1],\n ];\n\n DB::table('categories')->insert($categories);\n }", "protected function grid()\n {\n $grid = new Grid(new Cases);\n $grid->model()->orderBy('created_at','desc');\n $grid->id('Id');\n $grid->cate_id('分类')->display(function ($v){\n return CaseCate::find($v)['name'];\n });\n $grid->algw_id('顾问')->display(function ($v){\n return Algw::find($v)['name'];\n });\n $grid->is_tj('是否推荐')->display(function ($v){\n return $v==0?'否':'是';\n });\n $grid->title('标题');\n $grid->thumb('缩略图')->image();\n $grid->author('作者');\n $grid->disableExport();\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n // 在这里添加字段过滤器\n $filter->like('title', '标题');\n\n $filter->equal('cate_id','分类')->select('/admin/api/getcasecate');\n });\n return $grid;\n }", "public function county_sidebar()\n\t{\n\t\t$box = View::factory('iebc/sidebar');\n\t\t$box->counties = self::_counties();\n\t\t$box->render(TRUE);\n\t}", "public function get_categories()\n {\n return ['hsblog'];\n }", "public function getStrategys()\n {\n return [\n\n ];\n }", "protected function grid()\n\t{\n\t\t$grid = new Grid(new NativePlaceRegion);\n\t $grid->model()->where('parentid', '=', 0);\n\t\t$grid->paginate(40);\n\t\t\n\t\t$grid->region_id('地区id')->sortable();\n\t\t$grid->parentid('上级地区id')->sortable();\n\t\t$grid->region_name('地区名称');\n\t\t$grid->have_children('是否有更下级地区');\n\t\t\n\t\t// filter($callback)方法用来设置表格的简单搜索框\n\t\t$grid->filter(function ($filter) {\n\t\t\t$filter->disableIdFilter();\n\t\t\t$filter->like('region_name', '地区名称');\n\t\t});\n\t\t\n\t\treturn $grid;\n\t}", "protected function grid()\n {\n return Admin::grid(Country::class, function (Grid $grid) {\n $grid->id('ID')->sortable();\n $grid->name('城市名称');\n $grid->letter('城市代码');\n $grid->continent('所属大洲')->display(function ($continent) {\n $api = new ApiController;\n $country = $api->continent;\n if ($continent) {\n return $country[$continent];\n }\n return '';\n });\n });\n }", "function property_features_taxonomy() {\n\n\t\t$name = __( 'Features', 'wp_listings' );\n\t\t$singular_name = __( 'Feature', 'wp_listings' );\n\n\t\treturn array(\n\t\t\t'features' => array(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name'\t\t\t\t\t=> strip_tags( $name ),\n\t\t\t\t\t'singular_name' \t\t=> strip_tags( $singular_name ),\n\t\t\t\t\t'menu_name'\t\t\t\t=> strip_tags( $name ),\n\n\t\t\t\t\t'search_items'\t\t\t=> sprintf( __( 'Search %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'popular_items'\t\t\t=> sprintf( __( 'Popular %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'all_items'\t\t\t\t=> sprintf( __( 'All %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'edit_item'\t\t\t\t=> sprintf( __( 'Edit %s', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'update_item'\t\t\t=> sprintf( __( 'Update %s', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'add_new_item'\t\t\t=> sprintf( __( 'Add New %s', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'new_item_name'\t\t\t=> sprintf( __( 'New %s Name', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'add_or_remove_items'\t=> sprintf( __( 'Add or Remove %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'choose_from_most_used'\t=> sprintf( __( 'Choose from the most used %s', 'wp_listings' ), strip_tags( $name ) )\n\t\t\t\t),\n\t\t\t\t'hierarchical' => 0,\n\t\t\t\t'rewrite' => array( __( 'features', 'wp_listings' ), 'with_front' => false ),\n\t\t\t\t'editable' => 0\n\t\t\t)\n\t\t);\n\n\t}", "function taxonomy_fix()\n{\n $query = db_select('field_data_field_category', 'gd')\n ->fields('gd', array('entity_id','field_category_tid'))\n ->condition('bundle', 'blog');\n $results = $query->execute()->fetchAll();\n \n foreach ($results as $values)\n {\n \n $nnid=$values->entity_id;\n $node1=node_load($nnid);\n taxonomy_build_node_index($node1);\ndrupal_set_message($nnid);\n\n }\n return(\"Blog category are fixed Just create a test Blog and assign to each category to rebuild Menu Block\");\n}", "public function get_categories()\r\n {\r\n return ['appside_widgets'];\r\n }", "function _wb_universe_cards_displays(&$form, FormStateInterface $form_state)\n{\n $group = 'cards';\n $sous_group = 'displays';\n // debugLog::logs([], '_wb_universe__' . $group, 'dump', true);\n return $form['wb_universe_' . $group][$sous_group];\n}", "public function cat(){\n $cat_id = intval(I('get.cat_id'));\n if(!$cat_id){\n http_response_code(404);\n }\n\n $display = cookie('display');\n if($display) {\n if (!preg_match(\"/^list|grid$/\", $display)) {\n die('hack out');\n }else{\n if($display == 'list') {\n $this->assign('display', 1);\n }else{\n $this->assign('display', 0);\n }\n }\n }\n $this->assign('cat_id', $cat_id);\n $mbx = D('Admin/cat')->parentList($cat_id);\n if($mbx){\n $this->assign('mbx',$mbx);\n }\n\n $cat_in_nav = M('cat')->field('cat_id,cat_name')->where('show_in_nav=1')->select();\n $this->assign('cat_in_nav',$cat_in_nav);\n $his = array_reverse(session('history'),true);\n $this->assign('history',$his);\n $sale = M('goods')->field('goods_id,goods_name,thumb_img,shop_price,goods_number')->order('goods_number desc')->limit(10)->select();\n $this->assign('sale',$sale);\n $this->assign('cattree',D('Admin/Cat')->gettree());\n\n $this->assign('cat_name', M('cat')->field('cat_name')->find($cat_id)['cat_name']);\n\n $this->display();\n }", "public function content_by_category()\n {\n if(isset($this->content_by_category)) return $this->content_by_category;\n $this->content_by_category = array(\n 'total_with_objects' => 0,\n 'one_type_in_col' => 0,\n 'one_type_not_in_col' => 0,\n 'more_types_in_col' => 0,\n 'more_types_not_in_col' => 0);\n \n $this->mysqli->query(\"DROP TABLE IF EXISTS `taxon_concepts_data_types`\");\n $this->mysqli->query(\"CREATE TABLE `taxon_concepts_data_types` (\n `taxon_concept_id` int unsigned NOT NULL,\n `count_data_types` smallint unsigned NOT NULL,\n `count_toc` smallint unsigned NOT NULL,\n `in_col` tinyint unsigned NOT NULL,\n PRIMARY KEY (`taxon_concept_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8\");\n \n $outfile = $GLOBALS['db_connection']->select_into_outfile(\"SELECT tc.id, count(distinct do.data_type_id), count(distinct dotoc.toc_id), he_col.id IS NOT NULL FROM taxon_concepts tc JOIN data_objects_taxon_concepts dotc ON (tc.id=dotc.taxon_concept_id) JOIN data_objects do ON (dotc.data_object_id=do.id) LEFT JOIN data_objects_table_of_contents dotoc ON (do.id=dotoc.data_object_id) LEFT JOIN hierarchy_entries he_col ON (tc.id=he_col.taxon_concept_id AND he_col.hierarchy_id=\".Hierarchy::default_id().\") WHERE tc.published=1 AND tc.supercedure_id=0 AND do.published=1 AND do.visibility_id=\".Visibility::find(\"visible\").\" AND do.vetted_id=\".Vetted::find(\"trusted\").\" GROUP BY tc.id\");\n $GLOBALS['db_connection']->load_data_infile($outfile, 'taxon_concepts_data_types');\n unlink($outfile);\n \n $result = $this->mysqli->query(\"SELECT COUNT(*) count FROM taxon_concepts_data_types\");\n if($result && $row=$result->fetch_assoc()) $this->content_by_category['total_with_objects'] = $row['count'];\n \n $result = $this->mysqli->query(\"SELECT COUNT(*) count FROM taxon_concepts_data_types WHERE count_data_types=1 AND count_toc<2 AND in_col=1\");\n if($result && $row=$result->fetch_assoc()) $this->content_by_category['one_type_in_col'] = $row['count'];\n \n $result = $this->mysqli->query(\"SELECT COUNT(*) count FROM taxon_concepts_data_types WHERE count_data_types=1 AND count_toc<2 AND in_col=0\");\n if($result && $row=$result->fetch_assoc()) $this->content_by_category['one_type_not_in_col'] = $row['count'];\n \n $result = $this->mysqli->query(\"SELECT COUNT(*) count FROM taxon_concepts_data_types WHERE count_data_types>1 OR count_toc>1 AND in_col=1\");\n if($result && $row=$result->fetch_assoc()) $this->content_by_category['more_types_in_col'] = $row['count'];\n \n $result = $this->mysqli->query(\"SELECT COUNT(*) count FROM taxon_concepts_data_types WHERE count_data_types>1 OR count_toc>1 AND in_col=0\");\n if($result && $row=$result->fetch_assoc()) $this->content_by_category['more_types_not_in_col'] = $row['count'];\n \n $this->mysqli->query(\"DROP TABLE IF EXISTS `taxon_concepts_data_types`\");\n \n return $this->content_by_category;\n }", "protected function grid()\n {\n $grid = new Grid(new TopicCategory);\n $grid->model()->orderBy('sort', 'desc'); // 设置初始排序条件\n $grid->disableExport();\n\n /*自定义筛选框*/\n $grid->filter(function ($filter) {\n $filter->disableIdFilter(); // 去掉默认的id过滤器\n $filter->like('name', '话题分类名称');\n });\n\n $grid->column('id', 'Id')->sortable();\n $grid->column('name', '话题分类名称')->sortable();\n $grid->column('sort', '排序值')->sortable();\n $grid->column('topics', '话题数目')->display(function ($topics) {\n return count($topics);\n });\n // $grid->column('created_at', '创建时间');\n // $grid->column('updated_at', '更新时间');\n\n return $grid;\n }", "function getNumberOfSpecies();", "protected function grid()\n {\n $grid = new Grid(new SiteModel);\n\n $grid->id('ID')->sortable();\n $grid->name('Site name')->sortable();\n $grid->url('Site URL')->link()->sortable();\n $grid->enable('Disabled')->sortable()->using(['1' => '', '0' => 'Disabled'])->badge('red');\n $grid->official('Official')->sortable()->using(['1' => 'Official', '0' => ''])->badge('blue');\n $grid->searcheable('Searcheable')->sortable()->using(['1' => 'Search OK', '0' => ''])->display(function($v1, \\Encore\\Admin\\Grid\\Column $column, $v3=1){\n if ($v1 != '') {\n return \"<span class='badge bg-green' title='aa'>$v1</span>\";\n }\n return '';\n });\n \n $grid->updated_at('Updated at')->sortable();\n \n $grid->filter(function ($filter) {\n $filter->like('name', 'Site name');\n $filter->like('url', 'URL');\n });\n \n return $grid;\n }", "public function species()\n {\n return $this->allTaxa()->species();\n }", "function ss_variations(){\n\t\t\tthe_widget ( 'WC_Widget_Layered_Nav' );\n\t\t}", "public function get_sidebar_categories(){\n\n $html = '<tr class=\"wm-widget-sub-title\"><td>{{categories-title}}:</td></tr><tr class=\"wm-widget-info\"><td>';\n\n $categories = get_the_category();\n $output = '';\n foreach( $categories as $category ){\n $id = get_cat_ID( $category->name );\n $url = get_category_link( $id );\n $output .= '<span class=\"wm-tags\"><a href=\"' . $url . '\">' . $category->name . '</a></span>, ';\n }\n\n if( count( $categories ) > 1 ){\n /** Replace the categories title to be plural. */\n $html = str_replace( '{{categories-title}}', 'Categories', $html );\n } else {\n /** Replace the categories title to be singular. */\n $html = str_replace( '{{categories-title}}', 'Category', $html );\n }\n\n /** Remove the extra comma and space from the loop and close the HTML. */\n $html .= substr( $output, 0, strlen( $output ) - 2 ) . '</td></tr>';\n return $html;\n }", "public function get_categories($category = '')\n {\n /** @var \\tacitus89\\homepage\\entity\\category[] $entities */\n $entities = array();\n\n\t\t//it show all categories\n if($category == ''){\n $sql = 'SELECT f1.forum_id, f1.parent_id, f1.forum_name, f1.forum_desc, f1.forum_image, f1.hp_url, f1.hp_desc, f1.hp_special\n\t\t\tFROM ' . FORUMS_TABLE . ' f1, '. FORUMS_TABLE .' f2\n\t\t\tWHERE (f2.hp_show = 1 AND f2.parent_id = 0\n\t\t\t AND (f1.hp_special = 0 AND f1.hp_show = 1 AND (f1.parent_id = 0 OR f1.parent_id = f2.forum_id)) )\n\t\t\t\tOR (f1.forum_id = 543 AND f2.forum_id = 543)\n\t\t\t\tOR (f2.hp_show = 1 AND f1.hp_special = 1 AND (f1.parent_id = 0 OR f1.parent_id = f2.forum_id))\n\t\t\tORDER BY f1.hp_special, f1.left_id ASC';\n }\n\t\t//Special url\n\t\t//display all modding forums\n elseif ($category == 'modding') {\n $sql = 'SELECT f1.forum_id, f1.parent_id, f1.forum_name, f1.forum_desc, f1.forum_image, f1.hp_url, f1.hp_desc, f1.hp_special\n\t\t\tFROM ' . FORUMS_TABLE . ' f1\n\t\t\tWHERE f1.hp_show = 1 AND f1.hp_special = 1\n\t\t\tORDER BY f1.left_id ASC';\n }\n\t\t//display all forums of category\n\t\telse {\n\t\t\t$sql = 'SELECT f1.forum_id, f1.parent_id, f1.forum_name, f1.forum_desc, f1.forum_image, f1.hp_url, f1.hp_desc, f1.hp_special\n\t\t\tFROM ' . FORUMS_TABLE . ' f1\n\t\t\tRIGHT JOIN '. FORUMS_TABLE .' f2 ON (f2.left_id < f1.left_id AND f2.right_id > f1.right_id)\n\t\t\tWHERE f1.hp_show = 1 AND f2.hp_show = 1 \n\t\t\t\tAND f1.hp_special = 0 AND f2.hp_special = 0\n\t\t\t AND f2.hp_url = \"'. $category .'\"\n\t\t\tORDER BY f1.left_id ASC';\n\t\t}\n // Load all page data from the database\n $result = $this->db->sql_query($sql);\n\n while ($row = $this->db->sql_fetchrow($result))\n {\n\t\t\t//adding to pseudo-Category\n\t\t\tif($row['hp_special'] == 1)\n\t\t\t{\n\t\t\t\t$row['parent_id'] = 543;\n\t\t\t}\n\t\t\t//pseudo-Category\n\t\t\tif($row['forum_id'] == 543)\n\t\t\t{\n\t\t\t\t$row['forum_name'] = 'Modding';\n\t\t\t\t$row['hp_url'] = 'modding';\n\t\t\t}\n\t\t\t\n $category = $this->container->get('tacitus89.homepage.category')->import($row);\n if(isset($entities[$row['parent_id']]) && $row['parent_id'] > 0)\n {\n\t\t\t\t$entities[$row['parent_id']]->add_forum($category);\n }\n else\n {\n // Import each page row into an entity\n $entities[$row['forum_id']] = $category;\n }\n }\n $this->db->sql_freeresult($result);\n\n // Return all page entities\n return $entities;\n }" ]
[ "0.5809869", "0.5502675", "0.54181916", "0.54147524", "0.5324543", "0.5317915", "0.5244584", "0.52160305", "0.52015203", "0.51937073", "0.5155164", "0.50947785", "0.5060177", "0.50577253", "0.5049416", "0.5045114", "0.50351954", "0.5016639", "0.5014751", "0.5012064", "0.50074065", "0.49992085", "0.4975992", "0.4951923", "0.49451917", "0.494353", "0.49367929", "0.4935057", "0.49306068", "0.49246913", "0.4906075", "0.48837155", "0.48807818", "0.4874148", "0.4874148", "0.48549843", "0.48495817", "0.4839604", "0.48376617", "0.48376617", "0.48320806", "0.48205", "0.48203775", "0.48168066", "0.48168066", "0.48168066", "0.48151866", "0.48151538", "0.48151538", "0.48040673", "0.4792151", "0.4789182", "0.47816697", "0.47814238", "0.47786635", "0.47756654", "0.47744077", "0.47694904", "0.47664285", "0.47585213", "0.47491252", "0.47479936", "0.4746829", "0.4746829", "0.4739441", "0.47391602", "0.4738141", "0.47324264", "0.47286636", "0.47269067", "0.47253886", "0.47252634", "0.4724148", "0.4719734", "0.47131628", "0.4710174", "0.4690952", "0.46894073", "0.46863097", "0.4686274", "0.46833375", "0.46789578", "0.46766287", "0.46765387", "0.46756187", "0.46704185", "0.46700406", "0.46651283", "0.46571952", "0.46562457", "0.4651848", "0.46487486", "0.46438915", "0.46429047", "0.46366513", "0.4630262", "0.46301368", "0.46231893", "0.46229428", "0.46190056" ]
0.4935994
27
A variant of the species grid control with just the flexible search species available.
protected static function get_control_searchspecies($auth, $args, $tabAlias, $options) { // build a list of the search species IDs $ttlIds=[]; foreach (self::$parentSampleAttrs['smpAttr:'.$args['search_species_transect_attr_id']]['default'] as $value) { $ttlIds[] = $value['default']; } if (empty($ttlIds)) return '<p>'.lang::get('Please fill in the search species on the front page.').'</p>'; // safety $args['list_id']=$args['extra_list_id']; $args['taxon_filter_field']='taxa_taxon_list_id'; $args['taxon_filter']=implode("\n", $ttlIds); $options['rowInclusionCheck']='alwaysFixed'; $options['id']='search-list'; unset($args['extra_list_id']); return parent::get_control_species($auth, $args, $tabAlias, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSearch () {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_SEARCH###');\n\t\t$subpartArray = array();\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['search.']['LL'], 'search');\n\n\t\t// hide the radisus search by using a subpart\n\t\tif ($this->config['search']['radiusSearch'] != 1) {\n\t\t\t$subpartArray['###HIDE_RADIUSSEARCH###'] = '';\n\t\t}\n\n\t\t$markerArray['###DEFAULT_COUNTRY###'] = $this->config['defaultCountry']; // set the default country\n\t\t$markerArray['###DEFAULT_ZIP###'] = htmlspecialchars($this->piVars['zip']);\n\t\t$markerArray['###AUTOSUBMIT###'] = ($this->piVars['zip'] == '') ? '//' : '';\n\n\t\t// fetch the allowed categories as option list\n\t\t$markerArray['###CATEGORY###'] = $this->helperGetRecursiveCat($this->config['categories']);\n\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\treturn $content;\n\t}", "public function getSpecies();", "function tpps_details_search(array $form, array $form_state) {\n $params = drupal_get_query_parameters();\n $form['details_type'] = array(\n '#type' => 'select',\n '#options' => array(\n 'title' => t('Title'),\n 'species' => t('Species'),\n 'accession' => t('Accession'),\n 'author' => t('Primary Author'),\n 'year' => t('Publication Year'),\n 'phenotype_name' => t('Phenotype Name'),\n 'phenotype_ontology' => t('Phenotype Ontology Name'),\n 'genotype_name' => t('Genotype Name'),\n 'genotype_marker' => t('Genotype Marker Type'),\n 'tags' => t('Tags'),\n ),\n '#ajax' => array(\n 'wrapper' => 'tpps-details-form',\n 'callback' => 'tpps_details_form_callback',\n ),\n '#prefix' => '<div id=\"tpps-details-form\">',\n '#default_value' => $params['type'] ?? NULL,\n );\n\n $ops = array(\n '~*' => '~*',\n 'LIKE' => 'LIKE',\n '=' => '=',\n );\n\n $form['details_op'] = array(\n '#type' => 'select',\n '#options' => $ops,\n '#default_value' => $params['op'] ?? NULL,\n );\n\n $form['details_value'] = array(\n '#type' => 'textfield',\n '#suffix' => '</div>',\n '#autocomplete_path' => 'tpps/autocomplete/project_title',\n '#default_value' => $params['value'] ?? NULL,\n );\n\n if (empty($form_state['values']['details_type'])) {\n $form_state['values']['details_type'] = $params['type'] ?? NULL;\n }\n\n if (!empty($form_state['values']['details_type'])) {\n switch ($form_state['values']['details_type']) {\n case 'title':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/project_title';\n break;\n\n case 'species':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/species';\n break;\n\n case 'accession':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/project_accession';\n break;\n\n case 'author':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/author';\n break;\n\n case 'phenotype_name':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/phenotype';\n break;\n\n case 'phenotype_ontology':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/phenotype_ontology';\n break;\n\n case 'genotype_name':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/genotype';\n break;\n\n case 'genotype_marker':\n $form['details_value']['#autocomplete_path'] = 'tpps/autocomplete/genotype_marker';\n break;\n\n default:\n $form['details_value']['#autocomplete_path'] = NULL;\n break;\n }\n }\n\n $form['details_search'] = array(\n '#type' => 'button',\n '#button_type' => 'button',\n '#value' => t('Search'),\n );\n\n $form['reset_button'] = array(\n '#markup' => '<button class=\"btn btn-primary form-button\" type=\"reset\"/>Reset</button>',\n ); \n\n $form['#attributes'] = array(\n 'style' => 'text-align:center',\n );\n\n return $form;\n}", "public function action_search()\n\t{\n\t\t$price_min = array();\n\t\tfor ($i=100000; $i<=10000000; $i += 100000) {\n\t\t\t$price_min[$i] = '$ '.number::humanReadable($i);\n\t\t\tif ($i >= 1000000) $i += 400000;\n\t\t}\n\t\t$price_max = $price_min;\n\t\tarr::unshift($price_min, '', 'Minimum');\n\t\tarr::unshift($price_max, '', 'Maximum');\n\n\t\t// Setting types\n\t\t$types = ORM::factory('type')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($types, '', '-- Select --');\n\t\t\n\t\t// Setting cities\n\t\t$cities = ORM::factory('city')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($cities, '', '-- Select --');\n\t\t\n\t\t$this->template->content = new View('admin/property/search');\n\t\t$this->template->content->title = ucwords($this->_type).' Search';\n\t\t$this->template->content->types = $types;\n\t\t$this->template->content->cities = $cities;\n\t\t$this->template->content->price_min = $price_min;\n\t\t$this->template->content->price_max = $price_max;\n\t\t$this->template->content->post = array('type_id' => '', 'city_id' => '', 'pmin' => '', 'pmax' => '');\n\n\t\tif ( ! empty($_GET))\n\t\t{\n\t\t\t$this->template->content->results = new View('admin/property/read');\n\t\t\t$this->template->content->results->title = 'Search Results';\n\t\t\t$this->action_index(TRUE);\n/*\t\t\t$this->template->content->results->data = Model_Property::get_list(0, 1, false, 'desc');*/\n\t\t}\n\t}", "public function action_search()\n\t{\n\t\t$price_min = array();\n\t\tfor ($i=100000; $i<=10000000; $i += 100000) {\n\t\t\t$price_min[$i] = '$ '.number::humanReadable($i);\n\t\t\tif ($i >= 1000000) $i += 400000;\n\t\t}\n\t\t$price_max = $price_min;\n\t\tarr::unshift($price_min, '', 'Minimum');\n\t\tarr::unshift($price_max, '', 'Maximum');\n\n\t\t// Setting types\n\t\t$types = ORM::factory('type')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($types, '', '-- Select --');\n\t\t\n\t\t// Setting cities\n\t\t$cities = ORM::factory('city')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($cities, '', '-- Select --');\n\t\t\n\t\t$this->template->content = new View('admin/property/search');\n\t\t$this->template->content->title = 'Property Search';\n\t\t$this->template->content->types = $types;\n\t\t$this->template->content->cities = $cities;\n\t\t$this->template->content->price_min = $price_min;\n\t\t$this->template->content->price_max = $price_max;\n\t\t$this->template->content->post = array('type_id' => '', 'city_id' => '', 'pmin' => '', 'pmax' => '');\n\n\t\tif ( ! empty($_GET))\n\t\t{\n\t\t\t$this->template->content->results = new View('admin/property/read');\n\t\t\t$this->template->content->results->title = 'Search Results';\n\t\t\t$this->action_index(TRUE);\n\t\t}\n\t}", "public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( ProductsAttributes::grid() )->search ();\n\t}", "public function specsearch()\n\t{\n\t\t//\n\t\t//\n\t\t$inputData = Input::All(); \n\t\tvar_dump($inputData);\n\t\t$specialty = $inputData['title'];\n\t\t$zy=Flzhuanye::where('zymc','=',$specialty)->first();\n\t\t $schools = Zylb::search($specialty)->paginate(20);\n\t\t $ptzys= Tzy::distinct()->select('mkml','id')->where('tszy', '=', 0)->groupBy('mkml')->get();\n\t\t $tszys= Tzy::distinct()->select('mkml','id')->where('tszy', '=', 1)->groupBy('mkml')->get();\n\t\n\t\t//return \\View::make('colleges.search.index')->with('colleges',$colleges)\n // ->with('provinces',$provinces);\n $provinces= Province::All();\n return \\View::make('specialties.search.show')->with('schools',$schools)\n ->with('provinces',$provinces)\n\t\t\t\t\t\t\t\t\t\t\t\t ->with('zy',$specialty)\n\t\t\t\t\t\t\t\t\t\t\t\t ->with('tszys',$tszys);\n\t}", "public function setSpecies($species);", "function sopac_search_form_adv() {\n $locum = sopac_get_locum();\n $locum_cfg = $locum->locum_config;\n $getvars = sopac_parse_get_vars();\n\n $actions = sopac_parse_uri();\n if ($actions[0] == \"search\") {\n if($actions[3]) { $actions[2] = $actions[2] . \"/\" . $actions[3]; urlencode($actions[2]); }\n $search_query = $actions[2];\n $stype_selected = $actions[1] ? 'cat_' . $actions[1] : 'cat_keyword';\n }\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg[format_groups] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n\n $stypes = array(\n 'cat_keyword' => 'Keyword',\n 'cat_title' => 'Title',\n 'cat_author' => 'Author',\n 'cat_series' => 'Series',\n 'cat_tags' => 'Tags',\n 'cat_reviews' => 'Reviews',\n 'cat_subject' => 'Subject',\n 'cat_callnum' => 'Call Number',\n 'cat_isn' => 'ISBN or ISSN',\n );\n\n $sortopts = array(\n '' => 'Relevance',\n 'atoz' => 'Alphabetical A to Z',\n 'ztoa' => 'Alphabetical Z to A',\n 'catalog_newest' => 'Just Added',\n 'newest' => 'Pub date: Newest',\n 'oldest' => 'Pub date: Oldest',\n 'author' => 'Alphabetically by Author',\n 'top_rated' => 'Top Rated Items',\n 'popular_week' => 'Most Popular this Week',\n 'popular_month' => 'Most Popular this Month',\n 'popular_year' => 'Most Popular this Year',\n 'popular_total' => 'All Time Most Popular',\n );\n\n // Initialize the form\n $form = array(\n '#attributes' => array('class' => 'search-form'),\n '#validate' => array('sopac_search_catalog_validate'),\n '#submit' => array('sopac_search_catalog_submit'),\n );\n\n $form['search_query'] = array(\n '#type' => 'textfield',\n '#title' => t('Search term or phrase'),\n '#default_value' => $search_query,\n '#size' => 50,\n '#maxlength' => 255,\n );\n\n $form['search_type'] = array(\n '#type' => 'select',\n '#title' => t('Search by'),\n '#default_value' => $stype_selected,\n '#options' => $stypes,\n );\n $form['sort'] = array(\n '#type' => 'select',\n '#title' => t('Sorted by'),\n '#default_value' => '',\n '#options' => $sortopts,\n );\n $form['age_group'] = array(\n '#type' => 'select',\n '#title' => 'in age group',\n '#options' => array('' => \"Any Age Group\", 'adult' => \"Adult\", 'teen' => \"Teen\", 'youth' => \"Youth\"),\n );\n $form['limit_avail'] = array(\n '#type' => 'select',\n '#title' => 'limit to items on shelf at',\n '#options' => array_merge(array('' => '--', 'any' => \"Any Location\"), $locum_cfg['branches']),\n '#default_value' => $getvars['limit_avail'],\n '#suffix' => \"</div>\",\n );\n if (count($locum_cfg[collections])) {\n foreach ($locum_cfg[collections] as $loc_collect_key => $loc_collect_var) {\n $loc_collect[$loc_collect_key] = $loc_collect_key;\n }\n\n $form['collection'] = array(\n '#type' => 'select',\n '#title' => t('In these collections'),\n '#size' => 5,\n '#default_value' => $getvars[collection],\n '#options' => $loc_collect,\n '#multiple' => TRUE,\n );\n }\n\n asort($locum_cfg[formats]);\n $form['search_format'] = array(\n '#type' => 'select',\n '#title' => t('In these formats'),\n '#size' => 5,\n '#default_value' => $getvars[search_format],\n '#options' => $locum_cfg[formats],\n '#multiple' => TRUE,\n );\n $form['publisher'] = array(\n '#type' => 'textfield',\n '#title' => t('Publisher'),\n '#size' => 20,\n '#maxlength' => 255,\n );\n $form['pub_year_start'] = array(\n '#type' => 'textfield',\n '#title' => t('Published year between'),\n '#size' => 20,\n '#maxlength' => 255,\n );\n $form['pub_year_end'] = array(\n '#type' => 'textfield',\n '#title' => t('and'),\n '#size' => 20,\n '#maxlength' => 255,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search'),\n );\n $form['clear'] = array(\n '#name' => 'clear',\n '#type' => 'button',\n '#value' => t('Reset'),\n '#attributes' => array('onclick' => 'this.form.reset(); return false;'),\n );\n return $form;\n}", "function voyage_mikado_load_search_template() {\n\t\tglobal $voyage_mikado_IconCollections;\n\n\t\t$search_type = voyage_mikado_options()->getOptionValue('search_type');\n\n\t\t$search_icon = '';\n\t\tif(voyage_mikado_options()->getOptionValue('search_icon_pack') !== '') {\n\t\t\t$search_icon = $voyage_mikado_IconCollections->getSearchIcon(voyage_mikado_options()->getOptionValue('search_icon_pack'), true);\n\t\t}\n\n\t\t$parameters = array(\n\t\t\t'search_in_grid' => voyage_mikado_options()->getOptionValue('search_in_grid') == 'yes' ? true : false,\n\t\t\t'search_icon' => $search_icon,\n\t\t);\n\n\t\tvoyage_mikado_get_module_template_part('templates/types/'.$search_type, 'search', '', $parameters);\n\n\t}", "protected function grid()\n\t{\n\t\t$grid = new Grid(new NativePlaceRegion);\n\t $grid->model()->where('parentid', '=', 0);\n\t\t$grid->paginate(40);\n\t\t\n\t\t$grid->region_id('地区id')->sortable();\n\t\t$grid->parentid('上级地区id')->sortable();\n\t\t$grid->region_name('地区名称');\n\t\t$grid->have_children('是否有更下级地区');\n\t\t\n\t\t// filter($callback)方法用来设置表格的简单搜索框\n\t\t$grid->filter(function ($filter) {\n\t\t\t$filter->disableIdFilter();\n\t\t\t$filter->like('region_name', '地区名称');\n\t\t});\n\t\t\n\t\treturn $grid;\n\t}", "function display_search_field() {\n return $this->display_field(0, 'asearchtemplate');\n }", "protected function grid() {\n\t\t$grid = new Grid(new Country);\n\n\t\t$grid->filter(function ($filter) {\n\t\t\t$filter->disableIdFilter();\n\n\t\t\t$filter->column(3 / 4, function ($filter) {\n\t\t\t\t$continents = Continent::where('parent_id', '0')->pluck('cn_name', 'id');\n\t\t\t\t$filter->expand()->equal('continent_id', '大洲')->select($continents);\n\t\t\t\t$filter->expand()->where(function ($query) {\n\t\t\t\t\t$query->where('cname', 'like', \"%{$this->input}%\")\n\t\t\t\t\t\t->orWhere('full_cname', 'like', \"%{$this->input}%\")\n\t\t\t\t\t\t->orWhere('name', 'like', \"%{$this->input}%\")\n\t\t\t\t\t\t->orWhere('country_code', 'like', \"%{$this->input}%\");\n\t\t\t\t\t// $query->whereHas('country', function ($query){\n\t\t\t\t\t// $query->where('cname', 'like', \"%{$this->input}%\");\n\t\t\t\t\t// });\n\t\t\t\t}, '关键字');\n\t\t\t});\n\t\t});\n\n\t\t$grid->selector(function (Grid\\Tools\\Selector $selector) {\n\t\t\t$selector->select('continent_id', '洲名', [\n\t\t\t\t1 => '亚洲',\n\t\t\t\t2 => '美洲',\n\t\t\t\t3 => '非洲',\n\t\t\t\t4 => '大洋洲',\n\t\t\t\t5 => '南极洲',\n\t\t\t\t6 => '北美洲',\n\t\t\t\t7 => '南美洲',\n\t\t\t]);\n\t\t\t$selector->select('promotion', '推荐', [\n\t\t\t\t0 => '未推荐',\n\t\t\t\t1 => '推荐',\n\t\t\t]);\n\t\t});\n\n\t\t$grid->column('id', __('Id'));\n\t\t// $grid->column('continent_id', __('洲 id'));\n\t\t$grid->column('cname', __('中文名'));\n\t\t$grid->column('continent.cn_name', '洲名');\n\t\t$grid->continentlocation('地理位置')->pluck('cn_name')->label('danger');\n\t\t$grid->column('name', __('英文名称'));\n\t\t// $grid->column('lower_name', __('小写'))->limit(10);\n\t\t$grid->column('country_code', __('国家地区代码'))->limit(10);\n\t\t// $grid->column('full_name', __('英文全称'))->limit(10);\n\t\t$grid->column('full_cname', __('中文全称'))->limit(10);\n\t\t// $grid->column('remark', __('概况'))->limit(30);\n\t\t$grid->column('is_island', __('海岛'))->bool();\n\t\t$states = [\n\t\t\t'on' => ['value' => 1, 'text' => '是', 'color' => 'primary'],\n\t\t\t'off' => ['value' => 0, 'text' => '否', 'color' => 'default'],\n\t\t];\n\t\t$grid->column('promotion', __('推荐'))->switch($states);\n\t\t$grid->column('active', __('激活'))->switch($states);\n\t\t// $grid->column('created_at', __('Created at'));\n\t\t// $grid->column('updated_at', __('Updated at'));\n\n\t\treturn $grid;\n\t}", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "function sopac_search_form_basic() {\n\n $locum = sopac_get_locum('locum');\n $locum_cfg = $locum->locum_config;\n $getvars = sopac_parse_get_vars();\n\n $actions = sopac_parse_uri();\n if ($actions[0] == \"search\") {\n if ($actions[3]) {\n $actions[2] = $actions[2] . \"/\" . $actions[3];\n urlencode($actions[2]);\n }\n $search_query = $actions[2];\n $stype_selected = $actions[1] ? 'cat_' . $actions[1] : 'cat_keyword';\n }\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg[format_groups] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n\n $stypes = array(\n 'cat_keyword' => t('Keyword'),\n 'cat_title' => t('Title'),\n 'cat_author' => t('Author'),\n 'cat_series' => t('Series'),\n 'cat_tags' => t('Tags'),\n 'cat_reviews' => t('Reviews'),\n 'cat_subject' => t('Subject'),\n 'cat_callnum' => t('Call Number'),\n );\n\n $sortopts = array(\n 'relevance' => t('Relevance'),\n 'newest' => t('Newest First'),\n 'oldest' => t('Oldest First'),\n );\n\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg['format_groups'] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n if (is_null($prompt)) {\n $prompt = t('Enter your keywords');\n }\n\n // Initialize the form\n $form = array(\n '#attributes' => array('class' => 'search-form'),\n '#validate' => array('sopac_search_catalog_validate'),\n '#submit' => array('sopac_search_catalog_submit'),\n );\n // Start creating the basic search form\n $form['inline'] = array(\n '#prefix' => '<div class=\"basic-search-inline\">',\n '#suffix' => '</div>'\n );\n $form['inline']['search_query'] = array(\n '#type' => 'textfield',\n '#default_value' => $search_query,\n '#size' => 25,\n '#maxlength' => 255,\n '#attributes' => array('x-webkit-speech' => 'true'),\n );\n $form['inline']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search'),\n );\n\n $form['filters'] = array(\n '#prefix' => '<div id=\"filters\">',\n '#suffix' => '</div>'\n );\n $form['filters']['search_type'] = array(\n '#type' => 'select',\n '#title' => t('Search By'),\n '#default_value' => $stype_selected,\n '#options' => $stypes,\n );\n $form['filters']['search_format'] = array(\n '#type' => 'select',\n '#title' => t('Material'),\n '#default_value' => $_GET['search_format'],\n '#selected' => $_GET['search_format'],\n '#options' => $sformats,\n );\n $form['filters']['limit_avail'] = array(\n '#type' => 'select',\n '#title' => 'On Shelf At',\n '#options' => array_merge(array('' => '--', 'any' => \"Any Location\"), $locum_cfg['branches']),\n '#default_value' => $getvars['limit_avail'],\n );\n $form['advanced'] = array(\n '#value' => '<div class=\"basic-search-links\">' .\n l(\"Advanced Search\", variable_get('sopac_url_prefix', 'cat/seek') . '/advanced') .\n '&nbsp;|&nbsp;' .\n l(\"Search Tips\", variable_get('sopac_url_prefix', 'cat/seek') . '/tips') .\n '</div>',\n );\n\n return $form;\n}", "function fluid_edge_get_search() {\n fluid_edge_load_search_template();\n }", "function tpps_details_species(array &$state) {\n $query = db_select('chado.organism', 'o');\n $query->join('chado.pub_organism', 'po', 'o.organism_id = po.organism_id');\n $query->join('chado.project_pub', 'pp', 'pp.pub_id = po.pub_id');\n $query->fields('o', array('organism_id', 'genus', 'species', 'common_name'));\n $query->condition('pp.project_id', $state['ids']['project_id']);\n $query = $query->execute();\n $rows = array();\n\n while (($result = $query->fetchObject())) {\n $id = $result->organism_id;\n $common_name = $result->common_name;\n $family = $order = \"\";\n\n if (tpps_chado_prop_exists('organism', $id, 'family')) {\n $family = db_select('chado.organismprop', 'o')\n ->fields('o', array('value'))\n ->condition('organism_id', $id)\n ->condition('type_id', tpps_load_cvterm('family')->cvterm_id)\n ->execute()->fetchObject()->value;\n }\n\n if (tpps_chado_prop_exists('organism', $id, 'order')) {\n $order = db_select('chado.organismprop', 'o')\n ->fields('o', array('value'))\n ->condition('organism_id', $id)\n ->condition('type_id', tpps_load_cvterm('order')->cvterm_id)\n ->execute()->fetchObject()->value;\n }\n\n if (empty($common_name) and tpps_chado_prop_exists('organism', $id, 'common name')) {\n $common_name = db_select('chado.organismprop', 'o')\n ->fields('o', array('value'))\n ->condition('organism_id', $id)\n ->condition('type_id', tpps_load_cvterm('common name')->cvterm_id)\n ->execute()->fetchObject()->value;\n }\n\n $name = \"{$result->genus} {$result->species}\";\n $link = tpps_entity_link($id, $name, 'Organism');\n $rows[$name] = array(\n $order,\n $family,\n $link,\n $common_name,\n );\n }\n \n $vars = array(\n 'header' => array(\n 'Order',\n 'Family',\n 'Species',\n 'Common Name',\n ),\n 'rows' => $rows,\n 'attributes' => array(\n 'class' => array('view'),\n 'id' => 'tpps_table_display',\n ),\n 'caption' => '',\n 'colgroups' => NULL,\n 'sticky' => FALSE,\n 'empty' => '',\n );\n return theme('table', $vars);\n}", "public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }", "public function searchCarte()\n {\n $this->utils->Restreindre($this->userConnecter->admin, $this->utils->Est_autoriser(40, $this->userConnecter->profil));\n $data['lang'] = $this->lang->getLangFile($this->getSession()->getAttribut('lang'));\n $params = array('view' => 'compte/search-carte');\n $this->view($params, $data);\n }", "protected function searchResults(SpecimensSelfFormFilter $form, sfWebRequest $request)\n {\n if($request->getParameter('searchSpecimen','') !== '')\n {\n // Bind form with data contained in searchExpedition array\n $form->bind($request->getParameter('searchSpecimen'));\n // Test that the form binded is still valid (no errors)\n\n if ($form->isValid())\n {\n // Define all properties that will be either used by the data query or by the pager\n // They take their values from the request. If not present, a default value is defined\n $query = $form->getQuery()->orderby($this->orderBy . ' ' . $this->orderDir);\n // Define in one line a pager Layout based on a pagerLayoutWithArrows object\n // This pager layout is based on a Doctrine_Pager, itself based on a customed Doctrine_Query object (call to the getExpLike method of ExpeditionTable class)\n $this->pagerLayout = new PagerLayoutWithArrows(new DarwinPager($query,\n $this->currentPage,\n $form->getValue('rec_per_page')\n ),\n new Doctrine_Pager_Range_Sliding(array('chunk' => $this->pagerSlidingSize)),\n $this->getController()->genUrl($this->s_url.$this->o_url).'/page/{%page_number}'\n );\n // Sets the Pager Layout templates\n $this->setDefaultPaggingLayout($this->pagerLayout);\n // If pager not yet executed, this means the query has to be executed for data loading\n if (! $this->pagerLayout->getPager()->getExecuted())\n $this->specimens = $this->pagerLayout->execute();\n\n\n $specs = array();\n foreach($this->specimens as $specimen)\n {\n $specs[$specimen->getId()] = $specimen->getId();\n }\n $specCodes = Doctrine::getTable('Codes')->getCodesRelatedArray('specimens', $specs);\n $this->codes = array();\n foreach($specCodes as $code)\n {\n if(! isset($this->codes[$code->getRecordId()]) )\n $this->codes[$code->getRecordId()] = array();\n $this->codes[$code->getRecordId()][] = $code;\n }\n }\n }\n }", "public function basicSearch(){\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t$SearchNameOrganisme = $this->_getParam('Basicseacrhname');\n\t\t\t\t\t\t\tif(strlen(trim($SearchNameOrganisme))>0){\n\t\t\t\t\t\t\t\tif(get_magic_quotes_gpc()){\n\t\t\t\t\t\t\t\t\t$SearchNameOrganisme = stripslashes($SearchNameOrganisme);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$SearchNameOrganisme = mysql_real_escape_string($SearchNameOrganisme);\n\t\t\t\t\t\t\t\t$ShowingBasicSearch = $this->GetModelOrganize->searchbasic($SearchNameOrganisme);\n\t\t\t\t\t\t\t\t$this->view->getfivetable = $ShowingBasicSearch;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$getAllDataToview = $this->GetModelOrganize->selectAllDataForOrganismeMenu ();\n\t\t\t\t\t\t\t\t$this->view->getfivetable = $getAllDataToview;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}catch (ErrorException $ex){\n\t\t\t\t\t\t\techo \"Message:\".$ex->getMessage();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public function showGrid($fast_search=false)\n {\n //fazer paginação, tenho a classe no mwork/lib\n //$objects = DB::getObjects(\"SELECT {$this->sqlColumns} FROM usuarios\");\n $table = $this->model->getTable();\n \n if (!$this->actions)\n {\n $this->addAction('Ver', $this->viewImage, 'info'); // js func // parameter \n $this->addAction('Editar', $this->editImage, 'edit', array($this->model->getPrimaryKey()), 'showContent', array('conteudo'));\n $this->addAction('Deletar', $this->deleteImage, 'delete');\n }\n \n $objects = new stdClass();\n \n $objects = DB::getObjects($this->getSql());\n \n if(!$fast_search)\n {\n $grid = '<div id =\"' . $this->gridId . '\" > <table width=\"100%\">';\n \n }\n if ($objects)\n {\n if(!$fast_search)\n { \n $grid.='<thead>';\n $gridLabels = '';\n $gridInputs = '';\n foreach ($this->columns as $columnTable => $column)\n {\n $align = $column->parameters[1] ? $column->parameters[1] : 'center';\n $width = $column->parameters[0] ? $column->parameters[0].'%' : ''; \n if($column->relation && !preg_match('/like/', $columnTable)) \n { \n $ref_column = explode('=', $column->relation);\n \n foreach($ref_column as $ref)\n {\n if(preg_match(\".$table.\", $ref))\n {\n $ref_column = explode('.',$ref);\n $ref_column = $ref_column[1];\n break;\n } \n }\n \n $newColumnTable = ''; \n $newColumnTable = str_replace('::','.', $columnTable);\n \n $tableColumn = explode('.', $newColumnTable);\n $tableColumn = $tableColumn[0];\n $tableColumn = trim($tableColumn);\n $ref_column = trim($ref_column);\n \n unset($modelTable);\n $modelTable = $this->MCore->getModelFromTable($tableColumn);\n unset($combo);\n $combo = new MCombo($modelTable->getArray()); \n $combo->setName($tableColumn.'::'.$ref_column.'::'.'=');\n $combo->setId($tableColumn.'::'.$ref_column.'::'.'='); \n $gridInputs .= \"<td align='{$align}' width='{$width}'> \".$combo->show().\" </td>\";\n }\n else\n {\n unset($input);\n $input = new MText();\n $input->setName($columnTable.'::'.'like');\n $gridInputs .= \"<td align='$align' width='{$width}'> \".$input->show().\" </td>\";\n }\n $gridLabels.=\"<td align='{$align}' width='{$width}'> {$column->label} </td>\";\n }\n \n $grid.=\"<tr> {$gridLabels} </tr>\";\n $grid.=\"<tr class='filters-grid'> {$gridInputs} </tr> \";\n $grid.='</thead> <tbody id=\"tbody_'.$this->gridId.'\">';\n }\n \n foreach ($objects as $object)\n {\n $grid.= '<tr>';\n \n foreach ($this->columns as $key => $value)\n {\n $objKey = '';\n if(preg_match('/\\|/',$key))\n { \n $key = explode('|', $key);\n $objKey = trim($key[1]);\n }\n else\n {\n $key = explode('::', $key); \n $objKey = trim($key[1]);\n }\n \n $grid.='<td align=\"center\">' . $object->{$objKey} . '</td>';\n }\n \n foreach ($this->actions as $objAction)\n {\n $params= null;\n if ($objAction->params)\n {\n $params= null;\n foreach ($objAction->params as $actionParam)\n {\n if ($object->{$actionParam})\n {\n $params.= $object->{$actionParam} . ',';\n }\n else\n {\n $params.= $actionParam . ',';\n }\n \n }\n $params = substr($params, 0, -1);\n $params = '(' . $params . ')';\n }\n else\n {\n $params = '()';\n }\n $action = null; \n $action = $objAction->action . $params;\n $jsParams = null;\n if ($objAction->jsParams)\n { \n $jsParams = \"'{$action}',\";\n\n foreach ($objAction->jsParams as $actionJsParam)\n {\n $jsParams .= \"'{$actionJsParam}',\";\n }\n $jsParams = substr($jsParams, 0, -1);\n $jsParams = \"({$jsParams})\";\n }\n else\n {\n $jsParams = \"('{$action}')\";\n }\n \n $grid.=\"<td align='center' width='15'> <img class='grid_img_action' src='{$objAction->icon}' title='{$objAction->title}' onclick = \\\"{$objAction->jsFunction}{$jsParams}\\\"/> </td>\";\n }\n\n $grid.= '</tr>';\n }\n }\n else\n {\n $grid.='<tr> <td> Nothing found </td> </tr>';\n }\n \n if(!$fast_search)\n {\n $grid.='</tbody> </table></div>'; \n echo \" <script>\n $('#{$this->gridId}').keyup(function(e)\n { \n if(e.keyCode == 13) \n {\n var objsFilter = $('.filters-grid').find('input,select'); \n ajaxSubmitObjs('{$this->listControlName}::search(1)','tbody_{$this->gridId}',objsFilter);\n return true;\n }\n });\n\n $('#{$this->gridId}').find('select').change(function(e)\n { \n var objsFilter = $('.filters-grid').find('input,select'); \n ajaxSubmitObjs('{$this->listControlName}::search(1)','tbody_{$this->gridId}',objsFilter);\n return true;\n });\n\n </script>\";\n }\n echo $grid;\n \n \n }", "function test_general_entries_search_on_dynamic_field_values() {\n\t\t// Single word is searched. One matching entry should be found.\n\t\t$search_string = 'Utah';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entry metas table';\n\t\tself::run_entries_found_tests( $msg, $items, 1, array( 'steph_entry_key' ) );\n\t}", "protected function grid()\n {\n $grid = new Grid(new Specialization);\n\n $grid->id('Id');\n $grid->full_name('Полное найменование');\n $grid->short_name('Краткое найменование');\n $grid->code('Код специальности');\n $grid->cathedra_id('Кафедра')->using(Cathedra::all()->pluck('abbreviation', 'id')->toArray());\n $grid->created_at('Создано');\n $grid->updated_at('Обновлено');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SiteModel);\n\n $grid->id('ID')->sortable();\n $grid->name('Site name')->sortable();\n $grid->url('Site URL')->link()->sortable();\n $grid->enable('Disabled')->sortable()->using(['1' => '', '0' => 'Disabled'])->badge('red');\n $grid->official('Official')->sortable()->using(['1' => 'Official', '0' => ''])->badge('blue');\n $grid->searcheable('Searcheable')->sortable()->using(['1' => 'Search OK', '0' => ''])->display(function($v1, \\Encore\\Admin\\Grid\\Column $column, $v3=1){\n if ($v1 != '') {\n return \"<span class='badge bg-green' title='aa'>$v1</span>\";\n }\n return '';\n });\n \n $grid->updated_at('Updated at')->sortable();\n \n $grid->filter(function ($filter) {\n $filter->like('name', 'Site name');\n $filter->like('url', 'URL');\n });\n \n return $grid;\n }", "function scribbles_add_search_form() {\n\n\tget_template_part( 'templates/parts/search' );\n\n}", "public function haz_eff_hea(){\n $this->search_list();\n\t}", "protected static function display_search_form() {\n $locale = self::$locale;\n add_to_title($locale['global_202']);\n $form_elements = self::$form_config['form_elements'];\n /*\n * Search Areas\n */\n $options_table = \"<p><strong>\".$locale['405'].\"</strong></p><table style='width:100%'>\\n\";\n if (!empty(self::$form_config['radio_button'])) {\n foreach (self::$form_config['radio_button'] as $key => $value) {\n $options_table .= \"<tr>\\n<td>\".$value.\"</td>\\n</tr>\\n\";\n }\n }\n $options_table .= \"<tr>\\n<td>\\n\n \".form_checkbox('stype', $locale['407'], self::get_param('stype'), [\n 'type' => 'radio',\n 'value' => 'all',\n 'onclick' => 'display(this.value)',\n 'reverse_label' => TRUE\n ]\n ).\"</td>\\n</tr>\\n</table>\\n\";\n\n /*\n * Date limit\n */\n $date_opts = [\n '0' => $locale['421'],\n '86400' => $locale['422'],\n '604800' => $locale['423'],\n '1209600' => $locale['424'],\n '2419200' => $locale['425'],\n '7257600' => $locale['426'],\n '14515200' => $locale['427']\n ];\n\n $disabled_status = FALSE;\n if (isset($form_elements[self::get_param('stype')]['disabled'])) {\n $disabled_status = !empty($form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE;\n if (self::get_param('stype') != 'all') {\n $disabled_status = in_array(\"datelimit\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE;\n }\n }\n\n if (self::get_param('stype') == \"all\") {\n $disabled_status = TRUE;\n }\n\n $search_areas = \"<div class='row'>\";\n $search_areas .= \"<div class='col-xs-12 col-sm-3'>\".$locale['420'].\"</div>\";\n $search_areas .= \"<div class='col-xs-12 col-sm-9'>\";\n $search_areas .= form_select('datelimit', '', self::get_param('datelimit'),\n [\n 'inner_width' => '150px',\n 'options' => $date_opts,\n 'deactivate' => $disabled_status\n ]);\n $search_areas .= form_checkbox('fields', $locale['430'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '2',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields1',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields1\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= form_checkbox('fields', $locale['431'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '1',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields2',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields2\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= form_checkbox('fields', $locale['432'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '0',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields3',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields3\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= \"</div></div>\";\n\n /*\n * Sort\n */\n $sort_opts = [\n 'datestamp' => $locale['441'],\n 'subject' => $locale['442'],\n 'author' => $locale['443']\n ];\n\n $sort = \"<div class='row'>\";\n $sort .= \"<div class='col-xs-12 col-sm-3'>\".$locale['440'].\"</div>\";\n $sort .= \"<div class='col-xs-12 col-sm-9'>\";\n $sort .= form_select('sort', '', self::get_param('sort'), [\n 'inner_width' => '150px',\n 'options' => $sort_opts,\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"sort\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]);\n $sort .= form_checkbox('order', $locale['450'], self::get_param('order'),\n [\n 'type' => 'radio',\n 'value' => '0',\n 'reverse_label' => TRUE,\n 'input_id' => 'order1',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"order1\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $sort .= form_checkbox('order', $locale['451'], self::get_param('order'),\n [\n 'type' => 'radio',\n 'value' => '1',\n 'reverse_label' => TRUE,\n 'input_id' => 'order2',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"order2\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $sort .= \"</div></div>\";\n\n /*\n * Char list\n */\n $char_opts = [\n '50' => '50',\n '100' => '100',\n '150' => '150',\n '200' => '200'\n ];\n\n $char_areas = \"<div class='row'>\";\n $char_areas .= \"<div class='col-xs-12 col-sm-3'>\".$locale['460'].\"</div>\";\n $char_areas .= \"<div class='col-xs-12 col-sm-9'>\";\n $char_areas .= form_select('chars', '', self::get_param('chars'), [\n 'inner_width' => '150px',\n 'options' => $char_opts,\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"chars\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $char_areas .= \"</div></div>\";\n\n /*\n * Bind\n */\n $info = [\n 'openform' => openform('advanced_search_form', 'post', BASEDIR.'search.php'),\n 'closeform' => closeform(),\n 'search_form_stext' => form_text('stext', str_replace('[SITENAME]', fusion_get_settings('sitename'), self::$locale['400']), urldecode(self::get_param('stext')), ['inline' => FALSE, 'placeholder' => $locale['401']]),\n 'search_form_button' => form_button('search', $locale['402'], $locale['402'], ['class' => 'btn-primary']),\n 'search_form_method' => form_checkbox('method', '', self::get_param('method'),\n [\n \"options\" => [\n 'OR' => $locale['403'],\n 'AND' => $locale['404']\n ],\n 'type' => 'radio',\n 'reverse_label' => TRUE,\n ]),\n 'search_form_sources' => $options_table,\n 'search_areas' => $search_areas,\n 'sort_areas' => $sort,\n 'char_areas' => $char_areas\n ];\n /*\n * Replace\n */\n echo $info['openform'];\n echo strtr(Search::render_search(), [\n '{%title%}' => str_replace('[SITENAME]', fusion_get_settings('sitename'), self::$locale['400']),\n '{%search_text%}' => $info['search_form_stext'],\n '{%search_button%}' => $info['search_form_button'],\n '{%search_method%}' => $info['search_form_method'],\n '{%search_sources%}' => $info['search_form_sources'],\n '{%search_areas%}' => $info['search_areas'],\n '{%sort_areas%}' => $info['sort_areas'],\n '{%char_areas%}' => $info['char_areas'],\n ]);\n echo $info['closeform'];\n /*\n * Javascript\n */\n $search_js = \"function display(val) {\\nswitch (val) {\\n\";\n foreach ($form_elements as $type => $array1) {\n $search_js .= \"case '\".$type.\"':\\n\";\n foreach ($array1 as $what => $array2) {\n foreach ($array2 as $elements => $value) {\n if ($what == \"enabled\") {\n $search_js .= \"document.getElementById('\".$value.\"').disabled = false;\\n\";\n } else {\n if ($what == \"disabled\") {\n $search_js .= \"document.getElementById('\".$value.\"').disabled = true;\\n\";\n } else {\n if ($what == \"display\") {\n $search_js .= \"document.getElementById('\".$value.\"').style.display = 'block';\\n\";\n } else {\n if ($what == \"nodisplay\") {\n $search_js .= \"document.getElementById('\".$value.\"').style.display = 'none';\\n\";\n }\n }\n }\n }\n }\n }\n $search_js .= \"break;\\n\";\n }\n $search_js .= \"case 'all':\\n\";\n $search_js .= \"document.getElementById('datelimit').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields1').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields2').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields3').disabled = false;\\n\";\n $search_js .= \"document.getElementById('sort').disabled = false;\\n\";\n $search_js .= \"document.getElementById('order1').disabled = false;\\n\";\n $search_js .= \"document.getElementById('order2').disabled = false;\\n\";\n $search_js .= \"document.getElementById('chars').disabled = false;\\n\";\n $search_js .= \"break;}}\";\n add_to_footer(\"<script type='text/javascript'>\".jsminify($search_js).\"</script>\");\n }", "public function actionScientificName($term) {\n $pieces = explode(' ', $term);\n\n // Check for valid input\n if (count($pieces) <= 0 || empty($pieces[0])) {\n die('Invalid request');\n }\n\n // Construct default search criteria\n $where_fields = array('AND', 'ts.external = 0', 'tg.genus LIKE :genus');\n $where_fields_data = array(':genus' => $pieces[0] . '%');\n\n // Create basic SQL-command;\n $dbHerbarInput = $this->getDbHerbarInput();\n $command = $dbHerbarInput->createCommand()\n ->select(\"ts.taxonID, herbar_view.GetScientificName( ts.taxonID, 0 ) AS ScientificName\")\n ->from(\"tbl_tax_species ts\")\n ->leftJoin(\"tbl_tax_genera tg\", \"tg.genID = ts.genID\")\n ->order(\"ScientificName\");\n\n // Check if we search the first epithet as well\n if (count($pieces) >= 2 && !empty($pieces[1])) {\n $command->leftJoin(\"tbl_tax_epithets te0\", \"te0.epithetID = ts.speciesID\");\n\n $where_fields[] = 'te0.epithet LIKE :epithet0';\n $where_fields_data[':epithet0'] = $pieces[1] . '%';\n } else {\n $where_fields[] = 'ts.speciesID IS NULL';\n }\n\n // Add where condition\n $command->where($where_fields, $where_fields_data);\n\n $rows = $command->queryAll();\n\n $results = array();\n foreach ($rows as $row) {\n $taxonID = $row['taxonID'];\n $scientificName = $row['ScientificName'];\n\n //$scientificName = $this->getTaxonName($taxonID);\n\n if (!empty($scientificName)) {\n $results[] = array(\n \"label\" => $scientificName,\n \"value\" => $scientificName,\n \"id\" => $taxonID,\n );\n }\n }\n\n // Output results as service response\n $this->serviceOutput($results);\n }", "function index_page (&$tpl) {\n $tpl->assign ('tmanufacturer', fill_lists ('tmanufacturer', select_manfrs (false, 'tyres')));\n $tpl->assign ('width', fill_lists ('width', select_twidths ()));\n $tpl->assign ('height', fill_lists ('height', select_theights ()));\n $tpl->assign ('radius', fill_lists ('radius', select_tradiuses ()));\n $tpl->parse ('main.panel.searchfields.tyres');\n\n $tpl->assign ('dmanufacturer', fill_lists ('dmanufacturer', select_manfrs (false, 'disks')));\n $tpl->assign ('holes', fill_lists ('holes', select_dholes ()));\n $tpl->assign ('distance', fill_lists ('distance', select_ddistances ()));\n $tpl->assign ('radius', fill_lists ('radius', select_dradiuses ()));\n $tpl->parse ('main.panel.searchfields.disks');\n\n $tpl->parse ('main.panel.searchfields');\n $tpl->parse ('main.panel');\n\n if (isset($_GET['tyres'])) include 'show_tyres.php';\n elseif (isset($_GET['disks'])) include 'show_disks.php';\n}", "function ting_extended_search_settings_fields_form($form, &$form_state) {\n $form = array(\n '#tree' => TRUE,\n );\n\n $form['fields'] = array(\n '#prefix' => '<div id=\"ting-ext-search-wrapper\">',\n '#suffix' => '</div>',\n '#type' => 'fieldset',\n '#title' => t('Fields'),\n '#theme' => 'ting_ext_search_fields_table',\n '#header' => array(\n t('Title'),\n '',\n t('Placeholder'),\n t('Well index'),\n t('Type'),\n '', // Keep it for value\n ),\n );\n\n $fields = variable_get('ting_ext_search_fields_settings', array());\n $form_state['fields'] = $fields;\n if (!isset($form_state['fields_count'])) {\n $form_state['fields_count'] = empty($fields) ? 1 : count($fields);\n }\n $fields_count = $form_state['fields_count'];\n $field_types = array(\n 'textfield' => t('Textfield'),\n 'select' => t('Dropdown'),\n 'checkboxes' => t('Checkboxes'),\n 'radios' => t('Radios'),\n );\n\n $value_types = array(\n 'ting_well_types' => t('Well types'),\n 'ting_well_sources' => t('Well sources'),\n 'pickup_branches' => t('Pickup branches'),\n 'custom_list' => t('Custom list'),\n );\n\n for ($i = 0; $i < $fields_count; $i++) {\n $form['fields'][$i]['title'] = array(\n '#type' => 'textfield',\n '#default_value' => isset($fields[$i]['title']) ? $fields[$i]['title'] : '',\n );\n\n $form['fields'][$i]['machine_name'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($fields[$i]['machine_name']) ? $fields[$i]['machine_name'] : '',\n '#machine_name' => array(\n 'source' => array('fields', $i, 'title'),\n 'exists' => '_ting_extended_search_field_exists',\n ),\n '#disabled' => isset($fields[$i]['machine_name']),\n );\n\n $form['fields'][$i]['placeholder'] = array(\n '#type' => 'textfield',\n '#default_value' => isset($fields[$i]['placeholder']) ? $fields[$i]['placeholder'] : '',\n );\n\n $form['fields'][$i]['index'] = array(\n '#type' => 'textfield',\n '#default_value' => isset($fields[$i]['index']) ? $fields[$i]['index'] : '',\n );\n\n $form['fields'][$i]['type'] = array(\n '#type' => 'select',\n '#options' => $field_types,\n '#default_value' => isset($fields[$i]['type']) ? $fields[$i]['type'] : 'textfield',\n );\n $form['fields'][$i]['values']['type'] = array(\n '#type' => 'select',\n '#options' => $value_types,\n '#default_value' => isset($fields[$i]['values']['type']) ? $fields[$i]['values']['type'] : 'ting_well_types',\n '#states' => array(\n 'invisible' => array(\n ':input[name=\"fields[' . $i . '][type]\"]' => array(\n 'value' => 'textfield'\n ),\n ),\n ),\n );\n $value = '';\n if (isset($fields[$i]['values']['list']) && !empty($fields[$i]['values']['list']) && is_array($fields[$i]['values']['list'])) {\n $list = $fields[$i]['values']['list'];\n array_walk($list, function(&$i, $k) {\n $i = \"{$k}|{$i}\";\n });\n $value = implode(\"\\r\\n\", $list);\n }\n $form['fields'][$i]['values']['list'] = array(\n '#type' => 'textarea',\n '#rows' => 8,\n '#cols' => 5,\n '#default_value' => $value,\n '#states' => array(\n 'visible' => array(\n ':input[name=\"fields[' . $i . '][values][type]\"]' => array('value' => 'custom_list'),\n ),\n ),\n );\n }\n\n $form['fields']['more'] = array(\n '#type' => 'submit',\n '#value' => t('Add another one'),\n '#submit' => array('ting_ext_search_more_submit'),\n '#limit_validation_errors' => array(),\n '#ajax' => array(\n 'callback' => 'ting_ext_search_callback',\n 'wrapper' => 'ting-ext-search-wrapper',\n ),\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n return $form;\n}", "function mysite_netcomp_build_search_form($form, &$form_state){\n $form['search_pns'] = array(\n '#type' => 'fieldset',\n '#title' => t('Enter up to three product numbers')\n );\n $form['search_pns']['search_pn1'] = array(\n '#type' => 'textfield',\n// '#title' => t('Product ID')\n );\n $form['search_pns']['search_pn2'] = array(\n '#type' => 'textfield',\n// '#title' => t('Product ID')\n );\n $form['search_pns']['search_pn3'] = array(\n '#type' => 'textfield',\n// '#title' => t('Product ID')\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search'),\n '#submit' => array('mysite_netcomp_search_submit')\n );\n $form['#validate'][] = 'mysite_netcomp_search_validate';\n if (isset($form_state['storage']['results'])){\n $form['results']= array(\n '#markup' => theme('nc_product_results', $form_state['storage']['results']),\n\n );\n }\n return $form;\n\n\n}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('stageId',$this->stageId);\n\t\t$criteria->compare('nameEN',$this->nameEN,true);\n\t\t$criteria->compare('nameTH',$this->nameTH,true);\n\t\t$criteria->compare('nameCN',$this->nameCN,true);\n\t\t$criteria->compare('worldId',$this->worldId);\n\t\t$criteria->compare('areaId',$this->areaId);\n\t\t$criteria->compare('level',$this->level);\n\t\t$criteria->compare('ordinal',$this->ordinal);\n\t\t$criteria->compare('useEnergy',$this->useEnergy);\n\t\t$criteria->compare('drop_warriorId',$this->drop_warriorId);\n\t\t$criteria->compare('drop_equipmentId',$this->drop_equipmentId);\n\t\t$criteria->compare('drop_gemId',$this->drop_gemId);\n\t\t$criteria->compare('drop_ore',$this->drop_ore);\n\t\t$criteria->compare('drop_money',$this->drop_money);\n\t\t$criteria->compare('enemyId_wave1',$this->enemyId_wave1,true);\n\t\t$criteria->compare('enemyId_wave2',$this->enemyId_wave2,true);\n\t\t$criteria->compare('enemyId_wave3',$this->enemyId_wave3,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "protected function grid()\n {\n $grid = new Grid(new Talent);\n\n $grid->column('talents_id', 'ID');\n $grid->column('name', '姓名')->filter('like');\n $grid->column('sex', '性别')->filter('like');\n $grid->column('jobtitle', '工作单位及职务')->filter('like');\n $grid->column('education', '学历学位')->filter('like');\n $grid->column('university', '毕业院校与专业')->filter('like');\n $grid->column('major', '目前的专业/技术特长')->filter('like');\n $grid->column('linkphone', '联系电话')->filter('like');\n $grid->exporter(new TalentExporter());\n $grid->actions(function ($actions) {\n // 去掉查看\n $actions->disableView();\n });\n return $grid;\n }", "public function actionSearch($info){\n $cl = new SphinxClient();\n $cl->SetServer ( '127.0.0.1', 9312);\n//$cl->SetServer ( '10.6.0.6', 9312);\n//$cl->SetServer ( '10.6.0.22', 9312);\n//$cl->SetServer ( '10.8.8.2', 9312);\n $cl->SetConnectTimeout ( 10 );\n $cl->SetArrayResult ( true );\n// $cl->SetMatchMode ( SPH_MATCH_ANY);\n $cl->SetMatchMode ( SPH_MATCH_EXTENDED2);\n $cl->SetLimits(0, 1000);\n// $info = '戴尔';\n $res = $cl->Query($info, 'goods');//shopstore_search\n//print_r($cl);\n// print_r($res);\n// var_dump($res);exit;\n if (isset($res)){\n $ids=[];\n foreach ($res['matches'] as $r){\n $ids[] = $r['id'];\n }\n $pager = new Pagination();\n $pager->totalCount = Goods::find()->where(['in','id',$ids])->count();\n $pager->defaultPageSize = 4;\n $goods = Goods::find()->where(['in','id',$ids])->andWhere(['status'=>1])->offset($pager->offset)->limit($pager->limit)->all();\n //实例化表单模型\n// var_dump($ids);exit;\n// $goods = Goods::find()->where(['goods_category_id'=>$parent_id])->andWhere(['status'=>1])->all();\n// var_dump($pager);exit;\n return $this->render('/list/index',['goods'=>$goods,'pager'=>$pager]);\n\n\n }else{\n\n }\n }", "public function search()\n\t{\n\t\t\n\t}", "function sopac_search_block($locum_results_all, $locum_cfg) {\n global $user;\n\n $getvars = sopac_parse_get_vars();\n $uri = sopac_parse_uri();\n $format = $getvars['search_format'];\n $term_arr = explode('?', trim(preg_replace('/\\//', ' ', $uri[2])));\n\n $search['term'] = trim($term_arr[0]);\n $search['type'] = trim($uri[1]);\n $search['sortby'] = $getvars['sort'] ? $getvars['sort'] : t('Most relevant');\n $search['format'] = count($getvars['search_format']) && ($getvars['search_format'][0] != 'all') ? $getvars['search_format'] : array();\n $search['series'] = count($getvars['facet_series']) ? $getvars['facet_series'] : array();\n $search['lang'] = count($getvars['facet_lang']) ? $getvars['facet_lang'] : array();\n $search['year'] = count($getvars['facet_year']) ? $getvars['facet_year'] : array();\n $search['decade'] = count($getvars['facet_decade']) ? $getvars['facet_decade'] : array();\n $search['age'] = count($getvars['age']) ? $getvars['age'] : array();\n $search['subject'] = count($getvars['facet_subject']) ? $getvars['facet_subject'] : array();\n\n return theme('sopac_search_block', $search, $locum_results_all, $locum_cfg, $user);\n\n}", "function fluid_edge_load_search_template() {\n fluid_edge_get_module_template_part('templates/types/fullscreen', 'search');\n }", "function ting_extended_search_settings_display_form($form, &$form_state) {\n $form = array(\n '#tree' => TRUE,\n );\n\n $form['display'] = array(\n '#type' => 'fieldset',\n '#title' => t('Fields'),\n '#theme' => 'ting_ext_search_display_table',\n '#header' => array(\n t('Field'),\n t('Column'),\n t('Sort'),\n t('Status'),\n t('Weight'),\n ),\n );\n\n $fields = variable_get('ting_ext_search_fields_settings', array());\n $form_state['fields'] = $fields;\n\n if (!isset($form_state['fields_count'])) {\n $form_state['fields_count'] = empty($fields) ? 0 : count($fields);\n }\n $fields_count = $form_state['fields_count'];\n\n $columns = array(\n 'left' => t('Left'),\n 'right' => t('Right'),\n );\n\n $sort_types = array(\n 'alphabetic_asc' => t('Alphabetic'),\n 'alphabetic_desc' => t('Alphabetic(reverse)'),\n 'numeric_asc' => t('Numeric'),\n 'numeric_desc' => t('Numeric(reverse)'),\n );\n\n for ($i = 0; $i < $fields_count; $i++) {\n $form['display'][$i]['title'] = array(\n '#type' => 'textfield',\n '#disabled' => TRUE,\n '#default_value' => isset($fields[$i]['title']) ? $fields[$i]['title'] : '',\n );\n\n $form['display'][$i]['column'] = array(\n '#type' => 'radios',\n '#options' => $columns,\n '#default_value' => isset($fields[$i]['column']) ? $fields[$i]['column'] : 'left',\n );\n\n $form['display'][$i]['sort'] = array(\n '#type' => 'select',\n '#options' => $sort_types,\n '#default_value' => isset($fields[$i]['sort']) ? $fields[$i]['sort'] : 'alphabetic_asc',\n );\n\n $form['display'][$i]['status'] = array(\n '#type' => 'checkbox',\n '#default_value' => isset($fields[$i]['status']) ? $fields[$i]['status'] : 1,\n );\n $form['display'][$i]['weight'] = array(\n '#type' => 'weight',\n '#default_value' => (isset($fields[$i]['weight'])) ? $fields[$i]['weight'] : 0,\n '#attributes' => array(\n 'class' => array('display-weight'),\n )\n );\n $form['display'][$i]['machine_name'] = array(\n '#type' => 'hidden',\n '#value' => $fields[$i]['machine_name'],\n );\n }\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n return $form;\n}", "function sopac_catalog_search() {\n global $pager_page_array, $pager_total, $locum_results_all, $locum_cfg;\n global $user;\n $account = user_load(array('uid' => $user->uid));\n // Load Required JS libraries\n drupal_add_js(drupal_get_path('module', 'sopac') .'/js/jquery.treeview.js');\n drupal_add_js(drupal_get_path('module', 'sopac') .'/js/jquery.rating.js');\n drupal_add_js(drupal_get_path('module', 'sopac') .'/js/facet-browser.js');\n require_once('sopac_social.php');\n $getvars = sopac_parse_get_vars();\n $actions = sopac_parse_uri();\n $locum = sopac_get_locum();\n $locum_cfg = $locum->locum_config;\n $no_circ = $locum->csv_parser($locum_cfg['location_limits']['no_request']);\n $valid_search_types = array('title', 'author', 'keyword', 'subject', 'series', 'callnum', 'tags', 'reviews'); // TODO handle this more dynamically\n\n $output = $getvars['output'];\n $sort = $getvars['sort'];\n $format = $getvars['search_format'];\n $location = $getvars['location'];\n $limit_avail = $getvars['limit_avail'];\n $pager_page_array = explode(',', $getvars['page']);\n // temp for advanced page. should this be broken out\n if($actions[1] == 'isn'){\n $actions[1] = 'keyword';\n }\n $search_type = $actions[1];\n if ($actions[3]) {\n $actions[2] = $actions[2] . \"/\" . $actions[3];\n }\n $search_term = $actions[2];\n // If there is a proper search query, we get that data here.\n if (in_array($actions[1], $valid_search_types)) {\n $valid_search = TRUE;\n\n // Save the search URL in a cookie\n $_SESSION['search_url'] = request_uri();\n\n if ($getvars['perpage']) {\n $limit = $getvars['perpage'];\n }\n elseif ($account->profile_perpage) {\n $limit = $account->profile_perpage;\n }\n else {\n $limit = variable_get('sopac_results_per_page', 10);\n }\n\n\n if ($user->uid && $limit != $account->profile_perpage) {\n $field = db_fetch_object(db_query(\"SELECT * FROM profile_fields WHERE name = 'profile_perpage'\"));\n db_query(\"INSERT INTO profile_values (fid, uid, value) VALUES (%d, %d, '%s') ON DUPLICATE KEY UPDATE value = '%s'\", $field->fid, $user->uid, $limit, $limit);\n }\n\n //if ($addl_search_args['limit']) {\n // $limit = $addl_search_args['limit'];\n //}\n //else {\n // $limit = variable_get('sopac_results_per_page', 20);\n //}\n\n // Initialize the pager if need be\n if ($pager_page_array[0]) {\n $page = $pager_page_array[0] + 1;\n }\n else {\n $page = 1;\n }\n $page_offset = $limit * ($page - 1);\n\n // Grab the faceted search arguments from the URL\n $facet_args = array();\n if (count($getvars['facet_series'])) {\n $facet_args['facet_series'] = $getvars['facet_series'];\n }\n if (count($getvars['facet_lang'])) {\n $facet_args['facet_lang'] = $getvars['facet_lang'];\n }\n if (count($getvars['facet_year'])) {\n $facet_args['facet_year'] = $getvars['facet_year'];\n }\n if (count($getvars['facet_decade'])) {\n $facet_args['facet_decade'] = $getvars['facet_decade'];\n }\n if (count($getvars['age'])) {\n $facet_args['age'] = $getvars['age'];\n }\n if (count($getvars['facet_subject'])) {\n $facet_args['facet_subject'] = $getvars['facet_subject'];\n }\n if (count($getvars['facet_lexile'])) {\n $facet_args['facet_lexile'] = $getvars['facet_lexile'];\n }\n\n // Hide suppressed records unless permission\n $show_inactive = user_access('show suppressed records');\n\n // Get the search results from Locum\n $locum_results_all = $locum->search($search_type, $search_term, $limit, $page_offset, $sort, $format, $location, $facet_args, FALSE, $limit_avail, $show_inactive);\n $num_results = $locum_results_all['num_hits'];\n $result_info['limit'] = $limit;\n $result_info['num_results'] = $num_results;\n $result_info['hit_lowest'] = $page_offset + 1;\n if (($page_offset + $limit) < $num_results) {\n $result_info['hit_highest'] = $page_offset + $limit;\n }\n else {\n $result_info['hit_highest'] = $num_results;\n }\n }\n\n // Construct the search form\n $search_form_cfg = variable_get('sopac_search_form_cfg', 'both');\n $search_form = sopac_search_form($search_form_cfg);\n\n // If we get results back, we begin creating the hitlist\n if ($num_results > 0) {\n // We need to determine how many result pages there are.\n $pager_total[0] = ceil($num_results / $limit);\n $hitlist = '';\n $hitnum = $page_offset + 1;\n\n // When limiting to available, sometimes the \"Last\" link takes the user beyond the number of\n // available items and errors out. This will step them back until they have at least 1 hit.\n if (!count($locum_results_all['results']) && $getvars['limit_avail']) {\n $uri_arr = explode('?', request_uri());\n $uri = $uri_arr[0];\n $getvars_tmp = $getvars;\n if ($getvars_tmp['page']) {\n if ($getvars_tmp['page'] == 1) {\n $getvars_tmp['page'] = '';\n }\n else {\n $getvars_tmp['page']--;\n }\n $pvars_tmp = trim(sopac_make_pagevars(sopac_parse_get_vars($getvars_tmp)));\n $gvar_indicator = $pvars_tmp ? '?' : '';\n $step_link = $uri . $gvar_indicator . $pvars_tmp;\n header('Location: ' . $step_link);\n }\n }\n\n // Loop through results.\n foreach ($locum_results_all['results'] as $locum_result) {\n\n // Grab Stdnum\n $stdnum = $locum_result['stdnum'][0];\n\n // Get the cover image\n $cover_img_url = $locum_result['cover_img'];\n $locum_result['sort'] = $sort;\n // Grab Syndetics reviews, etc..\n $review_links = $locum->get_syndetics($locum_result['stdnum'][0]);\n if (count($review_links)) {\n $locum_result['review_links'] = $review_links;\n }\n\n // Send it all off to the template\n if ($output == \"rss\") {\n $result_body .= theme('sopac_results_hitlist_rss', $hitnum, $cover_img_url, $locum_result, $locum_cfg, $no_circ);\n }\n else if ($output == \"xml\") {\n $result_body .= theme('sopac_results_hitlist_xml', $hitnum, $cover_img_url, $locum_result, $locum_cfg, $no_circ);\n }\n else {\n $result_body .= theme('sopac_results_hitlist', $hitnum, $cover_img_url, $locum_result, $locum_cfg, $no_circ);\n }\n $hitnum++;\n }\n\n $hitlist_pager = theme('pager', NULL, $limit, 0, NULL, 6);\n }\n else if ($valid_search) {\n $result_body .= theme('sopac_results_nohits', $locum_results_all, $locum->locum_config);\n }\n\n // Pull it all together into the search page template\n $result_page = $search_form . theme($output_template, $result_info, $hitlist_pager, $result_body, $locum_results_all, $locum->locum_config);\n\n // Check to see if we're doing RSS\n if ($output == \"rss\") {\n print theme('sopac_results_rss', $result_info, $search_term, $search_type, $result_body, $locum_results_all, $locum->locum_config);\n exit(0);\n }\n else if ($output == \"xml\") {\n print theme('sopac_results_xml', $result_info, $hitlist_pager, $result_body, $locum_results_all, $locum->locum_config);\n exit(0);\n }\n else {\n $result_page = $search_form . theme('sopac_results', $result_info, $hitlist_pager, $result_body, $locum_results_all, $locum->locum_config);\n }\n\n $search_feed_url = sopac_update_url(request_uri(), 'output', 'rss');\n drupal_add_feed($search_feed_url, 'Search for \"' . $search_term . '\"');\n\n return $result_page;\n\n}", "public function executeSearch(sfWebRequest $request)\n {\n\n $this->is_specimen_search = false;\n // Initialize the order by and paging values: order by collection_name here\n $this->setCommonValues('specimensearch', 'collection_name', $request);\n // Modify the s_url to call the searchResult action when on result page and playing with pager\n $this->s_url = 'specimensearch/search'.'?is_choose='.$this->is_choose;\n\n // Initialize filter\n $this->form = new SpecimensFormFilter(null,array('user' => $this->getUser()));\n // If the search has been triggered by clicking on the search button or with pinned specimens\n \n $this->search_request=$request;\n \n //ftheeten 2018 04 17 modified for GET parameters (keep query state)\n if(($request->getParameter('specimen_search_filters','') !== '' ) || $request->hasParameter('pinned') )\n {\n if($request->isMethod('post'))\n {\n // Store all post parameters\n $criterias = $request->getPostParameters();\n }\n //ftheeten 2018 04 17 modified for GET parameters\n elseif($request->isMethod('get'))\n {\n\n $criterias = $request->getGetParameters();\n }\n // If pinned specimens called\n if($request->hasParameter('pinned'))\n {\n\t // Get all ids pinned\n $ids = implode(',',$this->getUser()->getAllPinned('specimen') );\n if($ids == '')\n $ids = '0';\n $this->is_pinned_only_search = true;\n // Set the list of ids as criteria\n $criterias['specimen_search_filters']['spec_ids'] = $ids;\n\n }\n // If instead it's a call to a stored specimen search\n elseif($request->hasParameter('spec_search'))\n {\n // Get the saved search concerned\n $saved_search = Doctrine::getTable('MySavedSearches')->getSavedSearchByKey($request->getParameter('spec_search'), $this->getUser()->getId());\n // Forward 404 if we don't get the search requested\n $this->forward404Unless($saved_search);\n\n $criterias['specimen_search_filters']['spec_ids'] = $saved_search->getSearchedIdString();\n if($criterias['specimen_search_filters']['spec_ids'] == '')\n $criterias['specimen_search_filters']['spec_ids'] = '0';\n $this->is_specimen_search = $saved_search->getId();\n }\n $this->form->bind($criterias['specimen_search_filters']) ;\n }\n // If search_id parameter is given it means we try to open an already saved search with its criterias\n elseif($request->getParameter('search_id','') != '')\n {\n // Get the saved search asked\n $saved_search = Doctrine::getTable('MySavedSearches')->getSavedSearchByKey($request->getParameter('search_id'), $this->getUser()->getId()) ;\n // If not available, not found -> forward on 404 page\n $this->forward404Unless($saved_search);\n\n if($saved_search->getIsOnlyId())\n $this->is_specimen_search = $saved_search->getId();\n // Get all search criterias from DB\n $criterias = $saved_search->getUnserialRequest();\n // Transform all visible fields stored as a string with | as separator and store it into col_fields field\n $criterias['specimen_search_filters']['col_fields'] = implode('|',$saved_search->getVisibleFieldsInResult()) ;\n // If data were set, in other terms specimen_search_filters array is available...\n if(isset($criterias['specimen_search_filters']))\n {\n // Bring all the required/necessary widgets on page\n Doctrine::getTable('Specimens')->getRequiredWidget($criterias['specimen_search_filters'], $this->getUser()->getId(), 'specimensearch_widget');\n if($saved_search->getisOnlyId() && $criterias['specimen_search_filters']['spec_ids']=='')\n $criterias['specimen_search_filters']['spec_ids'] = '0';\n $this->form->bind($criterias['specimen_search_filters']) ;\n }\n \n }\n\n if($this->form->isBound())\n {\n if ($this->form->isValid())\n {\n $this->getUser()->storeRecPerPage( $this->form->getValue('rec_per_page'));\n // When criteria parameter is given, it means we go back to criterias\n if($request->hasParameter('criteria'))\n {\n $this->setTemplate('index');\n // Bring all the required/necessary widgets on page\n Doctrine::getTable('Specimens')->getRequiredWidget($criterias['specimen_search_filters'], $this->getUser()->getId(), 'specimensearch_widget');\n $this->loadWidgets();\n return;\n }\n else\n {\n $this->spec_lists = Doctrine::getTable('MySavedSearches')\n ->getListFor($this->getUser()->getId(), 'specimen');\n if($this->orderBy==\"col_peoples\")\n {\n $this->orderBy=\"(SELECT p.formated_name_indexed from people p where id= spec_coll_ids[1])\";\n }\n elseif($this->orderBy==\"don_peoples\")\n {\n $this->orderBy=\"(SELECT p.formated_name_indexed from people p where id= spec_don_sel_ids[1])\";\n }\n \n $query = $this->form->getQuery()->orderby($this->orderBy . ' ' . $this->orderDir. ', id');\n //If export is defined export it!\n $this->field_to_show = $this->getVisibleColumns($this->getUser(), $this->form);\n \n\t\t if($request->getParameter('export','') != '')\n {\n $this->specimensearch = $query->limit(1000)->execute();\n $this->setLayout(false);\n $this->loadRelated();\n $this->getResponse()->setHttpHeader('Pragma: private', true);\n $this->getResponse()->setHttpHeader('Content-Disposition',\n 'attachment; filename=\"export.csv\"');\n $this->getResponse()->setContentType(\"application/force-download text/csv\");\n $this->setTemplate('exportCsv');\n return ;\n }\n // Define in one line a pager Layout based on a pagerLayoutWithArrows object\n // This pager layout is based on a Doctrine_Pager, itself based on a customed Doctrine_Query object (call to the getExpLike method of ExpeditionTable class)\n\n \n $pager = new DarwinPager($query,\n $this->currentPage,\n $this->form->getValue('rec_per_page')\n );\n // Replace the count query triggered by the Pager to get the number of records retrieved\n $count_q = clone $query;\n\t\n $count_q->select(\" count(s.id), count(distinct s.id) as distinct_records, count(distinct s.ig_num) as count_ig\")->removeDqlQueryPart('orderby')->from(\"SpecimensStoragePartsView s\")->limit(0);\n\t\t\n if($this->form->with_group) {\n\t\t\t $count_q->select(\" count(s.id), count(distinct s.id) as distinct_records, count(distinct s.ig_num) as count_ig\")->removeDqlQueryPart('groupby')->from(\"SpecimensStoragePartsView s\")->limit(0);\n \n }\n\t\t $count_q2=clone $count_q;\n\t\t $count_q2->select('sum(s.specimen_count_min) as sum_specimen_count_min,sum(s.specimen_count_max) as sum_specimen_count_max ')->from(\"Specimens s\");\n\t\t $resultset_count_details =$count_q2->fetchOne(array(), Doctrine_Core::HYDRATE_ARRAY);\n\t\t\n\t\t \n\t\t \n\t\t \n // Initialize an empty count query\n $counted = new DoctrineCounted();\n // Define the correct select count() of the count query\n $counted->count_query = $count_q;\n\t\t \n\t\t \n // And replace the one of the pager with this new one\n $pager->setCountQuery($counted);\n $this->pagerLayout = new PagerLayoutWithArrows($pager,\n new Doctrine_Pager_Range_Sliding(array('chunk' => $this->pagerSlidingSize)),\n $this->getController()->genUrl($this->s_url.$this->o_url).'/page/{%page_number}'\n );\n // Sets the Pager Layout templates\n $this->setDefaultPaggingLayout($this->pagerLayout);\n // If pager not yet executed, this means the query has to be executed for data loading\n\n\n //if (! $this->pagerLayout->getPager()->getExecuted())\n $this->specimensearch = $this->pagerLayout->execute();\n\t\t//$counted2->execute();\n\t\t\n\t\t\t$this->pagerLayout->getPager()->additional_count=array_merge($counted->all_results , $resultset_count_details);\n //Load Codes and related for each item\n $this->loadRelated();\n\n $this->field_to_show = $this->getVisibleColumns($this->getUser(), $this->form);\n $this->defineFields($this->source);\n \n //ftheeten 2016 06 08 save query for report (via save searc)\n //$this->queryToSave = $this->form->getQuery();\n $this->setParamsToSaveQuery();\n return $request->isXmlHttpRequest()? $this->renderPartial('searchSuccess'): null;\n \n } \n } \n }\n\n $this->setTemplate('index');\n if(isset($criterias['specimen_search_filters']))\n Doctrine::getTable('Specimens')->getRequiredWidget($criterias['specimen_search_filters'], $this->getUser()->getId(), 'specimensearch_widget');\n $this->loadWidgets();\n\n }", "private function identifySearchableGrid(Request $request)\n {\n $gridDefinition = 'prestashop.core.grid.definition.factory.monitoring.empty_category';\n $gridId = EmptyCategoryGridDefinitionFactory::GRID_ID;\n\n $definitionMap = [\n NoQtyProductWithCombinationGridDefinitionFactory::GRID_ID => 'prestashop.core.grid.definition.factory.monitoring.no_qty_product_with_combination',\n NoQtyProductWithoutCombinationGridDefinitionFactory::GRID_ID => 'prestashop.core.grid.definition.factory.monitoring.no_qty_product_without_combination',\n DisabledProductGridDefinitionFactory::GRID_ID => 'prestashop.core.grid.definition.factory.monitoring.disabled_product',\n ProductWithoutImageGridDefinitionFactory::GRID_ID => 'prestashop.core.grid.definition.factory.monitoring.product_without_image',\n ProductWithoutDescriptionGridDefinitionFactory::GRID_ID => 'prestashop.core.grid.definition.factory.monitoring.product_without_description',\n ProductWithoutPriceGridDefinitionFactory::GRID_ID => 'prestashop.core.grid.definition.factory.monitoring.product_without_price',\n ];\n\n foreach ($definitionMap as $id => $definition) {\n if ($request->request->has($id)) {\n $gridId = $id;\n $gridDefinition = $definition;\n\n break;\n }\n }\n\n return [\n 'grid_id' => $gridId,\n 'grid_definition' => $this->get($gridDefinition),\n ];\n }", "function test_field_specific_search_on_dynamic_field_utah() {\n\n\t\t// Single word. One matching entry should be found\n\t\t$search_string = 'Utah';\n\t\t$field_key = 'dynamic-state';\n\t\t$items = self::generate_and_run_field_specific_query( 'all_field_types', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in Dynamic field ' . $field_key;\n\t\tself::run_entries_found_tests( $msg, $items, 1, array( 'steph_entry_key' ) );\n\n\t}", "function voyage_mikado_get_search() {\n\n\t\tif(voyage_mikado_active_widget(false, false, 'mkd_search_opener')) {\n\n\t\t\t$search_type = voyage_mikado_options()->getOptionValue('search_type');\n\n\t\t\tvoyage_mikado_load_search_template();\n\n\t\t}\n\t}", "public function InitializeSearch($cn) {\r\n //SetDisplayValues($attributes) \r\n\r\n /* Campos de busqueda */\r\n $this->m_obj->GetField(\"cap_code\")->SetDisplayValues(Array(\"Name\"=>\"cap_code\", \"Label\"=>\"Capacitación Nro\", \"Type\"=>\"int\", \"IsPK\"=>true, \"IsForDB\"=>true, \"Order\"=>101, \"Presentation\"=>\"INT\", \"IsNullable\"=>false));\r\n $this->m_obj->GetField(\"mon_code\")->SetDisplayValues(Array(\"Name\"=>\"mon_code\", \"Label\"=>\"Monitoreo Nro\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>102, \"Presentation\"=>\"INT\"));\r\n $this->m_obj->GetField(\"cir_code\")->SetDisplayValues(Array(\"Name\"=>\"cir_code\", \"Label\"=>\"Circuito\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>103, \"Presentation\"=>\"CIRCUITO_ACTIVO\", \"IsNullable\"=>false, \"IsVisible\"=>true));\r\n $this->m_obj->GetField(\"use_code_operador\")->SetDisplayValues(Array(\"Name\"=>\"use_code_operador\", \"Label\"=>\"Operador\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>104, \"Presentation\"=>\"OPERADOR\", \"IsNullable\"=>false, \"IsVisible\"=>true));\r\n $this->m_obj->GetField(\"use_code_supervisor\")->SetDisplayValues(Array(\"Name\"=>\"use_code_supervisor\", \"Label\"=>\"Supervisor Asignado\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>105, \"Presentation\"=>\"SUPERVISOR\", \"IsNullable\"=>false, \"IsVisible\"=>true));\r\n $this->m_obj->GetField(\"cap_status\")->SetDisplayValues(Array(\"Name\"=>\"cap_status\", \"Label\"=>\"Estado\", \"Size\"=>20, \"IsForDB\"=>true, \"Order\"=>107, \"Presentation\"=>\"CAP_STATUS\", \"InitialValue\"=>\"PENDIENTE\"));\r\n }", "function search() {}", "private function search_items()\n\t\t{\n\t\t\t$inputsearch = str_replace(\"\\\\\",\"\\\\\\\\\",$this->inputsearch); // SRX_BACKSLASH_FIX_ISSUE\n\t\t\tif(substr($this->inputsearch,0,1) == \"\\\\\")\n\t\t\t{\n\t\t\t\t$pre_jocker = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pre_jocker = '%';\n\t\t\t}\n\t\t\t\n\t\t\t$query = \"\tSELECT\n\t\t\t\t\t\t\t`MTN`.`id` AS 'id'\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t`\".$this->tree_node.\"` `MTN`,\n\t\t\t\t\t\t\t`\".$this->tree_caption.\"` `MTC`\n\t\t\t\t\t\tWHERE 1 = 1\n\t\t\t\t\t\t\tAND `MTN`.`id` = `MTC`.`id`\n\t\t\t\t\t\t\tAND `MTN`.`application_release` = `MTC`.`application_release`\n\t\t\t\t\t\t\tAND `MTN`.`application_release`\t= '\".$this->application_release.\"'\n\t\t\t\t\t\t\tAND `MTC`.`language` = '\".$this->language.\"'\n\t\t\t\t\t\t\tAND `MTC`.`title`\t\tlike '\".$pre_jocker.$this->mysql_protect($inputsearch).\"%'\n\t\t\t\t\t\";\n\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\n\t\t\t// Clear list\n\t\t\t$this->listexpand = ''; \n\t\t\t$this->listhighlight = '';\n\t\t\t\n\t\t\t$this->count_item_found = 0;\n\t\t\t\n\t\t\twhile ($row = $result->fetch_array(MYSQLI_ASSOC))\n\t\t\t{\n\t\t\t\t// Prepare array for full expansion\n\t\t\t\t$this->listexpand[$row['id']] = true;\n\t\t\t\t\n\t\t\t\t// Build array to highlight item\n\t\t\t\t$this->listhighlight[$row['id']] = true;\n\t\t\t\t\n\t\t\t\t$this->count_item_found = $this->count_item_found + 1; // Count number of entries in current search\n\t\t\t}\n\n\t\t\tif(!$this->count_item_found)\n\t\t\t{\n\t\t\t\t// Search launched but no item found\n\t\t\t\t$this->count_item_found = 'NoItemFound';\n\t\t\t}\n\t\t\t\n\t\t\t$this->build_full_array_expansion();\n\t\t\t\n\t\t\t//$_SESSION[$this->ssid]['MT'][$this->internal_id][\"expandlist\"] = $this->listexpand;\n\t\t}", "public function search();", "public function search();", "public function searchAction() {\n parent::searchAction();\n }", "function launchpad_search_flexible_where($q) {\n\tglobal $wpdb;\n\t\n\t// We only want to do this on a search page.\n\tif(is_search()) {\n\t\t// Get the post types so we can find out what flexible types there are.\n\t\t$types = launchpad_get_post_types();\n\t\t\n\t\t// This keeps up with what flexible types we have already considered.\n\t\t$used_flex = array();\n\t\t$used_meta = array();\n\t\t\n\t\t// If we have post types.\n\t\tif($types) {\n\t\t\n\t\t\t// Loop the post types.\n\t\t\tforeach($types as $type) {\n\t\t\t\t\n\t\t\t\t// If the type has flexible content.\n\t\t\t\tif(isset($type['flexible'])) {\n\t\t\t\t\t\n\t\t\t\t\t// Loop the flexible content.\n\t\t\t\t\tforeach($type['flexible'] as $flex_name => $flex_value) {\n\t\t\t\t\t\n\t\t\t\t\t\t// If we haven't used the flexible content, add it to the query.\n\t\t\t\t\t\t// Unfortunately, the WHERE is already pretty populated by now.\n\t\t\t\t\t\t// We can't just shove this onto the end. So, we use the post_title\n\t\t\t\t\t\t// part of the WHERE as a template and use preg_replace trickery\n\t\t\t\t\t\t// to put the right stuff in the right place.\n\t\t\t\t\t\tif(!in_array($flex_name, $used_flex)) {\n\t\t\t\t\t\t\t$used_flex[] = $flex_name;\n\t\t\t\t\t\t\t$q = preg_replace(\"/(\\($wpdb->posts.post_title LIKE '(%.*?%)'\\))/\", '$1 OR (launchpad_search_' . $flex_name . '.meta_value LIKE \"$2\")', $q);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If the type has metabox content.\n\t\t\t\tif(isset($type['metaboxes'])) {\n\t\t\t\t\t\n\t\t\t\t\t// Loop the metabox content.\n\t\t\t\t\tforeach($type['metaboxes'] as $meta_name => $meta_value) {\n\t\t\t\t\t\n\t\t\t\t\t\t// If we haven't used the metabox content, add it to the query.\n\t\t\t\t\t\t// Unfortunately, the WHERE is already pretty populated by now.\n\t\t\t\t\t\t// We can't just shove this onto the end. So, we use the post_title\n\t\t\t\t\t\t// part of the WHERE as a template and use preg_replace trickery\n\t\t\t\t\t\t// to put the right stuff in the right place.\n\t\t\t\t\t\tif(!in_array($meta_name, $used_meta)) {\n\t\t\t\t\t\t\t$used_meta[] = $meta_name;\n\t\t\t\t\t\t\t$q = preg_replace(\"/(\\($wpdb->posts.post_title LIKE '(%.*?%)'\\))/\", '$1 OR (launchpad_search_' . $meta_name . '.meta_value LIKE \"$2\")', $q);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $q;\n}", "public function ajax_tree()\n {\n $catalogue_name = get_param_string('catalogue_name', '');\n if ($catalogue_name == '') {\n if (get_param_string('content', '') != '') {\n return null; // Mid-search\n }\n\n $tree = create_selection_list_catalogues(null, true);\n if ($tree->is_empty()) {\n inform_exit(do_lang_tempcode('NO_ENTRIES', 'catalogue'));\n }\n\n require_code('form_templates');\n $fields = form_input_list(do_lang_tempcode('NAME'), '', 'catalogue_name', $tree, null, true);\n $post_url = get_self_url(false, false, null, false, true);\n $submit_name = do_lang_tempcode('PROCEED');\n $hidden = build_keep_post_fields();\n\n $title = get_screen_title('SEARCH');\n return do_template('FORM_SCREEN', array('_GUID' => 'a2812ac8056903811f444682d45ee448', 'TARGET' => '_self', 'GET' => true, 'SKIP_WEBSTANDARDS' => true, 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => '', 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_ICON' => 'buttons__search', 'SUBMIT_NAME' => $submit_name));\n }\n\n return array('choose_catalogue_category', array('catalogue_name' => $catalogue_name));\n }", "function search ($specimen, $scientificName = '')\n{\n\tglobal $config;\n\t\n\t$hits = array();\n\t\n\t$hit_keys = array();\n\t\n\tif ($specimen->parsed)\n\t{\n\t\tforeach ($specimen->parameters as $parameters)\n\t\t{\n\t\t\t$url = 'https://api.gbif.org/v1/occurrence/search?';\n\t\t\t\t\t\t\n\t\t\tif ($scientificName != '')\n\t\t\t{\n\t\t\t\t$parameters['scientificName'] = $scientificName;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tforeach ($parameters as $k => $v)\n\t\t\t{\n\t\t\t\t$url .= $k . '=' . urlencode($v) . '&';\n\t\t\t}\n\t\t\t\n\t\t\t// echo $url . \"\\n\";\t\t\t\n\t\t\t\n\t\t\t$json = get($url);\n\t\t\t\n\t\t\tif ($json != '')\n\t\t\t{\n\t\t\t\t$obj = json_decode($json);\n\t\t\t\tforeach ($obj->results as $occurrence)\n\t\t\t\t{\n\t\t\t\t\t// We may encounter the same record more than once, so ensure uniqueness\n\t\t\t\t\tif (!in_array($occurrence->gbifID, $hit_keys))\n\t\t\t\t\t{\n\t\t\t\t\t\t$hit_keys[] = $occurrence->gbifID;\n\t\t\t\t\t\t$hits[] = $occurrence;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t//$hits[$occurrence->gbifID] = $occurrence;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\t\n\treturn $hits;\t\n}", "public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( Invoices::grid() )->search ();\n\t}", "function my_epl_add_single_bedrooms_search_dropdown_field($fields) {\n\tforeach($fields as $field_key => &$field) {\n\t if( in_array($field['meta_key'], array('property_bedrooms_min','property_bedrooms_max') ) ) {\n\t\t\tunset($fields[$field_key]);\n\t }\n\t}\n\t$fields[] =array(\n\t\t'key'\t\t\t=>\t'search_bed',\n\t\t//'multiple'\t\t=>\ttrue,\n\t\t'meta_key'\t\t=>\t'property_bedrooms',\n\t\t'label'\t\t\t=>\t__('Bedrooms','epl'),\n\t\t'type'\t\t\t=>\t'select',\n\t\t'option_filter'\t\t=>\t'property_bedrooms',\n\t\t'options'\t\t=>\tarray(\n\t\t\t\t\t\t\t'studio'\t=> 'Studio',\n\t\t\t\t\t\t\t'1'\t\t=> '1',\n\t\t\t\t\t\t\t'2'\t\t=> '2',\n\t\t\t\t\t\t\t'3'\t\t=> '3',\n\t\t\t\t\t\t\t'4'\t\t=> '4',\n\t\t\t\t\t\t\t'5'\t\t=> '5',\n\t\t),\n\t\t'option_type' => 'range', // provide range of option instead of option array\n\t\t'query'\t\t\t=>\tarray(\n\t\t\t\t\t\t\t'query'\t\t=>\t'meta',\n\t\t\t\t\t\t\t'compare'\t=>\t'EQUALS',\n\t\t\t\t\t\t\t'type'\t\t=>\t'numeric'\n\t\t),\n\t\t'class'\t\t\t=>\t'epl-search-row-full',\n\t\t'order'\t\t\t=> 160\n\t);\n\treturn $fields;\n}", "function quick_search() {\n if(!$this->request->isAsyncCall()) {\n $this->redirectTo('search');\n } // if\n\n //BOF:mod 20110629 search\n if (trim($this->request->post('search_for'))!=''){\n\t\t//$_SESSION['search_string'] = trim($this->request->post('search_for'));\n\t }\n //$this->smarty->assign('search_string', $_SESSION['search_string']);\n //EOF:mod 20110629 search\n\n /*$object_types = array();\n $object_types[] = array('id' => '', 'text' => '');\n $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);\n mysql_select_db(DB_NAME, $link);\n $query = \"select distinct type from healingcrystals_project_objects order by type\";\n $result = mysql_query($query);\n while($type = mysql_fetch_assoc($result)){\n \t$object_types[] = array('id' => $type['type'], 'text' => $type['type']);\n }\n mysql_close($link);*/\n\t $search_projects = array();\n\t $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);\n\t mysql_select_db(DB_NAME, $link);\n\t $query = \"select distinct a.project_id from healingcrystals_project_users a inner join healingcrystals_projects b on a.project_id=b.id where a.user_id='\" . $this->logged_user->getId() . \"' order by b.name\";\n\t $result = mysql_query($query);\n\t while($entry = mysql_fetch_assoc($result)){\n\t\t\t$search_projects[] = new Project($entry['project_id']);\n\t\t }\n\t mysql_close($link);\n $object_types = $this->get_object_types();\n if($this->request->isSubmitted()) {\n $search_for = trim($this->request->post('search_for'));\n $search_type = $this->request->post('search_type');\n $search_object_type = $this->request->post('search_object_type');\n $search_project_id = $this->request->post('search_project_id');\n\n if($search_for == '') {\n die(lang('Nothing to search for'));\n } // if\n\n $this->smarty->assign(array(\n 'search_for' => $search_for,\n 'search_type' => $search_type,\n 'search_object_type' => $search_object_type,\n 'object_types' => $object_types,\n 'search_project_id' => $search_project_id,\n 'search_projects' => $search_projects\n ));\n $per_page = 5;\n\n // Search inside the project\n if($search_type == 'in_projects') {\n\t\t //BOF:mod 20120822\n\t\t if ($search_object_type=='Attachment'){\n\t\t\t$template = get_template_path('_quick_search_project_objects', null, SYSTEM_MODULE);\n\t\t\tlist($results, $pagination) = search_attachments($search_for, $this->logged_user, 1, $per_page, $search_object_type, $search_project_id);\n\t\t } else {\n\t\t //EOF:mod 20120822\n\t\t\t$template = get_template_path('_quick_search_project_objects', null, SYSTEM_MODULE);\n\t\t\tlist($results, $pagination) = search_index_search($search_for, 'ProjectObject', $this->logged_user, 1, $per_page, $search_object_type, $search_project_id);\n\t\t //BOF:mod 20120822\n\t\t }\n\t\t //EOF:mod 20120822\n\t\t \n // Search for people\n } elseif($search_type == 'for_people') {\n $template = get_template_path('_quick_search_users', null, SYSTEM_MODULE);\n list($results, $pagination) = search_index_search($search_for, 'User', $this->logged_user, 1, $per_page);\n\n // Search for projects\n } elseif($search_type == 'for_projects') {\n $template = get_template_path('_quick_search_projects', null, SYSTEM_MODULE);\n list($results, $pagination) = search_index_search($search_for, 'Project', $this->logged_user, 1, $per_page);\n\n // Unknown type\n } else {\n die(lang('Unknown search type: :type', array('type' => $search_type)));\n } // if\n\n $this->smarty->assign(array(\n 'results' => $results,\n 'pagination' => $pagination,\n ));\n\n $this->smarty->display($template);\n die();\n } else {\n \t$this->smarty->assign('object_types', $object_types);\n \t$this->smarty->assign('search_projects', $search_projects);\n }\n }", "function smarty_function_forms_search($params, &$smarty)\n{\n\t$title = \"Search\";\n\t$ajax = true;\n\t$class = \"\";\n\t$sdivid = \"search\" . rand();\n\tforeach ($params as $_key=>$_value) {\n\t\tswitch ($_key) {\n\t\tcase 'form':\n\t\tcase 'class':\n\t\tcase 'table':\n\t\tcase 'title':\n\t\tcase 'ajax':\n\t\t\t$$_key = $_value;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$output = \"\";\n\n\t$display = \"none\";\n\n\n\t$cur_table = &$form->tables->$table;\n\n\tif ($class == \"\")\n\t\t$class = \"forms\";\n\n\tif ($cur_table->search[\"type\"] == \"all\" || $cur_table->search[\"type\"] == \"individual\")\n\t{\n\t\tif (strlen($cur_table->search['value']) != 0)\n\t\t\t$display = \"block\";\n\t\t$output .= \"<input type=\\\"text\\\" value=\\\"$cur_table->search['value']\\\" name=\\\"search\\\">\";\n\t}\n\n\tif ($cur_table->search[\"type\"] != \"all\")\n\t{\n\n\t\tif ($cur_table->search[\"type\"] == \"individual\")\n\t\t{\n\t\t\t$output .=\"<br><SELECT name=\\\"searchfield\\\">\";\n\t\t}\n\n\t\tif ($cur_table->search[\"type\"] == \"advanced\")\n\t\t{\n \t\t\t$output .= \"<table class='$class'>\\r\";\n\t\t\tif (!$ajax)\n\t\t\t\t$output .= \"<tr><th colspan='2'>$title</th></tr>\\r\";\n\t\t}\n\n\t\tforeach ($cur_table->order as $fieldname)\n\t\t{\n\t\t\t$field = &$cur_table->fields[$fieldname];\n\t\t\tif (is_array($field->search[\"value\"]))\n\t\t\t{\n\t\t\t\tif (count($field->search[\"value\"]) != 0)\n\t\t\t\t\t$display = \"block\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (strlen($field->search['value']) != 0 && $field->search['value'] != \"any\")\n\t\t\t\t\t$display = \"block\";\n\t\t\t}\n\n\t\t\tif (isset($field->search[\"searchable\"]) && $field->search[\"searchable\"])\n\t\t\t{\n\t\t\t\tif ($cur_table->search[\"type\"] == \"individual\")\n\t\t\t\t{\n\t\t\t\t\t$cur_table->search[\"field\"] == $field->name ? $selected = \" selected \" : $selected = \"\";\n\t\t\t\t\t$output .= \"<OPTION value=\\\"$field->name\\\" $selected title=\\\"\\\">$field->name</OPTION>\";\n\t\t\t\t}\n\t\t\t\telse // CREATE ADVANCED SEARCH -- A BOX FOR EACH SEARCHABLE FIELD\n\t\t\t\t{\n\t\t\t\t\tif ($field->search[\"type\"] != \"range\")\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch ($field->search[\"type\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase \"exact\":\n\t\t\t\t\t\t\tcase \"contains\":\n\t\t\t\t\t\t\t\t$input = \"<input type=\\\"text\\\" value=\\\"{$field->search['value']}\\\" name=\\\"$field->name\\\" id=\\\"$field->name\\\">\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"index\":\n\t\t\t\t\t\t\t\t$input = \"<select name=\\\"$field->name\\\">\";\n\t\t\t\t\t\t\t\t$opput = \"\";\n\t\t\t\t\t\t\t\t$sel = false;\n\t\t\t\t\t\t\t\tforeach ($field->index as $val => $index)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($field->search[\"value\"] == $val && $field->search[\"value\"] != \"any\")\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$selected = \" selected \";\n\t\t\t\t\t\t\t\t\t\t$sel = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$selected = \"\";\n\t\t\t\t\t\t\t\t\t$opput .= \"<option value=\\\"$val\\\" $selected>$index</option>\\r\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$sel === true ? $selected = \"\" : $selected = \" selected \";\n\t\t\t\t\t\t\t\t\t$opput = \"<option value=\\\"any\\\" $selected>Any</option>\\r\" . $opput;\n\t\t\t\t\t\t\t\t\t$input .= $opput;\n\t\t\t\t\t\t\t\t$input .= \"</select>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"multiple\":\n\t\t\t\t\t\t\t\t$input = \"<select name=\\\"{$field->name}[]\\\" multiple>\";\n\t\t\t\t\t\t\t\t$opput = \"\";\n\t\t\t\t\t\t\t\tforeach ($field->index as $val => $index)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$selected = \"\";\n\t\t\t\t\t\t\t\t\tif (isset($field->search[\"value\"]) && is_array($field->search[\"value\"]))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($field->search[\"value\"] as $passedInValue)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($passedInValue == $val)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$selected = \" selected \";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$opput .= \"<option value=\\\"$val\\\" $selected>$index</option>\\r\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$input .= $opput;\n\t\t\t\t\t\t\t\t$input .= \"</select>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$output .= \"<tr><td>$field->label:</td><td>$input</td></tr>\\r\";\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$output .= \"<tr><td>$field->label min:</td><td><input type=\\\"text\\\" value=\\\"$field->search['value_min']\\\" name=\\\"$field->name\" . \"_min\\\" id=\\\"$field->name\" . \"_min\\\"></td></tr>\\r\";\n\t\t\t\t\t\t$output .= \"<tr><td>$field->label max:</td><td><input type=\\\"text\\\" value=\\\"$field->search['value_max']\\\" name=\\\"$field->name\" . \"_max\\\" id=\\\"$field->name\" . \"_max\\\"></td></tr>\\r\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($cur_table->search[\"type\"] == \"individual\")\n\t\t\t$output .= \"</SELECT>\";\n\n\t\tif ($cur_table->search[\"type\"] == \"advanced\")\n\t\t\t$output .= \"</table>\\r\";\n\n\t}\n\n\t$output .= \"<br><br><input type=\\\"submit\\\" name=\\\"Submit\\\" id=\\\"submit\\\" value=\\\"Search\\\"><br><br>\"; //onClick='document.main_form.submit();\n\tif ($ajax)\n\t{\n\t\t$output = \"<a style=\\\"cursor:pointer;\\\" onClick=\\\"new Effect.toggle('$sdivid', 'slide');\\\">Search</a><div id=\\\"$sdivid\\\" style=\\\"display:$display;\\\">\" . $output;\n\t\t$output .= \"</div>\";\n\t}\nreturn $output;\n}", "public function search(Request $request) {\n\n //sidebar\n\n $tree = session()->get('tree');\n //sidebar\n\n\n $constraints = [\n\n 'port_types.type' => $request['port_type_name'],\n 'asset_type.la_nla_type' => $request['asset_type_name'],\n ];\n\n $userauths = $this->doSearchingQuery($constraints);\n $constraints['port_type_name'] = $request['port_type_name'];\n $constraints['asset_type_name'] = $request['asset_type_name'];\n return view('system-mgmt/port-asset/index', ['userauths' => $userauths, 'searchingVals' => $constraints,'tree'=>$tree]);\n }", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "public function action_search() {\n\t\t$productIds = explode('/', $this->request->param('id'));\n\t\t\n\t\t$products = ORM::factory('product')->where('product_id', 'in', $productIds)->find_all();\n\t\t\n\t\t$view = View::factory('product/search');\n\t\t$view->set('products', $products);\n\t\t$this->template->set('content', $view);\n\t}", "public function getName()\n {\n return 'oo_content_search';\n }", "public function __construct()\r\n {\r\n parent::__construct();\r\n \r\n // creates the form\r\n $this->form = new TQuickForm('form_search_Musica');\r\n $this->form->class = 'tform'; // change CSS class\r\n $this->form = new BootstrapFormWrapper($this->form);\r\n $this->form->style = 'display: table;width:100%'; // change style\r\n $this->form->setFormTitle('Musica');\r\n \r\n\r\n // create the form fields\r\n $muscodigo = new TEntry('muscodigo');\r\n $musnome = new TEntry('musnome');\r\n $musregistro = new TEntry('musregistro');\r\n\r\n\r\n // add the fields\r\n $this->form->addQuickField('Muscodigo', $muscodigo, 200 );\r\n $this->form->addQuickField('Musnome', $musnome, 200 );\r\n $this->form->addQuickField('Musregistro', $musregistro, 200 );\r\n\r\n \r\n // keep the form filled during navigation with session data\r\n $this->form->setData( TSession::getValue('Musica_filter_data') );\r\n \r\n // add the search form actions\r\n $this->form->addQuickAction(_t('Find'), new TAction(array($this, 'onSearch')), 'fa:search');\r\n $this->form->addQuickAction(_t('New'), new TAction(array('MusicaForm', 'onEdit')), 'bs:plus-sign green');\r\n \r\n // creates a Datagrid\r\n $this->datagrid = new TDataGrid;\r\n $this->datagrid = new BootstrapDatagridWrapper($this->datagrid);\r\n $this->datagrid->style = 'width: 100%';\r\n $this->datagrid->datatable = 'true';\r\n // $this->datagrid->enablePopover('Popover', 'Hi <b> {name} </b>');\r\n \r\n\r\n // creates the datagrid columns\r\n $column_check = new TDataGridColumn('check', '', 'center');\r\n $column_muscodigo = new TDataGridColumn('muscodigo', 'Muscodigo', 'right');\r\n $column_musnome = new TDataGridColumn('musnome', 'Musnome', 'left');\r\n $column_musregistro = new TDataGridColumn('musregistro', 'Musregistro', 'left');\r\n $column_musduracao = new TDataGridColumn('musduracao', 'Musduracao', 'left');\r\n $column_musdata = new TDataGridColumn('musdata', 'Musdata', 'left');\r\n $column_musautor = new TDataGridColumn('musautor', 'Musautor', 'left');\r\n $column_artcodigo = new TDataGridColumn('artcodigo', 'Artcodigo', 'right');\r\n $column_gencodigo = new TDataGridColumn('gencodigo', 'Gencodigo', 'right');\r\n $column_musfaixa = new TDataGridColumn('musfaixa', 'Musfaixa', 'right');\r\n\r\n\r\n // add the columns to the DataGrid\r\n $this->datagrid->addColumn($column_check);\r\n $this->datagrid->addColumn($column_muscodigo);\r\n $this->datagrid->addColumn($column_musnome);\r\n $this->datagrid->addColumn($column_musregistro);\r\n $this->datagrid->addColumn($column_musduracao);\r\n $this->datagrid->addColumn($column_musdata);\r\n $this->datagrid->addColumn($column_musautor);\r\n $this->datagrid->addColumn($column_artcodigo);\r\n $this->datagrid->addColumn($column_gencodigo);\r\n $this->datagrid->addColumn($column_musfaixa);\r\n\r\n \r\n // create EDIT action\r\n $action_edit = new TDataGridAction(array('MusicaForm', 'onEdit'));\r\n $action_edit->setUseButton(TRUE);\r\n $action_edit->setButtonClass('btn btn-default');\r\n $action_edit->setLabel(_t('Edit'));\r\n $action_edit->setImage('fa:pencil-square-o blue fa-lg');\r\n $action_edit->setField('muscodigo');\r\n $this->datagrid->addAction($action_edit);\r\n \r\n\r\n \r\n // create the datagrid model\r\n $this->datagrid->createModel();\r\n \r\n // creates the page navigation\r\n $this->pageNavigation = new TPageNavigation;\r\n $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));\r\n $this->pageNavigation->setWidth($this->datagrid->getWidth());\r\n \r\n $this->datagrid->disableDefaultClick();\r\n \r\n // put datagrid inside a form\r\n $this->formgrid = new TForm;\r\n $this->formgrid->add($this->datagrid);\r\n \r\n // creates the delete collection button\r\n $this->deleteButton = new TButton('delete_collection');\r\n $this->deleteButton->setAction(new TAction(array($this, 'onDeleteCollection')), AdiantiCoreTranslator::translate('Delete selected'));\r\n $this->deleteButton->setImage('fa:remove red');\r\n $this->formgrid->addField($this->deleteButton);\r\n \r\n $gridpack = new TVBox;\r\n $gridpack->style = 'width: 100%';\r\n $gridpack->add($this->formgrid);\r\n $gridpack->add($this->deleteButton)->style = 'background:whiteSmoke;border:1px solid #cccccc; padding: 3px;padding: 5px;';\r\n \r\n $this->transformCallback = array($this, 'onBeforeLoad');\r\n\r\n\r\n // vertical box container\r\n $container = new TVBox;\r\n $container->style = 'width: 90%';\r\n // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));\r\n $ $container->add(TPanelGroup::pack('Musícas Seleção', $this->form));\r\n $container->add(TPanelGroup::pack('', $this->datagrid, $this->pageNavigation));\r\n \r\n parent::add($container);\r\n }", "protected function grid()\n {\n $grid = new Grid(new Facility);\n\n $grid->id('施設ID')->sortable();\n $grid->facility_name('施設名')->sortable();\n $grid->type('タイプ')->sortable();\n $grid->room('部屋数')->sortable();\n $grid->floor('フロア数')->sortable();\n $grid->transaction_status('取引ステータス')->sortable();\n $grid->sales_status('運営状況')->sortable();\n $grid->postalcode('郵便番号')->sortable();\n $grid->prefecture('都道府県')->sortable();\n $grid->address('住所')->sortable();\n $grid->katagaki('方書')->sortable();\n $grid->tel('電話番号')->sortable();\n $grid->manager('支配人')->sortable();\n $grid->manager_phone_number('支配人 携帯電話')->sortable();\n // $grid->division1('担当事業部1')->sortable();\n // $grid->department1('部署1')->sortable();\n // $grid->staff1('担当者名1')->sortable();\n // $grid->staff_phone_number1('担当者携帯1')->sortable();\n // $grid->remarks1('備考1')->sortable();\n // $grid->division2('担当事業部2')->sortable();\n // $grid->department2('部署2')->sortable();\n // $grid->staff2('担当者名2')->sortable();\n // $grid->staff_phone_number2('担当者携帯2')->sortable();\n // $grid->remarks2('備考2')->sortable();\n // $grid->division3('担当事業部3')->sortable();\n // $grid->department3('部署3')->sortable();\n // $grid->staff3('担当者名3')->sortable();\n // $grid->staff_phone_number3('担当者携帯3')->sortable();\n // $grid->remarks3('備考3')->sortable();\n // $grid->customer_id('顧客ID')->sortable();\n // $grid->wifi('WiFi販売')->sortable();\n // $grid->fixtures('備品販売')->sortable();\n // $grid->tv('TV販売')->sortable();\n // $grid->tableware('食器販売')->sortable();\n // $grid->created_at('Created at');\n // $grid->updated_at('Updated at');\n\n $grid->actions(function ($actions) {\n // $actions->disableDelete();\n // $actions->disableEdit();\n $actions->disableView();\n });\n\n return $grid;\n }", "public function product_by_search()\n\t{\n\t\t$CI =& get_instance();\n\t\t$this->auth->check_admin_auth();\n\t\t$CI->load->library('lproduct');\n\t\t$product_id = $this->input->post('product_id');\t\t\n $content = $CI->lproduct->product_search_list($product_id);\n $sub_menu = array(\n\t\t\t\tarray('label'=> 'Manage Product', 'url' => 'Cproduct', 'class' =>'active'),\n\t\t\t\tarray('label'=> 'Add Product', 'url' => 'Cproduct/manage_product')\n\t\t\t);\n\t\t$this->template->full_admin_html_view($content,$sub_menu);\n\t}", "public function search(){\r\n\t\t//Test if the POST parameters exist. If they don't present the user with the\r\n\t\t//search controls/form\r\n\t\tif(!isset($_POST[\"search\"])){\r\n\t\t\t$this->template->display('search.html.php');\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::search($_POST[\"search\"]);\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\t$this->template->recipes = $recipes;\r\n\t\r\n\t\t$this->template->display('results.html.php');\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('replacement_id',$this->replacement_id);\n\t\t$criteria->with=array('itemForReplacement', 'itemStocksForRepl', 'itemReplaced', 'itemStocksReplaced');\n\t\t\n\t\t//$criteria->compare('item_for_replacement_id',$this->item_for_replacement_id);\n\t\t$criteria->compare('t.id',$this->id,true);\n\t\t$criteria->compare('itemForReplacement.item_description',$this->item_for_replacement_id, true);\n\t\t\n\t\t//$criteria->compare('item_stocks_for_repl_id',$this->item_stocks_for_repl_id);\n\t\t$criteria->compare('t.id',$this->id,true);\n\t\t$criteria->compare('itemStocksForRepl.item_stocks_serial_no',$this->item_stocks_for_repl_id, true);\n\t\t\n\t\t//$criteria->compare('item_replaced_id',$this->item_replaced_id);\n\t\t$criteria->compare('t.id',$this->id,true);\n\t\t$criteria->compare('itemReplaced.item_description',$this->item_replaced_id, true);\n\t\t\n\t\t//$criteria->compare('item_stocks_replaced_id',$this->item_stocks_replaced_id);\n\t\t$criteria->compare('t.id',$this->id,true);\n\t\t$criteria->compare('itemStocksReplaced.item_stocks_serial_no',$this->item_stocks_replaced_id, true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "function clients_select_setupSearch($ctlData,$data,$element_count) {\n\t## first we prepare the field selector entry\n\tif($ctlData['SEARCHABLE'] != 'no') {\n\t\tif($ctlData['IDENTIFIER'] == $data[$element_count]['identifier']) {\n\t\t\t$value_box_visibility = '';\n\t\t\t$field_selector = '<option label=\"'.$ctlData['NAME'].'\" value=\"'.$ctlData['IDENTIFIER'].'\" selected>'.$ctlData['NAME'].'</option>';\n\t\t} else {\n\t\t\t$value_box_visibility = 'style=\"display:none;\"';\n\t\t\t$field_selector = '<option label=\"'.$ctlData['NAME'].'\" value=\"'.$ctlData['IDENTIFIER'].'\">'.$ctlData['NAME'].'</option>';\t\t\n\t\t}\n\t\n\t\t## then we must tell the main programm the fucntionality for selecting our desired input form set\n\t\t$input_selector = \" else if (document.s.search#.value == '\".$ctlData['IDENTIFIER'].\"') { showElement_row#('row#_\".$ctlData['IDENTIFIER'].\"'); }\";\n\t\t\n\t\t## finally in the case, that we want to specify our own input element we can do this here\n\t\t$values = explode(',',$ctlData['LABELS']);\n\t\t$keys = explode(',',$ctlData['VALUES']);\n\t\t$count = count($values);\n\t\t\n\t\t## now preare the HTMl-Code for it\n\t\t$output = '';\n\t\t$output .= '<option label=\"select\" value=\"-1\">select</option>';\n\t\tfor($i = 0; $i < $count; $i++) {\n\t\t\tif($keys[$i] == $data[$element_count]['value']) {\n\t\t\t\t$output .= '<option label=\"'.$values[$i].'\" value=\"'.$keys[$i].'\" selected>'.$values[$i].'</option>';\n\t\t\t} else {\n\t\t\t\t$output .= '<option label=\"'.$values[$i].'\" value=\"'.$keys[$i].'\">'.$values[$i].'</option>';\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t$input_element = '<div id=\"row#_'.$ctlData['IDENTIFIER'].'\" '.$value_box_visibility.'><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td valign=\"middle\">\n\t\t\t\t\t\t\t<select name=\"operator#_'.$ctlData['IDENTIFIER'].'\"><option label=\"contains\" value=\"contains\">contains</option>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</td><td align=\"left\" valign=\"top\"><img src=\"../../interface/images/blank.gif\" alt=\"\" width=\"10\" height=\"24\" border=\"0\">\n\t\t\t\t\t\t\t</td><td align=\"left\" valign=\"middle\"><select name=\"search_value#_'.$ctlData['IDENTIFIER'].'\">'.$output.'</select></td></tr></table></div>';\n\t\n\t\t## finally we return the setting\n\t\treturn array('fieldSelector'=>$field_selector,'inputSelector'=>$input_selector,'inputElement'=>$input_element,'inputName'=>\"row#_\".$ctlData['IDENTIFIER']);\n\t}\n}", "function realstate_search_form($catId = null) {\n if ($catId!=null) {\n // We check if the category is the same as our plugin\n foreach($catId as $id) {\n \t\tif(osc_is_this_category('realstate_plugin', $id)) {\n $conn = getConnection() ;\n $data = $conn->osc_dbFetchResults('SELECT * FROM %st_item_house_property_type_attr', DB_TABLE_PREFIX);\n $p_type = array();\n foreach ($data as $d) {\n $p_type[$d['fk_c_locale_code']][$d['pk_i_id']] = $d['s_name'];\n }\n unset($data);\n\t \t\tinclude_once 'search_form.php';\n\t \t\tbreak;\n\t \t}\n }\n }\n}", "public function grid ($name, $fields = null,$paginator=null,$sorting=false, $itemPerPage=null, $search=null, $index=null)\r\n {\r\n\t\t\t//icon\r\n\t\t\t$icon = new Spt_View_Helper_Icon;\r\n\t\t\t\t\r\n\t\t\t// taking value of sort using Fron controller getRequest() method.\r\n\t\t\t$sort = Zend_Controller_Front::getInstance()->getRequest()->getParam('sort','DESC');\r\n\t\t\t\r\n\t\t\t//page\r\n\t\t\t$page = Zend_Controller_Front::getInstance()->getRequest()->getParam('page','1');\r\n\t\t\t\r\n\t\t\t// checking and handling sorting.\r\n\t\t\tif ($sort == 'ASC') {\r\n\t\t\t\t$sort = 'DESC';\r\n\t\t\t} \r\n\t\t\telse {\r\n\t\t\t\t$sort = \"ASC\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//echo $itemPerPage;\r\n\t\t\t//print_r($paginator->_itemCountPerPage*2);\r\n\t\t\t// start constructing the gird.\r\n\t\t\t$output=\"<div id='\".$name.\"'>\";\r\n $output .= \"<table class='data-table'><thead><tr>\";\r\n\r\n // this foreach loop display the column header in \"th\" tag.\r\n\t\t\tforeach ($fields as $key => $value) \r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$output .= \"<th>\";\r\n\r\n // check if sorting is true, if so add link to the fields headers\r\n\t\t\t\tif($sorting && $value != \"Aktiviti\" && $value != \"Bil\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$output .= \"<a href='\".$this->view->url(array('sort'=>$sort,'by'=>$key)).\"'>\".$value.\"</a>&nbsp;\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(Zend_Controller_Front::getInstance()->getRequest()->getParam('by') == $key)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(Zend_Controller_Front::getInstance()->getRequest()->getParam('sort') == \"ASC\")\r\n\t\t\t\t\t\t\t$output .= $icon->sort_asc();\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$output .= $icon->sort_desc();\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{\r\n\t\t\t\t\t$output .= $value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$output .= \"</th>\";\r\n\r\n }\r\n\r\n $output .= \"</tr></thead>\";\r\n\t\t\t\r\n\t\t\t//Highlight search results\r\n\t\t\t$pattern = \"(\" . quotemeta($search) . \")\";\r\n\t\t\t$replacement = '<span class=\"highlight\">\\\\1</span>';\r\n\r\n // constructing the body that contain the records in rows and columns.\r\n\t\t\t$output .=\"<tbody>\";\r\n\r\n\t\t\t// this loop display the actual data.\r\n\t\t\tif(count($paginator) > 0)\r\n\t\t\t{\r\n\t\t\t\t$int_page = 0+(($itemPerPage*$page)-$itemPerPage);\r\n\t\t\t\tforeach($paginator as $p) \r\n\t\t\t\t{\r\n\t\t\t\t\t$int_page++;\r\n\t\t\t\t\t$output.=\"<tr onMouseOver=\\\"javascript: this.className='contents_mouseover';\\\" onMouseOut=\\\"javascript: this.className='contents_mouseout';\\\">\";\r\n\t\t\t\t\t$output.=\"<td>\".$int_page.\"</td>\";\r\n\t\t\t\t\tforeach($p as $record) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$output .= \"<td>\".eregi_replace($pattern, $replacement, $record).\"</td>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//$output .= $search;\r\n\t\t\t\t\r\n\t\t\t\t\t$output.=\"<td>\".$icon->view('Papar Pengguna', '/admin/user/view/id/'.$p[$index]);\r\n\t\t\t\t\t$output.=\"&nbsp;\";\r\n\t\t\t\t\t$output.=$icon->edit('Kemaskini Pengguna', '/admin/user/edit/id/'.$p[$index]);\r\n\t\t\t\t\t$output.=\"&nbsp;\";\r\n\t\t\t\t\t$output.=$icon->delete('Hapus Pengguna', '/admin/user/delete/id/'.$p[$index]).\"</td>\";\r\n\t\t\t\t\t$output.=\"</tr>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$output.=\"<tr><td colspan='\".count($fields).\"' align=\\\"center\\\">Tiada Rekod</td></tr>\";\r\n\t\t\t}\r\n\t\t\t$output .= \"</tbody>\";\r\n\r\n\t\t\t// check if paginator is ture, if so then add paginator component to the table \"tfoot\".\r\n\t\t\tif($paginator) \r\n\t\t\t{\r\n\t\t\t\t$output .=\"<tfoot>\";\r\n\t\t\t\t$output .=\"<td align='right' colspan='\".count($fields).\"'>\";\r\n\t\t\t\t$output.= $this->view->paginationControl($paginator,'Sliding','p.phtml');\r\n\t\t\t\t$output .=\"</td></tfoot>\";\r\n\t\t\t}\r\n\t\t\t$output .=\"</table></div>\";\r\n\r\n\t\t\treturn $output;\r\n }", "public function search() {\n\t\t// Equivalent to $_GET['track_name']\n\t\t$track_name = request('track_name');\n\t\t$genre = request('genre');\n\n\t\t$track = new Track();\n\n\t\t$results = $track->select('tracks.name AS track_name', 'composer', 'genres.name AS genre');\n\n\t\tif( isset($track_name) && !empty($track_name) ) {\n\t\t\t$results = $results->where('tracks.name', 'LIKE' , '%' . $track_name .'%');\n\t\t}\n\t\tif( isset($genre) && !empty($genre) ) {\n\t\t\t$results = $results->where('tracks.genre_id', '=' , $genre);\n\t\t}\n\t\t$results = $results->leftJoin('genres', 'tracks.genre_id', '=', 'genres.genre_id');\n\n\n\t\treturn view('search_results', [\n\t\t\t'tracks' => $results->get()\n\t\t]);\n\n\t}", "protected function grid()\n {\n $grid = new Grid(new BrandCooperation);\n\n $grid->sort('排序')->editable()->sortable();\n $grid->name('品牌名称');\n $grid->is_show('是否显示')->editable('select', [1 => '显示', 0 => '隐藏']);\n $grid->created_at('添加时间')->sortable();\n\n// $grid->actions(function ($actions) {\n// $actions->disableView(); // 禁用查看\n// });\n\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n // 查询\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->like('name', '品牌名称');\n $filter->equal('is_show', '显隐')->radio([1 => '显示', 0 => '隐藏']);\n });\n\n return $grid;\n }", "function search_job()\r\n{\r\n\tglobal $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;\r\n \r\n /*\r\n\t// GET JOB FIELDS\r\n\t$jobfields = $database->database_query(\"SELECT jobfield_id, jobfield_type, jobfield_options FROM se_jobfields WHERE jobfield_type<>'5'\");\r\n\t$jobvalue_query = \"se_jobs.job_title LIKE '%$search_text%' OR se_jobs.job_body LIKE '%$search_text%'\";\r\n \r\n\t// LOOP OVER JOB FIELDS\r\n\twhile($jobfield_info = $database->database_fetch_assoc($jobfields)) {\r\n \r\n\t // TEXT FIELD OR TEXTAREA\r\n\t if($jobfield_info[jobfield_type] == 1 | $jobfield_info[jobfield_type] == 2) {\r\n\t if($jobvalue_query != \"\") { $jobvalue_query .= \" OR \"; }\r\n\t $jobvalue_query .= \"se_jobvalues.jobvalue_\".$jobfield_info[jobfield_id].\" LIKE '%$search_text%'\";\r\n\r\n\t // RADIO OR SELECT BOX\r\n\t } elseif($jobfield_info[jobfield_type] == 3 | $jobfield_info[jobfield_type] == 4) {\r\n\t // LOOP OVER FIELD OPTIONS\r\n\t $options = explode(\"<~!~>\", $jobfield_info[jobfield_options]);\r\n\t for($i=0,$max=count($options);$i<$max;$i++) {\r\n\t if(str_replace(\" \", \"\", $options[$i]) != \"\") {\r\n\t $option = explode(\"<!>\", $options[$i]);\r\n\t $option_id = $option[0];\r\n\t $option_label = $option[1];\r\n\t if(strpos($option_label, $search_text)) {\r\n\t if($jobvalue_query != \"\") { $jobvalue_query .= \" OR \"; }\r\n\t $jobvalue_query .= \"se_jobvalues.jobvalue_\".$jobfield_info[jobfield_id].\"='$option_id'\";\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t}\r\n */\r\n \r\n /*\r\n $field = new se_field(\"job\");\r\n $text_columns = $field->field_index(TRUE);\r\n \r\n if( !is_array($text_columns) )\r\n $text_columns = array();\r\n */\r\n \r\n\t// CONSTRUCT QUERY\r\n $sql = \"\r\n SELECT\r\n se_jobs.job_id,\r\n se_jobs.job_title,\r\n se_jobs.job_body,\r\n se_jobs.job_photo,\r\n se_users.user_id,\r\n se_users.user_username,\r\n se_users.user_photo,\r\n se_users.user_fname,\r\n se_users.user_lname\r\n FROM\r\n se_jobs\r\n LEFT JOIN\r\n se_users\r\n ON se_jobs.job_user_id=se_users.user_id\r\n LEFT JOIN\r\n se_levels\r\n ON se_users.user_level_id=se_levels.level_id\r\n LEFT JOIN\r\n se_jobvalues\r\n ON se_jobs.job_id=se_jobvalues.jobvalue_job_id\r\n WHERE\r\n (se_jobs.job_search=1 || se_levels.level_job_search=0)\r\n \";\r\n \r\n /*\r\n $sql .= \" && (MATCH (`job_title`, `job_body`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\r\n \r\n if( !empty($text_columns) )\r\n $sql .= \" || MATCH (`\".join(\"`, `\", $text_columns).\"`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\r\n \r\n $sql .= \")\";\r\n */\r\n \r\n $text_columns[] = 'job_title';\r\n $text_columns[] = 'job_body';\r\n $sql .= \" && MATCH (`\".join(\"`, `\", $text_columns).\"`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\r\n \r\n \r\n\t// GET TOTAL ENTRIES\r\n $sql2 = $sql . \" LIMIT 201\";\r\n $resource = $database->database_query($sql2) or die($database->database_error().\" <b>SQL was: </b>{$sql2}\");\r\n\t$total_entries = $database->database_num_rows($resource);\r\n\r\n\t// IF NOT TOTAL ONLY\r\n\tif( $t==\"job\" )\r\n {\r\n\t // MAKE JOB PAGES\r\n\t $start = ($p - 1) * $results_per_page;\r\n\t $limit = $results_per_page+1;\r\n \r\n\t // SEARCH JOBS\r\n $sql3 = $sql . \" ORDER BY job_id DESC LIMIT {$start}, {$limit}\";\r\n $resource = $database->database_query($sql3) or die($database->database_error().\" <b>SQL was: </b>{$sql3}\");\r\n \r\n\t while( $job_info=$database->database_fetch_assoc($resource) )\r\n {\r\n\t // CREATE AN OBJECT FOR AUTHOR\r\n\t $profile = new se_user();\r\n\t $profile->user_info['user_id'] = $job_info['user_id'];\r\n\t $profile->user_info['user_username'] = $job_info['user_username'];\r\n\t $profile->user_info['user_photo'] = $job_info['user_photo'];\r\n\t $profile->user_info['user_fname'] = $job_info['user_fname'];\r\n\t $profile->user_info['user_lname'] = $job_info['user_lname'];\r\n\t $profile->user_displayname();\r\n \r\n\t // IF EMPTY TITLE\r\n\t if( !trim($job_info['job_title']) )\r\n $job_info['job_title'] = SE_Language::get(589);\r\n \r\n $job_info['job_body'] = cleanHTML($job_info['job_body'], '');\r\n \r\n\t // IF BODY IS LONG\r\n\t if( strlen($job_info['job_body'])>150 )\r\n $job_info['job_body'] = substr($job_info['job_body'], 0, 147).\"...\";\r\n \r\n\t // SET THUMBNAIL, IF AVAILABLE\r\n $thumb_path = NULL;\r\n if( !empty($job_info['job_photo']) )\r\n {\r\n $job_dir = se_job::job_dir($job_info['job_id']);\r\n $job_photo = $job_info['job_photo'];\r\n $job_thumb = substr($job_photo, 0, strrpos($job_photo, \".\")).\"_thumb\".substr($job_photo, strrpos($job_photo, \".\"));\r\n \r\n if( file_exists($job_dir.$job_thumb) )\r\n $thumb_path = $job_dir.$job_thumb;\r\n elseif( file_exists($job_dir.$job_photo) )\r\n $thumb_path = $job_dir.$job_photo;\r\n }\r\n \r\n if( !$thumb_path )\r\n $thumb_path = \"./images/icons/file_big.gif\";\r\n \r\n \r\n $result_url = $url->url_create('job', $job_info['user_username'], $job_info['job_id']);\r\n $result_name = 6400137;\r\n $result_desc = 6400138;\r\n \r\n \r\n\t $results[] = array(\r\n 'result_url' => $result_url,\r\n\t\t\t\t'result_icon' => $thumb_path,\r\n\t\t\t\t'result_name' => $result_name,\r\n\t\t\t\t'result_name_1' => $job_info['job_title'],\r\n\t\t\t\t'result_desc' => $result_desc,\r\n\t\t\t\t'result_desc_1' => $url->url_create('profile', $job_info['user_username']),\r\n\t\t\t\t'result_desc_2' => $profile->user_displayname,\r\n\t\t\t\t'result_desc_3' => $job_info['job_body']\r\n );\r\n \r\n unset($profile);\r\n\t }\r\n \r\n\t // SET TOTAL RESULTS\r\n\t $total_results = $total_entries;\r\n\t}\r\n\r\n\t// SET ARRAY VALUES\r\n\tSE_Language::_preload_multi(6400137, 6400138, 6400139);\r\n\tif( $total_entries>200 )\r\n $total_entries = \"200+\";\r\n \r\n\t$search_objects[] = array(\r\n 'search_type' => 'job',\r\n 'search_lang' => 6400139,\r\n 'search_total' => $total_entries\r\n );\r\n}", "function recherche_form($form, &$form_state, $args) {\n $form['f'] = array(\n '#type' => 'fieldset',\n '#title' => t('Recherche tous azimuts'),\n '#attributes' => array('class' => array('sessions','recherchestage', 'collapsible', 'collapsed')),\n );\n\n $form['f']['comodu'] = array(\n '#type' => 'textfield',\n '#title' => t('Rechercher un STAGE'),\n '#description' => t('Saisissez quelques lettres du titre (ou chiffres du numéro) pour rechercher un stage'),\n '#autocomplete_path' => 'autocomp/stage',\n '#element_validate' => array('element_validate_integer_positive'),\n '#prefix' => '<div class=\"ajaxform inline\">',\n '#suffix' => '</div>',\n '#size' => 80, \n );\n $form['f']['submit'] = array(\n '#type' => 'submit',\n '#value' => 'Envoyer,',\n '#submit' => array('recherche_stage_form_submit'),\n );\n\n $form['f']['coresp'] = array(\n '#type' => 'textfield',\n '#title' => t('Rechercher un FORMATEUR'),\n '#description' => t('Saisissez quelques lettres du nom pour rechercher un formateur'),\n '#autocomplete_path' => 'autocomp/formateur2',\n '#element_validate' => array('element_validate_integer_positive'),\n '#prefix' => '<div class=\"ajaxform inline\">',\n '#suffix' => '</div>',\n '#size' => 80, \n );\n $form['f']['submit2'] = array(\n '#type' => 'submit',\n '#value' => 'Envoyer.',\n '#submit' => array('recherche_formateur_form_submit'),\n );\n\n if (user_access('gest_etablissements gaiabb')) {\n $etab_add_icon = array(\n 'path' => drupal_get_path('module', 'gaiabb') . '/images/building_add.png',\n 'alt' => 'etab_add',\n 'title' => t('Ajouter un établissement manquant.'),\n 'attributes' => array('class' => 'some-img', 'id' => 'my-img'));\n $form['f']['lieu'] = array(\n '#markup' => t('<p>Ajouter un lieu&nbsp;').l(theme('image',$etab_add_icon),'etablissement/',\n array('attributes' => array('class' => 'anchor-class'), 'html' => TRUE)) . '</p>',\n );\n };\n return $form;\n}", "private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function searchForm()\n {\n $dimensionsOptions = $this->GoogleApi->getDimensionsOptions();\n $operatorOptions = $this->GoogleApi->getOperatorOptions();\n $this->set(\n compact(\n 'dimensionsOptions',\n 'operatorOptions'\n )\n );\n }", "function sopac_search_catalog_submit($form, &$form_state) {\n $locum = sopac_get_locum('locum');\n $locum_cfg = $locum->locum_config;\n\n $search_query = trim($form_state['values']['search_query']);\n if (!$search_query) {\n $search_query = '*';\n }\n if(strstr($search_query,'+')){\n $search_query = urlencode($search_query);\n }\n $search_type = $form_state['values']['search_type'];\n $search_type_arr = explode('_', $search_type);\n if ($search_type_arr[0] == 'cat') {\n $search_type = $search_type_arr[1];\n $search_fmt = $search_type_arr[2];\n\n // Material / Format types\n if ($search_fmt) {\n if ($search_fmt != 'all') {\n $uris['search_format'] = $locum->csv_parser($locum_cfg['format_groups'][$search_fmt], '|');\n }\n }\n elseif ($form_state['values']['search_format']) {\n if (is_array($form_state['values']['search_format'])) {\n $uris['search_format'] = trim(implode('|', $form_state['values']['search_format']));\n }\n else {\n $uris['search_format'] = $form_state['values']['search_format'];\n }\n }\n\n // Location selections overrule collection selections and act as\n // a filter if they are in a selection colection.\n if ($form_state['values']['collection']) {\n $locations = array();\n $uris['collection'] = trim(implode('|', $form_state['values']['collection']));\n foreach ($form_state['values']['collection'] as $collection) {\n $collection_arr = $locum->csv_parser($locum_cfg['collections'][$collection]);\n if ($form_state['values']['location']) {\n $valid_locs = array_intersect($form_state['values']['location'], $collection_arr);\n if (count($valid_locs)) {\n $locations = array_merge($locations, $valid_locs);\n }\n else {\n $locations = array_merge($locations, $collection_arr);\n }\n }\n else {\n $locations = array_merge($locations, $collection_arr);\n }\n }\n if ($form_state['values']['location']) {\n $locations = array_merge($locations, array_diff($form_state['values']['location'], $locations));\n }\n }\n elseif ($form_state['values']['location']) {\n $locations = $form_state['values']['location'];\n }\n if (count($locations)) {\n $uris['location'] = trim(implode('|', $locations));\n }\n\n // Sort variable\n if ($form_state['values']['sort']) {\n $uris['sort'] = $form_state['values']['sort'];\n }\n\n // Age Group variable\n if ($form_state['values']['age_group']) {\n $uris['age'] = $form_state['values']['age_group'];\n }\n\n // Limit to Available\n if ($form_state['values']['limit_avail']) {\n $uris['limit_avail'] = $form_state['values']['limit_avail'];\n }\n/*\n if ($form_state['values']['limit_avail'] || $form_state['values']['limit']) {\n if (variable_get('sopac_multi_branch_enable', 0)) {\n if ($form_state['values']['limit_avail'] && $form_state['values']['limit']) {\n $uris['limit_avail'] = $form_state['values']['limit_avail'];\n }\n }\n else {\n $uris['limit_avail'] = 'any';\n }\n }\n*/\n\n // Publisher Search\n if ($form_state['values']['publisher']) {\n //$uris['pub'] = trim($form_state['values']['publisher']);\n $search_query .= \" @publisher \".trim($form_state['values']['publisher']);\n }\n\n // Publication date ranges\n if ($form_state['values']['pub_year_start'] || $form_state['values']['pub_year_end']) {\n $uris['facet_year'] = trim($form_state['values']['pub_year_start']) . '-' .\n trim($form_state['values']['pub_year_end']);\n }\n $search_url = variable_get('sopac_url_prefix', 'cat/seek') . '/search/' . $search_type . '/' . $search_query;\n }\n elseif ($search_type_arr[0] == 'web') {\n switch ($search_type_arr[1]) {\n case 'local':\n $search_url = 'search/node/' . utf8_urldecode($search_query);\n break;\n case 'google':\n $search_url = 'http://www.google.com/search?hl=en&q=' . utf8_urldecode($search_query);\n break;\n }\n }\n\n drupal_goto($search_url, $uris);\n}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('InfectBackendBundle:Species')->findAll();\n\n return $this->render('InfectBackendBundle:Species:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "protected function grid()\n {\n return Admin::grid(Root::class, function (Grid $grid) {\n\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n $filter->like('name')->placeholder('请输入查询词根');\n\n // 在这里添加字段过滤器\n // $filter->like('word');\n // $filter->equal('word_id')->placeholder('请输入查询单词');\n\n });\n\n $grid->id('ID')->sortable();\n $grid->name('词根');\n //$grid->types()->options()->select([0 => '前缀', 1 => '后缀', 2 => '词根']);\n $grid->types()->editable('select', [0 => '前缀', 1 => '后缀', 2 => '词根']); //可编辑\n $grid->description('描述');\n //$grid->created_at();\n //$grid->updated_at();\n });\n }", "public function search() {\n include 'views/search-form.php';\n }", "public function searchIndex()\n {\n try {\n $ingredient = Ingredient::all();\n $origine = Origine::all();\n $plat = Plat::paginate(10);\n return view('search', compact('origine', 'ingredient', 'plat'));\n } catch (Exception $error) {\n return redirect()->route('admin')->with('danger', 'Une erreur est survenue : ' . $error);\n }\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria();\n $criteria->with = array('snmpTemplate');\n $criteria->compare('t.id', $this->id);\n $criteria->compare('t.name', $this->name, true);\n $criteria->compare('t.type', $this->type, true);\n $criteria->compare('t.mac', $this->mac, true);\n $criteria->compare('t.ip', $this->ip, true);\n $criteria->compare('t.snmp_template_id', $this->snmp_template_id);\n $criteria->compare('snmp_template.name', $this->snmpTemplate, true);\n $criteria->compare('host_face_id', $this->host_face_id);\n\n return new CActiveDataProvider('Host', array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'attributes' => array(\n 'snmpTemplate' => array(\n 'asc' => 'snmpTemplate.name',\n 'desc' => 'snmpTemplate.name DESC',\n ),\n '*',\n ),\n ),\n ));\n }", "function _esf_tc_helper_custom_search_block($path) {\n $form = drupal_get_form('esf_tc_custom_partner_search_form');\n return drupal_render($form);\n}", "public function searching(){\n\t\t\t$cari = $this->input->post('cari');\n\t\t\t$data['cari'] = $cari;\n\t\t\t$data['searching'] = $this->Artikel_model->searching($cari);\n\t\t\t$this->load->view('front/proses/searching',$data);\n\t\t}", "function searchItem(Request $request){\n $shoes = Shoe::where('name', 'LIKE', '%'.$request->search.'%')->paginate(6);\n return view('justdu-it.home')->with('shoes', $shoes);\n }", "public function searchQueryDataProvider() {}", "protected function grid()\n {\n $grid = new Grid(new City());\n\n $grid->column('id', __('Id'));\n $grid->column('sort', __('Sort'));\n $grid->column('name', __('Name'));\n $grid->column('slug', __('Slug'));\n $grid->column('description', __('field.description'))->display(function ($item) {\n return mb_strimwidth($item, 0, 500, '...');\n });\n $grid->column('files', __('field.images'))->display(function () {\n $images = array();\n foreach ($this->files as $file) {\n array_push($images, preg_replace(\"/images\\//\", \"images/small.\", $file->file));\n }\n return $images;\n })->carousel(150, 100);\n\n return $grid;\n }", "function search()\n\t{}", "function search()\n\t{}", "protected static function get_control_fixedspecies($auth, $args, $tabAlias, $options) {\n unset($args['extra_list_id']);\n $options['rowInclusionCheck']='hasData';\n $options['id']='fixed-list';\n return parent::get_control_species($auth, $args, $tabAlias, $options);\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('realty_id',$this->realty_id);\n\t\t$criteria->compare('parcel_size',$this->parcel_size);\n\t\t$criteria->compare('parcel_size_unit',$this->parcel_size_unit,true);\n\t\t$criteria->compare('living_space_size',$this->living_space_size);\n\t\t$criteria->compare('total_space_size',$this->total_space_size);\n\t\t$criteria->compare('space_size_units',$this->space_size_units,true);\n\t\t$criteria->compare('number_of_floors',$this->number_of_floors);\n\t\t$criteria->compare('space_conditions',$this->space_conditions,true);\n\t\t$criteria->compare('newly_built',$this->newly_built);\n\t\t$criteria->compare('floor',$this->floor);\n\t\t$criteria->compare('rooms',$this->rooms);\n\t\t$criteria->compare('bedrooms',$this->bedrooms);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search(){}", "public function searchSubContent()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set branch to search to a variable.\n $branch = $this->getSearchBranch();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields, $branch);\n }", "public function searchableAs(): string\n {\n return 'controlpanel_index';\n }", "public function hookAdminItemsSearch()\n {\n $formSelect = get_view()->formSelect(\n 'zotero_item_type', null, null,\n label_table_options(self::getZoteroItemTypes())\n );\n echo '\n <div class=\"field\">\n <div class=\"two columns alpha\">\n <label for=\"zotero_item_type\">Zotero Item Type</label>\n </div>\n <div class=\"five columns omega inputs\">';\n echo $formSelect;\n echo '\n </div>\n </div>';\n }", "function agsg_shortcode_render_list_page()\n{\n global $shortcode_page;\n global $shortcode_list_table;\n //Create an instance of our package class...\n\n //Fetch, prepare, sort, and filter our data...\n $shortcode_list_table->prepare_items();\n ?>\n <!-- serach form -->\n <div class=\"search-container\">\n <form method=\"post\">\n <input type=\"hidden\" name=\"page\" value=\"<?php echo $shortcode_page ?>\"/>\n <?php $shortcode_list_table->search_box('Search', $shortcode_page); ?>\n <div class=\"check-box-container\">\n <?php\n $cols = $shortcode_list_table->get_search_cols();\n $col_ks = array_keys($cols);\n echo \"<span class='search-by'><strong>Search By:</strong></span>\";\n for ($i = 0; $i < count($cols); $i++) {\n $col_k = $col_ks[$i];\n echo \"<label for='searchBy-\" . $col_ks[$i] . \"'> $cols[$col_k] </label>\n <input id='searchBy-\" . $col_ks[$i] . \"' type='checkbox' name='searchBy[]' value='\" . $col_ks[$i] . \"' />\";\n }\n echo \"<span class='search-by'><strong>For:</strong></span>\";\n ?>\n </div>\n </form>\n </div>\n <div class=\"search-response\"><?php\n if (isset($_POST['s']) && !isset($_POST['searchBy'])) {\n echo '<p class=\"error form-invalid\">No columns selected, please select a column.</p>';\n } else if (isset($_POST['s']) && $_POST['s'] === '') {\n echo '<p class=\"error form-invalid\">Please enter a search phrase to look for.</p>';\n }\n ?></div>\n <!-- <div class=\"search-response\">-->\n <!-- --><?php // @todo - Cannot figure out why this will not show columns when bottom labels are clicked\n// if(isset($_POST['s']) ){\n// if(isset($_POST['searchBy'])){\n// $s = $_POST['s'];\n// $s_msg = \"Search results for query $s in columns:\";\n// $by = $_POST['searchBy'];\n// for($i = 0; $i < count($by); $i++){\n// if($by[$i] == 'tag'){\n// $col = 'Shortcode Name';\n// }\n// if($i === 0){\n// $s_msg .= ' '.ucfirst($col);\n// }\n// else{\n// $s_msg .= ' / '.ucfirst($col);\n// }\n// }\n// }else{\n// $s_msg = 'No columns selected for search. All shortcodes returned.';\n// }\n// echo $s_msg;\n// }\n//\n ?>\n <!-- </div>-->\n <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions -->\n <form id=\"shortcodes_filter\" method=\"get\">\n <!-- For plugins, we also need to ensure that the form posts back to our current page -->\n <input type=\"hidden\" name=\"page\" value=\"<?php echo $_REQUEST['page'] ?>\"/>\n <?php\n $shortcode_list_table->display();\n ?>\n </form>\n<?php\n}", "public function indexAction(){\n\n // build select\n $db = Zend_Registry::get('dbAdapter');\n\n $select = $db\n ->select()\n ->from(array('r' => 'regions'), array(\n 'ID' => 'r.id',\n __b('Land') => 'r.region1',\n __b('Regierungsbezirk')=> 'r.region2',\n __b('Region') => 'r.region3',\n __b('URL Restaurant') => 'r.restUrl',\n __b('URL Catering') => 'r.caterUrl',\n __b('URL Großhandel') => 'r.greatUrl',\n __b('SEO Text') => \"IF(ISNULL(r.seoText) OR r.seoText='', 0, 1)\",\n ))\n ->order('r.id');\n \n // build grid\n $grid = Default_Helper::getTableGrid('regions');\n $grid->setExport(array());\n $grid->setPagination(50);\n\n // update some columns\n $grid->setSource(new Bvb_Grid_Source_Zend_Select($select));\n $grid->updateColumn(__b('SEO Text'), array('class' => 'seo-pupup-link', 'callback' => array('function' => 'intToYesNoIcon', 'params' => array('{{' . __b('SEO Text') . '}}'))));\n\n\n // add filters\n $filters = new Bvb_Grid_Filters();\n \n $filters->addFilter(__b('Land'))\n ->addFilter(__b('Regierungsbezirk'))\n ->addFilter(__b('Region'))\n ->addFilter(__b('SEO Text'), array('values' => array('' => __b('Alle'), '1' => __b('Ja'), '0' => __b('Nein'))));\n $grid->addFilters($filters);\n\n //deploy grid to view\n $this->view->grid = $grid->deploy();\n }", "public function search()\n\t{\n\t\tif (Request::get('search-groups'))\n\t\t{\n\t\t\t$q = Request::get('search-groups');\n\t\t\t$searchTerms = explode(' ', $q);\n\t\t\t$query = DB::table('groups');\n\n\t\t\tforeach($searchTerms as $term)\n\t\t\t{\n\t\t\t\t$query->where('name', 'LIKE', '%' . $term . '%');\n\t\t\t}\n\n\t\t\t$results = $query->get();\n\n\t\t\t// Return results to posts.search view\n\t\t\treturn view('groups.search', ['results' => $results]);\n\t\t}\n\n\t\treturn view('groups.search');\n\t}", "function ciniki_petadoptions_animalFieldSearch($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'field'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Field'),\n 'start_needle'=>array('required'=>'yes', 'blank'=>'yes', 'name'=>'Search String'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'petadoptions', 'private', 'checkAccess');\n $rc = ciniki_petadoptions_checkAccess($ciniki, $args['tnid'], 'ciniki.petadoptions.animalFieldSearch');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the list of field values\n //\n if( in_array($args['field'], array('category', 'breed', 'sex', 'years', 'color', 'size')) ) {\n $strsql = \"SELECT DISTINCT \" . $args['field'] . \" AS name \"\n . \"FROM ciniki_petadoption_animals \"\n . \"WHERE ciniki_petadoption_animals.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND \" . $args['field'] . \" <> '' \"\n . \"ORDER BY name \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.petadoptions', array(\n array('container'=>'results', 'fname'=>'name', 'fields'=>array('name')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['results']) ) {\n return array('stat'=>'ok', 'results'=>array());\n } \n\n return array('stat'=>'ok', 'results'=>$rc['results']);\n }\n\n return array('stat'=>'ok', 'results'=>array());\n}", "function rawSearchOptions() {\n $tab = parent::rawSearchOptions();\n\n $tab[] = [\n 'id' => '2',\n 'table' => $this->getTable(),\n 'field' => 'id',\n 'name' => __('ID'),\n 'massiveaction' => false,\n 'datatype' => 'number'\n ];\n\n $tab = array_merge($tab, Location::rawSearchOptionsToAdd());\n\n $tab[] = [\n 'id' => '16',\n 'table' => $this->getTable(),\n 'field' => 'comment',\n 'name' => __('Comments'),\n 'datatype' => 'text'\n ];\n\n $tab[] = [\n 'id' => '62',\n 'table' => 'glpi_softwarecategories',\n 'field' => 'completename',\n 'name' => __('Category'),\n 'datatype' => 'dropdown'\n ];\n\n $tab[] = [\n 'id' => '19',\n 'table' => $this->getTable(),\n 'field' => 'date_mod',\n 'name' => __('Last update'),\n 'datatype' => 'datetime',\n 'massiveaction' => false\n ];\n\n $tab[] = [\n 'id' => '121',\n 'table' => $this->getTable(),\n 'field' => 'date_creation',\n 'name' => __('Creation date'),\n 'datatype' => 'datetime',\n 'massiveaction' => false\n ];\n\n $tab[] = [\n 'id' => '23',\n 'table' => 'glpi_manufacturers',\n 'field' => 'name',\n 'name' => __('Publisher'),\n 'datatype' => 'dropdown'\n ];\n\n $tab[] = [\n 'id' => '24',\n 'table' => 'glpi_users',\n 'field' => 'name',\n 'linkfield' => 'users_id_tech',\n 'name' => __('Technician in charge of the software'),\n 'datatype' => 'dropdown',\n 'right' => 'own_ticket'\n ];\n\n $tab[] = [\n 'id' => '49',\n 'table' => 'glpi_groups',\n 'field' => 'completename',\n 'linkfield' => 'groups_id_tech',\n 'name' => __('Group in charge of the software'),\n 'condition' => ['is_assign' => 1],\n 'datatype' => 'dropdown'\n ];\n\n $tab[] = [\n 'id' => '64',\n 'table' => $this->getTable(),\n 'field' => 'template_name',\n 'name' => __('Template name'),\n 'datatype' => 'text',\n 'massiveaction' => false,\n 'nosearch' => true,\n 'nodisplay' => true,\n 'autocomplete' => true,\n ];\n\n $tab[] = [\n 'id' => '70',\n 'table' => 'glpi_users',\n 'field' => 'name',\n 'name' => __('User'),\n 'datatype' => 'dropdown',\n 'right' => 'all'\n ];\n\n $tab[] = [\n 'id' => '71',\n 'table' => 'glpi_groups',\n 'field' => 'completename',\n 'name' => __('Group'),\n 'condition' => ['is_itemgroup' => 1],\n 'datatype' => 'dropdown'\n ];\n\n $tab[] = [\n 'id' => '61',\n 'table' => $this->getTable(),\n 'field' => 'is_helpdesk_visible',\n 'name' => __('Associable to a ticket'),\n 'datatype' => 'bool'\n ];\n\n $tab[] = [\n 'id' => '63',\n 'table' => $this->getTable(),\n 'field' => 'is_valid',\n //TRANS: Indicator to know is all licenses of the software are valids\n 'name' => __('Valid licenses'),\n 'datatype' => 'bool'\n ];\n\n $tab[] = [\n 'id' => '80',\n 'table' => 'glpi_entities',\n 'field' => 'completename',\n 'name' => __('Entity'),\n 'massiveaction' => false,\n 'datatype' => 'dropdown'\n ];\n\n $newtab = [\n 'id' => '72',\n 'table' => 'glpi_items_softwareversions',\n 'field' => 'id',\n 'name' => _x('quantity', 'Number of installations'),\n 'forcegroupby' => true,\n 'usehaving' => true,\n 'datatype' => 'count',\n 'nometa' => true,\n 'massiveaction' => false,\n 'joinparams' => [\n 'jointype' => 'child',\n 'beforejoin' => [\n 'table' => 'glpi_softwareversions',\n 'joinparams' => ['jointype' => 'child'],\n ],\n 'condition' => \"AND NEWTABLE.`is_deleted_item` = 0\n AND NEWTABLE.`is_deleted` = 0\n AND NEWTABLE.`is_template_item` = 0\",\n ]\n ];\n\n if (Session::getLoginUserID()) {\n $newtab['joinparams']['condition'] .= getEntitiesRestrictRequest(' AND', 'NEWTABLE');\n }\n $tab[] = $newtab;\n\n $tab = array_merge($tab, SoftwareLicense::rawSearchOptionsToAdd());\n\n $name = _n('Version', 'Versions', Session::getPluralNumber());\n $tab[] = [\n 'id' => 'versions',\n 'name' => $name\n ];\n\n $tab[] = [\n 'id' => '5',\n 'table' => 'glpi_softwareversions',\n 'field' => 'name',\n 'name' => __('Name'),\n 'forcegroupby' => true,\n 'massiveaction' => false,\n 'displaywith' => ['softwares_id'],\n 'joinparams' => [\n 'jointype' => 'child'\n ],\n 'datatype' => 'dropdown'\n ];\n\n $tab[] = [\n 'id' => '31',\n 'table' => 'glpi_states',\n 'field' => 'completename',\n 'name' => __('Status'),\n 'datatype' => 'dropdown',\n 'forcegroupby' => true,\n 'massiveaction' => false,\n 'joinparams' => [\n 'beforejoin' => [\n 'table' => 'glpi_softwareversions',\n 'joinparams' => [\n 'jointype' => 'child'\n ]\n ]\n ]\n ];\n\n $tab[] = [\n 'id' => '170',\n 'table' => 'glpi_softwareversions',\n 'field' => 'comment',\n 'name' => __('Comments'),\n 'forcegroupby' => true,\n 'datatype' => 'text',\n 'massiveaction' => false,\n 'joinparams' => [\n 'jointype' => 'child'\n ]\n ];\n\n $tab[] = [\n 'id' => '4',\n 'table' => 'glpi_operatingsystems',\n 'field' => 'name',\n 'datatype' => 'dropdown',\n 'name' => __('Operating system'),\n 'forcegroupby' => true,\n 'joinparams' => [\n 'beforejoin' => [\n 'table' => 'glpi_softwareversions',\n 'joinparams' => [\n 'jointype' => 'child'\n ]\n ]\n ]\n ];\n\n // add objectlock search options\n $tab = array_merge($tab, ObjectLock::rawSearchOptionsToAdd(get_class($this)));\n\n $tab = array_merge($tab, Notepad::rawSearchOptionsToAdd());\n\n return $tab;\n }", "public function searchDialog()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\t\t$criteria->select = 'DISTINCT pegawai_id, gelardepan, nama_pegawai, gelarbelakang_nama, tempatlahir_pegawai, tgl_lahirpegawai, alamat_pegawai, jeniskelamin, nomorindukpegawai';\n\t\t\tif(!empty($this->ruangan_id)){\n\t\t\t\t$criteria->addCondition(\"ruangan_id = \".$this->ruangan_id); \t\t\t\n\t\t\t}\n\t\t$criteria->compare('LOWER(ruangan_nama)',strtolower($this->ruangan_nama),true);\n\t\tif(!empty($this->pegawai_id)){\n\t\t\t$criteria->addCondition(\"pegawai_id = \".$this->pegawai_id); \t\t\t\n\t\t}\n\t\t$criteria->compare('LOWER(gelardepan)',strtolower($this->gelardepan),true);\n\t\t$criteria->compare('LOWER(nama_pegawai)',strtolower($this->nama_pegawai),true);\n\t\t$criteria->compare('LOWER(gelarbelakang_nama)',strtolower($this->gelarbelakang_nama),true);\n\t\t$criteria->compare('LOWER(jeniskelamin)',strtolower($this->jeniskelamin),true);\n\t\t$criteria->compare('LOWER(nama_keluarga)',strtolower($this->nama_keluarga),true);\n\t\t$criteria->compare('LOWER(tempatlahir_pegawai)',strtolower($this->tempatlahir_pegawai),true);\n\t\t$criteria->compare('LOWER(tgl_lahirpegawai)',strtolower($this->tgl_lahirpegawai),true);\n\t\t$criteria->compare('LOWER(alamat_pegawai)',strtolower($this->alamat_pegawai),true);\n\t\t$criteria->compare('pegawai_aktif', isset($this->pegawai_aktif)?$this->pegawai_aktif:true); \n\t\t$criteria->order = 'nama_pegawai';\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n \n\t\t));\n\t}" ]
[ "0.5675033", "0.56723744", "0.55281776", "0.5326758", "0.5324858", "0.53080314", "0.53009504", "0.5294246", "0.5257911", "0.5253758", "0.52512854", "0.5246763", "0.51993203", "0.51870114", "0.5185717", "0.5153325", "0.5136134", "0.5107807", "0.51014835", "0.5100494", "0.50958824", "0.50578976", "0.505735", "0.5052882", "0.50502867", "0.5033513", "0.5024301", "0.49885517", "0.49793595", "0.4975868", "0.49520978", "0.49449128", "0.4942215", "0.4936184", "0.4926477", "0.49209973", "0.49171302", "0.49165633", "0.49115077", "0.49058512", "0.4897263", "0.4887198", "0.48833463", "0.48778525", "0.4877388", "0.4871921", "0.48712596", "0.48701358", "0.48701358", "0.4862262", "0.48611015", "0.4857218", "0.4854081", "0.48393732", "0.4834549", "0.4827524", "0.4819257", "0.48176813", "0.4813768", "0.48048916", "0.48037574", "0.48020402", "0.479985", "0.47989258", "0.47978693", "0.47911686", "0.4790524", "0.47862265", "0.4785235", "0.47797105", "0.47794467", "0.47783345", "0.4778217", "0.4772028", "0.47660765", "0.47615606", "0.47598338", "0.475847", "0.4753559", "0.4753496", "0.475213", "0.47510573", "0.47474158", "0.47460693", "0.47430223", "0.47415465", "0.47402218", "0.47402218", "0.47369277", "0.47365984", "0.4733141", "0.47316068", "0.47314456", "0.4723041", "0.47228706", "0.47176078", "0.471237", "0.47056606", "0.47048542", "0.47047225" ]
0.5802574
0
A set of input controls for defining the transect.
protected static function get_control_latlongs($auth, $args, $tabAlias, $options) { $r = data_entry_helper::text_input(array( 'label' => 'Transect start', 'fieldname' => 'gpsstart', 'helpText' => lang::get('Transect start, GPS coordinate (decimal WGS84 latitude and longitude). Click once on the map to set.') )); $r .= data_entry_helper::text_input(array( 'label' => 'Transect end', 'fieldname' => 'gpsend', 'helpText' => lang::get('Transect end, GPS coordinate (decimal WGS84 latitude and longitude). Click again on the map to set.') )); return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_controls()\n\t{\n\t\treturn array\n\t\t(\n\t\t\tself::CONTROL_PERMISSION => Module::PERMISSION_CREATE,\n\t\t\tself::CONTROL_RECORD => true,\n\t\t\tself::CONTROL_OWNERSHIP => true,\n\t\t\tself::CONTROL_FORM => true\n\t\t)\n\n\t\t+ parent::get_controls();\n\t}", "protected function _register_controls()\n {\n\n $this->start_controls_section(\n 'section_content',\n [\n 'label' => __('Content', 'elementor-super-cat'),\n ]\n );\n\n\n $this->add_control(\n 'taxonomy',\n [\n 'label' => __('Name of taxonomy to filter', 'elementor-super-cat'),\n 'type' => \\Elementor\\Controls_Manager::SELECT2,\n 'label_block' => true,\n 'options' => $this->get_taxonomies(),\n 'default' => isset($this->get_taxonomies()[0]) ? $this->get_taxonomies()[0] : []\n ]\n );\n\n $this->add_control(\n 'post_id',\n [\n 'label' => __('CSS ID of the post widget', 'elementor-super-cat'),\n 'type' => \\Elementor\\Controls_Manager::TEXT,\n ]\n );\n\n $this->add_control(\n 'order_by',\n [\n 'label' => __('Order By', 'elementor-super-cat'),\n 'type' => \\Elementor\\Controls_Manager::SELECT,\n 'default' => 'name',\n 'options' => [\n 'name' => __('Name', 'elementor-super-cat'),\n 'slug' => __('Slug', 'elementor-super-cat'),\n ],\n ]\n );\n\n $this->add_control(\n 'all_text',\n [\n 'label' => __('Text to show for <b>Show All</b>', 'elementor-super-cat'),\n 'type' => \\Elementor\\Controls_Manager::TEXT,\n 'default' => \"all\"\n ]\n );\n\n $this->add_control(\n 'hide_empty',\n [\n 'label' => __('Hide empty', 'elementor'),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n 'description' => __('If ON empty filters will be hidden.', 'elementor'),\n ]\n );\n\n\n $this->add_control(\n 'invisible_filter',\n [\n 'label' => __('Remove Filter and display only currenct taxonomy', 'elementor-super-cat'),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n 'description' => __('Removes the filter bar and only display related single related taxonomy', 'elementor'),\n ]\n );\n\n\n $this->end_controls_section();\n\n $this->start_controls_section(\n 'section_style',\n [\n 'label' => __('Style', 'elementor-super-cat'),\n 'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n ]\n );\n\n $this->add_control(\n 'color_filter',\n [\n 'label' => __('Color', 'elementor-super-cat'),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .elementor-portfolio__filter' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'color_filter_active',\n [\n 'label' => __('Active Color', 'elementor-super-cat'),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .elementor-portfolio__filter.elementor-active' => 'color: {{VALUE}};',\n ],\n ]\n );\n\n $this->add_group_control(\n 'typography',\n [\n 'name' => 'typography_filter',\n 'selector' => '{{WRAPPER}} .elementor-portfolio__filter',\n ]\n );\n\n $this->add_control(\n 'filter_item_spacing',\n [\n 'label' => __('Space Between', 'elementor-super-cat'),\n 'type' => \\Elementor\\Controls_Manager::SLIDER,\n 'default' => [\n 'size' => 10,\n ],\n 'range' => [\n 'px' => [\n 'min' => 0,\n 'max' => 100,\n ],\n ],\n 'selectors' => [\n '{{WRAPPER}} .elementor-portfolio__filter:not(:last-child)' => 'margin-right: calc({{SIZE}}{{UNIT}}/2)',\n '{{WRAPPER}} .elementor-portfolio__filter:not(:first-child)' => 'margin-left: calc({{SIZE}}{{UNIT}}/2)',\n ],\n ]\n );\n\n $this->add_control(\n 'filter_spacing',\n [\n 'label' => __('Spacing', 'elementor-super-cat'),\n 'type' => \\Elementor\\Controls_Manager::SLIDER,\n 'default' => [\n 'size' => 10,\n ],\n 'range' => [\n 'px' => [\n 'min' => 0,\n 'max' => 100,\n ],\n ],\n 'selectors' => [\n '{{WRAPPER}} .elementor-portfolio__filters' => 'margin-bottom: {{SIZE}}{{UNIT}}',\n ],\n ]\n );\n\n $this->end_controls_section();\n }", "public function build_controls()\n\t{\n\t\t$this->add_control( 'title', [\n\t\t\t'label' => __( 'Title' )\n\t\t] );\n\t\t$this->add_control( 'content', [\n\t\t\t'label' => __( 'Content' ),\n\t\t\t'type' => 'textarea'\n\t\t] );\n\t\t$this->add_control( 'link_url', [\n\t\t\t'label' => __( 'URL' )\n\t\t] );\n\t\t$this->add_control( 'link_text', [\n\t\t\t'label' => __( 'Link Text' )\n\t\t] );\n\t\t$this->add_control( 'link_target', [\n\t\t\t'label' => __( 'Open link in a new window/tab' ),\n\t\t\t'type' => 'checkbox',\n\t\t\t'value' => '1'\n\t\t] );\n\t}", "public function controls()\n {\n }", "function controls()\n\t{\n\t}", "public function getControls();", "protected function _register_controls() {\n parent::_register_controls();\n\n $this->start_controls_section(\n 'section_title',\n [\n 'label' => __( 'Single Product MultiVendor List', 'dokan' ),\n ]\n );\n\n $this->add_control(\n 'text',\n [\n 'label' => __( 'Title', 'dokan' ),\n 'default' => __( 'Other Available Vendor', 'dokan' ),\n 'placeholder' => __( 'Other Available Vendor', 'dokan' ),\n ]\n );\n\n $this->end_controls_section();\n }", "protected function _register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore \n\n\t\t$this->register_general_content_controls();\n\n\t\t$this->register_count_content_controls();\n\n\t\t$this->register_helpful_information();\n\t}", "public function BuildControls() {\n\n $this->EncType= $this->GetOption('EncType');\n\n // convert array of arrays into array of objects\n foreach($this->Controls as $Name=>&$Control) {\n // skip already builded controls\n if (is_object($Control)) {\n continue;\n }\n // find classname\n if (!isset($Control['Type'])) {\n $Control += array('Type'=>'text', 'Attributes'=>array('UNKNOWNTYPE'=>'YES'));\n }\n if (strpos($Control['Type'], '\\\\') === false) { // short name, ex.: \"select\"\n $Type= ucfirst($Control['Type']);\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\'.$Type.'Control';\n } else { // it is fully qualified class name\n $Class= $Control['Type'];\n }\n if (!class_exists($Class)) {\n $this->Error('Class \"'.$Class.'\" not found.');\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\TextControl'; // fallback to any primitive control\n }\n // copy this array into $Options and append few more items\n // and append common options to allow usage of services\n $Options= $Control + array(\n 'Name'=> $Name,\n 'Form'=> $this,\n 'Book'=> $this->GetOption('Book')\n ) + $this->GetCommonOptions();\n $Control= new $Class($Options);\n // switch to multipart encoding if any control require that\n if ($Control->GetMultipartEncoding()) {\n $this->EncType= 'multipart/form-data';\n }\n }\n $this->Builded= true;\n }", "function AddControls($controls)\r\n {\r\n $this->Controls = $controls;\r\n }", "protected function _register_controls() {\n\n\t\t\t\t$this->start_controls_section(\n\t\t\t\t\t'section_sc_booked',\n\t\t\t\t\t[\n\t\t\t\t\t\t'label' => __( 'ThemeREX Booked Calendar', 'trx_addons' ),\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t\t$this->add_control(\n\t\t\t\t\t'style',\n\t\t\t\t\t[\n\t\t\t\t\t\t'label' => __( 'Layout', 'trx_addons' ),\n\t\t\t\t\t\t'label_block' => false,\n\t\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t\t'calendar' => esc_html__('Calendar', 'trx_addons'),\n\t\t\t\t\t\t\t\t\t'list' => esc_html__('List', 'trx_addons')\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t'default' => 'calendar'\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t\t$this->add_control(\n\t\t\t\t\t'calendar',\n\t\t\t\t\t[\n\t\t\t\t\t\t'label' => __( 'Calendar', 'trx_addons' ),\n\t\t\t\t\t\t'label_block' => false,\n\t\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t\t\t'options' => trx_addons_array_merge(array(0 => esc_html__('- Select calendar -', 'trx_addons')), trx_addons_get_list_terms(false, 'booked_custom_calendars')),\n\t\t\t\t\t\t'default' => '0'\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t\t$this->add_control(\n\t\t\t\t\t'month',\n\t\t\t\t\t[\n\t\t\t\t\t\t'label' => __( 'Month', 'trx_addons' ),\n\t\t\t\t\t\t'label_block' => false,\n\t\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t\t\t'options' => trx_addons_array_merge(array(0 => esc_html__('- Current month -', 'trx_addons')), trx_addons_get_list_months()),\n\t\t\t\t\t\t'default' => '0'\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t\t$this->add_control(\n\t\t\t\t\t'year',\n\t\t\t\t\t[\n\t\t\t\t\t\t'label' => __( 'Year', 'trx_addons' ),\n\t\t\t\t\t\t'label_block' => false,\n\t\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t\t\t'options' => trx_addons_array_merge(array(0 => esc_html__('- Current year -', 'trx_addons')), trx_addons_get_list_range(date('Y'), date('Y')+25)),\n\t\t\t\t\t\t'default' => '0'\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->end_controls_section();\n\t\t\t}", "protected function _register_controls() {\n\t\t$template_type = learndash_elementor_get_template_type();\n\t\t$preview_step_id = $this->learndash_get_preview_post_id( $template_type );\n\n\t\t$this->start_controls_section(\n\t\t\t'preview',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Preview Setting', 'learndash-elementor' ),\n\t\t\t)\n\t\t);\n\n\t\tif ( in_array( $template_type, array( learndash_get_post_type_slug( 'course' ) ), true ) ) {\n\n\t\t\t$this->add_control(\n\t\t\t\t'preview_step_id',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => sprintf(\n\t\t\t\t\t\t// translators: placeholder: Course.\n\t\t\t\t\t\tesc_html_x( '%s', 'placeholder: Course', 'learndash-elementor' ),\n\t\t\t\t\t\t\\LearnDash_Custom_Label::get_label( 'course' )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => ElementorPro\\Modules\\QueryControl\\Module::QUERY_CONTROL_ID,\n\t\t\t\t\t'options' => array(),\n\t\t\t\t\t'default' => $preview_step_id,\n\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t'autocomplete' => array(\n\t\t\t\t\t\t'object' => ElementorPro\\Modules\\QueryControl\\Module::QUERY_OBJECT_POST,\n\t\t\t\t\t\t'query' => array(\n\t\t\t\t\t\t\t'post_type' => array( learndash_get_post_type_slug( 'course' ) ),\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} elseif ( in_array( $template_type, array( learndash_get_post_type_slug( 'lesson' ) ), true ) ) {\n\t\t\t$this->add_control(\n\t\t\t\t'preview_step_id',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => sprintf(\n\t\t\t\t\t\t// translators: placeholder: Lesson.\n\t\t\t\t\t\tesc_html_x( '%s', 'placeholder: Lesson', 'learndash-elementor' ),\n\t\t\t\t\t\t\\LearnDash_Custom_Label::get_label( 'lesson' )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => ElementorPro\\Modules\\QueryControl\\Module::QUERY_CONTROL_ID,\n\t\t\t\t\t'options' => array(),\n\t\t\t\t\t'default' => $preview_step_id,\n\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t'autocomplete' => array(\n\t\t\t\t\t\t'object' => ElementorPro\\Modules\\QueryControl\\Module::QUERY_OBJECT_POST,\n\t\t\t\t\t\t'query' => array(\n\t\t\t\t\t\t\t'post_type' => array( learndash_get_post_type_slug( 'lesson' ) ),\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} elseif ( in_array( $template_type, array( learndash_get_post_type_slug( 'topic' ) ), true ) ) {\n\t\t\t$this->add_control(\n\t\t\t\t'preview_step_id',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => sprintf(\n\t\t\t\t\t\t// translators: placeholder: Topic.\n\t\t\t\t\t\tesc_html_x( '%s', 'placeholder: Topic', 'learndash-elementor' ),\n\t\t\t\t\t\t\\LearnDash_Custom_Label::get_label( 'topic' )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => ElementorPro\\Modules\\QueryControl\\Module::QUERY_CONTROL_ID,\n\t\t\t\t\t'options' => array(),\n\t\t\t\t\t'default' => $preview_step_id,\n\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t'autocomplete' => array(\n\t\t\t\t\t\t'object' => ElementorPro\\Modules\\QueryControl\\Module::QUERY_OBJECT_POST,\n\t\t\t\t\t\t'query' => array(\n\t\t\t\t\t\t\t'post_type' => array( learndash_get_post_type_slug( 'topic' ) ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->add_control(\n\t\t\t'preview_user_id',\n\t\t\tarray(\n\t\t\t\t'label' => esc_html__( 'User ID', 'learndash-elementor' ),\n\t\t\t\t'type' => ElementorPro\\Modules\\QueryControl\\Module::QUERY_CONTROL_ID,\n\t\t\t\t'options' => array(),\n\t\t\t\t'default' => get_current_user_id(),\n\t\t\t\t'label_block' => true,\n\t\t\t\t'autocomplete' => array(\n\t\t\t\t\t'object' => ElementorPro\\Modules\\QueryControl\\Module::QUERY_OBJECT_USER,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t/**\n\t\t * Start of Style tab.\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'section_course_content_header',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Header', 'learndash-elementor' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\n\t\tif ( learndash_get_post_type_slug( 'course' ) === $template_type ) {\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_header_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-section-heading h2',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\t\t} elseif ( learndash_get_post_type_slug( 'lesson' ) === $template_type ) {\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_header_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-lesson-topic-list .ld-table-list .ld-table-list-header .ld-table-list-title',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\t\t} elseif ( learndash_get_post_type_slug( 'topic' ) === $template_type ) {\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_header_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-table-list .ld-table-list-header .ld-table-list-title',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->add_control(\n\t\t\t'control_course_content_header_text_color',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Color', 'learndash-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'default' => '',\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-section-heading > h2' => 'color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-table-list .ld-table-list-header' => 'color: {{VALUE}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tif ( in_array( $template_type, array( learndash_get_post_type_slug( 'lesson' ), learndash_get_post_type_slug( 'topic' ) ), true ) ) {\n\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_header_text_background_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Background Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => $this->learndash_get_template_color( 'primary' ),\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-table-list.ld-topic-list .ld-table-list-header' => 'background-color: {{VALUE}} !important;',\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-table-list.ld-topic-list .ld-table-list-header.ld-primary-background' => 'background-color: {{VALUE}} !important;',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( learndash_get_post_type_slug( 'course' ) === $template_type ) {\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_header_expand_text_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Expand Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-section-heading .ld-expand-button' => 'color: {{VALUE}};',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_header_expand_text_background_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Expand Background Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => $this->learndash_get_template_color( 'primary' ),\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-section-heading .ld-item-list-actions .ld-expand-button' => 'background-color: {{VALUE}} !important;',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'section_course_content_row_item',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Row Item', 'learndash-elementor' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'header_section_course_content_row_item_title',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'TITLE', 'learndash-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t)\n\t\t);\n\n\t\tif ( learndash_get_post_type_slug( 'course' ) === $template_type ) {\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_row_item_title_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-title',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\t\t} elseif ( learndash_get_post_type_slug( 'lesson' ) === $template_type ) {\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_row_item_title_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-topic-list.ld-table-list .ld-table-list-items',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\t\t} elseif ( learndash_get_post_type_slug( 'topic' ) === $template_type ) {\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_row_item_title_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-topic-list.ld-table-list .ld-table-list-items',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->add_control(\n\t\t\t'control_course_content_row_item_title_color',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Title Color', 'learndash-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'default' => '#495255',\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-title' => 'color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-table-list-items .ld-table-list-item a' => 'color: {{VALUE}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'control_course_content_row_item_background_color',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Background Color', 'learndash-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'default' => '#ffffff',\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-item-list .ld-item-list-item' => 'background-color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-table-list-items' => 'background-color: {{VALUE}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tif ( learndash_get_post_type_slug( 'course' ) === $template_type ) {\n\t\t\t$this->add_control(\n\t\t\t\t'header_section_course_content_row_item_expand',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'EXPAND', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t\t'separator' => 'before',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_row_item_expand_text_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Expand Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-item-details .ld-expand-button' => 'color: {{VALUE}} !important;',\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-item-details .ld-expand-button .ld-icon-arrow-down' => 'color: {{VALUE}} !important;',\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-item-details .ld-expand-button .ld-text' => 'color: {{VALUE}} !important;',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_row_item_expand_text_background_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Expand Background Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => $this->learndash_get_template_color( 'primary' ),\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-item-details .ld-expand-button .ld-icon-arrow-down' => 'background-color: {{VALUE}} !important;',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'header_course_content_row_item_lesson_progress',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'LESSON PROGRESS HEADER', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t\t'separator' => 'before',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_row_item_lesson_progress_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-lesson-list .ld-item-list-items .ld-item-list-item .ld-table-list-header',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_row_item_lesson_progress_text_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-lesson-list .ld-item-list-items .ld-item-list-item .ld-table-list-header.ld-primary-background' => 'color: {{VALUE}} !important;',\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-lesson-list .ld-item-list-items .ld-item-list-item .ld-table-list-header' => 'color: {{VALUE}} !important;',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_row_item_lesson_progress_text_background_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Background Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => $this->learndash_get_template_color( 'primary' ),\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-lesson-list .ld-item-list-items .ld-item-list-item .ld-table-list-header.ld-primary-background' => 'background-color: {{VALUE}} !important;',\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-lesson-list .ld-item-list-items .ld-item-list-item .ld-table-list-header' => 'background-color: {{VALUE}} !important;',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t}\n\n\t\t$this->end_controls_section();\n\n\t\tif ( in_array( $template_type, array( learndash_get_post_type_slug( 'lesson' ), learndash_get_post_type_slug( 'topic' ) ), true ) ) {\n\n\t\t\t$this->start_controls_section(\n\t\t\t\t'section_course_content_footer',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Footer', 'learndash-elementor' ),\n\t\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'header_course_content_footer_links',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'LINKS (Back to...)', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t\t'separator' => 'before',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_footer_links_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-content-actions a.ld-primary-color',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_footer_links_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => $this->learndash_get_template_color( 'primary' ),\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-content-actions a.ld-primary-color' => 'color: {{VALUE}} !important;',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'header_course_content_footer_navigation',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'NAVIGATION', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t\t'separator' => 'before',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_footer_navigation_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-content-action a.ld-button',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_footer_navigation_text_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-content-action a.ld-button' => 'color: {{VALUE}} !important;',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_footer_navigation_text_background_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Background Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => $this->learndash_get_template_color( 'primary' ),\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-content-action a.ld-button' => 'background-color: {{VALUE}};',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'header_course_content_footer_mark_complete',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'MARK COMPLETE', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t\t'separator' => 'before',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_group_control(\n\t\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'control_course_content_footer_mark_complete_text',\n\t\t\t\t\t'scheme' => \\Elementor\\Core\\Schemes\\Typography::TYPOGRAPHY_2,\n\t\t\t\t\t'selector' => '{{WRAPPER}} .learndash-wrapper .ld-content-action input.learndash_mark_complete_button',\n\t\t\t\t\t'exclude' => array( 'line_height' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_footer_mark_complete_text_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-content-action input.learndash_mark_complete_button' => 'color: {{VALUE}} !important;',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->add_control(\n\t\t\t\t'control_course_content_footer_mark_complete_text_background_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Background Color', 'learndash-elementor' ),\n\t\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t\t'default' => $this->learndash_get_template_color( 'secondary' ),\n\t\t\t\t\t'selectors' => array(\n\t\t\t\t\t\t'{{WRAPPER}} .learndash-wrapper .ld-content-action input.learndash_mark_complete_button' => 'background-color: {{VALUE}};',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->end_controls_section();\n\t\t}\n\t}", "protected function _register_controls()\n\t{\n\n\t\t$this->start_controls_section(\n\t\t\t'section_settings',\n\t\t\t[\n\t\t\t\t'label' => __('Settings', 'algolia-wp-plugin'),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'index_name',\n\t\t\t[\n\t\t\t\t'label' => __('Search Index', 'algolia-wp-plugin'),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'show_label' => true,\n\t\t\t\t'default' => 'wp_searchable_posts',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'facet_filters',\n\t\t\t[\n\t\t\t\t'label' => __('Facet Filters', 'algolia-wp-plugin'),\n\t\t\t\t'type' => Controls_Manager::CODE,\n\t\t\t\t'show_label' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hits_per_page',\n\t\t\t[\n\t\t\t\t'label' => __('Hits Per Page', 'algolia-wp-plugin'),\n\t\t\t\t'show_label' => true,\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'default' => 5,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'localize',\n\t\t\t[\n\t\t\t\t'label' => __('Localize', 'algolia-wp-plugin'),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => true,\n\t\t\t\t'frontend_available' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\t}", "public function register_controls()\n {\n }", "function add_specific_settings_controls() {\n\n\t\t$this->add_control(\n\t\t\t'success_message',\n\t\t\tarray(\n\t\t\t\t'type' => 'text',\n\t\t\t\t'label' => esc_html__( 'Success message', 'themeisle-companion' ),\n\t\t\t\t'default' => esc_html__( 'Your message has been sent!', 'themeisle-companion' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'error_message',\n\t\t\tarray(\n\t\t\t\t'type' => 'text',\n\t\t\t\t'label' => esc_html__( 'Error message', 'themeisle-companion' ),\n\t\t\t\t'default' => esc_html__( 'Oops! I cannot send this email!', 'themeisle-companion' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'to_send_email',\n\t\t\tarray(\n\t\t\t\t'type' => 'text',\n\t\t\t\t'label' => esc_html__( 'Send to', 'themeisle-companion' ),\n\t\t\t\t'default' => get_bloginfo( 'admin_email' ),\n\t\t\t\t'description' => esc_html__( 'Where should we send the email?', 'themeisle-companion' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'submit_label',\n\t\t\tarray(\n\t\t\t\t'type' => 'text',\n\t\t\t\t'label' => esc_html__( 'Submit', 'themeisle-companion' ),\n\t\t\t\t'default' => esc_html__( 'Submit', 'themeisle-companion' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'align_submit',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Alignment', 'themeisle-companion' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'toggle' => false,\n\t\t\t\t'default' => 'left',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'left' => array(\n\t\t\t\t\t\t'title' => __( 'Left', 'themeisle-companion' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t),\n\t\t\t\t\t'center' => array(\n\t\t\t\t\t\t'title' => __( 'Center', 'themeisle-companion' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t),\n\t\t\t\t\t'right' => array(\n\t\t\t\t\t\t'title' => __( 'Right', 'themeisle-companion' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .content-form .submit-form' => 'text-align: {{VALUE}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "protected function _register_controls()\n {\n $this->start_controls_section(\n 'section_content',\n [\n 'label' => __('Content', 'uap-uganda'),\n ]\n );\n\n $this->add_control(\n 'posts',\n [\n 'label' => __('Number of Posts', 'uap-uganda'),\n 'type' => Controls_Manager::NUMBER,\n 'default' => 2\n ]\n );\n\n $this->add_control(\n 'posts_per_page',\n [\n 'label' => __('Posts Per Page', 'uap-uganda'),\n 'type' => Controls_Manager::NUMBER,\n 'default' => 2\n ]\n );\n\n $this->end_controls_section();\n }", "protected function _register_controls() {\n\n\t\t//link\n\t\t//image\n\t\t//featured\n\t\t//term\n\t\t//style alternative-imagebox\n\t\t//\n\t\t//\n\n\n\t\t$this->start_controls_section(\n\t\t\t'section_content',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Content', 'elementor-listeo' ),\n\t\t\t)\n\t\t);\n\n\n\t\t$this->add_control(\n\t\t\t'url',\n\t\t\t[\n\t\t\t\t'label' => __( 'Link','elementor-listeo' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::URL,\n\t\t\t\t'placeholder' => __( 'https://your-link.com', 'elementor-listeo' ),\n\t\t\t\t'show_external' => true,\n\t\t\t\t'default' => [\n\t\t\t\t\t'url' => '',\n\t\t\t\t\t'is_external' => true,\n\t\t\t\t\t'nofollow' => true,\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\n\t\t$this->add_control(\n\t\t\t'background',\n\t\t\t[\n\t\t\t\t'label' => __( 'Choose Background Image', 'elementor-listeo' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::MEDIA,\n\t\t\t\t'default' => [\n\t\t\t\t\t'url' => \\Elementor\\Utils::get_placeholder_image_src(),\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n\n\n\t\t// $this->add_control(\n\t\t// \t'featured',\n\t\t// \t[\n\t\t// \t\t'label' => __( 'Featured badge', 'elementor-listeo' ),\n\t\t// \t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t// \t\t'label_on' => __( 'Show', 'your-plugin' ),\n\t\t// \t\t'label_off' => __( 'Hide', 'your-plugin' ),\n\t\t// \t\t'return_value' => 'yes',\n\t\t// \t\t'default' => 'yes',\n\t\t// \t]\n\t\t// );\n\n\t\t$this->add_control(\n\t\t\t'taxonomy',\n\t\t\t[\n\t\t\t\t'label' => __( 'Taxonomy', 'elementor-listeo' ),\n\t\t\t\t'type' => Controls_Manager::SELECT2,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => [],\n\t\t\t\t'options' => $this->get_taxonomies(),\n\t\t\t\t\n\t\t\t]\n\t\t);\n\n\t\t$taxonomy_names = get_object_taxonomies( 'listing','object' );\n\t\tforeach ($taxonomy_names as $key => $value) {\n\t\n\t\t\t$this->add_control(\n\t\t\t\t$value->name.'term',\n\t\t\t\t[\n\t\t\t\t\t'label' => __( 'Show term from '.$value->label, 'elementor-listeo' ),\n\t\t\t\t\t'type' => Controls_Manager::SELECT2,\n\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t'default' => [],\n\t\t\t\t\t'options' => $this->get_terms($value->name),\n\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t'taxonomy' => $value->name,\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\n\t\t$this->add_control(\n\t\t\t'show_counter',\n\t\t\t[\n\t\t\t\t'label' => __( 'Show listings counter', 'elementor-listeo' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Show', 'your-plugin' ),\n\t\t\t\t'label_off' => __( 'Hide', 'your-plugin' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => 'yes',\n\t\t\t]\n\t\t);\n\n\n\t\t$this->add_control(\n\t\t\t'style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Style ', 'elementor-listeo' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t'default' => 'alternative-imagebox',\n\t\t\t\t'options' => [\n\t\t\t\t\t'standard' => __( 'Standard', 'elementor-listeo' ),\n\t\t\t\t\t'alternative-imagebox' => __( 'Alternative', 'elementor-listeo' ),\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\n\t\t\n\n\t\t$this->end_controls_section();\n\n\t}", "public function getControls()\n {\n return $this->controls;\n }", "protected function _register_controls()\n {\n global $post;\n $page = get_post($post->ID);\n $pageTitle = $page->post_title;\n\n // Top post's part starts\n $this->start_controls_section(\n 'section_top',\n [\n 'label' => __('Top part of article', 'elementor'),\n ]\n );\n\n $this->add_control(\n 'page_title',\n [\n 'label' => 'Type page title',\n 'type' => \\Elementor\\Controls_Manager::TEXT,\n 'default' => $pageTitle,\n// 'default' => 'TEXT TITLE',\n ]\n );\n\n $this->add_control(\n 'page_subtitle',\n [\n 'label' => 'Type page sub title',\n 'type' => \\Elementor\\Controls_Manager::TEXT,\n ]\n );\n\n $this->add_control(\n 'blog_content_top',\n [\n 'label' => __('Top article part', 'elementor'),\n 'default' => __('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ac ornare odio, non \n ultricies leo. Mauris turpis erat, tristique eget dui eget, egestas consequat mi. Integer convallis, \n justo ut fermentum fermentum, erat purus pulvinar massa, ac viverra massa libero at nibh. Cras ac mi at\n nulla rutrum accumsan a nec tortor.', 'elementor'),\n 'placeholder' => __('Tab Content', 'elementor'),\n 'type' => Controls_Manager::WYSIWYG,\n 'show_label' => false,\n ]\n );\n\n $this->add_control(\n 'blog_content_middle',\n [\n 'label' => __('Middle article part', 'elementor'),\n 'default' => __('<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ac ornare odio, non \n ultricies leo. Mauris turpis erat, tristique eget dui eget, egestas consequat mi. Integer convallis, \n justo ut fermentum fermentum, erat purus pulvinar massa, ac viverra massa libero at nibh. Cras ac mi at\n nulla rutrum accumsan a nec tortor.</p>', 'elementor'),\n 'placeholder' => __('Tab Content', 'elementor'),\n 'type' => Controls_Manager::WYSIWYG,\n 'show_label' => false,\n ]\n );\n\n $this->add_control(\n 'blog_content_bottom',\n [\n 'label' => __('Bottom article part', 'elementor'),\n 'default' => __('<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ac ornare odio, non \n ultricies leo. Mauris turpis erat, tristique eget dui eget, egestas consequat mi. Integer convallis, \n justo ut fermentum fermentum, erat purus pulvinar massa, ac viverra massa libero at nibh. Cras ac mi at\n nulla rutrum accumsan a nec tortor.</p>', 'elementor'),\n 'placeholder' => __('Tab Content', 'elementor'),\n 'type' => Controls_Manager::WYSIWYG,\n 'show_label' => false,\n ]\n );\n\n $this->end_controls_section();\n // Top post's part ends\n\n // Middle post's part starts\n $this->start_controls_section(\n 'section_middle',\n [\n 'label' => __('Middle part of article', 'elementor'),\n ]\n );\n\n\n $this->add_control(\n 'the_quote',\n [\n 'label' => 'Type page sub title',\n 'type' => \\Elementor\\Controls_Manager::TEXTAREA,\n 'default' => __('“We’re seeing some really bullish bitcoin price action today along with other ...',\n 'plugin-domain'),\n ]\n );\n\n $this->end_controls_section();\n // Midddle post's part ends\n }", "public function output_widget_control_templates()\n {\n }", "public function getControls()\n\t{\t\t\t \n\t\treturn $this->getComponents(TRUE, 'Nette\\Forms\\IFormControl');\n\t}", "protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'section_content',\n\t\t\t[\n\t\t\t\t'label' => __( 'Content', 'elementor-hello-world' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'title',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title', 'elementor-hello-world' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'description',\n\t\t\t[\n\t\t\t\t'label' => __( 'Description', 'elementor-hello-world' ),\n\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n\t\t\t\t\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'content',\n\t\t\t[\n\t\t\t\t'label' => __( 'Content', 'elementor-hello-world' ),\n\t\t\t\t'type' => Controls_Manager::WYSIWYG,\n\t\t\t\t\n\t\t\t]\n\t\t);\n\n\n\t\t$this->end_controls_section();\n\t}", "public function setupControl()\n\t{\n\t\t$this->addText('referenceNumber', 'Reference number:');\n\t\t$this->addSelect('priority', 'Priority:', PriorityEnum::getOptions());\n\t\t$this->addTextArea('symptoms', 'Symptoms:', 40, 8)\n\t\t\t->addRule(Form::FILLED, 'Symptoms are required.');\n\t\t$this->addText('problemOwner', 'Problem owner:');\n\t\t$this->addSelect('status', 'State:', array(\n\t\t\tOperationProblem::STATUS_NEW => 'new',\n\t\t\tOperationProblem::STATUS_INVESTIGATED => 'investigated',\n\t\t\tOperationProblem::STATUS_RESOLVED => 'resolved',\n\t\t\tOperationProblem::STATUS_CLOSED => 'closed'\n\t\t));\n\n\t\t$this->addSelect('category', 'Category:', array('' => $this->noCategoryText) + $this->getCategoriesOptions());\n\n\t\t$this->addTextArea('onEventRaw', 'onEvent:');\n\n\t\t$this->addSubmit('save', 'Save problem');\n\n\t\t$this->onValidate[] = $this->onValidateForm;\n\t}", "protected function _register_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'content_section',\n\t\t\t[\n\t\t\t\t'label' => __( 'Content', 'portfolio-elementor' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_CONTENT,\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Section Heading Title\n\t\t$this->add_control(\n\t\t 'portfolio_section_heading_title',\n\t\t\t[\n\t\t\t 'label' => esc_html__('Section Heading Title','portfolio-elementor'),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::TEXT,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'placeholder' => esc_html__('Enter Section Heading Title','portfolio-elementor'),\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Section Heading Sub Title \n\t\t$this->add_control(\n\t\t 'portfolio_section_heading_sub_title',\n\t\t\t[\n\t\t\t 'label' => esc_html__('Section Heading Sub Title','portfolio-elementor'),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::TEXT,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'placeholder' => esc_html__('Enter Section Heading Sub Title','portfolio-elementor'),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t// end of the Content tab section\n\t\t\n\t\t// start of the Style tab section\n\t\t$this->start_controls_section(\n\t\t\t'style_section',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Content Style', 'portfolio-elementor' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->start_controls_tabs(\n\t\t\t'style_tabs'\n\t\t);\n\t\t\n\t\t// start everything related to Normal state here\n\t\t$this->start_controls_tab(\n\t\t\t'style_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Normal', 'portfolio-elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t// Section Heading Title Options\n\t\t$this->add_control(\n\t\t\t'portfolio_section_heading_title_options',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Section Heading Title', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n\t\t// Section Heading Title Color\n\t\t$this->add_control(\n\t\t\t'portfolio_section_heading_title_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Title Color', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'scheme' => [\n\t\t\t\t\t'type' => \\Elementor\\Scheme_Color::get_type(),\n\t\t\t\t\t'value' => \\Elementor\\Scheme_Color::COLOR_1,\n\t\t\t\t],\n\t\t\t\t'default' => '#dee3e4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .section-title h2' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Section Heading Title Typography\n\t\t$this->add_group_control(\n\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'portfolio_section_heading_title_typography',\n\t\t\t\t'label' => esc_html__( 'Typography', 'portfolio-elementor' ),\n\t\t\t\t'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_1,\n\t\t\t\t'selector' => '{{WRAPPER}} .section-title h2',\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Section Heading Sub Title Options\n\t\t$this->add_control(\n\t\t\t'portfolio_section_heading_sub_title_options',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Section Heading Sub Title', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n\t\t// Section Heading Sub Title Color\n\t\t$this->add_control(\n\t\t\t'portfolio_section_heading_sub_title_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Sub Title Color', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'scheme' => [\n\t\t\t\t\t'type' => \\Elementor\\Scheme_Color::get_type(),\n\t\t\t\t\t'value' => \\Elementor\\Scheme_Color::COLOR_1,\n\t\t\t\t],\n\t\t\t\t'default' => '#343a40',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .section-title p' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Section Heading Sub Title Typography\n\t\t$this->add_group_control(\n\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'portfolio_section_heading_sub_title_typography',\n\t\t\t\t'label' => esc_html__( 'Typography', 'portfolio-elementor' ),\n\t\t\t\t'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_1,\n\t\t\t\t'selector' => '{{WRAPPER}} .section-title p',\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_tab();\n\t\t// end everything related to Normal state here\n\n\t\t// start everything related to Hover state here\n\t\t$this->start_controls_tab(\n\t\t\t'style_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Hover', 'portfolio-elementor' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_tab();\n\t\t// end everything related to Hover state here\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\t\t// end of the Style tab section\n\n\t}", "protected function _register_controls()\n {\n\n /**\n * Style tab\n */\n\n $this->start_controls_section(\n 'general',\n [\n 'label' => __('Content', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_CONTENT,\n ]\n );\n\n $this->add_control(\n\t\t\t'menu_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Border Style', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => 'inline',\n\t\t\t\t'options' => [\n\t\t\t\t\t'inline' => __( 'Inline', 'akash-hp' ),\n\t\t\t\t\t'flyout' => __( 'Flyout', 'akash-hp' ),\n\t\t\t\t],\n\t\t\t]\n );\n \n $this->add_control(\n\t\t\t'trigger_label',\n\t\t\t[\n\t\t\t\t'label' => __( 'Trigger Label', 'akash-hp' ),\n 'type' => Controls_Manager::TEXT,\n\t\t\t]\n );\n \n $this->add_control(\n\t\t\t'trigger_open_icon',\n\t\t\t[\n\t\t\t\t'label' => __( 'Trigger Icon', 'text-domain' ),\n\t\t\t\t'type' => Controls_Manager::ICONS,\n\t\t\t\t'default' => [\n\t\t\t\t\t'value' => 'fa fa-align-justify',\n\t\t\t\t\t'library' => 'solid',\n ],\n \n\t\t\t]\n );\n \n $this->add_control(\n\t\t\t'trigger_close_icon',\n\t\t\t[\n\t\t\t\t'label' => __( 'Trigger Close Icon', 'text-domain' ),\n\t\t\t\t'type' => Controls_Manager::ICONS,\n\t\t\t\t'default' => [\n\t\t\t\t\t'value' => 'far fa-window-close',\n\t\t\t\t\t'library' => 'solid',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n 'menu_align',\n [\n 'label' => __('Align', 'akash-hp'),\n 'type' => Controls_Manager::CHOOSE,\n 'options' => [\n 'start' => [\n 'title' => __('Left', 'akash-hp'),\n 'icon' => 'fa fa-align-left',\n ],\n 'center' => [\n 'title' => __('top', 'akash-hp'),\n 'icon' => 'fa fa-align-center',\n ],\n 'flex-end' => [\n 'title' => __('Right', 'akash-hp'),\n 'icon' => 'fa fa-align-right',\n ],\n ],\n 'default' => 'left',\n\t\t\t\t'toggle' => true,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .akash-main-menu-wrap.navbar' => 'justify-content: {{VALUE}}'\n\t\t\t\t\t] \n ]\n );\n $this->end_controls_section();\n $this->start_controls_section(\n\t\t\t'header_infos_section',\n\t\t\t[\n\t\t\t\t'label' => __( 'Header Info', 'akash-hp' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_CONTENT,\n\t\t\t]\n );\n \n $this->add_control(\n\t\t\t'show_infos',\n\t\t\t[\n\t\t\t\t'label' => __( 'Show Title', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Show', 'akash-hp' ),\n\t\t\t\t'label_off' => __( 'Hide', 'akash-hp' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => 'no',\n\t\t\t]\n\t\t);\n\n\t\t$repeater = new Repeater();\n\n\t\t$repeater->add_control(\n\t\t\t'info_title', [\n\t\t\t\t'label' => __( 'Title', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'default' => __( 'info Title' , 'akash-hp' ),\n\t\t\t\t'label_block' => true,\n\t\t\t]\n\t\t);\n\n\t\t$repeater->add_control(\n\t\t\t'info_content', [\n\t\t\t\t'label' => __( 'Content', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::WYSIWYG,\n\t\t\t\t'default' => __( 'info Content' , 'akash-hp' ),\n\t\t\t\t'show_label' => false,\n\t\t\t]\n );\n \n $repeater->add_control(\n\t\t\t'info_url',\n\t\t\t[\n\t\t\t\t'label' => __( 'Link', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::URL,\n\t\t\t\t'placeholder' => __( 'https://your-link.com', 'akash-hp' ),\n\t\t\t\t'show_external' => true,\n\t\t\t]\n );\n \n\t\t$this->add_control(\n\t\t\t'header_infos',\n\t\t\t[\n\t\t\t\t'label' => __( 'Repeater info', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'fields' => $repeater->get_controls(),\n\t\t\t\t'default' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'info_title' => __( 'Call us:', 'akash-hp' ),\n\t\t\t\t\t\t'info_content' => __( '(234) 567 8901', 'akash-hp' ),\n\t\t\t\t\t],\n\t\t\t\t],\n 'title_field' => '{{{ info_title }}}',\n 'condition' => [\n 'show_infos' => 'yes',\n ]\n\t\t\t]\n\t\t);\n\n $this->end_controls_section();\n\n $this->start_controls_section(\n 'section_menu_style',\n [\n 'label' => __('Menu Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'menu_style' => 'inline',\n ]\n ]\n );\n\n\n\n\t\t$this->start_controls_tabs(\n\t\t\t'menu_items_tabs'\n );\n \n\t\t$this->start_controls_tab(\n\t\t\t'menu_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'akash-hp' ),\n\t\t\t]\n );\n \n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'menu_typography',\n 'label' => __('Menu Typography', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .main-navigation ul.navbar-nav>li>a',\n ]\n );\n\n $this->add_control(\n 'menu_color',\n [\n 'label' => __('Item Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav>li>a, \n {{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav > .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav > .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n \n ],\n ]\n );\n\n $this->add_control(\n 'menu_bg_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav>li>a' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n \n $this->add_responsive_control(\n 'item_gap',\n [\n 'label' => __('Menu Gap', 'akash-hp'),\n 'type' => Controls_Manager::SLIDER,\n 'range' => [\n 'px' => [\n 'min' => 0,\n 'max' => 100,\n ],\n ],\n 'devices' => ['desktop', 'tablet', 'mobile'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'margin-left: {{SIZE}}{{UNIT}};margin-right: {{SIZE}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'margin-right: {{SIZE}}{{UNIT}};margin-right: {{SIZE}}{{UNIT}};',\n ],\n\n ]\n );\n\n $this->add_responsive_control(\n 'item_padding',\n [\n 'label' => __('Item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>.menu-item-has-children>a' => 'padding: {{TOP}}{{UNIT}} calc({{RIGHT}}{{UNIT}} + 20px) {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n \n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>.menu-item-has-children>a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} calc({{RIGHT}}{{UNIT}} + 20px);',\n ],\n\n ]\n );\n\n $this->add_responsive_control(\n 'item_readius',\n [\n 'label' => __('Item Radius', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'menu_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'akash-hp' ),\n\t\t\t]\n\t\t);\n\n $this->add_control(\n 'menu_hover_color',\n [\n 'label' => __('Menu Hover Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav>li>a:hover, \n {{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav > .menu-item-has-children > a:hover .dropdownToggle,\n {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav li.current-menu-item>a' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'menu_bg_hover_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav>li:hover>a' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n $this->end_controls_section();\n\n $this->start_controls_section(\n 'dropdown_style',\n [\n 'label' => __('Dropdown Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'menu_style' => 'inline',\n ]\n ]\n );\n\n\t\t$this->start_controls_tabs(\n\t\t\t'dropdown_items_tabs'\n\t\t);\n\t\t$this->start_controls_tab(\n\t\t\t'dropdown_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'akash-hp' ),\n\t\t\t]\n );\n \n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'dripdown_typography',\n 'label' => __('Menu Typography', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li .sub-menu a',\n ]\n );\n \n $this->add_control(\n 'dropdown_item_color',\n [\n 'label' => __('Item Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a,\n {{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'dropdown_item_bg_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'ddown_menu_border_color',\n [\n 'label' => __('Menu Border Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu' => 'border-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'dropdown_item_radius',\n [\n 'label' => __('Menu radius', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n\n ]\n );\n\n $this->add_responsive_control(\n 'dropdown_item_padding',\n [\n 'label' => __('Item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'dropdown_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'akash-hp' ),\n\t\t\t]\n\t\t);\n\n $this->add_control(\n 'dropdown_item_hover_color',\n [\n 'label' => __('Item Hover Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a:hover,\n {{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav .sub-menu .menu-item-has-children > a:hover .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'dropdown_item_bg_hover_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a:hover' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->end_controls_tab();\n \n $this->end_controls_tabs();\n\n $this->end_controls_section();\n\n $this->start_controls_section(\n 'section_flyout_style',\n [\n 'label' => __('Flyout/Mobile Menu Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n\n\n\t\t$this->start_controls_tabs(\n\t\t\t'flyout_items_tabs'\n );\n \n\t\t$this->start_controls_tab(\n\t\t\t'flyout_menu_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'akash-hp' ),\n\t\t\t]\n );\n\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'flyout_menu_typography',\n 'label' => __('Item Typography', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li>a',\n ]\n );\n\n $this->add_control(\n 'flyout_menu_color',\n [\n 'label' => __('Item Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li>a, \n {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav > .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav > .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n $this->add_responsive_control(\n 'flyout_item_padding',\n [\n 'label' => __('Item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li>a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body:not(.rtl) {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>.menu-item-has-children>a' => 'padding: {{TOP}}{{UNIT}} calc({{RIGHT}}{{UNIT}} + 20px) {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n \n 'body.rtl {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li>a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>.menu-item-has-children>a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} calc({{RIGHT}}{{UNIT}} + 20px);',\n ],\n\n ]\n );\n\n $this->add_responsive_control(\n 'flyout_menu_padding',\n [\n 'label' => __('Menu Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-flyout .main-navigation' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\n 'body.rtl {{WRAPPER}} .menu-style-flyout .main-navigation' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n \n ],\n\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'flyout_menu_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'akash-hp' ),\n\t\t\t]\n\t\t);\n\n $this->add_control(\n 'flyout_menu_hover_color',\n [\n 'label' => __('Menu Hover Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .menu-style-flyout .main-navigation ul.navbar-nav>li>a:hover, \n {{WRAPPER}} .menu-style-flyout .menu-style-flyout .main-navigation ul.navbar-nav > .menu-item-has-children > a:hover .dropdownToggle,\n {{WRAPPER}} .menu-style-flyout .menu-style-flyout .main-navigation ul.navbar-nav li.current-menu-item>a' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n\n\t\t$this->end_controls_tab();\n\n $this->end_controls_tabs();\n \n $this->end_controls_section();\n\n $this->start_controls_section(\n 'flyout_dropdown_style',\n [\n 'label' => __('Flyout/Mobile Dropdown Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n\n\t\t$this->start_controls_tabs(\n\t\t\t'flyout_dropdown_items_tabs'\n\t\t);\n\t\t$this->start_controls_tab(\n\t\t\t'flyout_dropdown_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'akash-hp' ),\n\t\t\t]\n\t\t);\n \n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'flyout_dripdown_typography',\n 'label' => __('Dropdown Typography', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li .sub-menu a',\n ]\n );\n\n $this->add_control(\n 'flyout_dropdown_item_color',\n [\n 'label' => __('Item Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a,\n {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'flyout_dropdown_item_bg_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'flyout_dropdown_item_padding',\n [\n 'label' => __('Item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'flyout_dropdown_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'akash-hp' ),\n\t\t\t]\n\t\t);\n\n $this->add_control(\n 'flyout_dropdown_item_hover_color',\n [\n 'label' => __('Item Hover Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a:hover,\n {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .sub-menu .menu-item-has-children > a:hover .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'flyout_dropdown_item_bg_hover_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a:hover' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n\t\t$this->end_controls_tab();\n $this->end_controls_tabs();\n\n $this->end_controls_section();\n\n\n $this->start_controls_section(\n 'trigger_style',\n [\n 'label' => __('Trigger Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n\n\n $this->start_controls_tabs(\n 'trigger_style_tabs'\n );\n \n $this->start_controls_tab(\n 'trigger_style_normal_tab',\n [\n 'label' => __('Normal', 'akash-hp'),\n ]\n );\n \n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'trigger_typography',\n 'label' => __('Trigger Typography', 'akash-hp'),\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .navbar-toggler.open-menu',\n ]\n );\n\n $this->add_control(\n 'trigger_color',\n [\n 'label' => __('Trigger Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'trigger_background',\n [\n 'label' => __('Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_group_control(\n Group_Control_Border::get_type(),\n [\n 'name' => 'trigger_border',\n 'label' => __('Border', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .navbar-toggler.open-menu',\n ]\n );\n\n $this->add_control(\n\t\t\t'trigger_icon_size',\n\t\t\t[\n\t\t\t\t'label' => __( 'Icon size', 'plugin-domain' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .navbar-toggler.open-menu .navbar-toggler-icon svg' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t\t'{{WRAPPER}} .navbar-toggler.open-menu .navbar-toggler-icon i' => 'font-size: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'trigger_icon_gap',\n\t\t\t[\n\t\t\t\t'label' => __( 'Icon Gap', 'plugin-domain' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .navbar-toggler.open-menu .navbar-toggler-icon' => 'margin-right: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n 'trigger_radius',\n [\n 'label' => __('Border Radius', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .navbar-toggler.open-menu' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}\n ;',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'trigger_padding',\n [\n 'label' => __('Button Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .navbar-toggler.open-menu' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n ]\n );\n $this->end_controls_tab();\n\n $this->start_controls_tab(\n 'trigger_style_hover_tab',\n [\n 'label' => __('Hover', 'akash-hp'),\n ]\n );\n \n\n $this->add_control(\n 'trigger_hover_color',\n [\n 'label' => __('Trigger Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu:hover' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'trigger_hover_background',\n [\n 'label' => __('Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu:hover' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_group_control(\n Group_Control_Border::get_type(),\n [\n 'name' => 'trigger_hover_border',\n 'label' => __('Border', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .navbar-toggler.open-menu:hover',\n ]\n );\n\n $this->add_control(\n 'trigger_hover_animation',\n [\n 'label' => __('Hover Animation', 'akash-hp'),\n 'type' => Controls_Manager::HOVER_ANIMATION,\n ]\n );\n\n $this->add_responsive_control(\n 'trigger_hover_radius',\n [\n 'label' => __('Border Radius', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .navbar-toggler.open-menu:hover' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}\n ;',\n ],\n ]\n );\n \n $this->end_controls_tab();\n \n $this->end_controls_tabs();\n\n $this->end_controls_section();\n \n $this->start_controls_section(\n 'infos_style_section',\n [\n 'label' => __('Info Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'show_infos' => 'yes',\n ]\n ]\n );\n\n $this->start_controls_tabs(\n 'info_style_tabs'\n );\n \n $this->start_controls_tab(\n 'info_style_normal_tab',\n [\n 'label' => __('Normal', 'akash-hp'),\n ]\n );\n\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'info_title_typography',\n 'label' => __('Title Typography', 'akash-hp'),\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .header-info span',\n ]\n );\n\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'info_typography',\n 'label' => __('Info Typography', 'akash-hp'),\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .header-info h3 ',\n ]\n );\n\n $this->add_control(\n 'info_title_color',\n [\n 'label' => __('Info Title Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .header-info span' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'info_color',\n [\n 'label' => __('Info Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .header-info h3' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_group_control(\n Group_Control_Border::get_type(),\n [\n 'name' => 'info_box_border',\n 'label' => __('Box Border', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .akash-header-infos',\n ]\n );\n\n $this->add_control(\n\t\t\t'info_title_gap',\n\t\t\t[\n\t\t\t\t'label' => __( 'Info Title Gap', 'plugin-domain' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .header-info span' => 'margin-bottom: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n 'ifno_item_padding',\n [\n 'label' => __('Info item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .header-info' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\n 'body.rtl {{WRAPPER}} .header-info' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n ]\n );\n\n $this->end_controls_tab();\n\n $this->start_controls_tab(\n 'info_style_hover_tab',\n [\n 'label' => __('Hover', 'akash-hp'),\n ]\n );\n \n $this->add_control(\n 'info_title_color_hover',\n [\n 'label' => __('Info Title Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .header-info:hover span' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'info_color_hover',\n [\n 'label' => __('Info Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .header-info:hover h3' => 'color: {{VALUE}}',\n ],\n ]\n );\n \n \n $this->end_controls_tab();\n \n $this->end_controls_tabs();\n\n $this->end_controls_section();\n $this->start_controls_section(\n 'panel_style',\n [\n 'label' => __('Panel Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'panel_label_typography',\n 'label' => __('Label Typography', 'akash-hp'),\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler',\n ]\n );\n\n \n $this->add_control(\n 'panel_label_color',\n [\n 'label' => __('Label Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'close_trigger_color',\n [\n 'label' => __('Close Trigger Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler i' => 'color: {{VALUE}}',\n '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler svg path' => 'stroke: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'close_trigger_fill_color',\n [\n 'label' => __('Close Trigger Fill Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler svg path' => 'fill: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'close_label_background',\n [\n 'label' => __('Label Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.close-menu' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n \n $this->add_control(\n 'panel_background',\n [\n 'label' => __('Panel Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n\t\t\t'trigger_cloxe_icon_size',\n\t\t\t[\n\t\t\t\t'label' => __( 'Close Icon size', 'plugin-domain' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .menu-style-flyout .navbar-toggler.close-menu .navbar-toggler-icon svg' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t\t'{{WRAPPER}} .menu-style-flyout .navbar-toggler.close-menu .navbar-toggler-icon i' => 'font-size: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n \n $this->add_group_control(\n Group_Control_Box_Shadow::get_type(),\n [\n 'name' => 'panel_shadow',\n 'label' => __('Panel Shadow', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .navbar-inner',\n ]\n );\n\n $this->add_responsive_control(\n 'close_label_padding',\n [\n 'label' => __('Label Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-toggler.close-menu' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .navbar-toggler.close-menu' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n ]\n );\n \n $this->add_responsive_control(\n 'panel_padding',\n [\n 'label' => __('Panel Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-flyout .navbar-inner' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n ]\n );\n\n\n $this->end_controls_section();\n }", "protected function _register_controls() {\n\t}", "protected function _register_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'content_section',\n\t\t\t[\n\t\t\t\t'label' => __( 'Content', 'portfolio-elementor' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_CONTENT,\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Counter Number\n\t\t$this->add_control(\n\t\t\t'portfolio_counter_number',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Counter Number', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::TEXT,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => esc_html__( 'Enter Counter Number' , 'portfolio-elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t// Counter Title\n\t\t$this->add_control(\n\t\t\t'portfolio_counter_title',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Title', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::TEXT,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => esc_html__( 'Enter Counter Title' , 'portfolio-elementor' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t// end of the Content tab section\n\t\t\n\t\t// start of the Style tab section\n\t\t$this->start_controls_section(\n\t\t\t'style_section',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Content Style', 'portfolio-elementor' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->start_controls_tabs(\n\t\t\t'style_tabs'\n\t\t);\n\t\t\n\t\t// start everything related to Normal state here\n\t\t$this->start_controls_tab(\n\t\t\t'style_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Normal', 'portfolio-elementor' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Counter Box Options\n\t\t$this->add_control(\n\t\t\t'portfolio_counter_box_options',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Counter Box', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Counter Box Background Color\n\t\t$this->add_control(\n\t\t\t'portfolio_counter_box_background',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Background-Color', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'scheme' => [\n\t\t\t\t\t'type' => \\Elementor\\Scheme_Color::get_type(),\n\t\t\t\t\t'value' => \\Elementor\\Scheme_Color::COLOR_1,\n\t\t\t\t],\n\t\t\t\t'default' => '#f7f7f7',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .counter-box' => 'background: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Counter Box Border\n\t\t$this->add_control(\n\t\t\t'portfolio_counter_box_border',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Border', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'scheme' => [\n\t\t\t\t\t'type' => \\Elementor\\Scheme_Color::get_type(),\n\t\t\t\t\t'value' => \\Elementor\\Scheme_Color::COLOR_1,\n\t\t\t\t],\n\t\t\t\t'default' => '#eee',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .counter-box' => 'border: 8px solid {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t// Counter Number Options\n\t\t$this->add_control(\n\t\t\t'portfolio_counter_number_options',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Counter Number', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n\t\t// Counter Number Color\n\t\t$this->add_control(\n\t\t\t'portfolio_counter_number_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Number Color', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'scheme' => [\n\t\t\t\t\t'type' => \\Elementor\\Scheme_Color::get_type(),\n\t\t\t\t\t'value' => \\Elementor\\Scheme_Color::COLOR_1,\n\t\t\t\t],\n\t\t\t\t'default' => '232332',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .counter-box h3' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Counter Number Typography\n\t\t$this->add_group_control(\n\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'portfolio_counter_number_typography',\n\t\t\t\t'label' => esc_html__( 'Typography', 'portfolio-elementor' ),\n\t\t\t\t'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_1,\n\t\t\t\t'selector' => '{{WRAPPER}} .counter-box h3',\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Counter Title Options\n\t\t$this->add_control(\n\t\t\t'portfolio_counter_title_options',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Counter Title', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Counter Title Color\n\t\t$this->add_control(\n\t\t\t'portfolio_counter_title_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Color', 'portfolio-elementor' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'scheme' => [\n\t\t\t\t\t'type' => \\Elementor\\Scheme_Color::get_type(),\n\t\t\t\t\t'value' => \\Elementor\\Scheme_Color::COLOR_1,\n\t\t\t\t],\n\t\t\t\t'default' => '#232332',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .counter-box h6' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t// Counter Title Typography\n\t\t$this->add_group_control(\n\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'portfolio_counter_title_typography',\n\t\t\t\t'label' => esc_html__( 'Typography', 'portfolio-elementor' ),\n\t\t\t\t'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_1,\n\t\t\t\t'selector' => '{{WRAPPER}} .counter-box h6',\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_tab();\n\t\t// end everything related to Normal state here\n\n\t\t// start everything related to Hover state here\n\t\t$this->start_controls_tab(\n\t\t\t'style_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Hover', 'portfolio-elementor' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_tab();\n\t\t// end everything related to Hover state here\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\t\t// end of the Style tab section\n\n\t}", "protected function register_controls() {\n\n\t\t$this->render_team_member_content_control();\n\t\t$this->register_content_separator();\n\t\t$this->register_content_social_icons_controls();\n\t\t$this->register_helpful_information();\n\n\t\t/* Style */\n\t\t$this->register_style_team_member_image();\n\t\t$this->register_style_team_member_name();\n\t\t$this->register_style_team_member_designation();\n\t\t$this->register_style_team_member_desc();\n\t\t$this->register_style_team_member_icon();\n\t\t$this->register_content_spacing_control();\n\t}", "protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'main_clients_settings',\n\t\t\t[\n\t\t\t\t'label' => __( 'Clients Settings', 'elementor-main-clients' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t 'clients-columns',\n\t\t \t[\n\t\t \t'label' \t=> esc_html__( 'Column', 'essential-addons-elementor' ),\n\t\t \t'type' \t\t\t=> Controls_Manager::SELECT,\n\t\t \t'default' \t\t=> '2',\n\t\t \t'options' \t\t=> [\t\t\t\t\n\t\t\t\t\t'1' => esc_html__('1 Column', 'baldiyaat'),\n\t\t\t\t\t'2' => esc_html__('2 Column', 'baldiyaat'),\n\t\t\t\t\t'3' => esc_html__('3 Column', 'baldiyaat'),\n\t\t\t\t\t'4' => esc_html__('4 Column', 'baldiyaat'),\n\t\t\t\t\t'6' => esc_html__('6 Column', 'baldiyaat')\n\t\t \t],\n\t\t \t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'thumbnail-size',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Thumbnail Size', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'label_block' \t=> false,\n\t\t\t\t'default' => esc_html__( 'hide', 'essential-addons-elementor' ),\n\t\t \t'options' => wpha_get_thumbnail_list(),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'num-fetch',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Num Fetch', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => 10,\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t\n\t\t/**\n\t\t * Clients Text Settings\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'main_clients_config_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Clients Images', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'slider',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'seperator' => 'before',\n\t\t\t\t'default' => [\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t],\n\t\t\t\t'fields' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide',\n\t\t\t\t\t\t'label' => esc_html__( 'Image', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t\t\t'default' => [\n\t\t\t\t\t\t\t'url' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide_title',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Title', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '', 'essential-addons-elementor' )\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide_caption',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Caption', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '', 'essential-addons-elementor' )\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_enable_slide_link',\n\t\t\t\t\t\t'label' => __( 'Enable Image Link', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t\t\t'default' => 'false',\n\t\t\t\t\t\t'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'return_value' => 'true',\n\t\t\t\t\t\t\n\t\t\t\t \t],\n\t\t\t\t \t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide_link',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Link', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::URL,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => [\n\t\t \t\t\t'url' => '#',\n\t\t \t\t\t'is_external' => '',\n\t\t \t\t\t],\n\t\t \t\t\t'show_external' => true,\n\t\t \t\t\t'condition' => [\n\t\t \t\t\t\t'main_clients_settings_enable_slide_link' => 'true'\n\t\t \t\t\t]\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'title_field' => '{{main_clients_settings_slide_title}}',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\t\t\n\t\t/**\n\t\t * Clients Text Settings\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'main_clients_color_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Color & Design', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_sub_title_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Sub Title Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .kode-sub-title' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_title_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Title Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .slide-caption-title' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_caption_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Caption Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .slide-caption-des' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_button_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Button Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .banner_text_btn .bg-color' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_button_bg_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Button BG Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .banner_text_btn .bg-color' => 'background-color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t\n\t\t\n\t}", "public function getControls()\n\t{\n\t\t$this->ensureChildControls();\n\t\treturn $this->_container->getControls();\n\t}", "protected function _register_controls()\r\n {\r\n\r\n\r\n $this->start_controls_section(\r\n 'slider_settings_section',\r\n [\r\n 'label' => esc_html__('Query Settings', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_CONTENT,\r\n ]\r\n );\r\n $this->add_control(\r\n 'column',\r\n [\r\n 'label' => esc_html__('Column', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT,\r\n 'options' => array(\r\n '3' => esc_html__('04 Column', 'aapside-master'),\r\n '4' => esc_html__('03 Column', 'aapside-master'),\r\n '2' => esc_html__('06 Column', 'aapside-master')\r\n ),\r\n 'label_block' => true,\r\n 'description' => esc_html__('select grid column', 'aapside-master'),\r\n 'default' => '4'\r\n ]\r\n );\r\n $this->add_control(\r\n 'total',\r\n [\r\n 'label' => esc_html__('Total Post', 'aapside-master'),\r\n 'type' => Controls_Manager::TEXT,\r\n 'description' => esc_html__('enter how many post you want to show, enter -1 for unlimited', 'aapside-master'),\r\n 'default' => '-1'\r\n ]\r\n );\r\n $this->add_control(\r\n 'category',\r\n [\r\n 'label' => esc_html__('Category', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT2,\r\n 'multiple' => true,\r\n 'label_block' => true,\r\n 'description' => esc_html__('select category, for all category leave it blank', 'aapside-master'),\r\n 'options' => appside_master()->get_terms_names('portfolio-cat', 'id', true)\r\n ]\r\n );\r\n $this->add_control(\r\n 'orderby',\r\n [\r\n 'label' => esc_html__('Order By', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT,\r\n 'options' => array(\r\n 'ID' => esc_html__('ID', 'aapside-master'),\r\n 'title' => esc_html__('Title', 'aapside-master'),\r\n 'date' => esc_html__('Date', 'aapside-master'),\r\n ),\r\n 'description' => esc_html__('select order by', 'aapside-master'),\r\n 'default' => 'ID'\r\n ]\r\n );\r\n $this->add_control(\r\n 'order',\r\n [\r\n 'label' => esc_html__('Order', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT,\r\n 'options' => array(\r\n 'ASC' => esc_html__('Ascending', 'aapside-master'),\r\n 'DESC' => esc_html__('Descending', 'aapside-master'),\r\n ),\r\n 'description' => esc_html__('select order.', 'aapside-master'),\r\n 'default' => 'ASC'\r\n ]\r\n );\r\n $this->add_control(\r\n 'pagination',\r\n [\r\n 'label' => esc_html__('Pagination', 'aapside-master'),\r\n 'type' => Controls_Manager::SWITCHER,\r\n 'description' => esc_html__('you can set yes to show pagination.', 'aapside-master'),\r\n 'default' => 'yes'\r\n ]\r\n );\r\n $this->add_control(\r\n 'pagination_alignment',\r\n [\r\n 'label' => esc_html__('Pagination Alignment', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT,\r\n 'options' => array(\r\n 'left' => esc_html__('Left Align', 'aapside-master'),\r\n 'center' => esc_html__('Center Align', 'aapside-master'),\r\n 'right' => esc_html__('Right Align', 'aapside-master'),\r\n ),\r\n 'description' => esc_html__('you can set pagination alignment.', 'aapside-master'),\r\n 'default' => 'left',\r\n 'condition' => array('pagination' => 'yes')\r\n ]\r\n );\r\n $this->end_controls_section();\r\n\r\n $this->start_controls_section(\r\n 'thumbnail_settings_section',\r\n [\r\n 'label' => esc_html__('Thumbnail Styling', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n $this->add_control('thumb_border_radius', [\r\n 'label' => esc_html__('Border Radius', 'aapside-master'),\r\n 'type' => Controls_Manager::DIMENSIONS,\r\n 'size_units' => ['px', '%', 'em'],\r\n 'selectors' => [\r\n \"{{WRAPPER}} .hard-single-item-02 .thumb img\" => \"border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};\"\r\n ]\r\n ]);\r\n $this->add_control(\r\n 'thumbnail_bottom_gap',\r\n [\r\n 'label' => esc_html__('Thumbnail Bottom Gap', 'aapside-master'),\r\n 'type' => Controls_Manager::SLIDER,\r\n 'size_units' => ['px', '%'],\r\n 'range' => [\r\n 'px' => [\r\n 'min' => 0,\r\n 'max' => 100,\r\n 'step' => 1,\r\n ],\r\n '%' => [\r\n 'min' => 0,\r\n 'max' => 100,\r\n ],\r\n ],\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .thumb' => 'margin-bottom: {{SIZE}}{{UNIT}};',\r\n ],\r\n ]\r\n );\r\n $this->end_controls_section();\r\n\r\n\r\n /* title styling tabs start */\r\n $this->start_controls_section(\r\n 'title_settings_section',\r\n [\r\n 'label' => esc_html__('Title Styling', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n $this->start_controls_tabs(\r\n 'style_tabs'\r\n );\r\n\r\n $this->start_controls_tab(\r\n 'style_normal_tab',\r\n [\r\n 'label' => __('Normal', 'aapside-master'),\r\n ]\r\n );\r\n\r\n $this->add_control('title_color', [\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'type' => Controls_Manager::COLOR,\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .content .title' => \"color:{{VALUE}}\"\r\n ]\r\n ]);\r\n $this->end_controls_tab();\r\n\r\n $this->start_controls_tab(\r\n 'style_hover_tab',\r\n [\r\n 'label' => __('Hover', 'aapside-master'),\r\n ]\r\n );\r\n $this->add_control('title_hover_color', [\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'type' => Controls_Manager::COLOR,\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .content .title:hover' => \"color:{{VALUE}}\"\r\n ]\r\n ]);\r\n\r\n $this->end_controls_tab();\r\n\r\n $this->end_controls_tabs();\r\n\r\n $this->end_controls_section();\r\n\r\n /* title styling tabs end */\r\n\r\n /* readmore styling tabs start */\r\n $this->start_controls_section(\r\n 'readmore_settings_section',\r\n [\r\n 'label' => esc_html__('Category Styling', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n\r\n $this->start_controls_tabs(\r\n 'readmore_style_tabs'\r\n );\r\n\r\n $this->start_controls_tab(\r\n 'readmore_style_normal_tab',\r\n [\r\n 'label' => __('Normal', 'aapside-master'),\r\n ]\r\n );\r\n\r\n $this->add_control('readmore_color', [\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'type' => Controls_Manager::COLOR,\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .content .catagory a' => \"color:{{VALUE}}\"\r\n ]\r\n ]);\r\n $this->end_controls_tab();\r\n\r\n $this->start_controls_tab(\r\n 'readmore_style_hover_tab',\r\n [\r\n 'label' => __('Hover', 'aapside-master'),\r\n ]\r\n );\r\n\r\n $this->add_control('readmore_hover_color', [\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'type' => Controls_Manager::COLOR,\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .content .catagory a:hover' => \"color:{{VALUE}}\"\r\n ]\r\n ]);\r\n $this->end_controls_tab();\r\n\r\n $this->end_controls_tabs();\r\n\r\n $this->end_controls_section();\r\n /* readmore styling tabs end */\r\n\r\n /* pagination styling tabs start */\r\n $this->start_controls_section(\r\n 'pagination_settings_section',\r\n [\r\n 'label' => esc_html__('Pagination Settings', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n\r\n $this->start_controls_tabs(\r\n 'pagination_style_tabs'\r\n );\r\n\r\n $this->start_controls_tab(\r\n 'pagination_style_normal_tab',\r\n [\r\n 'label' => __('Normal', 'aapside-master'),\r\n ]\r\n );\r\n\r\n $this->add_control('pagination_color', [\r\n 'type' => Controls_Manager::COLOR,\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'selectors' => [\r\n \"{{WRAPPER}} .portfolio-pagination` ul li a\" => \"color: {{VALUE}}\",\r\n \"{{WRAPPER}} .portfolio-pagination ul li span\" => \"color: {{VALUE}}\",\r\n ]\r\n ]);\r\n $this->add_control('pagination_border_color', [\r\n 'type' => Controls_Manager::COLOR,\r\n 'label' => esc_html__('Border Color', 'aapside-master'),\r\n 'selectors' => [\r\n \"{{WRAPPER}} .portfolio-pagination ul li a\" => \"border-color: {{VALUE}}\",\r\n \"{{WRAPPER}} .portfolio-pagination ul li span\" => \"border-color: {{VALUE}}\",\r\n ]\r\n ]);\r\n $this->add_control('pagination_hr', [\r\n 'type' => Controls_Manager::DIVIDER\r\n ]);\r\n $this->add_group_control(Group_Control_Background::get_type(), [\r\n 'name' => 'pagination_background',\r\n 'label' => esc_html__('Background', 'aapside-master'),\r\n 'selector' => \"{{WRAPPER}} .portfolio-pagination ul li a, {{WRAPPER}} .portfolio-pagination ul li span\"\r\n ]);\r\n\r\n $this->end_controls_tab();\r\n\r\n $this->start_controls_tab(\r\n 'pagination_style_hover_tab',\r\n [\r\n 'label' => __('Hover', 'aapside-master'),\r\n ]\r\n );\r\n $this->add_control('pagination_hover_color', [\r\n 'type' => Controls_Manager::COLOR,\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'selectors' => [\r\n \"{{WRAPPER}} .portfolio-pagination ul li a:hover\" => \"color: {{VALUE}}\",\r\n \"{{WRAPPER}} .portfolio-pagination ul li span.current\" => \"color: {{VALUE}}\",\r\n ]\r\n ]);\r\n $this->add_control('pagination_hover_border_color', [\r\n 'type' => Controls_Manager::COLOR,\r\n 'label' => esc_html__('Border Color', 'aapside-master'),\r\n 'selectors' => [\r\n \"{{WRAPPER}} .portfolio-pagination ul li a:hover\" => \"border-color: {{VALUE}}\",\r\n \"{{WRAPPER}} .portfolio-pagination ul li span.current\" => \"border-color: {{VALUE}}\",\r\n ]\r\n ]);\r\n $this->add_control('pagination_hover_hr', [\r\n 'type' => Controls_Manager::DIVIDER\r\n ]);\r\n $this->add_group_control(Group_Control_Background::get_type(), [\r\n 'name' => 'pagination_hover_background',\r\n 'label' => esc_html__('Background', 'aapside-master'),\r\n 'selector' => \"{{WRAPPER}} .portfolio-pagination ul li a:hover, {{WRAPPER}} .Portfolio-pagination ul li span.current\"\r\n ]);\r\n\r\n\r\n $this->end_controls_tab();\r\n\r\n $this->end_controls_tabs();\r\n\r\n $this->end_controls_section();\r\n /* pagination styling tabs end */\r\n\r\n /* Typography tabs start */\r\n $this->start_controls_section(\r\n 'typography_settings_section',\r\n [\r\n 'label' => esc_html__('Typography Settings', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n $this->add_group_control(Group_Control_Typography::get_type(), [\r\n 'name' => 'title_typography',\r\n 'label' => esc_html__('Title Typography', 'aapside-master'),\r\n 'selector' => \"{{WRAPPER}} .hard-single-item-02 .content .title\"\r\n ]);\r\n $this->add_group_control(Group_Control_Typography::get_type(), [\r\n 'name' => 'post_meta_typography',\r\n 'label' => esc_html__('Category Typography', 'aapside-master'),\r\n 'selector' => \"{{WRAPPER}} .hard-single-item-02 .content .cats\"\r\n ]);\r\n $this->end_controls_section();\r\n\r\n /* Typography tabs end */\r\n }", "protected function _register_controls()\n {\n $this->tab_content();\n $this->tab_style();\n }", "public function build_controls()\n {\n $this->add_control( 'id', [\n 'label' => __( 'Post', 'customize-static-layout' ),\n 'type' => 'object_selector',\n 'post_query_vars' => static::get_post_query_vars(),\n 'select2_options' => [\n 'allowClear' => true,\n 'placeholder' => __( '&mdash; Select &mdash;', 'customize-static-layout' ),\n ],\n ], 'CustomizeObjectSelector\\Control' );\n }", "protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'section_content',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Content', 'elementor-gastenboek' ),\n\t\t\t)\n\t\t);\n\n $this->end_controls_section();\n\t}", "public function getAllControls();", "protected function _register_controls() {\n\n $nav_menus = wp_get_nav_menus();\n\n $nav_menus_option = array(\n esc_html__( 'Select a menu', 'Alita-extensions' ) => '',\n );\n\n foreach ( $nav_menus as $key => $nav_menu ) {\n $nav_menus_option[$nav_menu->name] = $nav_menu->name;\n }\n\n $this->start_controls_section(\n 'content_section',\n [\n 'label' => esc_html__( 'Content', 'Alita-extensions' ),\n 'tab' => Controls_Manager::TAB_CONTENT,\n ]\n );\n\n $this->add_control(\n 'title',\n [\n 'label' => esc_html__( 'Title', 'Alita-extensions' ),\n 'description' => esc_html__( 'Enter the title of menu.', 'Alita-extensions' ),\n 'type' => Controls_Manager::TEXT,\n 'default' => 'Alita Best Selling:',\n ]\n );\n\n $this->add_control(\n 'menu',\n [\n\n 'label' => esc_html__( 'Menu', 'Alita-extensions' ),\n 'type' => Controls_Manager::SELECT,\n 'default' => 'vertical-menu',\n 'options' => $nav_menus_option,\n ]\n );\n \n\n $this->end_controls_section();\n\n }", "protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'section_content',\n\t\t\t[\n\t\t\t\t'label' => __( 'Content', 'elementor-hello-world' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'title',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title', 'elementor-hello-world' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'Subtitle',\n\t\t\t[\n\t\t\t\t'label' => __( 'SubTitle', 'elementor-hello-world' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'gallery',\n\t\t\t[\n\t\t\t\t'label' => __( 'Add Images', 'plugin-domain' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::GALLERY,\n\t\t\t\t'default' => [],\n\t\t\t]\n\t\t);\n\t\t\n\t\t\n\t\t\n\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'section_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Style', 'elementor-hello-world' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t]\n\t\t);\n\n\t\t\t$this->add_group_control(\n\t\t\t\\Elementor\\Group_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'content_typography',\n\t\t\t\t'label' => __( 'Typography', 'elementor-hello-world' ),\n\t\t\t\t'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n\t\t\t\t'selector' => '{{WRAPPER}} .title',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'title_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title Color', 'elementor-hello-world' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'scheme' => [\n\t\t\t\t\t'type' => \\Elementor\\Scheme_Color::get_type(),\n\t\t\t\t\t'value' => \\Elementor\\Scheme_Color::COLOR_1,\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .title' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$this->add_control(\n\t\t\t'width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Width', 'elementor-hello-world' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 5,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t\t'size' => 50,\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .box' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'show_title',\n\t\t\t[\n\t\t\t\t'label' => __( 'Show Title', 'elementor-hello-world' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Show', 'elementor-hello-world' ),\n\t\t\t\t'label_off' => __( 'Hide', 'elementor-hello-world' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => 'yes',\n\t\t\t]\n\t\t);\n\t\t\n\t\t\n\t\t\n\t\n\t\t\n\n\t\t$this->end_controls_section();\n\t\t\n\t\t$this->start_controls_section(\n\t\t\t'section_advanced',\n\t\t\t[\n\t\t\t\t'label' => __( 'Opacity Change', 'elementor-hello-world' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'title_color1', \n\t\t\t[\n\t\t\t\t'label' => __( 'Title Color', 'elementor-hello-world' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::COLOR,\n\t\t\t\t'scheme' => [\n\t\t\t\t\t'type' => \\Elementor\\Scheme_Color::get_type(),\n\t\t\t\t\t'value' => \\Elementor\\Scheme_Color::COLOR_1,\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .title' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'transparent',\n\t\t\t[\n\t\t\t\t'label' => __( 'Enable', 'elementor-hello-world' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'On', 'elementor-hello-world' ),\n\t\t\t\t'label_off' => __( 'Off', 'elementor-hello-world' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => '',\n\t\t\t\t'frontend_available' => true,\n\t\t\t\t'prefix_class' => 'opacity-siva-border-',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .title2' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t\n\t\t$this->end_controls_section();\n\t}", "protected function _register_controls() {\n /*-----------------------------------------------------------------------------------*/\n /* Content TAB\n /*-----------------------------------------------------------------------------------*/\n $this->start_controls_section(\n 'title_section',\n array(\n 'label' => __('APR Heading', 'apr-core' ),\n )\n );\n /* Heading 1*/\n $this->add_control(\n 'title',\n array(\n 'label' => __( 'Title', 'apr-core' ),\n 'type' => Controls_Manager::TEXTAREA,\n 'dynamic' => array(\n 'active' => true\n ),\n 'placeholder' => __( 'Enter your title', 'apr-core' ),\n 'default' => __( 'Enter your title', 'apr-core' ),\n 'label_block' => true,\n )\n );\n $this->add_control(\n 'heading_size',\n array(\n 'label' => __( 'HTML Tag', 'apr-core' ),\n 'type' => Controls_Manager::SELECT,\n 'options' => array(\n 'h1' => __( 'H1', 'apr-core' ),\n 'h2' => __( 'H2', 'apr-core' ),\n 'h3' => __( 'H3', 'apr-core' ),\n 'h4' => __( 'H4', 'apr-core' ),\n 'h5' => __( 'H5', 'apr-core' ),\n 'p' => __( 'p', 'apr-core' ),\n ),\n 'default' => 'h3',\n )\n );\n $this->add_control(\n 'link',\n [\n 'label' => __( 'Link', 'elementor' ),\n 'type' => Controls_Manager::URL,\n 'dynamic' => [\n 'active' => true,\n ],\n 'default' => [\n 'url' => '',\n ],\n 'separator' => 'before',\n ]\n );\n $this->add_responsive_control(\n 'alignment',\n array(\n 'label' => __('Alignment', 'apr-core'),\n 'type' => Controls_Manager::CHOOSE,\n 'default' => 'left',\n 'options' => array(\n 'left' => array(\n 'title' => __( 'Left', 'apr-core' ),\n 'icon' => 'fa fa-align-left',\n ),\n 'center' => array(\n 'title' => __( 'Center', 'apr-core' ),\n 'icon' => 'fa fa-align-center',\n ),\n 'right' => array(\n 'title' => __( 'Right', 'apr-core' ),\n 'icon' => 'fa fa-align-right',\n )\n ),\n )\n );\n $this->add_control(\n 'description',\n array(\n 'label' => __( 'Description', 'apr-core' ),\n 'type' => Controls_Manager::TEXTAREA,\n 'dynamic' => array(\n 'active' \t=> true\n ),\n )\n );\n $this->add_control(\n 'description_position',\n [\n 'label' => __( 'Description Position', 'apr-core' ),\n 'type' => Controls_Manager::SELECT,\n 'default' => 'bottom',\n 'options' => [\n 'aside' => __( 'Aside', 'apr-core' ),\n 'bottom' => __( 'Bottom', 'apr-core' ),\n ],\n ]\n );\n $this->add_control(\n 'list_divider',\n [\n 'label' => __( 'Divider', 'apr-core' ),\n 'type' => Controls_Manager::SWITCHER,\n 'default' => 'no',\n 'separator' => 'before',\n ]\n );\n\n $this->add_control(\n 'divider_position',\n [\n 'label' => __( 'Position', 'apr-core' ),\n 'type' => Controls_Manager::SELECT,\n 'options' => [\n 'top' => __( 'Top', 'apr-core' ),\n 'bottom' => __( 'Bottom', 'apr-core' )\n ],\n 'default' => 'bottom',\n 'condition' => [\n 'list_divider' => 'yes',\n ]\n ]\n );\n\n $this->add_control(\n 'divider_color',\n [\n 'label' => __( 'Color', 'apr-core' ),\n 'type' => Controls_Manager::COLOR,\n 'default' => '',\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_3,\n ],\n 'condition' => [\n 'list_divider' => 'yes',\n ],\n 'selectors' => [\n '{{WRAPPER}} .heading-title:before' => 'background-color: {{VALUE}};',\n ],\n ]\n );\n $this->add_control(\n 'divider_color_hover',\n [\n 'label' => __( 'Color Hover', 'apr-core' ),\n 'type' => Controls_Manager::COLOR,\n 'default' => '',\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_3,\n ],\n 'condition' => [\n 'list_divider' => 'yes',\n ],\n 'selectors' => [\n '{{WRAPPER}} .heading-title:hover:before' => 'background-color: {{VALUE}};',\n ],\n ]\n );\n $this->add_responsive_control(\n 'divider_top',\n [\n 'label' => __( 'Top Space', 'apr-core' ),\n 'type' => Controls_Manager::SLIDER,\n 'default' => [\n 'size' => '',\n 'unit' => 'px',\n ],\n 'range' => [\n 'px' => [\n 'min' => 0,\n 'max' => 1000,\n ],\n ],\n 'size_units' => [ 'px' ],\n 'condition' => [\n 'list_divider' => 'yes',\n ],\n 'selectors' => [\n '{{WRAPPER}} .heading-title:before' => 'top: {{SIZE}}{{UNIT}};',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'divider_left',\n [\n 'label' => __( 'Left Space', 'apr-core' ),\n 'type' => Controls_Manager::SLIDER,\n 'default' => [\n 'size' => '',\n 'unit' => 'px',\n ],\n 'range' => [\n 'px' => [\n 'min' => 0,\n 'max' => 1000,\n ],\n ],\n 'size_units' => [ 'px' ],\n 'condition' => [\n 'list_divider' => 'yes',\n ],\n 'selectors' => [\n '{{WRAPPER}} .heading-title:before' => 'left: {{SIZE}}{{UNIT}};',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'divider_weight',\n [\n 'label' => __( 'Height', 'apr-core' ),\n 'type' => Controls_Manager::SLIDER,\n 'default' => [\n 'size' => 1,\n 'unit' => 'px',\n ],\n 'range' => [\n 'px' => [\n 'min' => 0,\n 'max' => 1000,\n ],\n '%' => [\n 'min' => 0,\n 'max' => 100,\n ],\n ],\n 'size_units' => [ '%', 'px' ],\n 'condition' => [\n 'list_divider' => 'yes',\n ],\n 'selectors' => [\n '{{WRAPPER}} .heading-title:before' => 'height: {{SIZE}}{{UNIT}};',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'divider_width',\n [\n 'label' => __( 'Width', 'apr-core' ),\n 'type' => Controls_Manager::SLIDER,\n 'condition' => [\n 'list_divider' => 'yes',\n ],\n 'default' => [\n 'size' => 100,\n 'unit' => 'px',\n ],\n 'range' => [\n 'px' => [\n 'min' => 0,\n 'max' => 1000,\n ],\n '%' => [\n 'min' => 0,\n 'max' => 100,\n ],\n ],\n 'size_units' => [ '%', 'px' ],\n 'selectors' => [\n '{{WRAPPER}} .heading-title:before' => 'width: {{SIZE}}{{UNIT}};',\n ],\n ]\n );\n \n $this->end_controls_section();\n /*-----------------------------------------------------------------------------------*/\n /* Style TAB\n /*-----------------------------------------------------------------------------------*/\n $this->start_controls_section(\n 'title_style_section',\n array(\n 'label' => __( 'Color', 'apr-core' ),\n 'tab' => Controls_Manager::TAB_STYLE,\n )\n );\n $this->add_control(\n 'title_color',\n [\n 'label' => __( 'Title Color', 'apr-core' ),\n 'type' => Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_1,\n ],\n 'selectors' => [\n // Stronger selector to avoid section style from overwriting\n '{{WRAPPER}} .heading-modern .heading-title,\n {{WRAPPER}} .heading-modern .heading-title a' => 'color: {{VALUE}};',\n ],\n ]\n );\n $this->add_control(\n 'desc_color',\n [\n 'label' \t=> __( 'Description color', 'apr-core' ),\n 'type' \t\t=> Controls_Manager::COLOR,\n 'scheme' \t=> [\n 'type' \t\t=> Scheme_Color::get_type(),\n 'value' \t=> Scheme_Color::COLOR_1,\n ],\n 'selectors' => [\n '{{WRAPPER}} .heading-modern .description' => 'color: {{VALUE}};',\n ],\n ]\n );\n $this->end_controls_section();\n $this->start_controls_section(\n 'desc_style',\n array(\n 'label' => __( 'Typography', 'apr-core' ),\n 'tab' => Controls_Manager::TAB_STYLE,\n )\n );\n\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' \t\t=> 'title_typo',\n 'label' \t=> __( 'Title', 'apr-core' ),\n 'selector' => '{{WRAPPER}} .heading-modern .heading-title',\n ]\n );\n $this->add_responsive_control(\n 'title_width',\n array(\n 'label' => __('Max width Title','apr-core' ),\n 'type' => Controls_Manager::SLIDER,\n 'size_units' => array('px','%'),\n 'range' => array(\n '%' => array(\n 'min' => 1,\n 'max' => 100,\n ),\n 'px' => array(\n 'min' => 1,\n 'max' => 1600,\n 'step' => 5\n )\n ),\n 'selectors' => array(\n '{{WRAPPER}} .heading-modern .heading-title' => 'max-width:{{SIZE}}{{UNIT}};'\n ),\n )\n );\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' \t\t=> 'desc_typo',\n 'label' \t=> __( 'Description', 'apr-core' ),\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' \t=> '{{WRAPPER}} .heading-modern .description',\n ]\n );\n $this->add_responsive_control(\n 'desc_width',\n array(\n 'label' => __('Max width Description','apr-core' ),\n 'type' => Controls_Manager::SLIDER,\n 'size_units' => array('px','%'),\n 'range' => array(\n '%' => array(\n 'min' => 1,\n 'max' => 100,\n ),\n 'px' => array(\n 'min' => 1,\n 'max' => 1600,\n 'step' => 5\n )\n ),\n 'selectors' => array(\n '{{WRAPPER}} .heading-modern .description' => 'max-width:{{SIZE}}{{UNIT}};'\n ),\n )\n );\n $this->add_responsive_control(\n 'title_margin',\n array(\n 'label' => __( 'Margin Title', 'apr-core' ),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => [ 'px', '%' ],\n 'allowed_dimensions' => 'vertical',\n 'placeholder' => [\n 'top' => '',\n 'right' => 'auto',\n 'bottom' => '',\n 'left' => 'auto',\n ],\n 'selectors' => [\n '{{WRAPPER}} .heading-modern .heading-title' => 'margin-top: {{TOP}}{{UNIT}}; margin-bottom: {{BOTTOM}}{{UNIT}};',\n ],\n )\n );\n\n $this->add_responsive_control(\n 'title_padding',\n [\n 'label' => __( 'Padding Title', 'apr-core' ),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => [ 'px', 'em', '%' ],\n 'selectors' => [\n '{{WRAPPER}} .heading-modern .heading-title' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'\n ],\n ]\n );\n $this->add_responsive_control(\n 'desc_margin',\n array(\n 'label' => __( 'Margin Description', 'apr-core' ),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => [ 'px', '%' ],\n 'allowed_dimensions' => 'vertical',\n 'placeholder' => [\n 'top' => '',\n 'right' => 'auto',\n 'bottom' => '',\n 'left' => 'auto',\n ],\n 'selectors' => [\n '{{WRAPPER}} .heading-modern .description' => 'margin-top: {{TOP}}{{UNIT}}; margin-bottom: {{BOTTOM}}{{UNIT}};',\n ],\n )\n );\n $this->add_responsive_control(\n 'description_padding',\n [\n 'label' => __( 'Padding Description', 'apr-core' ),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => [ 'px', 'em', '%' ],\n 'selectors' => [\n '{{WRAPPER}} .heading-modern .description' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'\n ],\n ]\n );\n $this->add_control(\n 'title_color_hover',\n [\n 'label' => __( 'Title Color Hover', 'apr-core' ),\n 'type' => Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_1,\n ],\n 'selectors' => [\n // Stronger selector to avoid section style from overwriting\n '{{WRAPPER}} .heading-modern .heading-title:hover,\n {{WRAPPER}} .heading-modern .heading-title a:hover' => 'color: {{VALUE}};',\n ],\n ]\n );\n $this->add_control(\n 'desc_color_hover',\n [\n 'label' => __( 'Description Color Hover', 'apr-core' ),\n 'type' => Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_1,\n ],\n 'selectors' => [\n // Stronger selector to avoid section style from overwriting\n '{{WRAPPER}} .heading-modern .description:hover' => 'color: {{VALUE}};',\n ],\n ]\n );\n $this->end_controls_section();\n }", "protected function _register_controls()\n {\n\n global $rand_num;\n $rand_num = rand(10000000, 99909999);\n $this->start_controls_section(\n 'content_section',\n [\n 'label' => __('Section Heading Settings', 'careerfy-frame'),\n 'tab' => Controls_Manager::TAB_CONTENT,\n ]\n );\n $this->add_control(\n 'view',\n [\n 'label' => __('Style', 'careerfy-frame'),\n 'type' => Controls_Manager::SELECT2,\n 'default' => 'view1',\n 'options' => [\n 'view1' => __('Style 1', 'careerfy-frame'),\n 'view2' => __('Style 2', 'careerfy-frame'),\n 'view3' => __('Style 3', 'careerfy-frame'),\n 'view4' => __('Style 4', 'careerfy-frame'),\n 'view5' => __('Style 5', 'careerfy-frame'),\n 'view6' => __('Style 6', 'careerfy-frame'),\n 'view7' => __('Style 7', 'careerfy-frame'),\n 'view8' => __('Style 8', 'careerfy-frame'),\n 'view9' => __('Style 9', 'careerfy-frame'),\n 'view10' => __('Style 10', 'careerfy-frame'),\n 'view11' => __('Style 11', 'careerfy-frame'),\n 'view12' => __('Style 12', 'careerfy-frame'),\n 'view13' => __('Style 13', 'careerfy-frame'),\n 'view14' => __('Style 14', 'careerfy-frame'),\n 'view15' => __('Style 15', 'careerfy-frame'),\n 'view16' => __('Style 16', 'careerfy-frame'),\n 'view17' => __('Style 17', 'careerfy-frame'),\n 'view18' => __('Style 18', 'careerfy-frame'),\n ],\n ]\n );\n $this->add_control(\n 's_title',\n [\n 'label' => __('Small Title', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXT,\n 'condition' => [\n 'view' => ['view6','view18']\n ],\n ]\n );\n $this->add_control(\n 'heading_img',\n [\n 'label' => __('Image', 'careerfy-frame'),\n 'type' => Controls_Manager::MEDIA,\n 'dynamic' => [\n 'active' => true,\n ],\n 'default' => [\n 'url' => Utils::get_placeholder_image_src(),\n ],\n 'condition' => [\n 'view' => array('view8', 'view15')\n ],\n ]\n );\n $this->add_control(\n 'h_title',\n [\n 'label' => __('Title', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXT,\n\n ]\n );\n $this->add_control(\n 'num_title',\n [\n 'label' => __('Title Number', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXT,\n 'condition' => [\n 'view' => 'view6'\n ],\n ]\n );\n $this->add_control(\n 'h_fancy_title',\n [\n 'label' => __('Fancy Title', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXT,\n 'condition' => [\n 'view' => array('view1', 'view2', 'view3', 'view4', 'view5')\n ],\n ]\n );\n\n $this->add_control(\n 'hc_icon',\n [\n 'label' => __('Icon', 'careerfy-frame'),\n 'type' => Controls_Manager::ICONS,\n 'description' => __(\"This will apply to heading style 3 only.\", \"careerfy-frame\"),\n 'condition' => [\n 'view' => array('view1', 'view2', 'view3', 'view4', 'view5')\n ],\n ]\n );\n $this->add_control(\n 'h_desc',\n [\n 'label' => __('Description', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXTAREA,\n ]\n );\n\n $this->add_control(\n 'text_align',\n [\n 'label' => __('Text Align', 'careerfy-frame'),\n 'type' => Controls_Manager::SELECT2,\n 'default' => 'center',\n 'options' => [\n 'center' => __('Center', 'careerfy-frame'),\n 'left' => __('Left', 'careerfy-frame'),\n\n ],\n 'condition' => [\n 'view' => array('view7', 'view8', 'view17','view18')\n ],\n ]\n );\n $this->end_controls_section();\n\n $this->start_controls_section(\n 'section_style',\n [\n 'label' => __('Heading Style', 'careerfy-frame'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n\n $this->add_control(\n 'hc_title',\n [\n 'label' => __('Color Title', 'careerfy-frame'),\n 'type' => Controls_Manager::COLOR,\n 'condition' => [\n 'view' => array('view1', 'view2', 'view3', 'view4', 'view5')\n ],\n ]\n );\n $this->add_control(\n 's_title_clr',\n [\n 'label' => __('Choose Small Title Color', 'careerfy-frame'),\n 'type' => Controls_Manager::COLOR,\n 'condition' => [\n 'view' => ['view6','view18']\n ],\n ]\n );\n $this->add_control(\n 'hc_title_clr',\n [\n 'label' => __('Choose Title Color', 'careerfy-frame'),\n 'type' => Controls_Manager::COLOR,\n 'description' => __(\"This Color will apply to 'Color Title'.\", \"careerfy-frame\"),\n\n ]\n );\n $this->add_control(\n 'desc_clr',\n [\n 'label' => __('Choose Description Color', 'careerfy-frame'),\n 'type' => Controls_Manager::COLOR,\n 'condition' => [\n 'view' => 'view6'\n ],\n ]\n );\n $this->add_control(\n 'proc_num_clr',\n [\n 'label' => __('Choose Process Number Color', 'careerfy-frame'),\n 'type' => Controls_Manager::COLOR,\n 'condition' => [\n 'view' => 'view6'\n ],\n ]\n );\n $this->add_control(\n 'hc_dcolor',\n [\n 'label' => __('Description Color', 'careerfy-frame'),\n 'type' => Controls_Manager::COLOR,\n 'description' => __(\"This will apply to the description only.\", \"careerfy-frame\"),\n\n ]\n );\n\n\n $this->end_controls_section();\n }", "protected function _register_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'section_style',\n\t\t\tarray(\n\t\t\t\t'label' => esc_html__( 'Style', 'woocommerce-builder-elementor' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'wc_style_warning',\n\t\t\t[\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::RAW_HTML,\n\t\t\t\t'raw' => esc_html__( 'This is the preview mode of the builder, this widget may not show properly you should view the result in the Product Page and The style of this widget is often affected by your theme and plugins. If you experience any such issue, try to switch to a basic theme and deactivate related plugins.', 'woocommerce-builder-elementor' ),\n\t\t\t\t'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',\n\t\t\t]\n\t\t);\n\t\t\n\n\t\t$this->end_controls_section();\n\n\t}", "public function render_control_templates()\n {\n }", "protected function _register_controls_parent() {\n $this->start_controls_section(\n 'custom_css_section',\n [\n 'label' => __('Custom CSS', 'unifato_addons'),\n 'tab' => \\Elementor\\Controls_Manager::TAB_CONTENT,\n ]\n );\n\n\n\t\t$this->add_control(\n\t\t\t'custom_css',\n\t\t\t[\n\t\t\t\t'label' => __( 'Custom CSS', 'unifato_addons' ),\n 'description' => __('Use <span style=\"color: red\">[SELECTOR]</span> to target selector. <br/><br/> <i>Example:</i> <br /><pre style=\"font-style: normal\">[SELECTOR] a {<br /> color: red;<br />}</pre>', 'unifato_addons'),\n 'default' => '',\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::CODE,\n\t\t\t\t'language' => 'css',\n\t\t\t\t'rows' => 20,\n\t\t\t]\n\t\t);\n\n $this->end_controls_section();\n\n $this->start_controls_section(\n 'additional_style_section',\n [\n 'label' => __('Additional Style', 'unifato_addons'),\n 'tab' => \\Elementor\\Controls_Manager::TAB_CONTENT,\n ]\n );\n\n $this->add_control(\n 'white_skin',\n [\n 'label' => __('White Skin?', 'unifato_addons'),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n 'label_on' => __( 'Yes', 'unifato_addons' ),\n 'label_off' => __( 'No', 'unifato_addons' ),\n 'return_value' => 'text-white',\n 'default' => 'no',\n 'dynamic' => [\n 'active' => true\n ],\n 'prefix_class' => '',\n ]\n );\n\n $this->end_controls_section();\n }", "protected function register_controls() {\n $this->start_controls_section(\n 'developer_tools',\n [\n 'label' => esc_html__( 'Developer Tools', 'bridge-core' ),\n 'tab' => \\Elementor\\Controls_Manager::TAB_CONTENT,\n ]\n );\n\n $this->add_control(\n 'shortcode_snippet',\n [\n 'label' => esc_html__( 'Show Shortcode Snippet', 'bridge-core' ),\n 'type' => \\Elementor\\Controls_Manager::SELECT,\n 'default' => 'no',\n 'options' => array(\n 'no' => esc_html__( 'No', 'bridge-core' ),\n 'yes' => esc_html__( 'Yes', 'bridge-core' ),\n ),\n ]\n );\n\n $this->end_controls_section();\n }", "protected function _register_controls()\n\t{\n\t\t// Heading\n\t\t$this->start_controls_section(\n\t\t\t'heading_style',\n\t\t\tarray(\n\t\t\t\t'label' => esc_html__('Heading', 'elementor'),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'heading_typography',\n\t\t\t\t'label' => esc_html__('Typography', 'elementor'),\n\t\t\t\t'selector' => '{{WRAPPER}} .woocommerce-additional-fields > h3',\n\t\t\t)\n\t\t);\n\t\t$this->add_control(\n\t\t\t'heading_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Color', 'elementor'),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields > h3' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'heading_align',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Alignment', 'elementor'),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'left' => [\n\t\t\t\t\t\t'title' => esc_html__('Left', 'elementor'),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => esc_html__('Center', 'elementor'),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'right' => [\n\t\t\t\t\t\t'title' => esc_html__('Right', 'elementor'),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'prefix_class' => '',\n\t\t\t\t'default' => '',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields > h3' => 'text-align: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\n\t\t// label\n\t\t$this->start_controls_section(\n\t\t\t'label_style',\n\t\t\tarray(\n\t\t\t\t'label' => esc_html__('Label', 'webt'),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'label_typography',\n\t\t\t\t'label' => esc_html__('Typography', 'elementor'),\n\t\t\t\t'selector' => '{{WRAPPER}} .woocommerce-additional-fields .form-row label',\n\t\t\t)\n\t\t);\n\t\t$this->add_control(\n\t\t\t'label_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Label Color', 'webt'),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields .form-row label' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'label_align',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Alignment', 'elementor'),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'left' => [\n\t\t\t\t\t\t'title' => esc_html__('Left', 'elementor'),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => esc_html__('Center', 'elementor'),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'right' => [\n\t\t\t\t\t\t'title' => esc_html__('Right', 'elementor'),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'prefix_class' => '',\n\t\t\t\t'default' => '',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields .form-row label' => 'text-align: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\n\t\t// Input Fields\n\t\t$this->start_controls_section(\n\t\t\t'input_style',\n\t\t\tarray(\n\t\t\t\t'label' => esc_html__('Input Fields', 'webt'),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'input_typography',\n\t\t\t\t'label' => esc_html__('Typography', 'elementor'),\n\t\t\t\t'selector' => '{{WRAPPER}} .woocommerce-additional-fields input , {{WRAPPER}} .woocommerce-additional-fields textarea',\n\t\t\t)\n\t\t);\n\t\t$this->add_control(\n\t\t\t'input_placeholder_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Field Placeholder Input Color', 'webt'),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields input::placeholder' => 'color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields input::-webkit-input-placeholder' => 'color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields input::-moz-placeholder' => 'color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields input:-ms-input-placeholder' => 'color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields textarea::placeholder' => 'color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields textarea::-webkit-input-placeholder' => 'color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields textarea::-moz-placeholder' => 'color: {{VALUE}};',\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields textarea:-ms-input-placeholder' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'input_padding',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Padding', 'elementor'),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => ['px', 'em'],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields input, {{WRAPPER}} .woocommerce-additional-fields textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\n\t\t$this->start_controls_tabs('tabs_input_style');\n\t\t$this->start_controls_tab(\n\t\t\t'tab_input_normal',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Normal', 'webt'),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'input_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Text Color', 'webt'),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields input, {{WRAPPER}} .woocommerce-additional-fields textarea' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'input_border',\n\t\t\t\t'selector' => '{{WRAPPER}} .woocommerce-additional-fields input, {{WRAPPER}} .woocommerce-additional-fields textarea',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'input_bg_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Background Color', 'webt'),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields input, {{WRAPPER}} .woocommerce-additional-fields textarea' => 'background-color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'input_border_radius',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Radius', 'webt'),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => ['px', '%'],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} woocommerce-additional-fields input, {{WRAPPER}} .woocommerce-additional-fields textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'input_box_shadow',\n\t\t\t\t'selector' => '{{WRAPPER}} woocommerce-additional-fields input, {{WRAPPER}} .woocommerce-additional-fields textarea',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'tab_input_focus',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Focus', 'webt'),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'input_focus_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Text Color', 'webt'),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields input:focus, {{WRAPPER}} .woocommerce-additional-fields textarea:focus' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'input_focus_border',\n\t\t\t\t'selector' => '{{WRAPPER}} .woocommerce-additional-fields input:focus, {{WRAPPER}} .woocommerce-additional-fields textarea:focus',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'input_focus_bg_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Background Color', 'webt'),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .woocommerce-additional-fields input:focus, {{WRAPPER}} .woocommerce-additional-fields textarea:focus' => 'background-color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'input_focus_border_radius',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Radius', 'webt'),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => ['px', '%'],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} woocommerce-additional-fields input:focus, {{WRAPPER}} .woocommerce-additional-fields textarea:focus' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'input_focus_box_shadow',\n\t\t\t\t'selector' => '{{WRAPPER}} woocommerce-additional-fields input:focus, {{WRAPPER}} .woocommerce-additional-fields textarea:focus',\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_tab();\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\t}", "protected function _register_controls() {\n \n \t$this->start_controls_section(\n \t\t'section_listing_posts',\n \t\t[\n \t\t\t'label' => __( 'Listing Posts', 'listslides' ),\n \t\t\t'tab' => Controls_Manager::TAB_CONTENT,\n \t\t]\n \t); \n\n \t$this->add_control(\n \t\t'item_per_page',\n \t\t[\n \t\t\t'label' => __( 'Number of Listings', 'listslides' ),\n \t\t\t'type' => Controls_Manager::SELECT,\n \t\t\t'default' => 5,\n \t\t\t'options' => [\n \t\t\t\t2 => __( 'Two', 'listslides' ),\n \t\t\t\t3 => __( 'Three', 'listslides' ),\n \t\t\t\t4 => __( 'Four', 'listslides' ),\n \t\t\t\t5 => __( 'Five', 'listslides')\n \t\t\t]\n \t\t]\n \t);\n\n \t$this->end_controls_section();\n\n \t$this->start_controls_section(\n\t\t\t'slide_settings',\n\t\t\t[\n\t\t\t\t'label' => __( 'Slides Settings', 'listslides' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_CONTENT,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'nav',\n\t\t\t[\n\t\t\t\t'label' => __( 'Navigation Arrow', 'listslides' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Show', 'listslides' ),\n\t\t\t\t'label_off' => __( 'Hide', 'listslides' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => 'true',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'dots',\n\t\t\t[\n\t\t\t\t'label' => __( 'Dots', 'listslides' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Show', 'listslides' ),\n\t\t\t\t'label_off' => __( 'Hide', 'listslides' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => 'true',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'autoplay',\n\t\t\t[\n\t\t\t\t'label' => __( 'Auto Play', 'listslides' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'listslides' ),\n\t\t\t\t'label_off' => __( 'No', 'listslides' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => 'true',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'loop',\n\t\t\t[\n\t\t\t\t'label' => __( 'Loop', 'listslides' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'listslides' ),\n\t\t\t\t'label_off' => __( 'No', 'listslides' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => 'true',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'mouseDrag',\n\t\t\t[\n\t\t\t\t'label' => __( 'Mouse Drag', 'listslides' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'listslides' ),\n\t\t\t\t'label_off' => __( 'No', 'listslides' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => 'true',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'touchDrag',\n\t\t\t[\n\t\t\t\t'label' => __( 'Touch Motion', 'listslides' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'listslides' ),\n\t\t\t\t'label_off' => __( 'No', 'listslides' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => 'true',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'autoplayTimeout',\n\t\t\t[\n\t\t\t\t'label' => __( 'Autoplay Timeout', 'listslides' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => '3000',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'autoplay' => 'true',\n\t\t\t\t],\n\t\t\t\t'options' => [\n\t\t\t\t\t'2000' => __( '2 Seconds', 'listslides' ),\n\t\t\t\t\t'3000' => __( '3 Seconds', 'listslides' ),\n\t\t\t\t\t'5000' => __( '5 Seconds', 'listslides' ),\n\t\t\t\t\t'10000' => __( '10 Seconds', 'listslides' ),\n\t\t\t\t\t'15000' => __( '15 Seconds', 'listslides' ),\n\t\t\t\t\t'20000' => __( '20 Seconds', 'listslides' ),\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n }", "protected function _register_controls() {\n\n $this->start_controls_section(\n 'content_section',\n [\n 'label' => esc_html__( 'Content', 'Alita-extensions' ),\n 'tab' => Controls_Manager::TAB_CONTENT,\n ]\n );\n\n $this->add_control(\n 'title',\n [\n 'label' => esc_html__( 'Title', 'Alita-extensions' ),\n 'type' => Controls_Manager::TEXT,\n 'default' => '',\n 'placeholder' => esc_html__( 'Enter title', 'Alita-extensions' ),\n ]\n );\n\n $this->add_control(\n 'show_savings',\n [\n 'label' => esc_html__( 'Show Savings Details', 'Alita-extensions' ),\n 'type' => Controls_Manager::SWITCHER,\n 'label_on' => esc_html__( 'Enable', 'Alita-extensions' ),\n 'label_off' => esc_html__( 'Disable', 'Alita-extensions' ),\n 'return_value' => true,\n 'default' => false,\n ]\n );\n\n $this->add_control(\n 'savings_in',\n [\n 'label' => esc_html__( 'Savings in', 'Alita-extensions' ),\n 'type' => Controls_Manager::SELECT,\n 'options' => [\n\n 'amount' => esc_html__( 'Amount', 'Alita-extensions' ),\n 'percentage' => esc_html__( 'Percentage', 'Alita-extensions' ),\n ],\n 'default'=> 'amount',\n ]\n );\n\n $this->add_control(\n 'savings_text',\n [\n 'label' => esc_html__('Savings Text', 'Alita-extensions'),\n 'type' => Controls_Manager::TEXT,\n ]\n );\n\n $this->add_control(\n 'limit',\n [\n 'label' => esc_html__( 'Number of Products to display', 'Alita-extensions' ),\n 'type' => Controls_Manager::TEXT,\n 'description' => esc_html__('Enter the number of products to display', 'Alita-extensions'),\n ]\n );\n\n $this->add_control(\n 'product_choice',\n [\n 'label' => esc_html__( 'Product Choice', 'Alita-extensions' ),\n 'type' => Controls_Manager::SELECT,\n 'options' => [\n\n 'recent' =>esc_html__( 'Recent', 'Alita-extensions' ),\n 'random' =>esc_html__( 'Random', 'Alita-extensions' ),\n 'specific' =>esc_html__( 'Specific', 'Alita-extensions' ),\n ],\n 'default'=> 'recent',\n ]\n );\n\n\n $this->add_control(\n 'product_id',\n [\n 'label' => esc_html__('Product ID', 'Alita-extensions'),\n 'type' => Controls_Manager::TEXT,\n 'description' => esc_html__('Enter the product id seperate by comma(,).', 'Alita-extensions'),\n ]\n );\n\n $this->end_controls_section();\n\n }", "protected function _register_controls() {\n\n $this->start_controls_section(\n 'content_section',\n [\n 'label' => esc_html__( 'Content', 'electro-extensions' ),\n 'tab' => Controls_Manager::TAB_CONTENT,\n ]\n );\n\n $this->add_control(\n 'title',\n [\n 'label' => esc_html__( 'Title', 'electro-extensions' ),\n 'type' => Controls_Manager::TEXT,\n 'default' => '',\n 'placeholder' => esc_html__( 'Enter title', 'electro-extensions' ),\n ]\n );\n\n $this->add_control(\n 'show_savings',\n [\n 'label' => esc_html__( 'Show Savings Details', 'electro-extensions' ),\n 'type' => Controls_Manager::SWITCHER,\n 'label_on' => esc_html__( 'Enable', 'electro-extensions' ),\n 'label_off' => esc_html__( 'Disable', 'electro-extensions' ),\n 'return_value' => 'true',\n 'default' => 'false',\n ]\n );\n\n $this->add_control(\n 'savings_in',\n [\n 'label' => esc_html__( 'Savings in', 'electro-extensions' ),\n 'type' => Controls_Manager::SELECT,\n 'options' => [\n\n 'amount' => esc_html__( 'Amount', 'electro-extensions' ),\n 'percentage' => esc_html__( 'Percentage', 'electro-extensions' ),\n ],\n 'default'=> 'amount',\n ]\n );\n\n $this->add_control(\n 'savings_text',\n [\n 'label' => esc_html__('Savings Text', 'electro-extensions'),\n 'type' => Controls_Manager::TEXT,\n ]\n );\n\n $this->add_control(\n 'limit',\n [\n 'label' => esc_html__( 'Number of Products to display', 'electro-extensions' ),\n 'type' => Controls_Manager::TEXT,\n 'description' => esc_html__('Enter the number of products to display', 'electro-extensions'),\n ]\n );\n\n $this->add_control(\n 'product_choice',\n [\n 'label' => esc_html__( 'Product Choice', 'electro-extensions' ),\n 'type' => Controls_Manager::SELECT,\n 'options' => [\n\n 'recent' =>esc_html__( 'Recent', 'electro-extensions' ),\n 'random' =>esc_html__( 'Random', 'electro-extensions' ),\n 'specific' =>esc_html__( 'Specific', 'electro-extensions' ),\n ],\n 'default'=> 'recent',\n ]\n );\n\n\n $this->add_control(\n 'product_id',\n [\n 'label' => esc_html__('Product ID', 'electro-extensions'),\n 'type' => Controls_Manager::TEXT,\n 'description' => esc_html__('Enter the product id seperate by comma(,).', 'electro-extensions'),\n ]\n );\n\n $this->end_controls_section();\n\n }", "function customize_controls_init()\n {\n }", "public function prepare_controls()\n {\n }", "protected function _register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore\n\n\t\t$this->register_controls();\n\t}", "protected function _register_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'content_section',\n\t\t\t[\n\t\t\t\t'label' => __( 'Content', 'plugin-name' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_CONTENT,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'url',\n\t\t\t[\n\t\t\t\t'label' => __( 'Nothing to do with this', 'elhelper' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::TEXT,\n\t\t\t\t'input_type' => 'url',\n\t\t\t\t'placeholder' => __( 'https://your-link.com ', 'elhelper' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t}", "protected function _register_controls(){\n //Name of the content section\n $this->start_controls_section(\n 'header_slider',\n array(\n 'label' => __('Slider', 'reveal'),\n 'tab' => Controls_Manager::TAB_CONTENT\n )\n );\n\n //input fields for the content\n $this->add_control(\n 'title',\n array(\n 'label' => __( 'Title', 'reveal' ),\n 'type' => Controls_Manager::WYSIWYG\n )\n ); // end add_control\n\n //button for the slider\n $this->add_control(\n 'button1_text',\n array(\n 'label' => __( 'Button 1 Text', 'reveal' ),\n 'type' => Controls_Manager::TEXT\n )\n );\n $this->add_control(\n 'button1_url',\n array(\n 'label' => __( 'Button 1 Url', 'reveal' ),\n 'type' => Controls_Manager::URL\n )\n );\n\n $this->add_control(\n 'button2_text',\n array(\n 'label' => __( 'Button 2', 'reveal' ),\n 'type' => Controls_Manager::TEXT\n )\n );\n $this->add_control(\n 'button2_url',\n array(\n 'label' => __( 'Button 2 Url', 'reveal' ),\n 'type' => Controls_Manager::URL\n )\n );\n\n //slider image\n $this->add_control(\n 'gallery',\n array(\n 'label' => __( 'Add Slider Images', 'reveal' ),\n 'type' => Controls_Manager::GALLERY,\n 'default' => [],\n )\n );\n\n $this->add_control(\n 'img_height',\n array(\n 'label' => __( 'Slider Images Height', 'reveal' ),\n 'type' => Controls_Manager::NUMBER,\n 'default' => 350,\n )\n );\n $this->end_controls_section(); //end of field creation\n\n //Section for style sheet\n $this->start_controls_section( //input field label\n 'content_style', //unique id\n [\n 'label' => __( 'Style', 'reveal' ),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n $this->end_controls_section();\n\n\n\n }", "protected function _register_controls()\n {\n\n $this->start_controls_section(\n 'content_section',\n [\n 'label' => __('Video Testimonials Settings', 'careerfy-frame'),\n 'tab' => Controls_Manager::TAB_CONTENT,\n ]\n );\n\n $this->add_control(\n 'vid_testimonial_view',\n [\n 'label' => __('Style', 'careerfy-frame'),\n 'type' => Controls_Manager::SELECT2,\n 'default' => 'view1',\n 'options' => [\n 'view1' => __('Style 1', 'careerfy-frame'),\n 'view2' => __('Style 2', 'careerfy-frame'),\n 'view3' => __('Style 3', 'careerfy-frame'),\n ],\n ]\n );\n\n $repeater = new \\Elementor\\Repeater();\n $repeater->add_control(\n 'vid_testimonial_img', [\n 'label' => __('Image', 'careerfy-frame'),\n 'type' => Controls_Manager::MEDIA,\n 'label_block' => true,\n 'dynamic' => [\n 'active' => true,\n ],\n 'default' => [\n 'url' => Utils::get_placeholder_image_src(),\n ],\n ]\n );\n\n $repeater->add_control(\n 'vid_url', [\n 'label' => __('Video URL', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXT,\n \"description\" => __(\"Put Video URL of Vimeo, Youtube.\", \"careerfy-frame\")\n ]\n );\n\n $repeater->add_control(\n 'client_title', [\n 'label' => __('Client Name', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXT,\n 'label_block' => true,\n \"description\" => __('client Title will be applied on style 1 and style 3.', \"careerfy-frame\")\n ]\n );\n\n\n $repeater->add_control(\n 'rank_title', [\n 'label' => __('Client Rank', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXT,\n 'label_block' => true,\n \"description\" => __('Client Rank will be applied on style 1 and style 3.', \"careerfy-frame\")\n ]\n );\n\n $repeater->add_control(\n 'company_title', [\n 'label' => __('Client Company', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXT,\n 'label_block' => true,\n \"description\" => __(\"Client Company will be applied to style 1 and style 2.\", \"careerfy-frame\")\n ]\n );\n\n $repeater->add_control(\n 'testimonial_desc', [\n 'label' => __('Description', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXTAREA,\n 'label_block' => true,\n \"description\" => __(\"Testimonial Description will be applied to style 3 only.\", \"careerfy-frame\")\n ]\n );\n\n $repeater->add_control(\n 'client_location', [\n 'label' => __('Client Location', 'careerfy-frame'),\n 'type' => Controls_Manager::TEXT,\n 'label_block' => true,\n \"description\" => __(\"Client Location will be applied to style 3 only.\", \"careerfy-frame\")\n ]\n );\n $this->add_control(\n 'careerfy_video_testimonial_item',\n [\n 'label' => __('Add video testimonial item', 'careerfy-frame'),\n 'type' => Controls_Manager::REPEATER,\n 'fields' => $repeater->get_controls(),\n 'title_field' => '{{{ company_title }}}',\n ]\n );\n $this->end_controls_section();\n }", "protected function _register_controls() {\r\n\r\n\t\t$this->start_controls_section(\r\n\t\t\t'settings_section',\r\n\t\t\t[\r\n\t\t\t\t'label' => esc_html__( 'General Settings', 'aapside-master' ),\r\n\t\t\t\t'tab' => Controls_Manager::TAB_CONTENT,\r\n\t\t\t]\r\n\t\t);\r\n\t\t$this->add_control( 'title', [\r\n\t\t\t'label' => esc_html__( 'Title', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( 'Primary Plan', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter title', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'featured', [\r\n\t\t\t'label' => esc_html__( 'Featured', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::SWITCHER,\r\n\t\t\t'default' => 'no',\r\n\t\t\t'description' => esc_html__( 'enable featured', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'price', [\r\n\t\t\t'label' => esc_html__( 'Price', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( '250', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter price', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'sign', [\r\n\t\t\t'label' => esc_html__( 'Sign', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( '$', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter sign', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'month', [\r\n\t\t\t'label' => esc_html__( 'Month', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( '/Mo', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter month', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'btn_text', [\r\n\t\t\t'label' => esc_html__( 'Button Text', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( 'Get Started', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter button text', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'btn_link', [\r\n\t\t\t'label' => esc_html__( 'Button Link', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::URL,\r\n\t\t\t'default' => array(\r\n\t\t\t\t'url' => '#'\r\n\t\t\t),\r\n\t\t\t'description' => esc_html__( 'enter button link', 'aapside-master' )\r\n\t\t] );\r\n\r\n\t\t$this->add_control( 'feature_items', [\r\n\t\t\t'label' => esc_html__( 'Feature Item', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::REPEATER,\r\n\t\t\t'default' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t'feature' => esc_html__( '5 Analyzer', 'aapside-master' )\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'fields' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t'name' => 'feature',\r\n\t\t\t\t\t'label' => esc_html__( 'Feature', 'aapside-master' ),\r\n\t\t\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t\t\t'description' => esc_html__( 'enter feature item.', 'aapside-master' ),\r\n\t\t\t\t\t'default' => esc_html__( '5 Analyzer', 'aapside-master' )\r\n\t\t\t\t]\r\n\t\t\t],\r\n\t\t] );\r\n\t\t$this->end_controls_section();\r\n\r\n\t\t$this->start_controls_section( 'styling_section', [\r\n\t\t\t'label' => esc_html__( 'Styling Settings', 'aapside-master' ),\r\n\t\t\t'tab' => Controls_Manager::TAB_STYLE\r\n\t\t] );\r\n\t\t$this->add_control( 'title_color', [\r\n\t\t\t'label' => esc_html__( 'Title Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-header .name\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_control( 'price_color', [\r\n\t\t\t'label' => esc_html__( 'Price Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-header .price-wrap .price\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_control( 'month_color', [\r\n\t\t\t'label' => esc_html__( 'Month Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-header .price-wrap .month\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_control( 'features_color', [\r\n\t\t\t'label' => esc_html__( 'Features Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-body ul\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->end_controls_section();\r\n\r\n\t\t/* button styling start */\r\n\t\t$this->start_controls_section( 'button_styling_section', [\r\n\t\t\t'label' => esc_html__( 'Button Styling', 'aapside-master' ),\r\n\t\t\t'tab' => Controls_Manager::TAB_STYLE\r\n\t\t] );\r\n\t\t$this->start_controls_tabs(\r\n\t\t\t'button_style_tabs'\r\n\t\t);\r\n\r\n\t\t$this->start_controls_tab(\r\n\t\t\t'button_style_normal_tab',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Normal', 'aapside-master' ),\r\n\t\t\t]\r\n\t\t);\r\n\t\t$this->add_control( 'button_normal_color', [\r\n\t\t\t'label' => esc_html__( 'Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Background::get_type(), [\r\n\t\t\t'label' => esc_html__( 'Button Background', 'aapside-master' ),\r\n\t\t\t'name' => 'button_normal_bg_color',\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Border::get_type(), [\r\n\t\t\t'label' => esc_html__( 'Border', 'aapside-master' ),\r\n\t\t\t'name' => 'button_normal_border',\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\"\r\n\t\t] );\r\n\r\n\t\t$this->end_controls_tab();\r\n\r\n\t\t$this->start_controls_tab(\r\n\t\t\t'button_style_hover_tab',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Hover', 'aapside-master' ),\r\n\t\t\t]\r\n\t\t);\r\n\t\t$this->add_control( 'button_hover_color', [\r\n\t\t\t'label' => esc_html__( 'Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn:hover\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Background::get_type(), [\r\n\t\t\t'label' => esc_html__( 'Button Background', 'aapside-master' ),\r\n\t\t\t'name' => 'button_hover_bg_color',\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn:hover\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Border::get_type(), [\r\n\t\t\t'label' => esc_html__( 'Border', 'aapside-master' ),\r\n\t\t\t'name' => 'button_hover_border',\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn:hover\"\r\n\t\t] );\r\n\r\n\t\t$this->end_controls_tab();\r\n\r\n\t\t$this->end_controls_tabs();\r\n\t\t$this->add_control( 'button_divider', [\r\n\t\t\t'type' => Controls_Manager::DIVIDER\r\n\t\t] );\r\n\t\t$this->add_responsive_control( 'button_border_radius', [\r\n\t\t\t'label' => esc_html__( 'Border Radius', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::DIMENSIONS,\r\n\t\t\t'units' => [ 'px', '%', 'em' ],\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\" => \"border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->end_controls_section();\r\n\t\t/* button styling end */\r\n\r\n\t\t/* border color start */\r\n\t\t$this->start_controls_section( 'hover_border_section', [\r\n\t\t\t'label' => esc_html__( 'Hover Border Style', 'aapside-master' ),\r\n\t\t\t'tab' => Controls_Manager::TAB_STYLE\r\n\t\t] );\r\n\r\n\t\t$this->add_group_control( Group_Control_Background::get_type(), [\r\n\t\t\t'name' => 'hover_background',\r\n\t\t\t'label' => esc_html__( 'Active Border Color', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02:after\"\r\n\t\t] );\r\n\r\n\t\t$this->end_controls_section();\r\n\t\t/* border color end */\r\n\r\n\r\n\t\t/* button styling start */\r\n\t\t$this->start_controls_section( 'typography_section', [\r\n\t\t\t'label' => esc_html__( 'Typography Settings', 'aapside-master' ),\r\n\t\t\t'tab' => Controls_Manager::TAB_STYLE\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Typography::get_type(), [\r\n\t\t\t'name' => 'title_typography',\r\n\t\t\t'label' => esc_html__( 'Title Typography', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-header .name\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Typography::get_type(), [\r\n\t\t\t'name' => 'price_typography',\r\n\t\t\t'label' => esc_html__( 'Price Typography', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-header .price-wrap\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Typography::get_type(), [\r\n\t\t\t'name' => 'features_typography',\r\n\t\t\t'label' => esc_html__( 'Features Typography', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-body ul\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Typography::get_type(), [\r\n\t\t\t'name' => 'button_typography',\r\n\t\t\t'label' => esc_html__( 'Button Typography', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\"\r\n\t\t] );\r\n\t\t$this->end_controls_section();\r\n\t\t/* button styling end */\r\n\t}", "public function customize_controls_init()\n {\n }", "public function customize_controls( $controls ) {\n\t\t/**\n\t\t * General section\n\t\t */\n\t\t$controls['projects_archive_page'] = array(\n\t\t\t'type' => 'dropdown-pages',\n\t\t\t'label' => __( 'Projects Page', 'mountain' ),\n\t\t\t'section' => 'projects-general'\n\t\t);\n\n\t\t$controls['projects_permalink_base'] = array(\n\t\t\t'type' => 'text',\n\t\t\t'label' => __( 'Permalink Base', 'mountain' ),\n\t\t\t'section' => 'projects-general',\n\t\t\t'default' => 'project'\n\t\t);\n\n\t\t$controls['projects_category_permalink_base'] = array(\n\t\t\t'type' => 'text',\n\t\t\t'label' => __( 'Category Permalink Base', 'mountain' ),\n\t\t\t'section' => 'projects-general',\n\t\t\t'default' => 'nproject-category'\n\t\t);\n\n\t\t$controls['projects_tag_permalink_base'] = array(\n\t\t\t'type' => 'text',\n\t\t\t'label' => __( 'Tag Permalink Base', 'mountain' ),\n\t\t\t'section' => 'projects-general',\n\t\t\t'default' => 'nproject-tag'\n\t\t);\n\n\t\t/**\n\t\t * Archive section\n\t\t */\n\t\t$controls['projects_archive_sidebar_layout'] = array(\n\t\t\t'type' => 'radio-images',\n\t\t\t'label' => __( 'List Sidebar Position', 'mountain' ),\n\t\t\t'section' => 'projects-archive',\n\t\t\t'choices' => array(\n\t\t\t\t'no-sidebar' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/no-sidebar.png',\n\t\t\t\t\t'tooltip' => __( 'No Sidebar', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'sidebar-left' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/sidebar-left.png',\n\t\t\t\t\t'tooltip' => __( 'Sidebar Left', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'sidebar-right' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/sidebar-right.png',\n\t\t\t\t\t'tooltip' => __( 'Sidebar Right', 'mountain' )\n\t\t\t\t)\n\t\t\t),\n\t\t\t'default' => 'sidebar-right'\n\t\t);\n\n\t\t$controls['projects_archive_sidebar'] = array(\n\t\t\t'type' => 'dropdown-sidebars',\n\t\t\t'section' => 'projects-archive',\n\t\t\t'label' => __( 'Project List Sidebar', 'mountain' ),\n\t\t\t'default' => 'sidebar-primary'\n\t\t);\n\n\t\t$controls['projects_archive_layout'] = array(\n\t\t\t'type' => 'radio-images',\n\t\t\t'label' => __( 'List Layout', 'mountain' ),\n\t\t\t'section' => 'projects-archive',\n\t\t\t'choices' => array(\n\t\t\t\t'grid' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/blog-grid.png',\n\t\t\t\t\t'tooltip' => __( 'Grid', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'masonry' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/blog-masonry.png',\n\t\t\t\t\t'tooltip' => __( 'Masonry Grid', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'gallery' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/portfolio-no-margin.png',\n\t\t\t\t\t'tooltip' => __( 'Gallery', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'justify' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/portfolio-justify.png',\n\t\t\t\t\t'tooltip' => __( 'Justified Grid', 'mountain' )\n\t\t\t\t)\n\t\t\t),\n\t\t\t'default' => 'grid'\n\t\t);\n\n\t\t$controls['projects_grid_columns'] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'section' => 'projects-archive',\n\t\t\t'label' => __( 'Grid Columns', 'mountain' ),\n\t\t\t'default' => 3,\n\t\t\t'choices' => array(\n\t\t\t\t2 => __( '2 Columns', 'mountain' ),\n\t\t\t\t3 => __( '3 Columns', 'mountain' ),\n\t\t\t\t4 => __( '4 Columns', 'mountain' ),\n\t\t\t\t5 => __( '5 Columns', 'mountain' ),\n\t\t\t)\n\t\t);\n\n\t\t$controls['projects_archive_filter'] = array(\n\t\t\t'type' => 'switcher',\n\t\t\t'section' => 'projects-archive',\n\t\t\t'label' => __( 'Show Items Filter', 'mountain' ),\n\t\t\t'default' => true\n\t\t);\n\t\t$controls['projects_archive_permalink'] = array(\n\t\t\t'type' => 'switcher',\n\t\t\t'section' => 'projects-archive',\n\t\t\t'label' => __( 'Enable Permalinks On Items', 'mountain' ),\n\t\t\t'default' => true\n\t\t);\n\n\t\t$controls['projects_archive_category_enabled'] = array(\n\t\t\t'type' => 'switcher',\n\t\t\t'section' => 'projects-archive',\n\t\t\t'label' => __( 'Show Project Categories', 'mountain' ),\n\t\t\t'default' => true\n\t\t);\n\t\t$controls['projects_archive_category_permalink'] = array(\n\t\t\t'type' => 'switcher',\n\t\t\t'section' => 'projects-archive',\n\t\t\t'label' => __( 'Enable Permalinks On Categories', 'mountain' ),\n\t\t\t'default' => true\n\t\t);\n\n\t\t$controls['projects_archive_pagination_style'] = array(\n\t\t\t'type' => 'radio-images',\n\t\t\t'label' => __( 'Pagination Style', 'mountain' ),\n\t\t\t'section' => 'projects-archive',\n\t\t\t'default' => 'numeric',\n\t\t\t'choices' => array(\n\t\t\t\t'pager' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/paging-pager.png',\n\t\t\t\t\t'tooltip' => __( 'Pager', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'numeric' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/paging-numeric.png',\n\t\t\t\t\t'tooltip' => __( 'Numeric', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'pager-numeric' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/paging-pager-numeric.png',\n\t\t\t\t\t'tooltip' => __( 'Pager & Numeric', 'mountain' )\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$controls['projects_posts_per_page'] = array(\n\t\t\t'type' => 'spinner',\n\t\t\t'section' => 'projects-archive',\n\t\t\t'label' => __( 'Posts Per Page', 'mountain' ),\n\t\t\t'default' => get_option( 'posts_per_page' )\n\t\t);\n\n\t\t/**\n\t\t * Project Single\n\t\t */\n\t\t$controls['projects_single_sidebar_layout'] = array(\n\t\t\t'type' => 'radio-images',\n\t\t\t'label' => __( 'Single Sidebar Position', 'mountain' ),\n\t\t\t'section' => 'projects-single',\n\t\t\t'choices' => array(\n\t\t\t\t'no-sidebar' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/no-sidebar.png',\n\t\t\t\t\t'tooltip' => __( 'No Sidebar', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'sidebar-left' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/sidebar-left.png',\n\t\t\t\t\t'tooltip' => __( 'Sidebar Left', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'sidebar-right' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/sidebar-right.png',\n\t\t\t\t\t'tooltip' => __( 'Sidebar Right', 'mountain' )\n\t\t\t\t)\n\t\t\t),\n\t\t\t'default' => 'sidebar-right'\n\t\t);\n\n\t\t$controls['projects_single_sidebar'] = array(\n\t\t\t'type' => 'dropdown-sidebars',\n\t\t\t'section' => 'projects-single',\n\t\t\t'label' => __( 'Single Project Sidebar', 'mountain' ),\n\t\t\t'default' => 'sidebar-primary'\n\t\t);\n\n\t\t$controls['projects_single_gallery_type'] = array(\n\t\t\t'type' => 'radio-images',\n\t\t\t'section' => 'projects-single',\n\t\t\t'label' => __( 'Gallery Type', 'mountain' ),\n\t\t\t'default' => 'grid',\n\t\t\t'choices' => array(\n\t\t\t\t'list' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/list.png',\n\t\t\t\t\t'tooltip' => __( 'List', 'mountain' )\n\t\t\t\t),\n\t\t\t\t'grid' => array(\n\t\t\t\t\t'src' => op_directory_uri() . '/assets/img/portfolio-no-margin.png',\n\t\t\t\t\t'tooltip' => __( 'Grid', 'mountain' )\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$controls['projects_single_gallery_columns'] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'section' => 'projects-single',\n\t\t\t'label' => __( 'Gallery Columns', 'mountain' ),\n\t\t\t'default' => 3,\n\t\t\t'choices' => array(\n\t\t\t\t2 => __( '2 Columns', 'mountain' ),\n\t\t\t\t3 => __( '3 Columns', 'mountain' ),\n\t\t\t\t4 => __( '4 Columns', 'mountain' ),\n\t\t\t\t5 => __( '5 Columns', 'mountain' ),\n\t\t\t)\n\t\t);\n\n\t\t$controls['projects_single_header_background'] = array(\n\t\t\t'type' => 'switcher',\n\t\t\t'section' => 'projects-single',\n\t\t\t'label' => __( 'Show Featured Image In Header', 'mountain' ),\n\t\t\t'default' => true\n\t\t);\n\n\t\t$controls['projects_single_navigator_enabled'] = array(\n\t\t\t'type' => 'switcher',\n\t\t\t'label' => __( 'Show Project Navigator', 'mountain' ),\n\t\t\t'section' => 'projects-single',\n\t\t\t'default' => true\n\t\t);\n\t\t$controls['projects_single_categories_enabled'] = array(\n\t\t\t'type' => 'switcher',\n\t\t\t'label' => __( 'Show Project Categories', 'mountain' ),\n\t\t\t'section' => 'projects-single',\n\t\t\t'default' => true\n\t\t);\n\t\t$controls['projects_single_tags_enabled'] = array(\n\t\t\t'type' => 'switcher',\n\t\t\t'label' => __( 'Show Project Tags', 'mountain' ),\n\t\t\t'section' => 'projects-single',\n\t\t\t'default' => true\n\t\t);\n\n\t\t/**\n\t\t * Project Related\n\t\t */\n\t\t$controls['projects_related_box_enabled'] = array(\n\t\t\t'type' => 'switcher',\n\t\t\t'label' => __( 'Show Related Projects', 'mountain' ),\n\t\t\t'section' => 'projects-related',\n\t\t\t'default' => true\n\t\t);\n\n\t\t$controls['projects_related_title'] = array(\n\t\t\t'type' => 'text',\n\t\t\t'label' => __( 'Widget Title', 'mountain' ),\n\t\t\t'section' => 'projects-related',\n\t\t\t'default' => __( 'Related Projects', 'mountain' )\n\t\t);\n\n\t\t$controls['projects_related_type'] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'section' => 'projects-related',\n\t\t\t'label' => __( 'Show Related Items Based On', 'mountain' ),\n\t\t\t'default' => 'tag',\n\t\t\t'choices' => array(\n\t\t\t\t'tag' => __( 'Tag', 'mountain' ),\n\t\t\t\t'category' => __( 'Category', 'mountain' ),\n\t\t\t\t'random' => __( 'Random', 'mountain' ),\n\t\t\t\t'recent' => __( 'Recent', 'mountain' )\n\t\t\t)\n\t\t);\n\n\t\t$controls['projects_related_style'] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'section' => 'projects-related',\n\t\t\t'label' => __( 'Related Project Style', 'mountain' ),\n\t\t\t'default' => 'grid',\n\t\t\t'choices' => array(\n\t\t\t\t'grid' => __( 'Grid', 'mountain' ),\n\t\t\t\t'masonry' => __( 'Grid Masonry', 'mountain' ),\n\t\t\t\t'no-margin' => __( 'Grid No Margin', 'mountain' )\n\t\t\t)\n\t\t);\n\n\t\t$controls['projects_related_columns_count'] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'section' => 'projects-related',\n\t\t\t'label' => __( 'Columns Count', 'mountain' ),\n\t\t\t'choices' => array(\n\t\t\t\t1 => __( '1 Column', 'mountain' ),\n\t\t\t\t2 => __( '2 Columns', 'mountain' ),\n\t\t\t\t3 => __( '3 Columns', 'mountain' ),\n\t\t\t\t4 => __( '4 Columns', 'mountain' ),\n\t\t\t\t5 => __( '5 Columns', 'mountain' )\n\t\t\t),\n\t\t\t'default' => 4\n\t\t);\n\n\t\t$controls['projects_related_posts_count'] = array(\n\t\t\t'type' => 'spinner',\n\t\t\t'section' => 'projects-related',\n\t\t\t'label' => __( 'Number Of Related Projects', 'mountain' ),\n\t\t\t'min' => 1,\n\t\t\t'default' => 4\n\t\t);\n\n\t\treturn $controls;\n\t}", "private function buildControls(){\n\n\t\t//create key - label pairs for this dropdown:\n\n\t\t$name = '_column_type_'.$this->fullId;\n\t\t$types = $this->getTypes();\n\n\t\tif( $this->referenceMode )\n\t\t\t$name = 'reference_'.$this->fullId;\n\n\n\t\tif( sizeof( $types ) > 1 ){\n\t\t\t\n\t\t\t$typeSelector = Field::select(\n\t\t\t\t$name,\n\t\t\t\t'',\n\t\t\t\t$types,\n\t\t\t\tarray(\n\t\t\t\t\t'defaultValue' => $this->type\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$class = 'column-controls column-choices-available';\n\n\t\t}else{\n\t\t\t$class = 'column-controls';\n\t\t\t$key = array_keys( $types );\n\t\t\t$typeSelector = Field::hidden( \n\t\t\t\t$name, \n\t\t\t\t[ \n\t\t\t\t\t'defaultValue' => $this->type, \n\t\t\t\t\t'class' => 'type-select'\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\techo '<div class=\"'.$class.'\">';\n\n\t\t\t//render the dropdown:\n\t\t\t$typeSelector->render();\n\t\t\techo '<h3 class=\"column-type\">'.$types[ $this->type ].'</h3>';\n\n\t\t\t//sorter\n\t\t\techo '<span class=\"sort dashicons dashicons-leftright\"></span>';\n\n\t\techo '</div>';\n\n\t}", "protected function _register_controls() { \n /*Testimonials Content Section */\n $this->start_controls_section('premium_testimonial_person_settings',\n [\n 'label' => __('Author', 'premium-addons-for-elementor'),\n ]\n );\n \n /*Person Image*/\n $this->add_control('premium_testimonial_person_image',\n [\n 'label' => __('Image','premium-addons-for-elementor'),\n 'type' => Controls_Manager::MEDIA,\n 'dynamic' => [ 'active' => true ],\n 'default' => [\n 'url' => Utils::get_placeholder_image_src()\n ],\n 'description' => __( 'Choose an image for the author', 'premium-addons-for-elementor' ),\n 'show_label' => true,\n ]\n ); \n\n /*Person Image Shape*/\n $this->add_control('premium_testimonial_person_image_shape',\n [\n 'label' => __('Image Style', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::SELECT,\n 'description' => __( 'Choose image style', 'premium-addons-for-elementor' ),\n 'options' => [\n 'square' => __('Square','premium-addons-for-elementor'),\n 'circle' => __('Circle','premium-addons-for-elementor'),\n 'rounded' => __('Rounded','premium-addons-for-elementor'),\n ],\n 'default' => 'circle',\n ]\n );\n \n /*Person Name*/ \n $this->add_control('premium_testimonial_person_name',\n [\n 'label' => __('Name', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::TEXT,\n 'dynamic' => [ 'active' => true ],\n 'default' => __('Person Name', 'premium-addons-for-elementor'),\n 'description' => __( 'Enter author name', 'premium-addons-for-elementor' ),\n 'label_block' => true\n ]\n );\n \n /*Name Title Tag*/\n $this->add_control('premium_testimonial_person_name_size',\n [\n 'label' => __('HTML Tag', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::SELECT,\n 'description' => __( 'Select a heading tag for author name', 'premium-addons-for-elementor' ),\n 'options' => [\n 'h1' => 'H1',\n 'h2' => 'H2',\n 'h3' => 'H3',\n 'h4' => 'H4',\n 'h5' => 'H5',\n 'h6' => 'H6',\n ],\n 'default' => 'h3',\n 'label_block' => true,\n ]\n );\n \n /*End Person Content Section*/\n $this->end_controls_section();\n\n /*Start Company Content Section*/ \n $this->start_controls_section('premium_testimonial_company_settings',\n [\n 'label' => __('Company', 'premium-addons-for-elementor')\n ]\n );\n \n /*Company Name*/\n $this->add_control('premium_testimonial_company_name',\n [\n 'label' => __('Name', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::TEXT,\n 'dynamic' => [ 'active' => true ],\n 'default' => __('Company Name','premium-addons-for-elementor'),\n 'description' => __( 'Enter company name', 'premium-addons-for-elementor' ),\n 'label_block' => true,\n ]\n );\n \n /*Company Name Tag*/\n $this->add_control('premium_testimonial_company_name_size',\n [\n 'label' => __('HTML Tag', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::SELECT,\n 'description' => __( 'Select a heading tag for company name', 'premium-addons-for-elementor' ),\n 'options' => [\n 'h1' => 'H1',\n 'h2' => 'H2',\n 'h3' => 'H3',\n 'h4' => 'H4',\n 'h5' => 'H5',\n 'h6' => 'H6', \n ],\n 'default' => 'h4',\n 'label_block' => true,\n ]\n );\n \n $this->add_control('premium_testimonial_company_link_switcher',\n [\n 'label' => __('Link', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::SWITCHER,\n 'default' => 'yes',\n ]\n );\n \n /*Company Link */\n $this->add_control('premium_testimonial_company_link',\n [\n 'label' => __('Link', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::TEXT,\n 'dynamic' => [\n 'active' => true,\n 'categories' => [\n TagsModule::POST_META_CATEGORY,\n TagsModule::URL_CATEGORY\n ]\n ],\n 'description' => __( 'Add company URL', 'premium-addons-for-elementor' ),\n 'label_block' => true,\n 'condition' => [\n 'premium_testimonial_company_link_switcher' => 'yes'\n ]\n ]\n );\n \n /*Link Target*/ \n $this->add_control('premium_testimonial_link_target',\n [\n 'label' => __('Link Target', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::SELECT,\n 'description' => __( 'Select link target', 'premium-addons-for-elementor' ),\n 'options' => [\n 'blank' => __('Blank'),\n 'parent' => __('Parent'),\n 'self' => __('Self'),\n 'top' => __('Top'),\n ],\n 'default' => __('blank','premium-addons-for-elementor'),\n 'condition' => [\n 'premium_testimonial_company_link_switcher' => 'yes'\n ]\n ]\n );\n \n /*End Company Content Section*/\n $this->end_controls_section();\n\n /*Start Testimonial Content Section*/\n $this->start_controls_section('premium_testimonial_settings',\n [\n 'label' => __('Content', 'premium-addons-for-elementor'),\n ]\n );\n\n /*Testimonial Content*/\n $this->add_control('premium_testimonial_content',\n [ \n 'label' => __('Testimonial Content', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::WYSIWYG,\n 'dynamic' => [ 'active' => true ],\n 'default' => __('Donec id elit non mi porta gravida at eget metus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras mattis consectetur purus sit amet fermentum. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec id elit non mi porta gravida at eget metus.','premium-addons-for-elementor'),\n 'label_block' => true,\n ]\n );\n \n /*End Testimonial Content Section*/\n $this->end_controls_section();\n \n /*Image Styling*/\n $this->start_controls_section('premium_testimonial_image_style',\n [\n 'label' => __('Image', 'premium-addons-for-elementor'),\n 'tab' => Controls_Manager::TAB_STYLE, \n ]\n );\n \n /*Image Size*/\n $this->add_control('premium_testimonial_img_size',\n [\n 'label' => __('Size', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::SLIDER,\n 'size_units' => ['px', 'em'],\n 'default' => [\n 'unit' => 'px',\n 'size' => 110,\n ],\n 'range' => [\n 'px'=> [\n 'min' => 10,\n 'max' => 150,\n ]\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-img-wrapper'=> 'width: {{SIZE}}{{UNIT}}; height:{{SIZE}}{{UNIT}};',\n ]\n ]\n );\n\n /*Image Border Width*/\n $this->add_control('premium_testimonial_img_border_width',\n [\n 'label' => __('Border Width (PX)', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::SLIDER,\n 'default' => [\n 'unit' => 'px',\n 'size' => 2,\n ],\n 'range' => [\n 'px'=> [\n 'min' => 0,\n 'max' => 15,\n ]\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-person-image' => 'border-width: {{SIZE}}{{UNIT}};',\n ]\n ]\n );\n \n /*Image Border Color*/\n $this->add_control('premium_testimonial_image_border_color',\n [\n 'label' => __('Color', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_1,\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-img-wrapper' => 'color: {{VALUE}};',\n ]\n ]\n );\n \n $this->end_controls_section();\n \n /*Start Person Settings Section*/\n $this->start_controls_section('premium_testimonials_person_style', \n [\n 'label' => __('Author', 'premium-addons-for-elementor'),\n 'tab' => Controls_Manager::TAB_STYLE, \n ]\n );\n \n /*Person Name Color*/\n $this->add_control('premium_testimonial_person_name_color',\n [\n 'label' => __('Color', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_1,\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-person-name' => 'color: {{VALUE}};',\n ]\n ]\n );\n \n /*Authohr Name Typography*/\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'author_name_typography',\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .premium-testimonial-person-name',\n ]\n );\n \n /*Separator Color*/\n $this->add_control('premium_testimonial_separator_color',\n [\n 'label' => __('Divider Color', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_1,\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-separator' => 'color: {{VALUE}};',\n ]\n ]\n );\n \n $this->end_controls_section();\n \n /*Start Company Settings Section*/\n $this->start_controls_section('premium_testimonial_company_style',\n [\n 'label' => __('Company', 'premium-addons-for-elementor'),\n 'tab' => Controls_Manager::TAB_STYLE, \n ]\n );\n\n /*Company Name Color*/\n $this->add_control('premium_testimonial_company_name_color',\n [\n 'label' => __('Color', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_2,\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-company-link' => 'color: {{VALUE}};',\n ]\n ]\n );\n \n /*Company Typography*/\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'company_name_typography',\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .premium-testimonial-company-link',\n ]\n ); \n\n /*End Color Section*/\n $this->end_controls_section();\n \n /*Start Content Settings Section*/\n $this->start_controls_section('premium_testimonial_content_style',\n [\n 'label' => __('Content', 'premium-addons-for-elementor'),\n 'tab' => Controls_Manager::TAB_STYLE, \n ]\n );\n\n /*Content Color*/\n $this->add_control('premium_testimonial_content_color',\n [\n 'label' => __('Color', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => Scheme_Color::get_type(),\n 'value' => Scheme_Color::COLOR_3,\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-text-wrapper' => 'color: {{VALUE}};',\n ]\n ]\n );\n \n /*Content Typography*/\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'content_typography',\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .premium-testimonial-text-wrapper',\n ]\n ); \n \n \n /*Testimonial Text Margin*/\n $this->add_responsive_control('premium_testimonial_margin',\n [\n 'label' => __('Margin', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'default' =>[\n 'top' => 15,\n 'bottom'=> 15,\n 'left' => 0 ,\n 'right' => 0 ,\n 'unit' => 'px',\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-text-wrapper' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};',\n ]\n ]\n );\n\n /*End Content Settings Section*/\n $this->end_controls_section();\n \n /*Start Quotes Style Section*/\n $this->start_controls_section('premium_testimonial_quotes',\n [\n 'label' => __('Quotation Icon', 'premium-addons-for-elementor'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n \n /*Quotes Color*/ \n $this->add_control('premium_testimonial_quote_icon_color',\n [\n 'label' => __('Color','premium-addons-for-elementor'),\n 'type' => Controls_Manager::COLOR,\n 'default' => 'rgba(110,193,228,0.2)',\n 'selectors' => [\n '{{WRAPPER}} .fa' => 'color: {{VALUE}};',\n ]\n ]\n );\n\n /*Quotes Size*/\n $this->add_control('premium_testimonial_quotes_size',\n [\n 'label' => __('Size', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::SLIDER,\n 'size_units' => ['px', '%', 'em'],\n 'default' => [\n 'unit' => 'px',\n 'size' => 120,\n ],\n 'range' => [\n 'px' => [\n 'min' => 5,\n 'max' => 250,\n ]\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-upper-quote, {{WRAPPER}} .premium-testimonial-lower-quote' => 'font-size: {{SIZE}}{{UNIT}};',\n ]\n ]\n );\n \n /*Upper Quote Position*/\n $this->add_responsive_control('premium_testimonial_upper_quote_position',\n [\n 'label' => __('Top Icon Position', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'default' =>[\n 'top' => 70,\n 'left' => 12 ,\n 'unit' => 'px',\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-upper-quote' => 'top: {{TOP}}{{UNIT}}; left:{{LEFT}}{{UNIT}};',\n ]\n ]\n );\n \n /*Lower Quote Position*/\n $this->add_responsive_control('premium_testimonial_lower_quote_position',\n [\n 'label' => __('Bottom Icon Position', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'default' =>[\n 'bottom' => 3,\n 'right' => 12,\n 'unit' => 'px',\n ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-lower-quote' => 'right: {{RIGHT}}{{UNIT}}; bottom: {{BOTTOM}}{{UNIT}};',\n ]\n ]\n );\n\n /*End Typography Section*/\n $this->end_controls_section();\n \n $this->start_controls_section('premium_testimonial_container_style',\n [\n 'label' => __('Container','premium-addons-for-elementor'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n \n $this->add_group_control(\n Group_Control_Background::get_type(),\n [\n 'name' => 'premium_testimonial_background',\n 'types' => [ 'classic' , 'gradient' ],\n 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper'\n ]\n );\n \n $this->add_group_control(\n Group_Control_Border::get_type(),\n [\n 'name' => 'premium_testimonial_container_border',\n 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper',\n ]\n );\n\n $this->add_control('premium_testimonial_container_border_radius',\n [\n 'label' => __('Border Radius', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::SLIDER,\n 'size_units' => ['px', '%', 'em'],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'border-radius: {{SIZE}}{{UNIT}}'\n ]\n ]\n );\n \n $this->add_group_control(\n Group_Control_Box_Shadow::get_type(),\n [\n 'name' => 'premium_testimonial_container_box_shadow',\n 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper',\n ]\n );\n \n $this->add_responsive_control('premium_testimonial_box_padding',\n [\n 'label' => __('Padding', 'premium-addons-for-elementor'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => [ 'px', 'em', '%' ],\n 'selectors' => [\n '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',\n ]\n ]\n );\n\n $this->end_controls_section();\n \n }", "protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'settings',\n\t\t\t[\n\t\t\t\t'label' => __( 'Brand list Settings', 'xstore-core' ),\n\t\t\t\t'tab' \t=> \\Elementor\\Controls_Manager::TAB_CONTENT,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'ids',\n\t\t\t[\n\t\t\t\t'label' \t=>\t__( 'Select Brand', 'xstore-core' ),\n\t\t\t\t'type' \t\t=>\t\\Elementor\\Controls_Manager::SELECT2,\n\t\t\t\t'multiple' \t=>\ttrue,\n\t\t\t\t'options' \t=>\tElementor::get_terms('brand'),\n\t\t\t\t'label_block'\t=> 'true',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_a_z',\n\t\t\t[\n\t\t\t\t'label' => __( 'Display A-Z filter', 'xstore-core' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'description' => __( 'Do not forget switch on Customize -> Speed Optimization -> Masonry Scripts', 'xstore-core' ),\n\t\t\t\t'label_on' => __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' => __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'columns',\n\t\t\t[\n\t\t\t\t'label' \t=> __( 'Columns', 'xstore-core' ),\n\t\t\t\t'type' \t\t=> \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t'default' \t=> '',\n\t\t\t\t'options' \t=> [\n\t\t\t\t\t'1' => esc_attr__( '1', 'xstore' ),\n\t\t\t\t\t'2' => esc_attr__( '2', 'xstore' ),\n\t\t\t\t\t'3' => esc_attr__( '3', 'xstore' ),\n\t\t\t\t\t'4' => esc_attr__( '4', 'xstore' ),\n\t\t\t\t\t'5' => esc_attr__( '5', 'xstore' ),\n\t\t\t\t\t'6' => esc_attr__( '6', 'xstore' ),\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'alignment',\n\t\t\t[\n\t\t\t\t'label' \t => __( 'Alignment', 'xstore-core' ),\n\t\t\t\t'type' \t\t => \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t'options' \t => [\n\t\t\t\t\t'left' \t => esc_html__('Left', 'xstore-core') , \n\t\t\t\t\t'center' => esc_html__('Center', 'xstore-core') , \n\t\t\t\t\t'right'\t => esc_html__('Right', 'xstore-core') \n\t\t\t\t],\n\t\t\t\t'default'\t => 'left'\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'capital_letter',\n\t\t\t[\n\t\t\t\t'label' => __( 'Display brands capital letter', 'xstore-core' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' => __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'brand_image',\n\t\t\t[\n\t\t\t\t'label' => __( 'Brand image', 'xstore-core' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' => __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'size',\n\t\t\t[\n\t\t\t\t'label' \t=>\t__( 'Images size', 'xstore-core' ),\n\t\t\t\t'type' \t\t=>\t\\Elementor\\Controls_Manager::TEXT,\n\t\t\t\t'condition' => ['brand_image' => 'yes'],\n\t\t\t\t'default' \t=>\t'',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'brand_title',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Brand title', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> 'yes',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'tooltip',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Title with tooltip', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'brand_desc',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Brand description', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_empty',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Hide empty', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'show_product_counts',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Show Product Counts', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'class',\n\t\t\t[\n\t\t\t\t'label' \t=>\t__( 'Extra Class', 'xstore-core' ),\n\t\t\t\t'type' \t\t=>\t\\Elementor\\Controls_Manager::TEXT,\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t}", "function CreateChildControls()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::CreateChildControls();\" . \"<HR>\";\n if ($this->listSettings->GetCount()) {\n if ($this->listSettings->HasItem(\"MAIN\", \"TABLE\")) {\n $this->Table = $this->listSettings->GetItem(\"MAIN\", \"TABLE\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_TABLE_SETTINGS\", array(), true);\n }\n if (! $this->error) {\n\n //parse library file\n \t$this->InitLibraryData();\n \t//reinitilize database columns definitions\n $this->ReInitTableColumns();\n //create validator\n $this->validator = new Validate($this, $this->Storage->columns, $this->library_ID);\n $this->Kernel->ImportClass(\"web.controls.\" . $this->editcontrol, $this->editcontrol);\n $_editControl = new $this->editcontrol(\"ItemsEdit\", \"edit\", $this->Storage);\n $this->AddControl($_editControl);\n }\n } // if\n else {\n $this->AddEditErrorMessage(\"EMPTY_LIBRARY_SETTINGS\", array(), true);\n }\n }", "protected function _register_controls() {\n\t\t$this->query_controls();\n\t\t$this->layout_controls();\n\n $this->start_controls_section(\n 'eael_section_post_block_style',\n [\n 'label' => __( 'Post Block Style', 'essential-addons-elementor' ),\n 'tab' => Controls_Manager::TAB_STYLE\n ]\n );\n\n\n $this->add_control(\n\t\t\t'eael_post_block_bg_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Post Background Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#fff',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-post-block-item' => 'background-color: {{VALUE}}',\n\t\t\t\t]\n\n\t\t\t]\n\t\t);\n\n\n $this->add_control(\n\t\t\t'eael_thumbnail_overlay_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Thumbnail Overlay Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => 'rgba(0,0,0, .5)',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-overlay, {{WRAPPER}} .eael-post-block.post-block-style-overlay .eael-entry-wrapper' => 'background-color: {{VALUE}}',\n\t\t\t\t]\n\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'eael_post_block_spacing',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Spacing Between Items', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', '%', 'em' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-post-block-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_border',\n\t\t\t\t'label' => esc_html__( 'Border', 'essential-addons-elementor' ),\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-post-block-item',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'eael_post_block_border_radius',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-post-block-item' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_box_shadow',\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-post-block-item',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n $this->start_controls_section(\n 'eael_section_typography',\n [\n 'label' => __( 'Color & Typography', 'essential-addons-elementor' ),\n 'tab' => Controls_Manager::TAB_STYLE\n ]\n );\n\n\t\t$this->add_control(\n\t\t\t'eael_post_block_title_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title Style', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'eael_post_block_title_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default'=> '#303133',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-title, {{WRAPPER}} .eael-entry-title a' => 'color: {{VALUE}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'eael_post_block_title_hover_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title Hover Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default'=> '#23527c',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-title:hover, {{WRAPPER}} .eael-entry-title a:hover' => 'color: {{VALUE}};',\n\t\t\t\t]\n\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'eael_post_block_title_alignment',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title Alignment', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'left' => [\n\t\t\t\t\t\t'title' => __( 'Left', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'right' => [\n\t\t\t\t\t\t'title' => __( 'Right', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-title' => 'text-align: {{VALUE}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_title_typography',\n\t\t\t\t'label' => __( 'Typography', 'essential-addons-elementor' ),\n\t\t\t\t'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-entry-title',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'eael_post_block_excerpt_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Excerpt Style', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'eael_post_block_excerpt_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Excerpt Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default'=> '',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-grid-post-excerpt p' => 'color: {{VALUE}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n\t\t\t'eael_post_block_excerpt_alignment',\n\t\t\t[\n\t\t\t\t'label' => __( 'Excerpt Alignment', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'left' => [\n\t\t\t\t\t\t'title' => __( 'Left', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'right' => [\n\t\t\t\t\t\t'title' => __( 'Right', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t],\n\t\t\t\t\t'justify' => [\n\t\t\t\t\t\t'title' => __( 'Justified', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-justify',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-grid-post-excerpt p' => 'text-align: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_excerpt_typography',\n\t\t\t\t'label' => __( 'Excerpt Typography', 'essential-addons-elementor' ),\n\t\t\t\t'scheme' => Scheme_Typography::TYPOGRAPHY_3,\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-grid-post-excerpt p',\n\t\t\t]\n\t\t);\n\n\n\t\t$this->add_control(\n\t\t\t'eael_post_block_meta_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Meta Style', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'eael_post_block_meta_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Meta Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default'=> '',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-meta, .eael-entry-meta a' => 'color: {{VALUE}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n\t\t\t'eael_post_block_meta_alignment_footer',\n\t\t\t[\n\t\t\t\t'label' => __( 'Meta Alignment', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'flex-start' => [\n\t\t\t\t\t\t'title' => __( 'Left', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'flex-end' => [\n\t\t\t\t\t\t'title' => __( 'Right', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t],\n\t\t\t\t\t'stretch' => [\n\t\t\t\t\t\t'title' => __( 'Justified', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-justify',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-footer' => 'justify-content: {{VALUE}};',\n\t\t\t\t],\n 'condition' => [\n 'meta_position' => 'meta-entry-footer',\n ]\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n\t\t\t'eael_post_block_meta_alignment_header',\n\t\t\t[\n\t\t\t\t'label' => __( 'Meta Alignment', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'left' => [\n\t\t\t\t\t\t'title' => __( 'Left', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'right' => [\n\t\t\t\t\t\t'title' => __( 'Right', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t],\n\t\t\t\t\t'justify' => [\n\t\t\t\t\t\t'title' => __( 'Justified', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-justify',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-meta' => 'text-align: {{VALUE}};',\n\t\t\t\t],\n 'condition' => [\n 'meta_position' => 'meta-entry-header',\n ]\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_meta_typography',\n\t\t\t\t'label' => __( 'Meta Typography', 'essential-addons-elementor' ),\n\t\t\t\t'scheme' => Scheme_Typography::TYPOGRAPHY_3,\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-entry-meta > div, {{WRAPPER}} .eael-entry-meta > span',\n\t\t\t]\n\t\t);\n\n\n\t\t$this->end_controls_section();\n\n\t\t/**\n\t\t * Load More Button Style Controls!\n\t\t */\n\t\t$this->load_more_button_style();\n\n\t}", "protected function register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'_section_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Advanced', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t// Element Name for the Navigator\n\t\t$this->add_control(\n\t\t\t'_title',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::HIDDEN,\n\t\t\t\t'render_type' => 'none',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_margin',\n\t\t\t[\n\t\t\t\t'label' => __( 'Margin', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'rem' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} > .elementor-widget-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_padding',\n\t\t\t[\n\t\t\t\t'label' => __( 'Padding', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'rem' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} > .elementor-widget-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_z_index',\n\t\t\t[\n\t\t\t\t'label' => __( 'Z-Index', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'min' => 0,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'z-index: {{VALUE}};',\n\t\t\t\t],\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_element_id',\n\t\t\t[\n\t\t\t\t'label' => __( 'CSS ID', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'dynamic' => [\n\t\t\t\t\t'active' => true,\n\t\t\t\t],\n\t\t\t\t'default' => '',\n\t\t\t\t'title' => __( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ),\n\t\t\t\t'style_transfer' => false,\n\t\t\t\t'classes' => 'elementor-control-direction-ltr',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_css_classes',\n\t\t\t[\n\t\t\t\t'label' => __( 'CSS Classes', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'dynamic' => [\n\t\t\t\t\t'active' => true,\n\t\t\t\t],\n\t\t\t\t'prefix_class' => '',\n\t\t\t\t'title' => __( 'Add your custom class WITHOUT the dot. e.g: my-class', 'elementor' ),\n\t\t\t\t'classes' => 'elementor-control-direction-ltr',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'section_effects',\n\t\t\t[\n\t\t\t\t'label' => __( 'Motion Effects', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_animation',\n\t\t\t[\n\t\t\t\t'label' => __( 'Entrance Animation', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::ANIMATION,\n\t\t\t\t'frontend_available' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'animation_duration',\n\t\t\t[\n\t\t\t\t'label' => __( 'Animation Duration', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => '',\n\t\t\t\t'options' => [\n\t\t\t\t\t'slow' => __( 'Slow', 'elementor' ),\n\t\t\t\t\t'' => __( 'Normal', 'elementor' ),\n\t\t\t\t\t'fast' => __( 'Fast', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'prefix_class' => 'animated-',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_animation!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_animation_delay',\n\t\t\t[\n\t\t\t\t'label' => __( 'Animation Delay', 'elementor' ) . ' (ms)',\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'default' => '',\n\t\t\t\t'min' => 0,\n\t\t\t\t'step' => 100,\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_animation!' => '',\n\t\t\t\t],\n\t\t\t\t'render_type' => 'none',\n\t\t\t\t'frontend_available' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_background',\n\t\t\t[\n\t\t\t\t'label' => __( 'Background', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->start_controls_tabs( '_tabs_background' );\n\n\t\t$this->start_controls_tab(\n\t\t\t'_tab_background_normal',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Background::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_background',\n\t\t\t\t'selector' => '{{WRAPPER}} > .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'_tab_background_hover',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Background::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_background_hover',\n\t\t\t\t'selector' => '{{WRAPPER}}:hover .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_background_hover_transition',\n\t\t\t[\n\t\t\t\t'label' => __( 'Transition Duration', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 3,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'render_type' => 'ui',\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} > .elementor-widget-container' => 'transition: background {{SIZE}}s',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_border',\n\t\t\t[\n\t\t\t\t'label' => __( 'Border', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->start_controls_tabs( '_tabs_border' );\n\n\t\t$this->start_controls_tab(\n\t\t\t'_tab_border_normal',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_border',\n\t\t\t\t'selector' => '{{WRAPPER}} > .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_border_radius',\n\t\t\t[\n\t\t\t\t'label' => __( 'Border Radius', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} > .elementor-widget-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_box_shadow',\n\t\t\t\t'selector' => '{{WRAPPER}} > .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'_tab_border_hover',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_border_hover',\n\t\t\t\t'selector' => '{{WRAPPER}}:hover .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_border_radius_hover',\n\t\t\t[\n\t\t\t\t'label' => __( 'Border Radius', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}:hover > .elementor-widget-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_box_shadow_hover',\n\t\t\t\t'selector' => '{{WRAPPER}}:hover .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_border_hover_transition',\n\t\t\t[\n\t\t\t\t'label' => __( 'Transition Duration', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 3,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .elementor-widget-container' => 'transition: background {{_background_hover_transition.SIZE}}s, border {{SIZE}}s, border-radius {{SIZE}}s, box-shadow {{SIZE}}s',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_masking',\n\t\t\t[\n\t\t\t\t'label' => __( 'Mask', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_mask_switch',\n\t\t\t[\n\t\t\t\t'label' => __( 'Mask', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'On', 'elementor' ),\n\t\t\t\t'label_off' => __( 'Off', 'elementor' ),\n\t\t\t\t'default' => '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control( '_mask_shape', [\n\t\t\t'label' => __( 'Shape', 'elementor' ),\n\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t'options' => $this->get_shapes(),\n\t\t\t'default' => 'circle',\n\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-image: url( ' . ELEMENTOR_ASSETS_URL . '/mask-shapes/{{VALUE}}.svg );' ),\n\t\t\t'condition' => [\n\t\t\t\t'_mask_switch!' => '',\n\t\t\t],\n\t\t] );\n\n\t\t$this->add_control(\n\t\t\t'_mask_image',\n\t\t\t[\n\t\t\t\t'label' => __( 'Image', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t'media_type' => 'image',\n\t\t\t\t'should_include_svg_inline_option' => true,\n\t\t\t\t'library_type' => 'image/svg+xml',\n\t\t\t\t'dynamic' => [\n\t\t\t\t\t'active' => true,\n\t\t\t\t],\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-image: url( {{URL}} );' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_shape' => 'custom',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_mask_notice',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::HIDDEN,\n\t\t\t\t'raw' => __( 'Need More Shapes?', 'elementor' ) . '<br>' . sprintf( __( 'Explore additional Premium Shape packs and use them in your site. <a target=\"_blank\" href=\"%s\">Learn More</a>', 'elementor' ), 'https://go.elementor.com/mask-control' ),\n\t\t\t\t'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_size',\n\t\t\t[\n\t\t\t\t'label' => __( 'Size', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'contain' => __( 'Fit', 'elementor' ),\n\t\t\t\t\t'cover' => __( 'Fill', 'elementor' ),\n\t\t\t\t\t'custom' => __( 'Custom', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'contain',\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-size: {{VALUE}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_size_scale',\n\t\t\t[\n\t\t\t\t'label' => __( 'Scale', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'vw' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 500,\n\t\t\t\t\t],\n\t\t\t\t\t'em' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t\t'size' => 100,\n\t\t\t\t],\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-size: {{SIZE}}{{UNIT}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_size' => 'custom',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_position',\n\t\t\t[\n\t\t\t\t'label' => __( 'Position', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'center center' => __( 'Center Center', 'elementor' ),\n\t\t\t\t\t'center left' => __( 'Center Left', 'elementor' ),\n\t\t\t\t\t'center right' => __( 'Center Right', 'elementor' ),\n\t\t\t\t\t'top center' => __( 'Top Center', 'elementor' ),\n\t\t\t\t\t'top left' => __( 'Top Left', 'elementor' ),\n\t\t\t\t\t'top right' => __( 'Top Right', 'elementor' ),\n\t\t\t\t\t'bottom center' => __( 'Bottom Center', 'elementor' ),\n\t\t\t\t\t'bottom left' => __( 'Bottom Left', 'elementor' ),\n\t\t\t\t\t'bottom right' => __( 'Bottom Right', 'elementor' ),\n\t\t\t\t\t'custom' => __( 'Custom', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'center center',\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-position: {{VALUE}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_position_x',\n\t\t\t[\n\t\t\t\t'label' => __( 'X Position', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'vw' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -500,\n\t\t\t\t\t\t'max' => 500,\n\t\t\t\t\t],\n\t\t\t\t\t'em' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t\t'size' => 0,\n\t\t\t\t],\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-position-x: {{SIZE}}{{UNIT}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_position' => 'custom',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_position_y',\n\t\t\t[\n\t\t\t\t'label' => __( 'Y Position', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'vw' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -500,\n\t\t\t\t\t\t'max' => 500,\n\t\t\t\t\t],\n\t\t\t\t\t'em' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t\t'size' => 0,\n\t\t\t\t],\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-position-y: {{SIZE}}{{UNIT}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_position' => 'custom',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_repeat',\n\t\t\t[\n\t\t\t\t'label' => __( 'Repeat', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'no-repeat' => __( 'No-Repeat', 'elementor' ),\n\t\t\t\t\t'repeat' => __( 'Repeat', 'elementor' ),\n\t\t\t\t\t'repeat-x' => __( 'Repeat-X', 'elementor' ),\n\t\t\t\t\t'repeat-Y' => __( 'Repeat-Y', 'elementor' ),\n\t\t\t\t\t'round' => __( 'Round', 'elementor' ),\n\t\t\t\t\t'space' => __( 'Space', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'no-repeat',\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-repeat: {{VALUE}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_size!' => 'cover',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_position',\n\t\t\t[\n\t\t\t\t'label' => __( 'Positioning', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_element_width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Width', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => '',\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => __( 'Default', 'elementor' ),\n\t\t\t\t\t'inherit' => __( 'Full Width', 'elementor' ) . ' (100%)',\n\t\t\t\t\t'auto' => __( 'Inline', 'elementor' ) . ' (auto)',\n\t\t\t\t\t'initial' => __( 'Custom', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'selectors_dictionary' => [\n\t\t\t\t\t'inherit' => '100%',\n\t\t\t\t],\n\t\t\t\t'prefix_class' => 'elementor-widget%s__width-',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'width: {{VALUE}}; max-width: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_element_custom_width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Custom Width', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_element_width' => 'initial',\n\t\t\t\t],\n\t\t\t\t'device_args' => [\n\t\t\t\t\tControls_Stack::RESPONSIVE_TABLET => [\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'_element_width_tablet' => [ 'initial' ],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\tControls_Stack::RESPONSIVE_MOBILE => [\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'_element_width_mobile' => [ 'initial' ],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vw' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'width: {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_element_vertical_align',\n\t\t\t[\n\t\t\t\t'label' => __( 'Vertical Align', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'flex-start' => [\n\t\t\t\t\t\t'title' => __( 'Start', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-top',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-middle',\n\t\t\t\t\t],\n\t\t\t\t\t'flex-end' => [\n\t\t\t\t\t\t'title' => __( 'End', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-bottom',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_element_width!' => '',\n\t\t\t\t\t'_position' => '',\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'align-self: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_position_description',\n\t\t\t[\n\t\t\t\t'raw' => '<strong>' . __( 'Please note!', 'elementor' ) . '</strong> ' . __( 'Custom positioning is not considered best practice for responsive web design and should not be used too frequently.', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::RAW_HTML,\n\t\t\t\t'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',\n\t\t\t\t'render_type' => 'ui',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_position',\n\t\t\t[\n\t\t\t\t'label' => __( 'Position', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => '',\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => __( 'Default', 'elementor' ),\n\t\t\t\t\t'absolute' => __( 'Absolute', 'elementor' ),\n\t\t\t\t\t'fixed' => __( 'Fixed', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'prefix_class' => 'elementor-',\n\t\t\t\t'frontend_available' => true,\n\t\t\t]\n\t\t);\n\n\t\t$start = is_rtl() ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' );\n\t\t$end = ! is_rtl() ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' );\n\n\t\t$this->add_control(\n\t\t\t'_offset_orientation_h',\n\t\t\t[\n\t\t\t\t'label' => __( 'Horizontal Orientation', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'toggle' => false,\n\t\t\t\t'default' => 'start',\n\t\t\t\t'options' => [\n\t\t\t\t\t'start' => [\n\t\t\t\t\t\t'title' => $start,\n\t\t\t\t\t\t'icon' => 'eicon-h-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'end' => [\n\t\t\t\t\t\t'title' => $end,\n\t\t\t\t\t\t'icon' => 'eicon-h-align-right',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'classes' => 'elementor-control-start-end',\n\t\t\t\t'render_type' => 'ui',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_offset_x',\n\t\t\t[\n\t\t\t\t'label' => __( 'Offset', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -1000,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vh' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => '0',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vw', 'vh' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'body:not(.rtl) {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}',\n\t\t\t\t\t'body.rtl {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_offset_orientation_h!' => 'end',\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_offset_x_end',\n\t\t\t[\n\t\t\t\t'label' => __( 'Offset', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -1000,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vh' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => '0',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vw', 'vh' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'body:not(.rtl) {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}',\n\t\t\t\t\t'body.rtl {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_offset_orientation_h' => 'end',\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_offset_orientation_v',\n\t\t\t[\n\t\t\t\t'label' => __( 'Vertical Orientation', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'toggle' => false,\n\t\t\t\t'default' => 'start',\n\t\t\t\t'options' => [\n\t\t\t\t\t'start' => [\n\t\t\t\t\t\t'title' => __( 'Top', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-top',\n\t\t\t\t\t],\n\t\t\t\t\t'end' => [\n\t\t\t\t\t\t'title' => __( 'Bottom', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-bottom',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'render_type' => 'ui',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_offset_y',\n\t\t\t[\n\t\t\t\t'label' => __( 'Offset', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -1000,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vh' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vh', 'vw' ],\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => '0',\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'top: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_offset_orientation_v!' => 'end',\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_offset_y_end',\n\t\t\t[\n\t\t\t\t'label' => __( 'Offset', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -1000,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vh' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vh', 'vw' ],\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => '0',\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'bottom: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_offset_orientation_v' => 'end',\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_responsive',\n\t\t\t[\n\t\t\t\t'label' => __( 'Responsive', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'responsive_description',\n\t\t\t[\n\t\t\t\t'raw' => __( 'Responsive visibility will take effect only on preview or live page, and not while editing in Elementor.', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::RAW_HTML,\n\t\t\t\t'content_classes' => 'elementor-descriptor',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_desktop',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hide On Desktop', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => '',\n\t\t\t\t'prefix_class' => 'elementor-',\n\t\t\t\t'label_on' => 'Hide',\n\t\t\t\t'label_off' => 'Show',\n\t\t\t\t'return_value' => 'hidden-desktop',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_tablet',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hide On Tablet', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => '',\n\t\t\t\t'prefix_class' => 'elementor-',\n\t\t\t\t'label_on' => 'Hide',\n\t\t\t\t'label_off' => 'Show',\n\t\t\t\t'return_value' => 'hidden-tablet',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_mobile',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hide On Mobile', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => '',\n\t\t\t\t'prefix_class' => 'elementor-',\n\t\t\t\t'label_on' => 'Hide',\n\t\t\t\t'label_off' => 'Show',\n\t\t\t\t'return_value' => 'hidden-phone',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\tPlugin::$instance->controls_manager->add_custom_attributes_controls( $this );\n\n\t\tPlugin::$instance->controls_manager->add_custom_css_controls( $this );\n\t}", "public function getAcroFormFieldNamesToTemplateNodes() {}", "function initControls()\n {\n\n $this->map->getControls()->getMaptype()->setDisplay((boolean) $this->showMapType);\n\n $this->map->getControls()->getMaptype()->setPosition($this->mapTypePosition);\n $this->map->getControls()->getMaptype()->setType($this->mapTypeType);\n\n $this->map->getControls()->getScale()->setDisplay((boolean) $this->showScale);\n $this->map->getControls()->getScale()->setPosition($this->scalePosition);\n\n $this->map->getControls()->getNavigation()->setDisplay((boolean) $this->showNavigation);\n\n $this->map->getControls()->getNavigation()->setPosition($this->navigationPosition);\n\n $this->map->getControls()->getNavigation()->setType($this->navigationType);\n\n\n $this->map->getControls()->getZoom()->setDisplay((boolean) $this->showZoom);\n $this->map->getControls()->getZoom()->setPosition($this->zoomPosition);\n $this->map->getControls()->getZoom()->setType($this->zoomType);\n\n $this->map->getControls()->getPan()->setDisplay((boolean) $this->showPan);\n $this->map->getControls()->getPan()->setPosition($this->panPosition);\n\n if ($this->initialMapType)\n {\n $this->map->setMaptype(new Tx_Listfeusers_Gmap_Maptype($this->initialMapType));\n }\n\n }", "public function GetControlsList() {\n\n return array_keys($this->Controls);\n }", "protected function _register_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'content_section',\n\t\t\tarray(\n\t\t\t\t'label' => 'Slider Revolution 6',\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_CONTENT,\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'revslidertitle',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Selected Module:', 'revslider' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::TEXT,\n\t\t\t\t'render_type' => 'none',\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t\t'event' => 'themepunch.selectslider',\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'shortcode',\n\t\t\tarray(\n\t\t\t\t//'type' => \\Elementor\\Controls_Manager::HIDDEN,\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::TEXT,\n\t\t\t\t'label' => __( 'Shortcode', 'revslider' ),\n\t\t\t\t'dynamic' => ['active' => true],\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t)\n\t\t);\n\n\t\t// Advanced \t\t\n\t\t$this->add_control(\n\t\t\t'select_slider',\n\t\t\tarray(\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::BUTTON,\n\t\t\t\t'button_type' => 'default',\n\t\t\t\t'text' => __( '<i type=\"button\" class=\"material-icons\">cached</i> Select Module', 'revslider' ),\n\t\t\t\t'event' => 'themepunch.selectslider',\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'edit_slider',\n\t\t\tarray(\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::BUTTON,\n\t\t\t\t'button_type' => 'default',\n\t\t\t\t'text' => __( '<i type=\"button\" class=\"material-icons\">edit</i> Edit Module', 'revslider' ),\n\t\t\t\t'event' => 'themepunch.editslider',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'settings_slider',\n\t\t\tarray(\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::BUTTON,\n\t\t\t\t'button_type' => 'default',\n\t\t\t\t'text' => __( '<i type=\"button\" class=\"material-icons\">tune</i> Block Settings', 'revslider' ),\n\t\t\t\t'event' => 'themepunch.settingsslider',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'optimize_slider',\n\t\t\tarray(\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::BUTTON,\n\t\t\t\t'button_type' => 'default',\n\t\t\t\t'text' => __( '<i type=\"button\" class=\"material-icons\">flash_on</i> Optimize File Sizes', 'revslider' ),\n\t\t\t\t'event' => 'themepunch.optimizeslider',\n\t\t\t)\n\t\t);\n\t\t$this->end_controls_section();\t\n\t}", "function CreateChildControls() {\n }", "protected function regenerateFormControls()\n\t{\n\t\t$form = $this->getForm();\n\n\t\t// regenerate checker's checkbox controls\n\t\tif ($this->hasOperations()) {\n\t\t\t$values = $form->getValues();\n\n\t\t\t$form->removeComponent($form['checker']);\n\t\t\t$sub = $form->addContainer('checker');\n\t\t\tforeach ($this->getRows() as $row) {\n\t\t\t\t$sub->addCheckbox($row[$this->keyName], $row[$this->keyName]);\n\t\t\t}\n\n\t\t\tif (!empty($values['checker'])) {\n\t\t\t\t$form->setDefaults(array('checker' => $values['checker']));\n\t\t\t}\n\t\t}\n\n\t\t// for selectbox filter controls update values if was filtered over column\n\t\tif ($this->hasFilters()) {\n\t\t\tparse_str($this->filters, $list);\n\n\t\t\tforeach ($this->getFilters() as $filter) {\n\t\t\t\tif ($filter instanceof SelectboxFilter) {\n\t\t\t\t\t$filter->generateItems();\n\t\t\t\t}\n\n\t\t\t\tif ($this->filters === $this->defaultFilters && ($filter->value !== NULL || $filter->value !== '')) {\n\t\t\t\t\tif (!in_array($filter->getName(), array_keys($list))) $filter->value = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// page input & items selectbox\n\t\t$form['page']->setValue($this->paginator->page); // intentionally page from paginator\n\t\t$form['items']->setValue($this->paginator->itemsPerPage);\n\t}", "protected function _register_controls() {\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'General Settings', 'essential-addons-elementor' )\n \t\t\t]\n \t\t);\n \t\t$this->add_control(\n\t\t 'eael_google_map_type',\n\t\t \t[\n\t\t \t\t'label' \t=> esc_html__( 'Google Map Type', 'essential-addons-elementor' ),\n\t\t \t'type' \t\t\t=> Controls_Manager::SELECT,\n\t\t \t'default' \t\t=> 'basic',\n\t\t \t'label_block' \t=> false,\n\t\t \t'options' \t\t=> [\n\t\t \t\t'basic' \t=> esc_html__( 'Basic', 'essential-addons-elementor' ),\n\t\t \t\t'marker' \t=> esc_html__( 'Multiple Marker', 'essential-addons-elementor' ),\n\t\t \t\t'static' \t=> esc_html__( 'Static', 'essential-addons-elementor' ),\n\t\t \t\t'polyline' => esc_html__( 'Polyline', 'essential-addons-elementor' ),\n\t\t \t\t'polygon' \t=> esc_html__( 'Polygon', 'essential-addons-elementor' ),\n\t\t \t\t'overlay' \t=> esc_html__( 'Overlay', 'essential-addons-elementor' ),\n\t\t \t\t'routes' \t=> esc_html__( 'With Routes', 'essential-addons-elementor' ),\n\t\t \t\t'panorama' => esc_html__( 'Panorama', 'essential-addons-elementor' ),\n\t\t \t]\n\t\t \t]\n\t\t);\n\t\t$this->add_control(\n 'eael_google_map_address_type',\n [\n 'label' => __( 'Address Type', 'essential-addons-elementor' ),\n 'type' => Controls_Manager::CHOOSE,\n 'options' => [\n\t\t\t\t\t'address' => [\n\t\t\t\t\t\t'title' => __( 'Address', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-map',\n\t\t\t\t\t],\n\t\t\t\t\t'coordinates' => [\n\t\t\t\t\t\t'title' => __( 'Coordinates', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-map-marker',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => 'address',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['basic']\n\t\t\t\t]\n ]\n );\n $this->add_control(\n\t\t\t'eael_google_map_addr',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Geo Address', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => esc_html__( 'Marina Bay, Singapore', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_address_type' => ['address'],\n\t\t\t\t\t'eael_google_map_type' => ['basic']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type!' => ['routes'],\n\t\t\t\t\t'eael_google_map_address_type' => ['coordinates']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type!' => ['routes'],\n\t\t\t\t\t'eael_google_map_address_type' => ['coordinates']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t// Only for static\n\t\t$this->add_control(\n\t\t\t'eael_google_map_static_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['static'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_static_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['static'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_resolution_title',\n\t\t\t[\n\t\t\t\t'label' => __( 'Map Image Resolution', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => 'static'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_static_width',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Static Image Width', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 610\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 1400,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => 'static'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_static_height',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Static Image Height', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 300\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 700,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => 'static'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t// Only for Overlay\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['overlay'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['overlay'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t// Only for panorama\n\t\t$this->add_control(\n\t\t\t'eael_google_map_panorama_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['panorama'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_panorama_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['panorama'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_content',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Overlay Content', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n\t\t\t\t'label_block' => True,\n\t\t\t\t'default' => esc_html__( 'Add your content here', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => 'overlay'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n \t\t$this->end_controls_section();\n \t\t/**\n \t\t * Map Settings (With Marker only for Basic)\n \t\t */\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_basic_marker_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'Map Marker Settings', 'essential-addons-elementor' ),\n \t\t\t\t'condition' => [\n \t\t\t\t\t'eael_google_map_type' => ['basic']\n \t\t\t\t]\n \t\t\t]\n \t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_title',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Title', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => esc_html__( 'Google Map Title', 'essential-addons-elementor' )\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_content',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Content', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => esc_html__( 'Google map content', 'essential-addons-elementor' )\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_icon_enable',\n\t\t\t[\n\t\t\t\t'label' => __( 'Custom Marker Icon', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => 'no',\n\t\t\t\t'label_on' => __( 'Yes', 'essential-addons-elementor' ),\n\t\t\t\t'label_off' => __( 'No', 'essential-addons-elementor' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t]\n\t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_icon',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Marker Icon', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t'default' => [\n\t\t\t\t\t// 'url' => Utils::get_placeholder_image_src(),\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_basic_marker_icon_enable' => 'yes'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_icon_width',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Marker Width', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 32\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 150,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_basic_marker_icon_enable' => 'yes'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_icon_height',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Marker Height', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 32\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 150,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_basic_marker_icon_enable' => 'yes'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n \t\t/**\n \t\t * Map Settings (With Marker)\n \t\t */\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_marker_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'Map Marker Settings', 'essential-addons-elementor' ),\n \t\t\t\t'condition' => [\n \t\t\t\t\t'eael_google_map_type' => ['marker', 'polyline', 'routes', 'static']\n \t\t\t\t]\n \t\t\t]\n \t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_markers',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'seperator' => 'before',\n\t\t\t\t'default' => [\n\t\t\t\t\t[ 'eael_google_map_marker_title' => esc_html__( 'Map Marker 1', 'essential-addons-elementor' ) ],\n\t\t\t\t],\n\t\t\t\t'fields' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_lat',\n\t\t\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_lng',\n\t\t\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_title',\n\t\t\t\t\t\t'label' => esc_html__( 'Title', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( 'Marker Title', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_content',\n\t\t\t\t\t\t'label' => esc_html__( 'Content', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( 'Marker Content. You can put html here.', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon_color',\n\t\t\t\t\t\t'label' => esc_html__( 'Default Icon Color', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'description' => esc_html__( '(Works only on Static mode)', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t\t\t'default' => '#e23a47',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon_enable',\n\t\t\t\t\t\t'label' => __( 'Use Custom Icon', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t'label_on' => __( 'Yes', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'label_off' => __( 'No', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'return_value' => 'yes',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon',\n\t\t\t\t\t\t'label' => esc_html__( 'Custom Icon', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t\t\t'default' => [\n\t\t\t\t\t\t\t// 'url' => Utils::get_placeholder_image_src(),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'eael_google_map_marker_icon_enable' => 'yes'\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon_width',\n\t\t\t\t\t\t'label' => esc_html__( 'Icon Width', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t\t\t'default' => esc_html__( '32', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'eael_google_map_marker_icon_enable' => 'yes'\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon_height',\n\t\t\t\t\t\t'label' => esc_html__( 'Icon Height', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t\t\t'default' => esc_html__( '32', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'eael_google_map_marker_icon_enable' => 'yes'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'title_field' => '{{eael_google_map_marker_title}}',\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\n\n \t\t/**\n \t\t * Polyline Coordinates Settings (Polyline)\n \t\t */\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_polyline_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'Coordinate Settings', 'essential-addons-elementor' ),\n \t\t\t\t'condition' => [\n \t\t\t\t\t'eael_google_map_type' => ['polyline', 'polygon']\n \t\t\t\t]\n \t\t\t]\n \t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_polylines',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'seperator' => 'before',\n\t\t\t\t'default' => [\n\t\t\t\t\t[ 'eael_google_map_polyline_title' => esc_html__( '#1', 'essential-addons-elementor' ) ],\n\t\t\t\t],\n\t\t\t\t'fields' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_polyline_title',\n\t\t\t\t\t\t'label' => esc_html__( 'Title', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '#', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_polyline_lat',\n\t\t\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_polyline_lng',\n\t\t\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'title_field' => '{{eael_google_map_polyline_title}}',\n\t\t\t]\n\t\t);\n \t\t$this->end_controls_section();\n\n \t\t/**\n \t\t * Routes Coordinates Settings (Routes)\n \t\t */\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_routes_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'Routes Coordinate Settings', 'essential-addons-elementor' ),\n \t\t\t\t'condition' => [\n \t\t\t\t\t'eael_google_map_type' => ['routes']\n \t\t\t\t]\n \t\t\t]\n \t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_routes_origin',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Origin', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'after',\n\t\t\t]\n\t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_routes_origin_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_routes_origin_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_routes_dest',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Destination', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'after',\n\t\t\t]\n\t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_routes_dest_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2833808', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_routes_dest_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8585377', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t \t'eael_google_map_routes_travel_mode',\n\t\t \t[\n\t\t \t\t'label' \t=> esc_html__( 'Travel Mode', 'essential-addons-elementor' ),\n\t\t \t'type' \t\t\t=> Controls_Manager::SELECT,\n\t\t \t'default' \t\t=> 'walking',\n\t\t \t'label_block' \t=> false,\n\t\t \t'options' \t\t=> [\n\t\t \t\t'walking' \t=> esc_html__( 'Walking', 'essential-addons-elementor' ),\n\t\t \t\t'bicycling' => esc_html__( 'Bicycling', 'essential-addons-elementor' ),\n\t\t \t\t'driving' \t=> esc_html__( 'Driving', 'essential-addons-elementor' ),\n\t\t \t]\n\t\t \t]\n\t\t);\n \t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'section_map_controls',\n\t\t\t[\n\t\t\t\t'label'\t=> esc_html__( 'Map Controls', 'essential-addons-elementor' )\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_zoom',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Zoom Level', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '14', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_streeview_control',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Street View Controls', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'true',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'true',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_type_control',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Map Type Control', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'yes',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_zoom_control',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Zoom Control', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'yes',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_fullscreen_control',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Fullscreen Control', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'yes',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_scroll_zoom',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Scroll Wheel Zoom', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'yes',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\t\t \n\t\t/**\n \t\t * Map Theme Settings\n \t\t */\n \t\t$this->start_controls_section(\n\t\t\t'eael_section_google_map_theme_settings',\n\t\t\t[\n\t\t\t\t'label'\t\t=> esc_html__( 'Map Theme', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type!'\t=> ['static', 'panorama']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n 'eael_google_map_theme_source',\n [\n 'label'\t\t=> __( 'Theme Source', 'essential-addons-elementor' ),\n\t\t\t\t'type'\t\t=> Controls_Manager::CHOOSE,\n 'options' => [\n\t\t\t\t\t'gstandard' => [\n\t\t\t\t\t\t'title' => __( 'Google Standard', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-map',\n\t\t\t\t\t],\n\t\t\t\t\t'snazzymaps' => [\n\t\t\t\t\t\t'title' => __( 'Snazzy Maps', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-map-marker',\n\t\t\t\t\t],\n\t\t\t\t\t'custom' => [\n\t\t\t\t\t\t'title' => __( 'Custom', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-edit',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default'\t=> 'gstandard'\n ]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_gstandards',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Google Themes', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => 'standard',\n\t\t\t\t'options' => [\n\t\t\t\t\t'standard' => __( 'Standard', 'essential-addons-elementor' ),\n\t\t\t\t\t'silver' => __( 'Silver', 'essential-addons-elementor' ),\n\t\t\t\t\t'retro' => __( 'Retro', 'essential-addons-elementor' ),\n\t\t\t\t\t'dark' => __( 'Dark', 'essential-addons-elementor' ),\n\t\t\t\t\t'night' => __( 'Night', 'essential-addons-elementor' ),\n\t\t\t\t\t'aubergine' => __( 'Aubergine', 'essential-addons-elementor' )\n\t\t\t\t],\n\t\t\t\t'description' => sprintf( '<a href=\"https://mapstyle.withgoogle.com/\" target=\"_blank\">%1$s</a> %2$s',__( 'Click here', 'essential-addons-elementor' ), __( 'to generate your own theme and use JSON within Custom style field.', 'essential-addons-elementor' ) ),\n\t\t\t\t'condition'\t=> [\n\t\t\t\t\t'eael_google_map_theme_source'\t=> 'gstandard'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_snazzymaps',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'SnazzyMaps Themes', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'label_block'\t\t\t=> true,\n\t\t\t\t'default' => 'colorful',\n\t\t\t\t'options' => [\n\t\t\t\t\t'default'\t\t=> __( 'Default', 'essential-addons-elementor' ),\n\t\t\t\t\t'simple'\t\t=> __( 'Simple', 'essential-addons-elementor' ),\n\t\t\t\t\t'colorful'\t\t=> __( 'Colorful', 'essential-addons-elementor' ),\n\t\t\t\t\t'complex'\t\t=> __( 'Complex', 'essential-addons-elementor' ),\n\t\t\t\t\t'dark'\t\t\t=> __( 'Dark', 'essential-addons-elementor' ),\n\t\t\t\t\t'greyscale'\t\t=> __( 'Greyscale', 'essential-addons-elementor' ),\n\t\t\t\t\t'light'\t\t\t=> __( 'Light', 'essential-addons-elementor' ),\n\t\t\t\t\t'monochrome'\t=> __( 'Monochrome', 'essential-addons-elementor' ),\n\t\t\t\t\t'nolabels'\t\t=> __( 'No Labels', 'essential-addons-elementor' ),\n\t\t\t\t\t'twotone'\t\t=> __( 'Two Tone', 'essential-addons-elementor' )\n\t\t\t\t],\n\t\t\t\t'description' => sprintf( '<a href=\"https://snazzymaps.com/explore\" target=\"_blank\">%1$s</a> %2$s',__( 'Click here', 'essential-addons-elementor' ), __( 'to explore more themes and use JSON within custom style field.', 'essential-addons-elementor' ) ),\n\t\t\t\t'condition'\t=> [\n\t\t\t\t\t'eael_google_map_theme_source'\t=> 'snazzymaps'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_custom_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Custom Style', 'essential-addons-elementor' ),\n\t\t\t\t'description' => sprintf( '<a href=\"https://mapstyle.withgoogle.com/\" target=\"_blank\">%1$s</a> %2$s',__( 'Click here', 'essential-addons-elementor' ), __( 'to get JSON style code to style your map', 'essential-addons-elementor' ) ),\n\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n 'condition' => [\n 'eael_google_map_theme_source' => 'custom',\n ],\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section(); \n \t\t/**\n\t\t * -------------------------------------------\n\t\t * Tab Style Google Map Style\n\t\t * -------------------------------------------\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'eael_section_google_map_style_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'General Style', 'essential-addons-elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_max_width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Max Width', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 1140,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1400,\n\t\t\t\t\t\t'step' => 10,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-google-map' => 'max-width: {{SIZE}}{{UNIT}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_max_height',\n\t\t\t[\n\t\t\t\t'label' => __( 'Max Height', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 400,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1400,\n\t\t\t\t\t\t'step' => 10,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-google-map' => 'height: {{SIZE}}{{UNIT}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_margin',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Margin', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t \t\t\t\t\t'{{WRAPPER}} .eael-google-map' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t \t\t\t],\n\t\t\t]\n\t\t);\n\n \t\t$this->end_controls_section();\n\n \t\t/**\n\t\t * -------------------------------------------\n\t\t * Tab Style Google Map Style\n\t\t * -------------------------------------------\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'eael_section_google_map_overlay_style_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Overlay Style', 'essential-addons-elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['overlay']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_overlay_width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Width', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 200,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1100,\n\t\t\t\t\t\t'step' => 10,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_bg_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Background Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#fff',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'background-color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_mapoverlay_padding',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Padding', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t \t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t \t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_overlay_margin',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Margin', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t \t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t \t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_google_map_overlay_border',\n\t\t\t\t'label' => esc_html__( 'Border', 'essential-addons-elementor' ),\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-gmap-overlay',\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_overlay_border_radius',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t \t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t \t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_google_map_overlay_box_shadow',\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-gmap-overlay',\n\t\t\t]\n\t\t);\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n \t'name' => 'eael_google_map_overlay_typography',\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-gmap-overlay',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#222',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\n\t\t/**\n\t\t * -------------------------------------------\n\t\t * Tab Style Google Map Stroke Style\n\t\t * -------------------------------------------\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'eael_section_google_map_stroke_style_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Stroke Style', 'essential-addons-elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['polyline', 'polygon', 'routes']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_stroke_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#e23a47',\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_stroke_opacity',\n\t\t\t[\n\t\t\t\t'label' => __( 'Opacity', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 0.8,\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0.2,\n\t\t\t\t\t\t'max' => 1,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_stroke_weight',\n\t\t\t[\n\t\t\t\t'label' => __( 'Weight', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 4,\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 10,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_stroke_fill_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Fill Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#e23a47',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['polygon']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_stroke_fill_opacity',\n\t\t\t[\n\t\t\t\t'label' => __( 'Fill Opacity', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 0.4,\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0.2,\n\t\t\t\t\t\t'max' => 1,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['polygon']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\t}", "public function getControlNames();", "protected function _register_controls()\n {\n \n // start_controls_section -----\n $this->start_controls_section(\n 'general_settings_section',\n [\n 'label' => __('General Settings', 'elementor-hello-world'),\n ]\n );\n $this->add_control(\n 'title',\n [\n 'label' => __('Title', 'elementor-hello-world'),\n 'type' => Controls_Manager::TEXTAREA,\n 'default' => ''\n ]\n );\n $this->add_control(\n 'description',\n [\n 'label' => 'Description',\n 'type' => Controls_Manager::WYSIWYG,\n 'default' => ''\n ]\n );\n \n $this->add_control(\n 'extra_classes',\n [\n 'label' => __('Extra Classes', 'elementor-hello-world'),\n 'type' => Controls_Manager::TEXT,\n 'default' => ''\n ]\n );\n $this->end_controls_section();\n \n $oRepeater = new \\Elementor\\Repeater();\n $this->start_controls_section(\n 'tab_name',\n [\n 'label' => __('Tab Name', 'elementor-hello-world'),\n ]\n );\n $oRepeater->add_control(\n 'tab_name',\n [\n 'label' => __('Tab Name', 'hslanding-elementor'),\n 'type' => \\Elementor\\Controls_Manager::TEXT,\n 'label_block' => true,\n ]\n );\n \n $oRepeater->add_control(\n 'tab_description',\n [\n 'label' => __('Tab Description', 'hslanding-elementor'),\n 'type' => \\Elementor\\Controls_Manager::WYSIWYG,\n 'label_block' => true,\n ]\n );\n \n $oRepeater->add_control(\n 'right_image',\n [\n 'label' => __('Right Image', 'hslanding-elementor'),\n 'type' => \\Elementor\\Controls_Manager::MEDIA,\n 'label_block' => true,\n ]\n );\n $oRepeater->add_control(\n 'right_content',\n [\n 'label' => __('Right Content', 'hslanding-elementor'),\n 'type' => \\Elementor\\Controls_Manager::WYSIWYG,\n 'label_block' => true,\n ]\n );\n $this->add_control(\n 'tabs',\n [\n 'label' => __('Tab Settings', 'plugin-domain'),\n 'type' => \\Elementor\\Controls_Manager::REPEATER,\n 'fields' => $oRepeater->get_controls()\n ]\n );\n \n // end_controls_section -----\n $this->end_controls_section();\n }", "protected function _register_controls() {\n // `Testimonial Carousel` Section\n $this->start_controls_section( 'testimonial_carousel', array(\n 'label' => 'Testimonial Carousel',\n 'tab' => Controls_Manager::TAB_CONTENT,\n ) );\n\n $repeater = new \\Elementor\\Repeater();\n\n $repeater->add_control( 'testimonial_image', array(\n 'label' => 'Choose Image',\n 'type' => Controls_Manager::MEDIA,\n 'default' => array(\n 'url' => \\Elementor\\Utils::get_placeholder_image_src(),\n ),\n ) );\n\n $repeater->add_group_control( \\Elementor\\Group_Control_Image_Size::get_type(), array(\n 'name' => 'testimonial_img_size',\n 'exclude' => array(),\n 'include' => array(),\n 'default' => 'thumbnail',\n ) );\n\n $repeater->add_control( 'testimonial_content', array(\n 'label' => 'Content',\n 'type' => Controls_Manager::TEXTAREA,\n 'default' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.',\n ) );\n\n $repeater->add_control( 'testimonial_name', array(\n 'label' => 'Name',\n 'type' => Controls_Manager::TEXT,\n 'default' => 'John Doe',\n ) );\n\n $repeater->add_control( 'testimonial_title', array(\n 'label' => 'Title',\n 'type' => Controls_Manager::TEXT,\n 'default' => 'Web Developer',\n ) );\n\n $this->add_control( 'testimonial_list', array(\n 'label' => 'Testimonials',\n 'type' => Controls_Manager::REPEATER,\n 'fields' => $repeater->get_controls(),\n 'default' => array(\n array(\n 'testimonial_content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pharetra magna eu nisi porttitor, ut auctor felis commodo. Fusce nunc nisl, volutpat vel dolor eget, dapibus congue mauris. Nullam vestibulum eros vitae augue sagittis aliquet. Nulla tempor imperdiet enim eu pulvinar.',\n ),\n array(\n 'testimonial_content' => 'Suspendisse nec imperdiet nisi, eu pulvinar turpis. Maecenas consequat pharetra mi eget volutpat. Vivamus quis pulvinar ante. Mauris vitae bibendum orci. Quisque porta dui mauris, eget facilisis nunc cursus et. Pellentesque condimentum mollis dignissim. Cras vehicula lacinia nulla, blandit luctus lectus ornare quis.',\n ),\n array(\n 'testimonial_content' => 'Etiam ac ligula magna. Nam tempus lorem a leo fermentum, eget iaculis eros vulputate. Fusce sollicitudin nulla ac aliquam scelerisque. Fusce nec dictum magna. Ut maximus ultrices pulvinar. Integer sit amet felis tellus. Phasellus turpis ex, luctus vulputate egestas eget, laoreet et nunc.',\n ),\n ),\n 'title_field' => '{{{ testimonial_name }}}'\n ) );\n\n $this->end_controls_section();\n\n // `Image` Section\n $this->start_controls_section( 'testimonial_image_style', array(\n 'label' => 'Image',\n 'tab' => Controls_Manager::TAB_STYLE,\n ) );\n\n $this->add_control( 'testimonial_image_size', array(\n 'label' => 'Image Size',\n 'type' => Controls_Manager::SLIDER,\n 'range' => array(\n 'px' => array(\n 'min' => 50,\n 'max' => 500,\n 'step' => 5,\n ),\n ),\n 'selectors' => array(\n '{{WRAPPER}} .img-box' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',\n ),\n ) );\n\n $this->add_group_control( \\Elementor\\Group_Control_Border::get_type(), array(\n 'name' => 'testimonial_image_border',\n 'label' => 'Border Type',\n 'selector' => '{{WRAPPER}} .img-box',\n ) );\n\n $this->add_control( 'testimonial_image_border_radius', array(\n 'label' => 'Border Radius',\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units'=> array( 'px', '%' ),\n 'selectors' => array(\n '{{WRAPPER}} .img-box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n '{{WRAPPER}} .img-box img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n ), \n ) );\n\n $this->end_controls_section();\n\n // `Content` Section\n $this->start_controls_section( 'testimonial_content_style', array(\n 'label' => 'Content',\n 'tab' => Controls_Manager::TAB_STYLE,\n ) );\n\n $this->add_control( 'testimonial_content_text_color', array(\n 'label' => 'Text Color',\n 'type' => Controls_Manager::COLOR,\n 'scheme' => array(\n 'type' => \\Elementor\\Scheme_Color::get_type(),\n 'value' => \\Elementor\\Scheme_Color::COLOR_3,\n ),\n 'selectors' => array(\n '{{WRAPPER}} .testimonial-content' => 'color: {{VALUE}}',\n ),\n ) );\n\n $this->add_group_control( \\Elementor\\Group_Control_Typography::get_type(), array(\n 'name' => 'testimonial_content_typography',\n 'label' => 'Typography',\n 'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_3,\n 'selector' => '{{WRAPPER}} .testimonial-content',\n ) );\n\n $this->add_group_control( \\Elementor\\Group_Control_Text_Shadow::get_type(),array(\n 'name' => 'testimonial_content_text_shadow',\n 'label' => 'Text Shadow',\n 'selector' => '{{WRAPPER}} .testimonial-content',\n ) );\n\n $this->end_controls_section();\n\n // `Name` Section\n $this->start_controls_section( 'testimonial_name_style', array(\n 'label' => 'Name',\n 'tab' => Controls_Manager::TAB_STYLE,\n ) );\n\n $this->add_control( 'testimonial_name_text_color', array(\n 'label' => 'Text Color',\n 'type' => Controls_Manager::COLOR,\n 'scheme' => array(\n 'type' => \\Elementor\\Scheme_Color::get_type(),\n 'value' => \\Elementor\\Scheme_Color::COLOR_1,\n ),\n 'selectors' => array(\n '{{WRAPPER}} .testimonial_name' => 'color: {{VALUE}}',\n ),\n ) );\n\n $this->add_group_control( \\Elementor\\Group_Control_Typography::get_type(), array(\n 'name' => 'testimonial_name_typography',\n 'label' => 'Typography',\n 'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .testimonial_name',\n ) );\n\n $this->add_group_control( \\Elementor\\Group_Control_Text_Shadow::get_type(),array(\n 'name' => 'testimonial_name_text_shadow',\n 'label' => 'Text Shadow',\n 'selector' => '{{WRAPPER}} .testimonial_name',\n ) );\n\n $this->end_controls_section();\n\n // `Title` Section\n $this->start_controls_section( 'testimonial_title_style', array(\n 'label' => 'Title',\n 'tab' => Controls_Manager::TAB_STYLE,\n ) );\n\n $this->add_control( 'testimonial_title_text_color', array(\n 'label' => 'Text Color',\n 'type' => Controls_Manager::COLOR,\n 'scheme' => array(\n 'type' => \\Elementor\\Scheme_Color::get_type(),\n 'value' => \\Elementor\\Scheme_Color::COLOR_3,\n ),\n 'selectors' => array(\n '{{WRAPPER}} .testimonial_title' => 'color: {{VALUE}}',\n ),\n ) );\n\n $this->add_group_control( \\Elementor\\Group_Control_Typography::get_type(), array(\n 'name' => 'testimonial_title_typography',\n 'label' => 'Typography',\n 'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_3,\n 'selector' => '{{WRAPPER}} .testimonial_title',\n ) );\n\n $this->add_group_control( \\Elementor\\Group_Control_Text_Shadow::get_type(),array(\n 'name' => 'testimonial_title_text_shadow',\n 'label' => 'Text Shadow',\n 'selector' => '{{WRAPPER}} .testimonial_title',\n ) );\n\n $this->end_controls_section();\n }", "function register_controls_for_site_typography_section( $controls ) {\n\n\t$section = 'site_typography_section';\n\t$priority = 1;\n\n\t$controls[] = array(\n\t\t'type' => 'group_title',\n\t\t'setting' => 'group_title_site_typography_body_font',\n\t\t'label' => __( 'Body Font', 'thememove' ),\n\t\t'section' => $section,\n\t\t'separator' => false,\n\t\t'priority' => $priority ++\n\t);\n\n\t$controls[] = array(\n\t\t'type' => 'select',\n\t\t'setting' => 'body_font_family',\n\t\t'label' => __( 'Font Family', 'thememove' ),\n\t\t'section' => $section,\n\t\t'default' => body_font_family,\n\t\t'choices' => Kirki_Fonts::get_font_choices(),\n\t\t'separator' => true,\n\t\t'output' => array(\n\t\t\t'element' => 'body,input, select, textarea, p',\n\t\t\t'property' => 'font-family'\n\t\t),\n\t\t'priority' => $priority ++\n\t);\n\n\t$controls[] = array(\n\t\t'type' => 'slider',\n\t\t'setting' => 'body_font_size',\n\t\t'label' => __( 'Font Size', 'thememove' ),\n\t\t'section' => $section,\n\t\t'default' => body_font_size,\n\t\t'separator' => false,\n\t\t'choices' => array(\n\t\t\t'min' => 10,\n\t\t\t'max' => 60,\n\t\t\t'step' => 1,\n\t\t),\n\t\t'output' => array(\n\t\t\t'element' => 'body,[class*=\"col-\"],.footer .menu li',\n\t\t\t'property' => 'font-size',\n\t\t\t'units' => 'px',\n\t\t),\n\t\t'transport' => 'postMessage',\n\t\t'priority' => $priority ++\n\t);\n\n\t$controls[] = array(\n\t\t'type' => 'group_title',\n\t\t'setting' => 'group_title_site_typography_heading_font',\n\t\t'label' => __( 'Heading Font', 'thememove' ),\n\t\t'section' => $section,\n\t\t'separator' => false,\n\t\t'priority' => $priority ++\n\t);\n\n\t$controls[] = array(\n\t\t'type' => 'select',\n\t\t'setting' => 'site_heading_font_family',\n\t\t'label' => __( 'Font Family', 'thememove' ),\n\t\t'section' => $section,\n\t\t'default' => site_heading_font_family,\n\t\t'separator' => true,\n\t\t'choices' => Kirki_Fonts::get_font_choices(),\n\t\t'output' => array(\n\t\t\t'element' => 'h1',\n\t\t\t'property' => 'font-family'\n\t\t),\n\t\t'priority' => $priority ++\n\t);\n\n\t//H1 Font Size\n\t$controls[] = array(\n\t\t'type' => 'slider',\n\t\t'setting' => 'site_h1_font_size',\n\t\t'label' => __( 'H1 Font Size', 'thememove' ),\n\t\t'section' => $section,\n\t\t'default' => site_h1_font_size,\n\t\t'separator' => true,\n\t\t'choices' => array(\n\t\t\t'min' => 10,\n\t\t\t'max' => 100,\n\t\t\t'step' => 1,\n\t\t),\n\t\t'output' => array(\n\t\t\t'element' => 'h1',\n\t\t\t'property' => 'font-size',\n\t\t\t'units' => 'px',\n\t\t),\n\t\t'transport' => 'postMessage',\n\t\t'priority' => $priority ++\n\t);\n\n\t//H2 Font Size\n\t$controls[] = array(\n\t\t'type' => 'slider',\n\t\t'setting' => 'site_h2_font_size',\n\t\t'label' => __( 'H2 Font Size', 'thememove' ),\n\t\t'section' => $section,\n\t\t'default' => site_h2_font_size,\n\t\t'separator' => true,\n\t\t'choices' => array(\n\t\t\t'min' => 10,\n\t\t\t'max' => 100,\n\t\t\t'step' => 1,\n\t\t),\n\t\t'output' => array(\n\t\t\t'element' => 'h2',\n\t\t\t'property' => 'font-size',\n\t\t\t'units' => 'px',\n\t\t),\n\t\t'transport' => 'postMessage',\n\t\t'priority' => $priority ++\n\t);\n\n\t//H3 Font Size\n\t$controls[] = array(\n\t\t'type' => 'slider',\n\t\t'setting' => 'site_h3_font_size',\n\t\t'label' => __( 'H3 Font Size', 'thememove' ),\n\t\t'section' => $section,\n\t\t'default' => site_h3_font_size,\n\t\t'separator' => true,\n\t\t'choices' => array(\n\t\t\t'min' => 10,\n\t\t\t'max' => 100,\n\t\t\t'step' => 1,\n\t\t),\n\t\t'output' => array(\n\t\t\t'element' => 'h3',\n\t\t\t'property' => 'font-size',\n\t\t\t'units' => 'px',\n\t\t),\n\t\t'transport' => 'postMessage',\n\t\t'priority' => $priority ++\n\t);\n\n\t//H4 Font Size\n\t$controls[] = array(\n\t\t'type' => 'slider',\n\t\t'setting' => 'site_h4_font_size',\n\t\t'label' => __( 'H4 Font Size', 'thememove' ),\n\t\t'section' => $section,\n\t\t'default' => site_h4_font_size,\n\t\t'separator' => true,\n\t\t'choices' => array(\n\t\t\t'min' => 10,\n\t\t\t'max' => 100,\n\t\t\t'step' => 1,\n\t\t),\n\t\t'output' => array(\n\t\t\t'element' => 'h4',\n\t\t\t'property' => 'font-size',\n\t\t\t'units' => 'px',\n\t\t),\n\t\t'transport' => 'postMessage',\n\t\t'priority' => $priority ++\n\t);\n\n\t//H5 Font Size\n\t$controls[] = array(\n\t\t'type' => 'slider',\n\t\t'setting' => 'site_h5_font_size',\n\t\t'label' => __( 'H5 Font Size', 'thememove' ),\n\t\t'section' => $section,\n\t\t'default' => site_h5_font_size,\n\t\t'separator' => true,\n\t\t'choices' => array(\n\t\t\t'min' => 10,\n\t\t\t'max' => 100,\n\t\t\t'step' => 1,\n\t\t),\n\t\t'output' => array(\n\t\t\t'element' => 'h5',\n\t\t\t'property' => 'font-size',\n\t\t\t'units' => 'px',\n\t\t),\n\t\t'transport' => 'postMessage',\n\t\t'priority' => $priority ++\n\t);\n\n\t//H6 Font Size\n\t$controls[] = array(\n\t\t'type' => 'slider',\n\t\t'setting' => 'site_h6_font_size',\n\t\t'label' => __( 'H6 Font Size', 'thememove' ),\n\t\t'section' => $section,\n\t\t'default' => site_h6_font_size,\n\t\t'choices' => array(\n\t\t\t'min' => 10,\n\t\t\t'max' => 100,\n\t\t\t'step' => 1,\n\t\t),\n\t\t'output' => array(\n\t\t\t'element' => 'h6',\n\t\t\t'property' => 'font-size',\n\t\t\t'units' => 'px',\n\t\t),\n\t\t'transport' => 'postMessage',\n\t\t'priority' => $priority ++\n\t);\n\n\treturn $controls;\n}", "protected function _register_controls() {\n $this->start_controls_section(\n 'section_video',\n [\n 'label' => __( 'Video', 'elementor' ),\n ]\n );\n\n\n $this->add_control(\n 'insert_url',\n [\n 'label' => __( 'External URL', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n ]\n );\n\n $this->add_control(\n 'hosted_url',\n [\n 'label' => __( 'Choose File', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::MEDIA,\n 'dynamic' => [\n 'active' => true,\n 'categories' => [\n TagsModule::MEDIA_CATEGORY,\n ],\n ],\n 'media_type' => 'video',\n 'condition' => [\n 'insert_url' => '',\n ],\n ]\n );\n\n $this->add_control(\n 'external_url',\n [\n 'label' => __( 'URL', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::URL,\n 'autocomplete' => false,\n 'show_external' => false,\n 'label_block' => true,\n 'show_label' => false,\n 'dynamic' => [\n 'active' => true,\n 'categories' => [\n TagsModule::POST_META_CATEGORY,\n TagsModule::URL_CATEGORY,\n ],\n ],\n 'media_type' => 'video',\n 'placeholder' => __( 'Enter your URL', 'elementor' ),\n 'condition' => [\n 'video_type' => 'hosted',\n 'insert_url' => 'yes',\n ],\n ]\n );\n\n $this->add_control(\n 'start',\n [\n 'label' => __( 'Start Time', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::NUMBER,\n 'description' => __( 'Specify a start time (in seconds)', 'elementor' ),\n 'condition' => [\n 'loop' => '',\n ],\n ]\n );\n\n $this->add_control(\n 'end',\n [\n 'label' => __( 'End Time', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::NUMBER,\n 'description' => __( 'Specify an end time (in seconds)', 'elementor' ),\n 'condition' => [\n 'loop' => '',\n ],\n ]\n );\n\n $this->add_control(\n 'overlay_block',\n [\n 'label' => __( 'Overlay', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n 'description' => __( 'If ON the video will be blocked by an overlay with a Text and a Button at end time.', 'elementor' ),\n ]\n );\n\n $this->add_control(\n 'auto_open',\n [\n 'label' => __( 'Auto-open link', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n 'description' => __( 'Set if a link should be opened after video stops. It can be an Elementor Popup.', 'elementor' ),\n ]\n );\n\n $this->add_control(\n 'auto_link',\n [\n 'label' => __( 'Link', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::URL,\n 'dynamic' => [\n 'active' => true,\n ],\n 'placeholder' => __( 'https://your-link.com', 'elementor' ),\n 'default' => [\n 'url' => '#',\n ],\n 'condition' => [\n 'auto_open' => 'yes',\n ],\n ]\n );\n\n $this->add_control(\n 'video_options',\n [\n 'label' => __( 'Video Options', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::HEADING,\n 'separator' => 'before',\n ]\n );\n\n $this->add_control(\n 'autoplay',\n [\n 'label' => __( 'Autoplay', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n ]\n );\n\n $this->add_control(\n 'mute',\n [\n 'label' => __( 'Mute', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n ]\n );\n\n $this->add_control(\n 'loop',\n [\n 'label' => __( 'Loop', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n ]\n );\n\n $this->add_control(\n 'controls',\n [\n 'label' => __( 'Player Controls', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n 'label_off' => __( 'Hide', 'elementor' ),\n 'label_on' => __( 'Show', 'elementor' ),\n 'default' => 'yes',\n ]\n );\n\n $this->add_control(\n 'showinfo',\n [\n 'label' => __( 'Video Info', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n 'label_off' => __( 'Hide', 'elementor' ),\n 'label_on' => __( 'Show', 'elementor' ),\n 'default' => 'yes',\n ]\n );\n\n\n\n $this->add_control(\n 'download_button',\n [\n 'label' => __( 'Download Button', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n 'label_off' => __( 'Hide', 'elementor' ),\n 'label_on' => __( 'Show', 'elementor' ),\n ]\n );\n\n $this->add_control(\n 'poster',\n [\n 'label' => __( 'Poster', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::MEDIA,\n ]\n );\n\n $this->add_control(\n 'view',\n [\n 'label' => __( 'View', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::HIDDEN,\n 'default' => 'hosted',\n ]\n );\n\n $this->end_controls_section();\n\n // Heading Content\n\n $this->start_controls_section(\n 'section_heading',\n [\n 'label' => __( 'Title', 'elementor' ),\n 'condition' => [\n 'overlay_block' => 'yes',\n ],\n ]\n );\n\n $this->add_control(\n 'title_text',\n [\n 'label' => __( 'Text', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::TEXTAREA,\n 'dynamic' => [\n 'active' => true,\n ],\n 'placeholder' => __( 'Enter your title', 'elementor' ),\n 'default' => __( 'Add Your Heading Text Here', 'elementor' ),\n ]\n );\n\n $this->end_controls_section();\n\n\n // Button Content\n\n $this->start_controls_section(\n 'section_button',\n [\n 'label' => __( 'Button', 'elementor' ),\n 'condition' => [\n 'overlay_block' => 'yes',\n ],\n ]\n );\n\n $this->add_control(\n 'button_type',\n [\n 'label' => __( 'Type', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SELECT,\n 'default' => '',\n 'options' => [\n '' => __( 'Default', 'elementor' ),\n 'info' => __( 'Info', 'elementor' ),\n 'success' => __( 'Success', 'elementor' ),\n 'warning' => __( 'Warning', 'elementor' ),\n 'danger' => __( 'Danger', 'elementor' ),\n ],\n 'prefix_class' => 'elementor-button-',\n ]\n );\n\n $this->add_control(\n 'text',\n [\n 'label' => __( 'Text', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::TEXT,\n 'dynamic' => [\n 'active' => true,\n ],\n 'default' => __( 'Click here', 'elementor' ),\n 'placeholder' => __( 'Click here', 'elementor' ),\n ]\n );\n\n // $this->add_control(\n // 'link',\n // [\n // 'label' => __( 'Link', 'elementor' ),\n // 'type' => \\Elementor\\Controls_Manager::TEXT,\n // 'dynamic' => [\n // 'active' => true,\n // ],\n // 'placeholder' => __( 'https://your-link.com', 'elementor' ),\n // 'default' => __( '#', 'elementor' ),\n //\n // ]\n // );\n $this->add_control(\n 'link',\n [\n 'label' => __( 'Link', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::URL,\n 'dynamic' => [\n 'active' => true,\n ],\n 'placeholder' => __( 'https://your-link.com', 'elementor' ),\n 'default' => [\n 'url' => '#',\n ],\n ]\n );\n\n $this->add_control(\n 'new_tab',\n [\n 'label' => __( 'Open link in new tab', 'your-plugin' ),\n 'label_on' => __( 'new', 'your-plugin' ),\n 'label_off' => __( 'same', 'your-plugin' ),\n 'type' => \\Elementor\\Controls_Manager::SWITCHER,\n 'return_value' => 'yes',\n 'default' => 'no'\n ]\n );\n\n $this->add_responsive_control(\n 'align',\n [\n 'label' => __( 'Alignment', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::CHOOSE,\n 'options' => [\n 'left' => [\n 'title' => __( 'Left', 'elementor' ),\n 'icon' => 'fa fa-align-left',\n ],\n 'center' => [\n 'title' => __( 'Center', 'elementor' ),\n 'icon' => 'fa fa-align-center',\n ],\n 'right' => [\n 'title' => __( 'Right', 'elementor' ),\n 'icon' => 'fa fa-align-right',\n ],\n 'justify' => [\n 'title' => __( 'Justified', 'elementor' ),\n 'icon' => 'fa fa-align-justify',\n ],\n ],\n 'prefix_class' => 'elementor%s-align-',\n 'default' => '',\n ]\n );\n\n $this->add_control(\n 'size',\n [\n 'label' => __( 'Size', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SELECT,\n 'default' => 'sm',\n 'options' => self::get_button_sizes(),\n 'style_transfer' => true,\n ]\n );\n\n $this->add_control(\n 'icon',\n [\n 'label' => __( 'Icon', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::ICON,\n 'label_block' => true,\n 'default' => '',\n ]\n );\n\n $this->add_control(\n 'icon_align',\n [\n 'label' => __( 'Icon Position', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SELECT,\n 'default' => 'left',\n 'options' => [\n 'left' => __( 'Before', 'elementor' ),\n 'right' => __( 'After', 'elementor' ),\n ],\n 'condition' => [\n 'icon!' => '',\n ],\n ]\n );\n\n $this->add_control(\n 'icon_indent',\n [\n 'label' => __( 'Icon Spacing', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SLIDER,\n 'range' => [\n 'px' => [\n 'max' => 50,\n ],\n ],\n 'condition' => [\n 'icon!' => '',\n ],\n 'selectors' => [\n '{{WRAPPER}} .elementor-button .elementor-align-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};',\n '{{WRAPPER}} .elementor-button .elementor-align-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};',\n ],\n ]\n );\n\n $this->add_control(\n 'view',\n [\n 'label' => __( 'View', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::HIDDEN,\n 'default' => 'traditional',\n ]\n );\n\n $this->add_control(\n 'button_css_id',\n [\n 'label' => __( 'Button ID', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::TEXT,\n 'dynamic' => [\n 'active' => true,\n ],\n 'default' => '',\n 'title' => __( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'yx-super-cat' ),\n 'label_block' => false,\n 'description' => __( 'Please make sure the ID is unique and not used elsewhere on the page this form is displayed. This field allows <code>A-z 0-9</code> & underscore chars without spaces.', 'yx-super-cat' ),\n 'separator' => 'before',\n\n ]\n );\n\n $this->end_controls_section();\n\n // $this->start_controls_section(\n // \t'section_image_overlay',\n // \t[\n // \t\t'label' => __( 'Image Overlay', 'yx-super-cat' ),\n // \t]\n // );\n //\n // $this->add_control(\n // \t'show_image_overlay',\n // \t[\n // \t\t'label' => __( 'Image Overlay', 'yx-super-cat' ),\n // \t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n // \t\t'label_off' => __( 'Hide', 'yx-super-cat' ),\n // \t\t'label_on' => __( 'Show', 'yx-super-cat' ),\n // \t]\n // );\n //\n // $this->add_control(\n // \t'image_overlay',\n // \t[\n // \t\t'label' => __( 'Choose Image', 'yx-super-cat' ),\n // \t\t'type' => \\Elementor\\Controls_Manager::MEDIA,\n // \t\t'default' => [\n // \t\t\t'url' => \\Elementor\\Utils::get_placeholder_image_src(),\n // \t\t],\n // \t\t'dynamic' => [\n // \t\t\t'active' => true,\n // \t\t],\n // \t\t'condition' => [\n // \t\t\t'show_image_overlay' => 'yes',\n // \t\t],\n // \t]\n // );\n //\n // $this->add_group_control(\n // \t\\Elementor\\Group_Control_Image_Size::get_type(),\n // \t[\n // \t\t'name' => 'image_overlay', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `image_overlay_size` and `image_overlay_custom_dimension`.\n // \t\t'default' => 'full',\n // \t\t'separator' => 'none',\n // \t\t'condition' => [\n // \t\t\t'show_image_overlay' => 'yes',\n // \t\t],\n // \t]\n // );\n //\n // $this->add_control(\n // \t'show_play_icon',\n // \t[\n // \t\t'label' => __( 'Play Icon', 'yx-super-cat' ),\n // \t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n // \t\t'default' => 'yes',\n // \t\t'condition' => [\n // \t\t\t'show_image_overlay' => 'yes',\n // \t\t\t'image_overlay[url]!' => '',\n // \t\t],\n // \t]\n // );\n //\n // $this->add_control(\n // \t'lightbox',\n // \t[\n // \t\t'label' => __( 'Lightbox', 'yx-super-cat' ),\n // \t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n // \t\t'frontend_available' => true,\n // \t\t'label_off' => __( 'Off', 'yx-super-cat' ),\n // \t\t'label_on' => __( 'On', 'yx-super-cat' ),\n // \t\t'condition' => [\n // \t\t\t'show_image_overlay' => 'yes',\n // \t\t\t'image_overlay[url]!' => '',\n // \t\t],\n // \t\t'separator' => 'before',\n // \t]\n // );\n //\n // $this->end_controls_section();\n\n // Video Style\n\n $this->start_controls_section(\n 'section_video_style',\n [\n 'label' => __( 'Video', 'yx-super-cat' ),\n 'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n ]\n );\n\n $this->add_control(\n 'aspect_ratio',\n [\n 'label' => __( 'Aspect Ratio', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::SELECT,\n 'options' => [\n '169' => '16:9',\n '219' => '21:9',\n '43' => '4:3',\n '32' => '3:2',\n '11' => '1:1',\n ],\n 'default' => '169',\n 'prefix_class' => 'elementor-widget-video elementor-aspect-ratio-',\n 'frontend_available' => true,\n ]\n );\n\n $this->add_group_control(\n \\Elementor\\Group_Control_Css_Filter::get_type(),\n [\n 'name' => 'css_filters',\n 'selector' => '{{WRAPPER}} .elementor-wrapper',\n ]\n );\n\n $this->add_control(\n 'play_icon_title',\n [\n 'label' => __( 'Play Icon', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::HEADING,\n 'condition' => [\n 'show_image_overlay' => 'yes',\n 'show_play_icon' => 'yes',\n ],\n 'separator' => 'before',\n ]\n );\n\n $this->add_control(\n 'play_icon_color',\n [\n 'label' => __( 'Color', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .elementor-custom-embed-play i' => 'color: {{VALUE}}',\n ],\n 'condition' => [\n 'show_image_overlay' => 'yes',\n 'show_play_icon' => 'yes',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'play_icon_size',\n [\n 'label' => __( 'Size', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::SLIDER,\n 'range' => [\n 'px' => [\n 'min' => 10,\n 'max' => 300,\n ],\n ],\n 'selectors' => [\n '{{WRAPPER}} .elementor-custom-embed-play i' => 'font-size: {{SIZE}}{{UNIT}}',\n ],\n 'condition' => [\n 'show_image_overlay' => 'yes',\n 'show_play_icon' => 'yes',\n ],\n ]\n );\n\n $this->add_group_control(\n \\Elementor\\Group_Control_Text_Shadow::get_type(),\n [\n 'name' => 'play_icon_text_shadow',\n 'selector' => '{{WRAPPER}} .elementor-custom-embed-play i',\n 'fields_options' => [\n 'text_shadow_type' => [\n 'label' => _x( 'Shadow', 'Text Shadow Control', 'yx-super-cat' ),\n ],\n ],\n 'condition' => [\n 'show_image_overlay' => 'yes',\n 'show_play_icon' => 'yes',\n ],\n ]\n );\n\n $this->end_controls_section();\n\n\n // Overlay Style\n\n $this->start_controls_section(\n 'section_overlay_style',\n [\n 'label' => __( 'Overlay', 'elementor' ),\n 'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'overlay_block' => 'yes',\n ],\n ]\n );\n\n $this->add_control(\n 'overlay_color',\n [\n 'label' => __( 'Overlay Color', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => \\Elementor\\Scheme_Color::get_type(),\n 'value' => \\Elementor\\Scheme_Color::COLOR_1,\n ],\n 'selectors' => [\n // Stronger selector to avoid section style from overwriting\n '{{WRAPPER}} .super-video-stopper' => 'background-color: {{VALUE}};',\n ],\n ]\n );\n\n $this->end_controls_section();\n\n\n\n // Heading Style\n\n $this->start_controls_section(\n 'section_title_style',\n [\n 'label' => __( 'Title', 'elementor' ),\n 'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'overlay_block' => 'yes',\n ],\n ]\n );\n\n $this->add_control(\n 'margin_bottom_tit',\n [\n 'label' => __( 'Bottom Margin', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::SLIDER,\n 'range' => [\n 'px' => [\n 'max' => 100,\n ],\n ],\n 'selectors' => [\n '{{WRAPPER}} .elementor-heading-title' => 'padding-bottom: {{SIZE}}{{UNIT}};',\n ],\n ]\n );\n\n $this->add_control(\n 'title_color',\n [\n 'label' => __( 'Text Color', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => \\Elementor\\Scheme_Color::get_type(),\n 'value' => \\Elementor\\Scheme_Color::COLOR_1,\n ],\n 'selectors' => [\n // Stronger selector to avoid section style from overwriting\n '{{WRAPPER}} .elementor-heading-title' => 'color: {{VALUE}};',\n ],\n ]\n );\n\n $this->add_group_control(\n \\Elementor\\Group_Control_Typography::get_type(),\n [\n 'name' => 'typography',\n 'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .elementor-heading-title',\n ]\n );\n\n $this->add_group_control(\n \\Elementor\\Group_Control_Text_Shadow::get_type(),\n [\n 'name' => 'text_shadow',\n 'selector' => '{{WRAPPER}} .elementor-heading-title',\n ]\n );\n\n $this->add_control(\n 'blend_mode',\n [\n 'label' => __( 'Blend Mode', 'elementor' ),\n 'type' => \\Elementor\\Controls_Manager::SELECT,\n 'options' => [\n '' => __( 'Normal', 'elementor' ),\n 'multiply' => 'Multiply',\n 'screen' => 'Screen',\n 'overlay' => 'Overlay',\n 'darken' => 'Darken',\n 'lighten' => 'Lighten',\n 'color-dodge' => 'Color Dodge',\n 'saturation' => 'Saturation',\n 'color' => 'Color',\n 'difference' => 'Difference',\n 'exclusion' => 'Exclusion',\n 'hue' => 'Hue',\n 'luminosity' => 'Luminosity',\n ],\n 'selectors' => [\n '{{WRAPPER}} .elementor-heading-title' => 'mix-blend-mode: {{VALUE}}',\n ],\n 'separator' => 'none',\n ]\n );\n\n $this->end_controls_section();\n\n // Lightbox\n\n $this->start_controls_section(\n 'section_lightbox_style',\n [\n 'label' => __( 'Lightbox', 'yx-super-cat' ),\n 'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'show_image_overlay' => 'yes',\n 'image_overlay[url]!' => '',\n 'lightbox' => 'yes',\n ],\n ]\n );\n\n $this->add_control(\n 'lightbox_color',\n [\n 'label' => __( 'Background Color', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'selectors' => [\n '#elementor-lightbox-{{ID}}' => 'background-color: {{VALUE}};',\n ],\n ]\n );\n\n $this->add_control(\n 'lightbox_ui_color',\n [\n 'label' => __( 'UI Color', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'selectors' => [\n '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'lightbox_ui_color_hover',\n [\n 'label' => __( 'UI Hover Color', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'selectors' => [\n '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button:hover' => 'color: {{VALUE}}',\n ],\n 'separator' => 'after',\n ]\n );\n\n $this->add_control(\n 'lightbox_video_width',\n [\n 'label' => __( 'Content Width', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::SLIDER,\n 'default' => [\n 'unit' => '%',\n ],\n 'range' => [\n '%' => [\n 'min' => 50,\n ],\n ],\n 'selectors' => [\n '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',\n ],\n ]\n );\n\n $this->add_control(\n 'lightbox_content_position',\n [\n 'label' => __( 'Content Position', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::SELECT,\n 'frontend_available' => true,\n 'options' => [\n '' => __( 'Center', 'yx-super-cat' ),\n 'top' => __( 'Top', 'yx-super-cat' ),\n ],\n 'selectors' => [\n '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',\n ],\n 'selectors_dictionary' => [\n 'top' => 'top: 60px',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'lightbox_content_animation',\n [\n 'label' => __( 'Entrance Animation', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::ANIMATION,\n 'frontend_available' => true,\n ]\n );\n\n $this->end_controls_section();\n\n\n // Button Style\n\n $this->start_controls_section(\n 'section_style',\n [\n 'label' => __( 'Button', 'yx-super-cat' ),\n 'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'overlay_block' => 'yes',\n ],\n ]\n );\n\n\n $this->start_controls_tabs( 'tabs_button_style' );\n\n $this->start_controls_tab(\n 'tab_button_normal',\n [\n 'label' => __( 'Normal', 'yx-super-cat' ),\n ]\n );\n\n $this->add_control(\n 'button_text_color',\n [\n 'label' => __( 'Text Color', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'default' => '',\n 'selectors' => [\n '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'color: {{VALUE}};',\n ],\n ]\n );\n\n\n $this->add_group_control(\n \\Elementor\\Group_Control_Typography::get_type(),\n [\n 'name' => 'typography_btn',\n 'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button',\n ]\n );\n\n $this->add_control(\n 'background_color',\n [\n 'label' => __( 'Background Color', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'scheme' => [\n 'type' => \\Elementor\\Scheme_Color::get_type(),\n 'value' => \\Elementor\\Scheme_Color::COLOR_4,\n ],\n 'selectors' => [\n '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'background-color: {{VALUE}};',\n ],\n ]\n );\n\n $this->end_controls_tab();\n\n $this->start_controls_tab(\n 'tab_button_hover',\n [\n 'label' => __( 'Hover', 'yx-super-cat' ),\n ]\n );\n\n $this->add_control(\n 'hover_color',\n [\n 'label' => __( 'Text Color', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover, {{WRAPPER}} a.elementor-button:focus, {{WRAPPER}} .elementor-button:focus' => 'color: {{VALUE}};',\n ],\n ]\n );\n\n $this->add_group_control(\n \\Elementor\\Group_Control_Typography::get_type(),\n [\n 'name' => 'typography_btn_hover',\n 'scheme' => \\Elementor\\Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover, {{WRAPPER}} a.elementor-button:focus, {{WRAPPER}} .elementor-button:focus',\n ]\n );\n\n $this->add_control(\n 'button_background_hover_color',\n [\n 'label' => __( 'Background Color', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover, {{WRAPPER}} a.elementor-button:focus, {{WRAPPER}} .elementor-button:focus' => 'background-color: {{VALUE}};',\n ],\n ]\n );\n\n $this->add_control(\n 'button_hover_border_color',\n [\n 'label' => __( 'Border Color', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::COLOR,\n 'condition' => [\n 'border_border!' => '',\n ],\n 'selectors' => [\n '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover, {{WRAPPER}} a.elementor-button:focus, {{WRAPPER}} .elementor-button:focus' => 'border-color: {{VALUE}};',\n ],\n ]\n );\n\n $this->add_control(\n 'hover_animation',\n [\n 'label' => __( 'Hover Animation', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::HOVER_ANIMATION,\n ]\n );\n\n $this->end_controls_tab();\n\n $this->end_controls_tabs();\n\n $this->add_group_control(\n \\Elementor\\Group_Control_Border::get_type(),\n [\n 'name' => 'border',\n 'selector' => '{{WRAPPER}} .elementor-button',\n 'separator' => 'before',\n ]\n );\n\n $this->add_control(\n 'border_radius',\n [\n 'label' => __( 'Border Radius', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::DIMENSIONS,\n 'size_units' => [ 'px', '%' ],\n 'selectors' => [\n '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n ],\n ]\n );\n\n $this->add_group_control(\n \\Elementor\\Group_Control_Box_Shadow::get_type(),\n [\n 'name' => 'button_box_shadow',\n 'selector' => '{{WRAPPER}} .elementor-button',\n ]\n );\n\n $this->add_responsive_control(\n 'text_padding',\n [\n 'label' => __( 'Padding', 'yx-super-cat' ),\n 'type' => \\Elementor\\Controls_Manager::DIMENSIONS,\n 'size_units' => [ 'px', 'em', '%' ],\n 'selectors' => [\n '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n ],\n 'separator' => 'before',\n ]\n );\n\n $this->end_controls_section();\n\n }", "protected function _register_controls()\n\t{\n\t\t$this->start_controls_section(\n\t\t\t'section_custom_notice',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Custom Notice', 'elementor'),\n\t\t\t\t'tab' => Controls_Manager::TAB_CONTENT,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'custom_notice',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Custom Notice', 'webt'),\n\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n\t\t\t\t'placeholder' => esc_html('A custom notice to any page on your site'),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'custom_type_notice',\n\t\t\t[\n\t\t\t\t'label' => esc_html__('Custom Notice Type', 'webt'),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => 'solid',\n\t\t\t\t'options' => [\n\t\t\t\t\t'success' => __('Success', 'webt'),\n\t\t\t\t\t'error' => __('Error', 'webt'),\n\t\t\t\t\t'notice' => __('Notice', 'webt'),\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'wc_custom_notice_warning',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::RAW_HTML,\n\t\t\t\t'raw' => esc_html__('Add a custom notice to any page on your site', 'webt'),\n\t\t\t\t'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\t}", "private function exclusive_products_controls() {\n\t\t$this->add_control(\n\t\t\tnew Control(\n\t\t\t\t'neve_exclusive_products_heading',\n\t\t\t\tarray(\n\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t'transport' => $this->selective_refresh,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Exclusive Products', 'neve' ),\n\t\t\t\t\t'section' => 'neve_single_product_layout',\n\t\t\t\t\t'priority' => 200,\n\t\t\t\t\t'class' => 'exclusive-products-accordion',\n\t\t\t\t\t'accordion' => true,\n\t\t\t\t\t'controls_to_wrap' => 2,\n\t\t\t\t\t'expanded' => true,\n\t\t\t\t),\n\t\t\t\t'Neve\\Customizer\\Controls\\Heading'\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\tnew Control(\n\t\t\t\t'neve_exclusive_products_title',\n\t\t\t\tarray(\n\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'priority' => 210,\n\t\t\t\t\t'section' => 'neve_single_product_layout',\n\t\t\t\t\t'label' => esc_html__( 'Title', 'neve' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$product_cat = $this->get_shop_categories();\n\t\t$this->add_control(\n\t\t\tnew Control(\n\t\t\t\t'neve_exclusive_products_category',\n\t\t\t\tarray(\n\t\t\t\t\t'default' => '-',\n\t\t\t\t\t'sanitize_callback' => array( $this, 'sanitize_categories' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Category', 'neve' ),\n\t\t\t\t\t'section' => 'neve_single_product_layout',\n\t\t\t\t\t'priority' => 220,\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'choices' => $product_cat,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'section_content',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Content', 'elementive' ),\n\t\t\t)\n\t\t);\n\n\t\t$repeater = new Repeater();\n\n\t\t$repeater->add_control(\n\t\t\t'client_logo',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Choose Image', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t'default' => array(\n\t\t\t\t\t'url' => Utils::get_placeholder_image_src(),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$repeater->add_control(\n\t\t\t'client_name',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Title', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'default' => __( 'Client Name', 'elementive' ),\n\t\t\t\t'placeholder' => __( 'Type your client name here', 'elementive' ),\n\t\t\t)\n\t\t);\n\n\t\t$repeater->add_control(\n\t\t\t'client_link',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Link', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::URL,\n\t\t\t\t'placeholder' => __( 'https://your-client.com', 'elementive' ),\n\t\t\t\t'show_external' => true,\n\t\t\t\t'default' => array(\n\t\t\t\t\t'url' => '',\n\t\t\t\t\t'is_external' => true,\n\t\t\t\t\t'nofollow' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'clients',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Clients List', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'fields' => $repeater->get_controls(),\n\t\t\t\t'default' => array(),\n\t\t\t\t'title_field' => '{{{ client_name }}}',\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'section_style',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Carousel', 'elementive' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'max_width',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Logo max width', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 600,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 120,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'tablet_default' => array(\n\t\t\t\t\t'size' => 120,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'mobile_default' => array(\n\t\t\t\t\t'size' => 120,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-clients-grid .elementive-client-grid-logo img' => 'max-width : {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->start_controls_tabs(\n\t\t\t'style_tabs'\n\t\t);\n\n\t\t$this->start_controls_tab(\n\t\t\t'style_normal_tab',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Normal', 'elementive' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'grayscale',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Crayscale', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'elementive' ),\n\t\t\t\t'label_off' => __( 'No', 'elementive' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => '',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'opacity',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Opacity', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array(),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'default' => array(\n\t\t\t\t\t'size' => 0.5,\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-clients-grid .elementive-client-grid-logo' => 'opacity : {{SIZE}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'style_hover_tab',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Hover', 'elementive' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'grayscale_hover',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Crayscale', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'elementive' ),\n\t\t\t\t'label_off' => __( 'No', 'elementive' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => '',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'opacity_hover',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Opacity', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array(),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'default' => array(\n\t\t\t\t\t'size' => 1,\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-clients-grid .elementive-client-grid-logo:hover' => 'opacity : {{SIZE}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'section_carousel',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Carousel', 'elementive' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_SETTINGS,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'vertical_align',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Vertical align', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => 'uk-flex-top',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'uk-flex-top' => __( 'Top', 'elementive' ),\n\t\t\t\t\t'uk-flex-middle' => __( 'Middle', 'elementive' ),\n\t\t\t\t\t'uk-flex-bottom' => __( 'Bottom', 'elementive' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'auto_play',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Enable auto play', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'elementive' ),\n\t\t\t\t'label_off' => __( 'No', 'elementive' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => '',\n\t\t\t\t'separator' => 'after',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'columns',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Columns', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array(),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 6,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 3,\n\t\t\t\t),\n\t\t\t\t'tablet_default' => array(\n\t\t\t\t\t'size' => 2,\n\t\t\t\t),\n\t\t\t\t'mobile_default' => array(\n\t\t\t\t\t'size' => 1,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'margins',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Column margin', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array(),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 30,\n\t\t\t\t),\n\t\t\t\t'tablet_default' => array(\n\t\t\t\t\t'size' => 30,\n\t\t\t\t),\n\t\t\t\t'mobile_default' => array(\n\t\t\t\t\t'size' => 0,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'overflow',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Overflow', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'True', 'elementive' ),\n\t\t\t\t'label_off' => __( 'False', 'elementive' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => '',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'loop',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Loop', 'elementive' ),\n\t\t\t\t'description' => __( 'Set to yes to enable continuous loop mode', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'True', 'elementive' ),\n\t\t\t\t'label_off' => __( 'False', 'elementive' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => '',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'centered',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Centered slider', 'elementive' ),\n\t\t\t\t'description' => __( 'If yes, then active slide will be centered, not always on the left side.', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'True', 'elementive' ),\n\t\t\t\t'label_off' => __( 'False', 'elementive' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'default' => '',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'speed',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Speed', 'elementive' ),\n\t\t\t\t'description' => __( 'Speed of the enter/exit transition.', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 10,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 10,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'default' => array(\n\t\t\t\t\t'size' => 500,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'navigation',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Navigation', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'True', 'elementive' ),\n\t\t\t\t'label_off' => __( 'False', 'elementive' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'default' => '',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'navigation_diameter_width',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Diameter', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 30,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 40,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation ' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'navigation_icon_width',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Icon width', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 5,\n\t\t\t\t\t\t'max' => 20,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 10,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation svg' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'navigation_radius',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Border radius', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation' => 'border-radius: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->start_controls_tabs(\n\t\t\t'navigation_tabs',\n\t\t\tarray(\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->start_controls_tab(\n\t\t\t'navigation_normal_tab',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Normal', 'elementive' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'navigation_color',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Color', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'scheme' => array(\n\t\t\t\t\t'type' => Scheme_Color::get_type(),\n\t\t\t\t\t'value' => Scheme_Color::COLOR_2,\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation svg' => 'color: {{VALUE}}',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'navigation_border',\n\t\t\t\t'label' => __( 'Border', 'elementive' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation_diameter' => 'yes',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Background::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'navigation_background',\n\t\t\t\t'label' => __( 'Background', 'elementive' ),\n\t\t\t\t'types' => array( 'classic', 'gradient' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation_diameter' => 'yes',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation',\n\t\t\t\t'separator' => 'before',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'navigation_box_shadow',\n\t\t\t\t'label' => __( 'Box Shadow', 'elementive' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation_diameter' => 'yes',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation',\n\t\t\t\t'separator' => 'before',\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'navigation_hover_tab',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Hover', 'elementive' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'navigation_color_hover',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Color', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'scheme' => array(\n\t\t\t\t\t'type' => Scheme_Color::get_type(),\n\t\t\t\t\t'value' => Scheme_Color::COLOR_2,\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation:hover svg' => 'color: {{VALUE}}',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'navigation_border_hover',\n\t\t\t\t'label' => __( 'Border', 'elementive' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation:hover',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Background::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'navigation_background_hover',\n\t\t\t\t'label' => __( 'Background', 'elementive' ),\n\t\t\t\t'types' => array( 'classic', 'gradient' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation .navigation-background-hover',\n\t\t\t\t'separator' => 'before',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'navigation_box_shadow_hover',\n\t\t\t\t'label' => __( 'Box Shadow', 'elementive' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'navigation' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .elementive-carousel-navigation:hover',\n\t\t\t\t'separator' => 'before',\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->add_control(\n\t\t\t'pagination',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Pagination', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'True', 'elementive' ),\n\t\t\t\t'label_off' => __( 'False', 'elementive' ),\n\t\t\t\t'return_value' => 'true',\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'default' => '',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'pagination_bullet_align',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Bullet align', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => 'uk-text-center',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'uk-text-center' => __( 'Center', 'elementive' ),\n\t\t\t\t\t'uk-text-left' => __( 'Left', 'elementive' ),\n\t\t\t\t\t'uk-text-right' => __( 'Right', 'elementive' ),\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'pagination_bottom',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Bottom size', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 0,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .elementive-carousel-pagination ' => 'bottom: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'pagination_bullet_margin',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Bullet margin', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 20,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 3,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet ' => 'margin: 0 {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'pagination_bullet_width',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Bullet width', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 3,\n\t\t\t\t\t\t'max' => 20,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 5,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet ' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'pagination_bullet_height',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Bullet height', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 20,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 5,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet ' => 'height: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'pagination_radius',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Border radius', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 10,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet' => 'border-radius: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->start_controls_tabs(\n\t\t\t'pagination_tabs',\n\t\t\tarray(\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->start_controls_tab(\n\t\t\t'pagination_normal_tab',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Normal', 'elementive' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'pagination_color',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Color', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'scheme' => array(\n\t\t\t\t\t'type' => Scheme_Color::get_type(),\n\t\t\t\t\t'value' => Scheme_Color::COLOR_2,\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet' => 'background-color: {{VALUE}}',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'pagination_border',\n\t\t\t\t'label' => __( 'Border', 'elementive' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination_diameter' => 'yes',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'pagination_box_shadow',\n\t\t\t\t'label' => __( 'Box Shadow', 'elementive' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination_diameter' => 'yes',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet',\n\t\t\t\t'separator' => 'before',\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'pagination_hover_tab',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Active', 'elementive' ),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'pagination_diameter_width_active',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Bullet width', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => array( 'px' ),\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 5,\n\t\t\t\t\t\t'max' => 40,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'devices' => array( 'desktop', 'tablet', 'mobile' ),\n\t\t\t\t'desktop_default' => array(\n\t\t\t\t\t'size' => 8,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet-active' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'pagination_color_hover',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Color', 'elementive' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'scheme' => array(\n\t\t\t\t\t'type' => Scheme_Color::get_type(),\n\t\t\t\t\t'value' => Scheme_Color::COLOR_2,\n\t\t\t\t),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet-active' => 'background-color: {{VALUE}}',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'pagination_border_hover',\n\t\t\t\t'label' => __( 'Border', 'elementive' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet-active',\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'pagination_box_shadow_hover',\n\t\t\t\t'label' => __( 'Box Shadow', 'elementive' ),\n\t\t\t\t'condition' => array(\n\t\t\t\t\t'pagination' => 'true',\n\t\t\t\t),\n\t\t\t\t'selector' => '{{WRAPPER}} .elementive-carousel .swiper-pagination-bullet-active',\n\t\t\t\t'separator' => 'before',\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t// End carousel navigation section.\n\t\t$this->end_controls_section();\n\t}", "protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'main_gallery_settings',\n\t\t\t[\n\t\t\t\t'label' => __( 'Gallery Settings', 'elementor-main-gallery' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t 'style',\n\t\t \t[\n\t\t \t'label' \t=> esc_html__( 'Slider Type', 'essential-addons-elementor' ),\n\t\t \t'type' \t\t\t=> Controls_Manager::SELECT,\n\t\t \t'default' \t\t=> 'bxslider',\n\t\t \t'label_block' \t=> false,\n\t\t \t'options' \t\t=> [\t\t\t\t\n\t\t\t\t\t'instagram'=> esc_html__('Instagram', 'baldiyaat'),\n\t\t\t\t\t'gallery-slider'=> esc_html__('Gallery Slider Carousel', 'baldiyaat'),\n\t\t\t\t\t'simple-gallery'=> esc_html__('Simple Gallery', 'baldiyaat'),\n\t\t\t\t\t'video-slider'=> esc_html__('Video Gallery', 'baldiyaat')\n\t\t \t],\n\t\t \t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t 'gallery-columns',\n\t\t \t[\n\t\t \t'label' \t=> esc_html__( 'Column', 'essential-addons-elementor' ),\n\t\t \t'type' \t\t\t=> Controls_Manager::SELECT,\n\t\t \t'default' \t\t=> '2',\n\t\t \t'options' \t\t=> [\t\t\t\t\n\t\t\t\t\t'1' => esc_html__('1 Column', 'baldiyaat'),\n\t\t\t\t\t'2' => esc_html__('2 Column', 'baldiyaat'),\n\t\t\t\t\t'3' => esc_html__('3 Column', 'baldiyaat'),\n\t\t\t\t\t'4' => esc_html__('4 Column', 'baldiyaat'),\n\t\t\t\t\t'6' => esc_html__('6 Column', 'baldiyaat')\n\t\t \t],\n\t\t \t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'thumbnail-size',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Thumbnail Size', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'label_block' \t=> false,\n\t\t\t\t'default' => esc_html__( 'hide', 'essential-addons-elementor' ),\n\t\t \t'options' => wpha_get_thumbnail_list(),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'num-fetch',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Num Fetch', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => 10,\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'pagination',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Pagination', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'yes', 'essential-addons-elementor' ),\n\t\t\t\t'label_off' => __( 'no', 'essential-addons-elementor' ),\n\t\t\t\t'return_value' => 'enable',\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t\n\t\t/**\n\t\t * Gallery Text Settings\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'main_gallery_config_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Gallery Images', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'slider',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'seperator' => 'before',\n\t\t\t\t'default' => [\n\t\t\t\t\t[ 'main_gallery_settings_slide' => KODEFOREST_MAIN_URL . 'assets/gallery/simple-gallery.png' ],\n\t\t\t\t\t[ 'main_gallery_settings_slide' => KODEFOREST_MAIN_URL . 'assets/gallery/simple-gallery.png' ],\n\t\t\t\t\t[ 'main_gallery_settings_slide' => KODEFOREST_MAIN_URL . 'assets/gallery/simple-gallery.png' ],\n\t\t\t\t\t[ 'main_gallery_settings_slide' => KODEFOREST_MAIN_URL . 'assets/gallery/simple-gallery.png' ],\n\t\t\t\t\t[ 'main_gallery_settings_slide' => KODEFOREST_MAIN_URL . 'assets/gallery/simple-gallery.png' ],\n\t\t\t\t\t[ 'main_gallery_settings_slide' => KODEFOREST_MAIN_URL . 'assets/gallery/simple-gallery.png' ],\n\t\t\t\t\t[ 'main_gallery_settings_slide' => KODEFOREST_MAIN_URL . 'assets/gallery/simple-gallery.png' ],\n\t\t\t\t],\n\t\t\t\t'fields' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_gallery_settings_slide',\n\t\t\t\t\t\t'label' => esc_html__( 'Image', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t\t\t'default' => [\n\t\t\t\t\t\t\t'url' => KODEFOREST_MAIN_URL . 'assets/gallery/simple-gallery.png',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_gallery_settings_slide_title',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Title', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '', 'essential-addons-elementor' )\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_gallery_settings_slide_caption',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Caption', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '', 'essential-addons-elementor' )\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_gallery_settings_enable_slide_link',\n\t\t\t\t\t\t'label' => __( 'Enable Image Link', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t\t\t'default' => 'false',\n\t\t\t\t\t\t'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'return_value' => 'true',\n\t\t\t\t\t\t\n\t\t\t\t \t],\n\t\t\t\t \t[\n\t\t\t\t\t\t'name' => 'main_gallery_settings_slide_link',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Link', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::URL,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => [\n\t\t \t\t\t'url' => '#',\n\t\t \t\t\t'is_external' => '',\n\t\t \t\t\t],\n\t\t \t\t\t'show_external' => true,\n\t\t \t\t\t'condition' => [\n\t\t \t\t\t\t'main_gallery_settings_enable_slide_link' => 'true'\n\t\t \t\t\t]\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'title_field' => '{{main_gallery_settings_slide_title}}',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\t\t\n\t\t/**\n\t\t * Gallery Text Settings\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'main_gallery_color_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Color & Design', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_galleryt_bghover_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Background Hover Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#d2973b',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .kode_gallery_fig:hover img' => 'background-color: {{VALUE}} !important;',\n\t\t\t\t],\n\t\t\t]\n\t\t);\t\t\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_gallery_caption_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Caption Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .slide-caption-des' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_gallery_button_bg_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Button BG Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .kode_gallery_fig:hover a' => 'background-color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t\n\t\t\n\t}", "public function output_setup_form() {\n\t\t$this->output_controls_html( 'klicktipp' );\n\t}", "protected function _register_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'section_image',\n\t\t\t[\n\t\t\t\t'label' => __( 'Image', 'happyden' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Width', 'happyden' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t],\n\t\t\t\t'tablet_default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t],\n\t\t\t\t'mobile_default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ '%', 'px', 'vw' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .happyden-feature-image img' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'space',\n\t\t\t[\n\t\t\t\t'label' => __( 'Max Width', 'happyden' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t],\n\t\t\t\t'tablet_default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t],\n\t\t\t\t'mobile_default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ '%', 'px', 'vw' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .happyden-feature-image img' => 'max-width: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'height',\n\t\t\t[\n\t\t\t\t'label' => __( 'Height', 'happyden' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'tablet_default' => [\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'mobile_default' => [\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', 'vh' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 500,\n\t\t\t\t\t],\n\t\t\t\t\t'vh' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .happyden-feature-image img' => 'height: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'object-fit',\n\t\t\t[\n\t\t\t\t'label' => __( 'Object Fit', 'happyden' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'condition' => [\n\t\t\t\t\t'height[size]!' => '',\n\t\t\t\t],\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => __( 'Default', 'happyden' ),\n\t\t\t\t\t'fill' => __( 'Fill', 'happyden' ),\n\t\t\t\t\t'cover' => __( 'Cover', 'happyden' ),\n\t\t\t\t\t'contain' => __( 'Contain', 'happyden' ),\n\t\t\t\t],\n\t\t\t\t'default' => '',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .happyden-feature-image img' => 'object-fit: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\t}", "public function get_control_args() {\n\t\t$args = array(\n\t\t\t'label' => __( $this->label, 'styles' ),\n\t\t\t'section' => $this->group,\n\t\t\t'settings' => $this->setting,\n\t\t\t'priority' => $this->priority . $this->group_priority,\n\t\t);\n\t\treturn $args;\n\t}", "public function multipleActionsControl() {\n $multipleActions = (array)$this->object->info->info->form->multipleActions->action;\n if (count($multipleActions) > 0) {\n $multipleActionsOptions = '';\n foreach ($multipleActions as $multipleAction) {\n $linkMultiple = url($this->type.'/multiple-'.$multipleAction, true);\n $multipleActionsOptions .= '<div class=\"multipleAction multipleOption\" rel=\"'.$linkMultiple.'\">\n '.__($multipleAction.'Selected').'\n </div>'; \n }\n return '<div class=\"multipleActions\">\n <div class=\"multipleAction multipleActionCheckAll\">\n '.FormField_Checkbox::create(array('name'=>'checkboxList')).'\n </div>\n '.$multipleActionsOptions.'\n </div>';\n }\n }", "public function getInputNames();", "public function createChildControls ()\n\t{\n\t\tif ($this->_container===null)\n\t\t{\n\t\t\t$this->_container=Prado::CreateComponent('System.Web.UI.ActiveControls.TActivePanel');\n\t\t\t$this->_container->setId($this->getId(false).'_content');\n\t\t\tparent::getControls()->add($this->_container);\n\t\t}\n\t}", "function CreateChildControls(){\n\t for($i=0; $i<sizeof($this->libs); $i++){\n\t\tif(!$this->error[$this->libs[$i]]){\n\t\t\t$this->AddControl(new ItemsListControl(\"ItemsList_\".$this->libs[$i], \"list\", $this->Storage));\n\t\t\t //Add control to controls\n\t\t\t$extra_url=\"\"; // Clearing ExtraUrl\n\t\t\tfor($j=0; $j<sizeof($this->libs); $j++){ // MAking ExtraUrl based on current controls state\n\t\t\t\t $extra_url .= \"&amp;\".$this->libs[$j].\"_start=\".$this->start[$this->libs[$j]].\"&amp;\".$this->libs[$j].\"_order_by=\".$this->order_by[$this->libs[$j]].($this->is_context_frame ? \"&amp;contextframe=1\" : \"\");\n\t\t\t}\n\t\t\t// Adding ItemsList control\n\t\t\t$this->Controls[\"ItemsList_\".$this->libs[$i]]->InitControl(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t //\"fields\" => $this->fields,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"library_ID\" => $this->libs[$i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"self\" => $this->self.\"\".$extra_url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"handler\" =>$this->handler,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"package\" =>$this->Package,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"order_by\" => $this->order_by[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"start\" => $this->start[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"data_extractor\" => $this->extractor_method,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"parent_id\" => $this->parent_id[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"data\" => $this->data[$this->libs[$i]]\n\t\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t // Getting list of subcategories\n\t\t $sub_categories = $this->Controls[\"ItemsList_\".$this->libs[$i]]->GetSubCategories();\n\t\t $tree_control = $this->Controls[\"ItemsList_\".$this->libs[$i]]->GetTreeControl();\n\t\t $nodelevels = $this->Controls[\"ItemsList_\".$this->libs[$i]]->GetNodeLevels();\n\t\t // Geting current level in catalog\n\t\t $nodelevel = (empty($nodelevels) ? 0 : $nodelevels[$this->parent_id[$this->libs[$i]]]+1);\n\t\t if($sub_categories !== false){\n\t\t\t for($k=0; $k<sizeof($sub_categories); $k++){\n\t\t\t\t if((!empty($sub_categories[$k][\"levels\"]) && in_array($nodelevel, $sub_categories[$k][\"levels\"])) ||\n\t\t\t\t\t(empty($sub_categories[$k][\"levels\"]))\n\t\t\t\t ) {\n\t\t\t\t // Preparing data for Sub-categories controls\n\t\t\t\t $sub_start=\"\";\n\t\t\t\t $sub_order_by=\"\";\n\t\t\t\t $append_str=\"\";\n\t\t\t\t // Building parts of url to preserve host-catalog sorting orders and paging\n\t\t\t\t for($l=0; $l<sizeof($sub_categories); $l++){\n\t\t\t\t\t $sub_start[$l] = $this->Request->ToNumber($sub_categories[$l][\"library\"].\"_start\",0);\n\t\t\t\t\t $sub_order_by[$l] = $this->Request->ToString($sub_categories[$l][\"library\"].\"_order_by\",\"\");\n\t\t\t\t\t $append_str .= \"&amp;\".$sub_categories[$l][\"library\"].\"_start=\".$sub_start[$l].\"&amp;\".$sub_categories[$l][\"library\"].\"_order_by=\".$sub_order_by[$l];\n\t\t\t\t }\n\t\t\t\t $host_extra_url = \"&amp;\".$this->libs[$i].\"_parent_id=\".$this->parent_id[$this->libs[$i]].\"&amp;\".$this->libs[$i].\"_start=\".$this->start[$this->libs[$i]].\"&amp;\".$this->libs[$i].\"_order_by=\".$this->order_by[$this->libs[$i]];\n\t\t\t\t // Appending built extra url to host-catalog control\n\t\t\t\t $this->Controls[\"ItemsList_\".$this->libs[$i]]->AppendSelfString($append_str);\n\t\t\t\t // Adding Child catalog to current host\n\t\t\t\t $this->AddControl(new ItemsListControl(\"ItemsList_sub_\".$sub_categories[$k][\"library\"], \"list\", $this->Storage));\n\t\t\t\t $this->Controls[\"ItemsList_sub_\".$sub_categories[$k][\"library\"]]->InitControl(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"library_ID\" => $sub_categories[$k][\"library\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"host_library_ID\" => $this->libs[$i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"self\" => $this->self.\"\".$extra_url.\"\".$host_extra_url.$append_str,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"handler\" =>$this->handler,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"package\" =>$this->Package,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"order_by\" => $sub_order_by[$k],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"start\" => $sub_start[$k],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"data_extractor\" => $this->extractor_method,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"parent_id\" => $this->parent_id[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"data\" => array($sub_categories[$k][\"link_field\"] => $this->parent_id[$this->libs[$i]]),\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"custom_var\" => $sub_categories[$k][\"link_field\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"custom_val\" => $this->parent_id[$this->libs[$i]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"tree_control\" => $tree_control,\n\t\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\t\t}// if\n\t\t\t } // for k\n\n\t\t } // if sub_categories\n\t\t} // if !error\n\t\t} // for i\n\t}", "public function getControl()\r\n\t{\r\n\t\t$control=parent::getControl();\r\n\t\t$control->class[]='tag-control';\r\n\r\n\t\tif ($this->delimiter!==NULL && Strings::trim($this->delimiter)!=='') {\r\n\t\t\t$control->attrs['data-tag-delimiter']=$this->delimiter;\r\n\t\t\t}\r\n\r\n\t\tif ($this->joiner!==NULL && Strings::trim($this->joiner)!=='') {\r\n\t\t\t$control->attrs['data-tag-joiner']=$this->joiner;\r\n\t\t\t}\r\n\t\r\n\t\tif ($this->suggestCallback!==NULL) {\r\n\t\t\t$form=$this->getForm();\r\n\t\t\tif (!$form || !$form instanceof Form) {\r\n\t\t\t\tthrow new \\Nette\\InvalidStateException('TagInput supports only Nette\\Application\\UI\\Form.');\r\n\t\t\t\t}\r\n\t\t\t$control->attrs['data-tag-suggest']=$form->presenter->link($this->renderName, array('word_filter' => '%__filter%'));\r\n\t\t\t}\r\n\r\n\t\treturn $control;\r\n\t}", "function InitChildControls() {\n }", "public function controlDataForJs()\n {\n return [\n // Base Control\n 'input_name' => $this->inputName(),\n\n // Range Control\n 'show_range_value' => $this->showRangeValue(),\n 'range_value_location' => $this->rangeValueLocation(),\n ];\n }", "public function setup_display_rule_controls()\n {\n $setup_display_control_args =\n array(\n 'activate_optin' => apply_filters('mo_optin_form_customizer_activate_optin_args',\n array(\n 'type' => 'checkbox',\n 'label' => __('Activate optin', 'mailoptin'),\n 'section' => $this->customizerClassInstance->setup_display_rule_section_id,\n 'settings' => $this->option_prefix . '[activate_optin]',\n 'description' => __('The optin will not be displayed unless this setting is checked.', 'mailoptin'),\n 'priority' => 10\n )\n )\n );\n\n if (defined('MAILOPTIN_DISPLAY_RULES_FLAG')) {\n $setup_display_control_args['load_optin_globally'] = apply_filters('mo_optin_form_customizer_load_optin_globally_args',\n array(\n 'type' => 'checkbox',\n 'label' => __('Globally load optin', 'mailoptin'),\n 'section' => $this->customizerClassInstance->setup_display_rule_section_id,\n 'settings' => $this->option_prefix . '[load_optin_globally]',\n 'description' => __('The optin will be loaded on all pages of your website if checked.', 'mailoptin'),\n 'priority' => 20\n )\n );\n $setup_display_control_args['hide_logged_in'] = apply_filters('mo_optin_form_customizer_hide_logged_in_args', array(\n 'type' => 'checkbox',\n 'label' => __('Hide for Logged-in Users', 'mailoptin'),\n 'description' => __('Check to hide the optin for users logged into your website.', 'mailoptin'),\n 'section' => $this->customizerClassInstance->setup_display_rule_section_id,\n 'settings' => $this->option_prefix . '[hide_logged_in]',\n 'priority' => 25,\n )\n );\n }\n\n $setup_display_control_args = apply_filters(\n \"mo_optin_form_customizer_setup_display_rule_controls\",\n $setup_display_control_args,\n $this->wp_customize,\n $this->option_prefix,\n $this->customizerClassInstance\n );\n\n do_action('mailoptin_before_setup_display_rule_controls_addition');\n\n foreach ($setup_display_control_args as $id => $args) {\n if (is_object($args)) {\n $this->wp_customize->add_control($args);\n } else {\n $this->wp_customize->add_control($this->option_prefix . '[' . $id . ']', $args);\n }\n }\n\n do_action('mailoptin_after_setup_display_rule_controls_addition');\n }", "public function getControlList(): array;", "public function newInputs($inputs = array())\n {\n return new Google_Documents_ToggleProperties_Inputs($inputs);\n }", "public function enqueue_control_scripts() {\r\n\r\n\t\twp_enqueue_script( 'example-1-customize-controls', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/customize-controls.js', array( 'customize-controls' ) );\r\n\r\n\t\twp_enqueue_style( 'example-1-customize-controls', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/customize-controls.css' );\r\n\t}", "function RenderChildren() {\n if ($this->HasControls()) {\n foreach($this->Controls as $control) {\n $control->Render();\n }\n }\n }", "public function renderToolbarControls()\n {\n $this->kernel->event->trigger('phifty.crud.toolbar_init',$this);\n foreach( $this->_toolbarItems as $controller ) {\n echo $controller->controlAction();\n }\n }", "protected function prepend_controls($out = '')\n\t{\n\t\t// Check if we are in 'line' context and if the control div has been added\n\t\tif ($this->line_opened === true && $this->controls_opened === false)\n\t\t{\n\t\t\t$out = '<div class=\"controls\">'.\"\\n\".$out;\n\t\t\t$this->controls_opened = true;\n\t\t}\n\t\treturn $out;\n\t}", "function avControl( &$table, $name, $description, $default, $required, $quered, $list, $header, $order)\n\t{\n\t\t$this->constructor(&$table, $name, $description, $default, $required, $quered, $list, $header, $order);\n\t}", "public function form_elements() {\n\n\t\t\t// Instantiate Widget Inputs\n\t\t\t$form_elements = new Layers_Form_Elements();\n\n\t\t\t// Return design bar\n\t\t\treturn $form_elements;\n\n\t\t}", "public function pre_out()\n\t{\n\t\t$out = '';\n\t\tif ( !FormControlTextMulti::$outpre ) {\n\t\t\tFormControlTextMulti::$outpre = true;\n\t\t\tif(is_array($this->value)) {\n\t\t\t\t$fieldcount = count($this->value);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$fieldcount = 0;\n\t\t\t}\n\t\t\t// translatable strings\n\t\t\t// very bad practice but the below code is just horrible to read already and heredoc does not support method calls\n\t\t\t$removeitem = _t( 'Remove item' );\n\t\t\t$remove = _t( '[remove]' );\n\t\t\t$removethisitem = _t( 'Remove this item?' );\n\t\t\t$out .= <<< JSCODE\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\tcontrols.textmulti = {\n\t\t\t\t\tadd: function(e, controlname){\n\t\t\t\t\t\t$(e).before('<div><input type=\"text\" name=\"' + controlname + '[]\"> <a href=\"#\" onclick=\"return controls.textmulti.remove(this);\" title=\"{$removeitem}\" class=\"textmulti_remove\">{$remove}</a></div>');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t\tremove: function(e) {\n\t\t\t\t\t\tvar item = $(e).prev();\n\t\t\t\t\t\tif (confirm(\"{$removethisitem} \" + item.val())) {\n\t\t\t\t\t\t\titem.parent().remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\t</script>\nJSCODE;\n\t\t}\n\t\treturn $this->controls_js($out);\n\t}", "public function render_control_template_scripts()\n {\n }", "public function render_control_template_scripts()\n {\n }", "public function render_control_template_scripts()\n {\n }" ]
[ "0.6379662", "0.62218696", "0.62190634", "0.61529434", "0.6125563", "0.6070212", "0.6038771", "0.59947556", "0.5971441", "0.5961184", "0.5950652", "0.5944477", "0.58884037", "0.5883044", "0.5873803", "0.58702385", "0.58504665", "0.5847933", "0.5840035", "0.58113354", "0.5780342", "0.57552516", "0.57539105", "0.5749731", "0.5746531", "0.5729767", "0.57283515", "0.5728103", "0.5725568", "0.57172936", "0.5714005", "0.5713046", "0.5705193", "0.56956387", "0.5695036", "0.5694983", "0.56942254", "0.56817764", "0.5678304", "0.56744", "0.56576824", "0.56543946", "0.56450474", "0.5642719", "0.5638547", "0.5629928", "0.56292754", "0.5574194", "0.5571682", "0.55608475", "0.55219597", "0.5506136", "0.5503059", "0.5498211", "0.54980737", "0.54877025", "0.54726523", "0.5458614", "0.54408413", "0.5397567", "0.53626645", "0.53471977", "0.5327925", "0.5310711", "0.5299927", "0.52963865", "0.5262112", "0.52602863", "0.5246926", "0.5243064", "0.522033", "0.52157086", "0.521563", "0.5203949", "0.51743716", "0.51494694", "0.5143685", "0.5126702", "0.5126511", "0.5095451", "0.5032265", "0.49796772", "0.49700442", "0.49354213", "0.49305", "0.49250454", "0.48941907", "0.48665965", "0.48560357", "0.48531199", "0.48302907", "0.4815651", "0.48135865", "0.48059565", "0.47911322", "0.4787507", "0.4786889", "0.4778099", "0.47750443", "0.47750443", "0.47750443" ]
0.0
-1
Run the database seeds.
public function run(Faker $faker) { //seleziono tutti gli autori $authors = Author::all(); //ciclo tutti gli autori, per ogni autore inserisco foreach($authors as $author) { if($author->info == null) { $newAuthorInfo = new AuthorInfo; $newAuthorInfo->author_id; $newAuthorInfo->nationality = $faker->country(); $newAuthorInfo->bio = $faker->paragraph(5, true); if(rand(0,1) == 1) { $newAuthorInfo->image = $faker->imageUrl(200, 300); $newAuthorInfo->alive = 1; } $newAuthorInfo->save(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Name of the DHL Express product.
public function getProductName(): ?string { return $this->productName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_name() {\n $type = static::get_type();\n return util::string(\"product:{$type}\");\n }", "public function getName_product()\n {\n return $this->name_product;\n }", "public function getProductName()\n {\n return $this->product_name;\n }", "public function getProductName()\n {\n return $this->product_name;\n }", "public function getProductName() {\n //return the value product name\n return $this->ProductName;\n }", "public function getProdName()\n {\n return $this->prod_name;\n }", "public function getProductName(){\n return $this->product_name;\n }", "public function get_productName(): string\n {\n // $res is a string;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductName();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTNAME_INVALID;\n }\n }\n $res = $this->_productName;\n return $res;\n }", "public function getDocumentProductName()\n {\n return (string) $this->document_product_name;\n }", "public function getProduct_name () {\n\t$preValue = $this->preGetValue(\"product_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_name;\n\treturn $data;\n}", "public function getProductName()\n {\n if (!isset($this->name))\n {\n if (!$this->name = $this->getHelper()->getName($this->getSlug()))\n {\n $this->name = $this->getHelper()->getNameFromPath($this->getPathname());\n }\n }\n\n return $this->name;\n }", "public function fullname()\n\t{\n\t\treturn $this->product->name .' - '. $this->name();\n\t}", "public function getName()\n {\n return 'recipeproduct';\n }", "public function get_title() {\n return esc_html__( 'Onsale Product', 'electro-extensions' );\n }", "public function get_title() {\n return esc_html__( 'Onsale Product', 'Alita-extensions' );\n }", "public static function getSoftwareName()\n\t\t{\n\t\t\treturn 'Wordpress 3.9.1 en WooCommerce 3.0.0+';\n\t\t}", "public function getSoftwareName()\n {\n return $this->getParam(self::SOFTWARE_PARAM_NAME);\n }", "public function get_name() {\n\t\treturn 'single-product-images';\n\t}", "public function getName() : string\n {\n return $this->get('name', 'products');\n }", "public function getFullname(): string\n {\n return $this->product->lang->title . ' ' . $this->lang->title;\n }", "public function name(): string\n {\n return 'PROD';\n }", "public function getProdName(){\n\t\treturn array_keys($this->_products);\n\t}", "public function getProductIdentifier()\n {\n $value = $this->_config->get('dataprocessing/products/identifier');\n\n if ($value === null) {\n $value = 'sku';\n }\n\n return $value;\n }", "public function get_name() {\n return 'electro_elementor_product_onsale_block';\n }", "public function getName()\n {\n return 'Wechat_Express';\n }", "public function getName()\n {\n return 'PayNL iDeal';\n }", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function getName()\n {\n return 'Alipay Refund Express';\n }", "public function name()\n\t{\n\t\treturn $this->lang->words['stock'];\n\t}", "public function getProdTitle()\n {\n return $this->prod_title;\n }", "public function getShopName()\n {\n return 'oscommerce-2.3.4';\n }", "public function getEntityName()\n {\n return CacheKeys::PRODUCT_VARCHAR;\n }", "public function getSource()\n {\n return 'product';\n }", "protected function getProductName(): ?string\n\t{\n\t\tstatic $cache = [];\n\n\t\t$productId = $this->getProductId();\n\t\tif (!$productId)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!array_key_exists($productId, $cache))\n\t\t{\n\t\t\tLoader::includeModule('iblock');\n\n\t\t\t$row = ElementTable::getRow([\n\t\t\t\t'select' => [\n\t\t\t\t\t'NAME',\n\t\t\t\t],\n\t\t\t\t'filter' => [\n\t\t\t\t\t'=ID' => $productId,\n\t\t\t\t],\n\t\t\t]);\n\t\t\t$cache[$productId] = $row ? (string)$row['NAME'] : null;\n\t\t}\n\n\t\treturn $cache[$productId];\n\t}", "public function getName(): string\n {\n return $this->fqsen->getName();\n }", "public function getName()\n {\n return config('payment.gateways.paypal_pro.name');\n }", "public function getName()\n {\n return $this->fqsen->getName();\n }", "public static function productName(string $project, string $location, string $catalog, string $branch, string $product): string\n {\n return self::getPathTemplate('product')->render([\n 'project' => $project,\n 'location' => $location,\n 'catalog' => $catalog,\n 'branch' => $branch,\n 'product' => $product,\n ]);\n }", "public function setItemName()\n {\n if ($product = $this->product) {\n $name = $product->productPrint->name;\n $name = $product->mailingOption->name . ' ' . $name;\n $name = $name . ' ' . $product->stockOption->name;\n $this->name = $name;\n $this->save();\n }\n }", "function carton_get_formatted_product_name( $product ) {\n\tif ( ! $product || ! is_object( $product ) )\n\t\treturn;\n\n\tif ( $product->get_sku() )\n\t\t$identifier = $product->get_sku();\n\telseif ( $product->is_type( 'variation' ) )\n\t\t$identifier = '#' . $product->variation_id;\n\telse\n\t\t$identifier = '#' . $product->id;\n\n\tif ( $product->is_type( 'variation' ) ) {\n\t\t$attributes = $product->get_variation_attributes();\n\t\t$extra_data = ' &ndash; ' . implode( ', ', $attributes ) . ' &ndash; ' . carton_price( $product->get_price() );\n\t} else {\n\t\t$extra_data = '';\n\t}\n\n\treturn sprintf( __( '%s &ndash; %s%s', 'carton' ), $identifier, $product->get_title(), $extra_data );\n}", "public function getProductDescription()\n\t{\n\t\treturn $this->getKeyValue('product_description'); \n\n\t}", "function tep_get_products_name($product_id, $language = '') {\n global $languages_id;\n\n if (empty($language)) $language = $languages_id;\n\n $product_query = tep_db_query(\"select products_name from \" . TABLE_PRODUCTS_DESCRIPTION . \" where products_id = '\" . (int)$product_id . \"' and language_id = '\" . (int)$language . \"'\");\n $product = tep_db_fetch_array($product_query);\n\n return $product['products_name'];\n }", "public function productCategoryName() {\n\t\treturn $this->generator->randomElement( static::$categories );\n\t}", "protected function _releaseName()\n {\n return \"Version {$this->version}\" . ($this->name ? \": {$this->name}\" : '');\n }", "private function getProductTypeName() {\n $result = WooCommerceSettings::getProductTypeOptionsForSelect()[$this->wooData->getProductType()];\n return is_array($result) ? $result['name'] : $result;\n }", "public function getProductName($id=''){\r\n if($id != ''){\r\n $res = $this->CI->DatabaseModel->access_database('ts_products','select','',array('prod_id'=>$id));\r\n if(!empty($res)) {\r\n $prodd = $res[0]['prod_urlname'] != '' ? $res[0]['prod_urlname'] : $res[0]['prod_name'] ;\r\n $p = strtolower($prodd);\r\n $p = str_replace(' ','-',$p);\r\n $p = preg_replace('!-+!', '-', $p);\r\n return $p.'/';\r\n }\r\n else {\r\n return '/';\r\n }\r\n }\r\n else {\r\n return '/';\r\n }\r\n die();\r\n\t}", "public function getName() {\n\t\treturn \"PowerMgmt\";\n\t}", "public function getPackagedName()\n {\n return Generator::getPackageName() . $this->getContextualPart() . ucfirst(self::uniqueName($this->getCleanName(), $this->getContextualPart()));\n }", "public function get_name()\n\t\t{\n\t\t\treturn \"Item is present/not present in the shopping cart\";\n\t\t}", "public function getLabel()\n {\n return 'VR pay eCommerce';\n }", "function GetProductName ( $whichProduct )\n{\n\n\tmysql_select_db ( 'products' );\n\t$query = 'SELECT * FROM products where ID like '.$whichProduct;\n\n\t$result = mysql_query($query );\n\n\tif ( $result )\n\t{\n\t\t$num_results = mysql_num_rows ( $result );\n\t\tif ( $num_results == 1 )\n\t\t{\n\t\t\t$row = mysql_fetch_object ( $result );\n\t\t\t$productName = $row->name;\n\t\t}\n\t\telse\n\t\t\t$productName = 'General';\n\t}\n\n\treturn $productName;\n}", "public function getNameBase()\n {\n if ($this->nameBase === false) {\n $this->setNameBase($this->product->getNameBase());\n }\n return $this->nameBase;\n }", "public function getEquipmentName()\n {\n return isset($this->EquipmentName) ? $this->EquipmentName : null;\n }", "public function getEquipmentName()\n {\n return isset($this->EquipmentName) ? $this->EquipmentName : null;\n }", "public function get_name() {\n return 'Alita_elementor_product_onsale_block';\n }", "public function getCookieName()\n {\n return Mage::helper('fastlycdn')->generateCookieName(\n Fastly_CDN_Model_Esi_Tag_Reports_Product_Viewed::COOKIE_NAME\n );\n }", "public function getName()\n {\n return $this->quoteItem->getName();\n }", "public static function getProductName($product_id) {\n $name = fn_get_product_name($product_id, $lang_code = CART_LANGUAGE, $as_array = false);\n return $name;\n }", "public function identifier()\n {\n return 'Feegleweb.Octoshop';\n }", "public function get_title() {\r\n\t\treturn esc_html__( 'Price Plan: 02', 'aapside-master' );\r\n\t}", "function getProductName($ms3Oid) {\n\t\t$this->dbgstart();\n\t\t$sql = \"SELECT Name FROM Product WHERE AsimOid = '$ms3Oid'\";\n\t\t$result = $this->db->sql_query($sql);\n\t\tif ($result) {\n\t\t\t$row = $this->db->sql_fetch_row($result);\n\t\t\t$this->dbgend();\n\t\t\treturn $row[0];\n\t\t}\n\t\t$this->dbgend();\n\t\treturn false;\n\t}", "public function get_plugin_name() {\n\t\treturn __( 'WooCommerce Cost of Goods', 'woocommerce-cost-of-goods' );\n\t}", "public function get_program_name() {\n $program = new program($this->db, $this->program);\n return $program->get_name() . \n (($program->get_version() != null && $program->get_version() != \"\") ? \n (\" (Version \".$program->get_version()).\")\" : \"\");\n \n \n }", "public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}", "public function getProductMetadata()\n {\n return sprintf(\"%s %s %s\",\n $this->productMetadata->getName(),\n $this->productMetadata->getEdition(),\n $this->productMetadata->getVersion());\n }", "public function get_name() {\r\n\t\treturn 'appside-price-plan-two-widget';\r\n\t}", "function superfood_elated_woocommerce_template_loop_product_title() {\n\n\t\t$tag = superfood_elated_options()->getOptionValue('eltdf_products_list_title_tag');\n\t\tif($tag === '') {\n\t\t\t$tag = 'h4';\n\t\t}\n\t\tthe_title('<' . $tag . ' class=\"eltdf-product-list-title\"><a href=\"'.get_the_permalink().'\">', '</a></' . $tag . '>');\n\t}", "public function getName()\n {\n return $this->getNodeText('/p:package/p:name');\n }", "public function getName()\n {\n return 'ewallet';\n }", "public function getTabTitle()\n {\n return Mage::helper('chirpify_seller')->__('Product');\n }", "public function getProdDescription()\n {\n return $this->prod_description;\n }", "public function getName()\n {\n switch ($this->queriedContext) {\n case $this->i8n('context-keyword'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-keyword') . ' : ' . $this->getInput('q');\n break;\n case $this->i8n('context-group'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-group') . ' : ' . $this->getKey('group');\n break;\n case $this->i8n('context-talk'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-talk') . ' : ' . $this->getTalkTitle();\n break;\n default: // Return default value\n return static::NAME;\n }\n }", "public function getName()\n {\n return Language::_('Ispapi.name', true);\n }", "public function getName()\n {\n return 'loyalty_identifier_extension';\n }", "public function GetName() {\n\t\treturn __( 'DB & Integrations &#8682;', 'wp-security-audit-log' );\n\t}", "public function getProdName() {\n return $this->ProductName;\n}", "public function renderInfoDevice()\n {\n $name = array();\n \n if ($this->device_family)\n {\n if ($this->device_version)\n {\n if ('-' == substr($this->device_version, 0, 1))\n {\n return $this->device_family . $this->device_version;\n }\n \n return $this->device_family . ' ' . $this->device_version;\n }\n \n return $this->device_family;\n }\n \n if ($this->device_version)\n {\n return $this->device_version;\n }\n \n return '';\n }", "public function getNombreProducto()\n {\n return $this->nombreProducto;\n }", "function name() {\n\t\t\treturn PHPLM_NAME;\n\t\t}", "public function getName()\n {\n return 'VnPay';\n }", "public function get_name() {\r\n\t\treturn '';\r\n\t}", "function responsive_woo_woocommerce_template_loop_product_title() {\n\n\t\techo '<a href=\"' . esc_url( get_the_permalink() ) . '\" class=\"responsive-loop-product__link\">';\n\t\twoocommerce_template_loop_product_title();\n\t\techo '</a>';\n\t}", "public function getName()\n {\n return $this->getAttributeModel()->getStoreLabel();\n }", "public function get_plugin_name() {\n\n\t\treturn __( 'WooCommerce Print Invoices/Packing Lists', 'woocommerce-pip' );\n\t}", "public function getName() {\n\t\treturn Language::_(\"Alipay.name\", true);\n\t}", "public function name() {\n\t\treturn \"Беремена\";\n\t}", "public function getName() {\n\t\treturn (string)$this->gpml[\"Name\"];\n\t}", "public function getConflictingProductTypeName()\n {\n return $this->conflictingProductTypeName;\n }", "public function displayName()\n {\n return Settings::get(\n 'octoshop_products_label',\n trans('offline.sitesearch::lang.settings.octoshop_itemurl_badge')\n );\n }", "public function getName() {\n return Language::_(\"TheSSLStorePlugin.name\", true);\n }", "public function getLabel()\n {\n return 'Shopware Connect';\n }", "function kvell_edge_woocommerce_template_loop_product_title() {\n\t\t$tag = kvell_edge_options()->getOptionValue( 'edgtf_products_list_title_tag' );\n\t\tif ( $tag === '' ) {\n\t\t\t$tag = 'h5';\n\t\t}\n\t\t\n\t\tthe_title( '<' . $tag . ' class=\"edgtf-product-list-title\"><a href=\"' . get_the_permalink() . '\">', '</a></' . $tag . '>' );\n\t}", "public function productdata($prod_id)\n {\n $prodname = $this->Dbmodel->getproduct($prod_id); \n return $prodname;\n }", "public function getProduct()\n {\n return $this->coreRegistry->registry('product');\n }", "public function getName()\n {\n return Language::_(\"TpayPayments.name\", true);\n }", "public function getProdAlt4()\n {\n return $this->prod_alt4;\n }", "public function getProduct()\r\n {\r\n return $this->_params['product'];\r\n }", "protected function name()\n\t{\n\t\treturn 'flyer';\n\t}" ]
[ "0.72593105", "0.7219317", "0.7193031", "0.71342313", "0.7015499", "0.67939943", "0.6786698", "0.67198807", "0.6634048", "0.658662", "0.63774276", "0.6364802", "0.6331167", "0.6311149", "0.6241261", "0.6121327", "0.6117779", "0.60898906", "0.6082293", "0.6038307", "0.59841585", "0.5974412", "0.589602", "0.586499", "0.58534014", "0.5830571", "0.5819062", "0.5818327", "0.5809166", "0.57841", "0.57755274", "0.57734", "0.57382613", "0.5733161", "0.57095826", "0.569175", "0.56908405", "0.5687101", "0.5667365", "0.56671333", "0.56650364", "0.5657099", "0.5651019", "0.56315756", "0.5630302", "0.5624307", "0.5624228", "0.56122774", "0.56031543", "0.5592575", "0.5589802", "0.55850023", "0.55819225", "0.55819225", "0.55676156", "0.5564286", "0.5553806", "0.5549033", "0.55447054", "0.5532027", "0.5524291", "0.5518753", "0.55056846", "0.5489107", "0.5472965", "0.5460136", "0.5459531", "0.5455168", "0.54485506", "0.54437673", "0.5439978", "0.5438561", "0.54335964", "0.5427933", "0.5421524", "0.54202986", "0.5419287", "0.5416393", "0.54112214", "0.5409014", "0.5408649", "0.5404879", "0.539967", "0.5399584", "0.5397595", "0.53962725", "0.53901184", "0.5388529", "0.5385993", "0.5385666", "0.5383087", "0.53812134", "0.5380973", "0.5377245", "0.5377017", "0.5371454", "0.53699833", "0.53690004" ]
0.6133614
17
Name of the DHL Express product.
public function setProductName(?string $productName): self { $this->initialized['productName'] = true; $this->productName = $productName; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_name() {\n $type = static::get_type();\n return util::string(\"product:{$type}\");\n }", "public function getName_product()\n {\n return $this->name_product;\n }", "public function getProductName()\n {\n return $this->product_name;\n }", "public function getProductName()\n {\n return $this->product_name;\n }", "public function getProductName() {\n //return the value product name\n return $this->ProductName;\n }", "public function getProdName()\n {\n return $this->prod_name;\n }", "public function getProductName(){\n return $this->product_name;\n }", "public function get_productName(): string\n {\n // $res is a string;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductName();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTNAME_INVALID;\n }\n }\n $res = $this->_productName;\n return $res;\n }", "public function getDocumentProductName()\n {\n return (string) $this->document_product_name;\n }", "public function getProduct_name () {\n\t$preValue = $this->preGetValue(\"product_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_name;\n\treturn $data;\n}", "public function getProductName()\n {\n if (!isset($this->name))\n {\n if (!$this->name = $this->getHelper()->getName($this->getSlug()))\n {\n $this->name = $this->getHelper()->getNameFromPath($this->getPathname());\n }\n }\n\n return $this->name;\n }", "public function fullname()\n\t{\n\t\treturn $this->product->name .' - '. $this->name();\n\t}", "public function getName()\n {\n return 'recipeproduct';\n }", "public function get_title() {\n return esc_html__( 'Onsale Product', 'electro-extensions' );\n }", "public function get_title() {\n return esc_html__( 'Onsale Product', 'Alita-extensions' );\n }", "public function getProductName(): ?string\n {\n return $this->productName;\n }", "public function getProductName(): ?string\n {\n return $this->productName;\n }", "public function getProductName(): ?string\n {\n return $this->productName;\n }", "public static function getSoftwareName()\n\t\t{\n\t\t\treturn 'Wordpress 3.9.1 en WooCommerce 3.0.0+';\n\t\t}", "public function getSoftwareName()\n {\n return $this->getParam(self::SOFTWARE_PARAM_NAME);\n }", "public function get_name() {\n\t\treturn 'single-product-images';\n\t}", "public function getName() : string\n {\n return $this->get('name', 'products');\n }", "public function getFullname(): string\n {\n return $this->product->lang->title . ' ' . $this->lang->title;\n }", "public function name(): string\n {\n return 'PROD';\n }", "public function getProdName(){\n\t\treturn array_keys($this->_products);\n\t}", "public function getProductIdentifier()\n {\n $value = $this->_config->get('dataprocessing/products/identifier');\n\n if ($value === null) {\n $value = 'sku';\n }\n\n return $value;\n }", "public function get_name() {\n return 'electro_elementor_product_onsale_block';\n }", "public function getName()\n {\n return 'Wechat_Express';\n }", "public function getName()\n {\n return 'PayNL iDeal';\n }", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function getName()\n {\n return 'Alipay Refund Express';\n }", "public function name()\n\t{\n\t\treturn $this->lang->words['stock'];\n\t}", "public function getProdTitle()\n {\n return $this->prod_title;\n }", "public function getShopName()\n {\n return 'oscommerce-2.3.4';\n }", "public function getEntityName()\n {\n return CacheKeys::PRODUCT_VARCHAR;\n }", "public function getSource()\n {\n return 'product';\n }", "protected function getProductName(): ?string\n\t{\n\t\tstatic $cache = [];\n\n\t\t$productId = $this->getProductId();\n\t\tif (!$productId)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!array_key_exists($productId, $cache))\n\t\t{\n\t\t\tLoader::includeModule('iblock');\n\n\t\t\t$row = ElementTable::getRow([\n\t\t\t\t'select' => [\n\t\t\t\t\t'NAME',\n\t\t\t\t],\n\t\t\t\t'filter' => [\n\t\t\t\t\t'=ID' => $productId,\n\t\t\t\t],\n\t\t\t]);\n\t\t\t$cache[$productId] = $row ? (string)$row['NAME'] : null;\n\t\t}\n\n\t\treturn $cache[$productId];\n\t}", "public function getName(): string\n {\n return $this->fqsen->getName();\n }", "public function getName()\n {\n return config('payment.gateways.paypal_pro.name');\n }", "public function getName()\n {\n return $this->fqsen->getName();\n }", "public static function productName(string $project, string $location, string $catalog, string $branch, string $product): string\n {\n return self::getPathTemplate('product')->render([\n 'project' => $project,\n 'location' => $location,\n 'catalog' => $catalog,\n 'branch' => $branch,\n 'product' => $product,\n ]);\n }", "public function setItemName()\n {\n if ($product = $this->product) {\n $name = $product->productPrint->name;\n $name = $product->mailingOption->name . ' ' . $name;\n $name = $name . ' ' . $product->stockOption->name;\n $this->name = $name;\n $this->save();\n }\n }", "function carton_get_formatted_product_name( $product ) {\n\tif ( ! $product || ! is_object( $product ) )\n\t\treturn;\n\n\tif ( $product->get_sku() )\n\t\t$identifier = $product->get_sku();\n\telseif ( $product->is_type( 'variation' ) )\n\t\t$identifier = '#' . $product->variation_id;\n\telse\n\t\t$identifier = '#' . $product->id;\n\n\tif ( $product->is_type( 'variation' ) ) {\n\t\t$attributes = $product->get_variation_attributes();\n\t\t$extra_data = ' &ndash; ' . implode( ', ', $attributes ) . ' &ndash; ' . carton_price( $product->get_price() );\n\t} else {\n\t\t$extra_data = '';\n\t}\n\n\treturn sprintf( __( '%s &ndash; %s%s', 'carton' ), $identifier, $product->get_title(), $extra_data );\n}", "public function getProductDescription()\n\t{\n\t\treturn $this->getKeyValue('product_description'); \n\n\t}", "function tep_get_products_name($product_id, $language = '') {\n global $languages_id;\n\n if (empty($language)) $language = $languages_id;\n\n $product_query = tep_db_query(\"select products_name from \" . TABLE_PRODUCTS_DESCRIPTION . \" where products_id = '\" . (int)$product_id . \"' and language_id = '\" . (int)$language . \"'\");\n $product = tep_db_fetch_array($product_query);\n\n return $product['products_name'];\n }", "public function productCategoryName() {\n\t\treturn $this->generator->randomElement( static::$categories );\n\t}", "protected function _releaseName()\n {\n return \"Version {$this->version}\" . ($this->name ? \": {$this->name}\" : '');\n }", "private function getProductTypeName() {\n $result = WooCommerceSettings::getProductTypeOptionsForSelect()[$this->wooData->getProductType()];\n return is_array($result) ? $result['name'] : $result;\n }", "public function getProductName($id=''){\r\n if($id != ''){\r\n $res = $this->CI->DatabaseModel->access_database('ts_products','select','',array('prod_id'=>$id));\r\n if(!empty($res)) {\r\n $prodd = $res[0]['prod_urlname'] != '' ? $res[0]['prod_urlname'] : $res[0]['prod_name'] ;\r\n $p = strtolower($prodd);\r\n $p = str_replace(' ','-',$p);\r\n $p = preg_replace('!-+!', '-', $p);\r\n return $p.'/';\r\n }\r\n else {\r\n return '/';\r\n }\r\n }\r\n else {\r\n return '/';\r\n }\r\n die();\r\n\t}", "public function getName() {\n\t\treturn \"PowerMgmt\";\n\t}", "public function getPackagedName()\n {\n return Generator::getPackageName() . $this->getContextualPart() . ucfirst(self::uniqueName($this->getCleanName(), $this->getContextualPart()));\n }", "public function get_name()\n\t\t{\n\t\t\treturn \"Item is present/not present in the shopping cart\";\n\t\t}", "public function getLabel()\n {\n return 'VR pay eCommerce';\n }", "function GetProductName ( $whichProduct )\n{\n\n\tmysql_select_db ( 'products' );\n\t$query = 'SELECT * FROM products where ID like '.$whichProduct;\n\n\t$result = mysql_query($query );\n\n\tif ( $result )\n\t{\n\t\t$num_results = mysql_num_rows ( $result );\n\t\tif ( $num_results == 1 )\n\t\t{\n\t\t\t$row = mysql_fetch_object ( $result );\n\t\t\t$productName = $row->name;\n\t\t}\n\t\telse\n\t\t\t$productName = 'General';\n\t}\n\n\treturn $productName;\n}", "public function getNameBase()\n {\n if ($this->nameBase === false) {\n $this->setNameBase($this->product->getNameBase());\n }\n return $this->nameBase;\n }", "public function getEquipmentName()\n {\n return isset($this->EquipmentName) ? $this->EquipmentName : null;\n }", "public function getEquipmentName()\n {\n return isset($this->EquipmentName) ? $this->EquipmentName : null;\n }", "public function get_name() {\n return 'Alita_elementor_product_onsale_block';\n }", "public function getCookieName()\n {\n return Mage::helper('fastlycdn')->generateCookieName(\n Fastly_CDN_Model_Esi_Tag_Reports_Product_Viewed::COOKIE_NAME\n );\n }", "public function getName()\n {\n return $this->quoteItem->getName();\n }", "public static function getProductName($product_id) {\n $name = fn_get_product_name($product_id, $lang_code = CART_LANGUAGE, $as_array = false);\n return $name;\n }", "public function identifier()\n {\n return 'Feegleweb.Octoshop';\n }", "public function get_title() {\r\n\t\treturn esc_html__( 'Price Plan: 02', 'aapside-master' );\r\n\t}", "function getProductName($ms3Oid) {\n\t\t$this->dbgstart();\n\t\t$sql = \"SELECT Name FROM Product WHERE AsimOid = '$ms3Oid'\";\n\t\t$result = $this->db->sql_query($sql);\n\t\tif ($result) {\n\t\t\t$row = $this->db->sql_fetch_row($result);\n\t\t\t$this->dbgend();\n\t\t\treturn $row[0];\n\t\t}\n\t\t$this->dbgend();\n\t\treturn false;\n\t}", "public function get_plugin_name() {\n\t\treturn __( 'WooCommerce Cost of Goods', 'woocommerce-cost-of-goods' );\n\t}", "public function get_program_name() {\n $program = new program($this->db, $this->program);\n return $program->get_name() . \n (($program->get_version() != null && $program->get_version() != \"\") ? \n (\" (Version \".$program->get_version()).\")\" : \"\");\n \n \n }", "public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}", "public function getProductMetadata()\n {\n return sprintf(\"%s %s %s\",\n $this->productMetadata->getName(),\n $this->productMetadata->getEdition(),\n $this->productMetadata->getVersion());\n }", "public function get_name() {\r\n\t\treturn 'appside-price-plan-two-widget';\r\n\t}", "function superfood_elated_woocommerce_template_loop_product_title() {\n\n\t\t$tag = superfood_elated_options()->getOptionValue('eltdf_products_list_title_tag');\n\t\tif($tag === '') {\n\t\t\t$tag = 'h4';\n\t\t}\n\t\tthe_title('<' . $tag . ' class=\"eltdf-product-list-title\"><a href=\"'.get_the_permalink().'\">', '</a></' . $tag . '>');\n\t}", "public function getName()\n {\n return $this->getNodeText('/p:package/p:name');\n }", "public function getName()\n {\n return 'ewallet';\n }", "public function getTabTitle()\n {\n return Mage::helper('chirpify_seller')->__('Product');\n }", "public function getProdDescription()\n {\n return $this->prod_description;\n }", "public function getName()\n {\n switch ($this->queriedContext) {\n case $this->i8n('context-keyword'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-keyword') . ' : ' . $this->getInput('q');\n break;\n case $this->i8n('context-group'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-group') . ' : ' . $this->getKey('group');\n break;\n case $this->i8n('context-talk'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-talk') . ' : ' . $this->getTalkTitle();\n break;\n default: // Return default value\n return static::NAME;\n }\n }", "public function getName()\n {\n return Language::_('Ispapi.name', true);\n }", "public function getName()\n {\n return 'loyalty_identifier_extension';\n }", "public function GetName() {\n\t\treturn __( 'DB & Integrations &#8682;', 'wp-security-audit-log' );\n\t}", "public function getProdName() {\n return $this->ProductName;\n}", "public function renderInfoDevice()\n {\n $name = array();\n \n if ($this->device_family)\n {\n if ($this->device_version)\n {\n if ('-' == substr($this->device_version, 0, 1))\n {\n return $this->device_family . $this->device_version;\n }\n \n return $this->device_family . ' ' . $this->device_version;\n }\n \n return $this->device_family;\n }\n \n if ($this->device_version)\n {\n return $this->device_version;\n }\n \n return '';\n }", "public function getNombreProducto()\n {\n return $this->nombreProducto;\n }", "function name() {\n\t\t\treturn PHPLM_NAME;\n\t\t}", "public function getName()\n {\n return 'VnPay';\n }", "public function get_name() {\r\n\t\treturn '';\r\n\t}", "function responsive_woo_woocommerce_template_loop_product_title() {\n\n\t\techo '<a href=\"' . esc_url( get_the_permalink() ) . '\" class=\"responsive-loop-product__link\">';\n\t\twoocommerce_template_loop_product_title();\n\t\techo '</a>';\n\t}", "public function getName()\n {\n return $this->getAttributeModel()->getStoreLabel();\n }", "public function get_plugin_name() {\n\n\t\treturn __( 'WooCommerce Print Invoices/Packing Lists', 'woocommerce-pip' );\n\t}", "public function getName() {\n\t\treturn Language::_(\"Alipay.name\", true);\n\t}", "public function name() {\n\t\treturn \"Беремена\";\n\t}", "public function getName() {\n\t\treturn (string)$this->gpml[\"Name\"];\n\t}", "public function getConflictingProductTypeName()\n {\n return $this->conflictingProductTypeName;\n }", "public function displayName()\n {\n return Settings::get(\n 'octoshop_products_label',\n trans('offline.sitesearch::lang.settings.octoshop_itemurl_badge')\n );\n }", "public function getName() {\n return Language::_(\"TheSSLStorePlugin.name\", true);\n }", "public function getLabel()\n {\n return 'Shopware Connect';\n }", "function kvell_edge_woocommerce_template_loop_product_title() {\n\t\t$tag = kvell_edge_options()->getOptionValue( 'edgtf_products_list_title_tag' );\n\t\tif ( $tag === '' ) {\n\t\t\t$tag = 'h5';\n\t\t}\n\t\t\n\t\tthe_title( '<' . $tag . ' class=\"edgtf-product-list-title\"><a href=\"' . get_the_permalink() . '\">', '</a></' . $tag . '>' );\n\t}", "public function productdata($prod_id)\n {\n $prodname = $this->Dbmodel->getproduct($prod_id); \n return $prodname;\n }", "public function getProduct()\n {\n return $this->coreRegistry->registry('product');\n }", "public function getName()\n {\n return Language::_(\"TpayPayments.name\", true);\n }", "public function getProdAlt4()\n {\n return $this->prod_alt4;\n }", "public function getProduct()\r\n {\r\n return $this->_params['product'];\r\n }", "protected function name()\n\t{\n\t\treturn 'flyer';\n\t}" ]
[ "0.72593105", "0.7219317", "0.7193031", "0.71342313", "0.7015499", "0.67939943", "0.6786698", "0.67198807", "0.6634048", "0.658662", "0.63774276", "0.6364802", "0.6331167", "0.6311149", "0.6241261", "0.6133614", "0.6133614", "0.6133614", "0.6121327", "0.6117779", "0.60898906", "0.6082293", "0.6038307", "0.59841585", "0.5974412", "0.589602", "0.586499", "0.58534014", "0.5830571", "0.5819062", "0.5818327", "0.5809166", "0.57841", "0.57755274", "0.57734", "0.57382613", "0.5733161", "0.57095826", "0.569175", "0.56908405", "0.5687101", "0.5667365", "0.56671333", "0.56650364", "0.5657099", "0.5651019", "0.56315756", "0.5630302", "0.5624307", "0.5624228", "0.56122774", "0.56031543", "0.5592575", "0.5589802", "0.55850023", "0.55819225", "0.55819225", "0.55676156", "0.5564286", "0.5553806", "0.5549033", "0.55447054", "0.5532027", "0.5524291", "0.5518753", "0.55056846", "0.5489107", "0.5472965", "0.5460136", "0.5459531", "0.5455168", "0.54485506", "0.54437673", "0.5439978", "0.5438561", "0.54335964", "0.5427933", "0.5421524", "0.54202986", "0.5419287", "0.5416393", "0.54112214", "0.5409014", "0.5408649", "0.5404879", "0.539967", "0.5399584", "0.5397595", "0.53962725", "0.53901184", "0.5388529", "0.5385993", "0.5385666", "0.5383087", "0.53812134", "0.5380973", "0.5377245", "0.5377017", "0.5371454", "0.53699833", "0.53690004" ]
0.0
-1
This is the global DHL Express product code for which the delivery is feasible respecting the input data from the request.
public function getProductCode(): ?string { return $this->productCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function determainclaimType()\r\n {\r\n // 9 digits\r\n if (preg_match($this->keycodeRegex, $this->keycode) == false)\r\n {\r\n $this->claimType = \"invaild-keycode\";\r\n }\r\n \r\n // if keycode is NOT null, then search in the database\r\n else if ($this->keycode != null)\r\n {\r\n $result = mysql_query(\"SELECT Keycode, Claimable, Repairable, WarrantyMonths\r\n FROM Product \r\n WHERE Product.Keycode = $this->keycode\");\r\n\r\n $array = mysql_fetch_array($result);\r\n\r\n // if keycode is null, item does not exist in the database\r\n //if ($array[\"Keycode\"] == false)\r\n if (empty($array))\r\n {\r\n $this->claimType = \"keycode-not-found\";\r\n }\r\n // if product is claimable and repairable\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 1)\r\n { \r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) \r\n {\r\n //// check warranty period\r\n $this->claimType = \"repair-warranty\";\r\n }\r\n else\r\n {\r\n // check warranty period\r\n $this->claimType = \"repair-no-warranty\";\r\n }\r\n }\r\n else // transactionResult number rows is zero, this means no transaction was founds\r\n { \r\n $this->claimType = \"repair-no-transaction\";\r\n }\r\n }\r\n // if product offers a finanical claim\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"finanical-warranty\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"finanical-outside-warranty\";\r\n }\r\n }\r\n else // transactionResult's rows was zero so no tranaction number was found\r\n {\r\n $this->claimType = \"finanical-no-transaction\";\r\n }\r\n }\r\n // if a product is NOT claimable with supplier\r\n else if ($array[\"Claimable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are above zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"not-claimable-refund\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"not-claimable-outside-warranty\";\r\n }\r\n }\r\n else // no vaild transaction number provided\r\n {\r\n $this->claimType = \"not-claimable-no-transaction\";\r\n }\r\n }\r\n }\r\n \r\n }", "public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function productFlowProcess(){\r\n\t\t$query = $this->request->data ;\r\n\t\t$status = $query[\"status\"] ;\r\n\t\t$description = $query[\"description\"] ;\r\n\t\t$filterId = $query[\"filterId\"] ;\r\n\t\t$asin = $query[\"asin\"] ;\r\n\t\t$strategy = $query[\"strategy\"] ;\r\n\t\t/*print_r( $this->request ) ; \r\n\t\tprint_r($this->request->data) ;\r\n\t\techo \">>>>>>>>>>>>>>>>>\".$description ;*/\r\n\t\t\r\n\t\t\r\n\t\t//更新状态\r\n\t\t$this->Sale->updateProductFilterStatus($this->request->data) ;\r\n\t\t\r\n\t\t//添加备注\r\n\t\t//if( trim($description) != \"\" ){\r\n\t\t$this->Product->updateProductComment($asin,$description,$strategy) ;\r\n\t\t//}\r\n\t\t\r\n\t\t//加入黑名单\r\n\t\tif( $status == 3 ){\r\n\t\t\t$user = $this->getCookUser() ;\r\n\t\t\t$this->Sale->removeProduct($this->request->data,$user) ;\r\n\t\t}else{\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$this->response->type(\"json\") ;\r\n\t\t$this->response->body( \"success\") ;\r\n\r\n\t\treturn $this->response ;\r\n\t}", "public function cs_proress_request($params = array()) {\n global $post, $cs_gateway_options, $cs_form_fields2;\n extract($params);\n\n $cs_current_date = date('Y-m-d H:i:s');\n $output = '';\n $rand_id = $this->cs_get_string(5);\n $business_email = $cs_gateway_options['cs_paypal_email'];\n\n\n $currency = isset($cs_gateway_options['cs_currency_type']) && $cs_gateway_options['cs_currency_type'] != '' ? $cs_gateway_options['cs_currency_type'] : 'USD';\n $cs_opt_hidden1_array = array(\n 'id' => '',\n 'std' => '_xclick',\n 'cust_id' => \"\",\n 'cust_name' => \"cmd\",\n 'return' => true,\n );\n $cs_opt_hidden2_array = array(\n 'id' => '',\n 'std' => sanitize_email($business_email),\n 'cust_id' => \"\",\n 'cust_name' => \"business\",\n 'return' => true,\n );\n $cs_opt_hidden3_array = array(\n 'id' => '',\n 'std' => $cs_trans_amount,\n 'cust_id' => \"\",\n 'cust_name' => \"amount\",\n 'return' => true,\n );\n $cs_opt_hidden4_array = array(\n 'id' => '',\n 'std' => $currency,\n 'cust_id' => \"\",\n 'cust_name' => \"currency_code\",\n 'return' => true,\n );\n $cs_opt_hidden5_array = array(\n 'id' => '',\n 'std' => $cs_package_title,\n 'cust_id' => \"\",\n 'cust_name' => \"item_name\",\n 'return' => true,\n );\n $cs_opt_hidden6_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_job_id),\n 'cust_id' => \"\",\n 'cust_name' => \"item_number\",\n 'return' => true,\n );\n $cs_opt_hidden7_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"cancel_return\",\n 'return' => true,\n );\n $cs_opt_hidden8_array = array(\n 'id' => '',\n 'std' => '1',\n 'cust_id' => \"\",\n 'cust_name' => \"no_note\",\n 'return' => true,\n );\n $cs_opt_hidden9_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"invoice\",\n 'return' => true,\n );\n $cs_opt_hidden10_array = array(\n 'id' => '',\n 'std' => esc_url($this->listner_url),\n 'cust_id' => \"\",\n 'cust_name' => \"notify_url\",\n 'return' => true,\n );\n $cs_opt_hidden11_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"lc\",\n 'return' => true,\n );\n $cs_opt_hidden12_array = array(\n 'id' => '',\n 'std' => '2',\n 'cust_id' => \"\",\n 'cust_name' => \"rm\",\n 'return' => true,\n );\n $cs_opt_hidden13_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"custom\",\n 'return' => true,\n );\n $cs_opt_hidden14_array = array(\n 'id' => '',\n 'std' => esc_url(home_url('/')),\n 'cust_id' => \"\",\n 'cust_name' => \"return\",\n 'return' => true,\n );\n\n $output .= '<form name=\"PayPalForm\" id=\"direcotry-paypal-form\" action=\"' . $this->gateway_url . '\" method=\"post\"> \n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden1_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden2_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden3_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden4_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden5_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden6_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden7_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden8_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden9_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden10_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden11_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden12_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden13_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden14_array) . '\n </form>';\n\n\n $data = CS_FUNCTIONS()->cs_special_chars($output);\n $data .= '<script>\n\t\t\t\t\t \t jQuery(\"#direcotry-paypal-form\").submit();\n\t\t\t\t\t </script>';\n echo CS_FUNCTIONS()->cs_special_chars($data);\n }", "function external_code($request)\n\t{\n\t\tlist($success, $return) = $this->system->is_valid_access4($request);\n\t\tif (!$success) return [FALSE, $return];\n\n\t\t//cek parameter: SecuritiesMarketCode\n\t\tif (!isset($request->params->SecuritiesMarketCode) || empty($request->params->SecuritiesMarketCode)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter SecuritiesMarketCode'])]];\n\t\t}\n\n\t\t//cek parameter: MarketID --> sumber external identification \n\t\tif (!isset($request->params->MarketID) || empty($request->params->MarketID)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter MarketID'])]];\n\t\t}\n\n\t\t$this->db->select('T2.SecuritiesCode');\n\t\t$this->db->from('market_instrument_id_market T1');\n\t\t$this->db->join('market_instrument T2', 'T1.SecuritiesID = T2.SecuritiesID'); \n\t\t$this->db->where('T1.MarketID', $request->params->MarketID);\n\t\t$this->db->where('T1.SecuritiesMarketCode', $request->params->SecuritiesMarketCode);\n\t\t$row = $this->db->get()->row();\n if (!$row) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-2', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-2'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'market company'])]];\n }\n\n\t\t$request->log_size = mb_strlen(serialize($row), '8bit');\n\t\t$request->log_type\t= 'data';\t\n\t\t$this->system->save_billing($request);\n\n\t\treturn [TRUE, ['result' => ['SecuritiesCode' => $row->SecuritiesCode]]];\n\t}", "public static function postsubmit_derive_product($lead) {\n\t\t$wsProduct = '';\n\t\tif( empty($lead->wsMaxProductLine) || 'Unknown' == $lead->wsMaxProductLine ) { // no Product Line context on the form page\n\t\t\tif ( 'History-Culture Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\tif( !empty($lead->domesticOrInternational ) && 'us' == $lead->domesticOrInternational ) {\n\t\t\t\t\t$wsProduct = 'Middle School - History'; // default to History\n\t\t\t\t} else {\n\t\t\t\t\t$wsProduct = 'High School - International'; // abroad means Perspectives Division\n\t\t\t\t}\n\t\t\t} elseif ( 'Science Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Middle School - Science';\n\t\t\t} elseif ( 'Undergraduate Tours' == $lead->leadFormProduct || \n\t\t\t\t\t 'Graduate-Level Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'University'; // does not exist in Maximizer yet\n\t\t\t} elseif ( 'Music Festivals' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Concert and Performing Tours' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Marching Band Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Dance-Cheer Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Theatre Opportunities' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Performing';\n\t\t\t} elseif ( 'Sports Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Sports'; // does not exist in Maximizer yet\n\t\t\t} else {\n\t\t\t\t$wsProduct = 'Unknown';\n\t\t\t}\n\t\t} else {\n\t\t\t$wsProduct = $lead->wsMaxProductLine;\n\t\t}\n\t\treturn $wsProduct;\n\t}", "public function process_request () {\n \n add_action( 'admin_notices', array( $this, 'admin_notices' ) );\n \n $supported_actions = array( 'activate-products', 'deactivate-product' );\n if ( !isset( $_REQUEST['action'] ) || !in_array( $_REQUEST['action'], $supported_actions ) || !check_admin_referer( 'bulk-' . 'licenses' ) ) {\n return null;\n }\n \n $response = false;\n $status = 'false';\n $type = $_REQUEST['action'];\n\n switch ( $type ) {\n case 'activate-products':\n $products = array();\n if ( isset( $_POST[ 'products' ] ) && 0 < count( $_POST[ 'products' ] ) ) {\n foreach ( $_POST[ 'products' ] as $k => $v ) {\n if ( !empty( $v[ 'license_key' ] ) ) {\n $products[$k] = $v;\n }\n }\n }\n if ( 0 < count( $products ) ) {\n //echo \"<pre>\"; print_r( $products ); echo \"</pre>\"; die();\n $response = $this->activate_products( $products );\n } else {\n $response = false;\n $type = 'no-license-keys';\n }\n break;\n\n case 'deactivate-product':\n if ( isset( $_GET['filepath'] ) && ( '' != $_GET['filepath'] ) ) {\n $response = $this->deactivate_product( $_GET['filepath'] );\n }\n break;\n\n default:\n break;\n }\n\n if ( $response == true ) {\n $status = 'true';\n }\n \n $redirect_url = \\UsabilityDynamics\\Utility::current_url( array( 'type' => urlencode( $type ), 'status' => urlencode( $status ) ), array( 'action', 'filepath', '_wpnonce' ) );\n wp_safe_redirect( $redirect_url );\n exit;\n }", "public function getProdCode()\n {\n return $this->prod_code;\n }", "function getProductCode()\n {\n return $this->productCode;\n }", "public function compliteAction()\n {\n\n $config = $this->get('plugins')->Frontend()->PilibabaPilipaySystem()->Config();\n $merchantNO = $this->Request()->getParam('merchantNO');\n $orderNo = $this->Request()->getParam('orderNo');\n $orderAmount = $this->Request()->getParam('orderAmount');\n $signType = $this->Request()->getParam('signType');\n $payResult = $this->Request()->getParam('payResult');\n $signMsg = $this->Request()->getParam('signMsg');\n $dealId = $this->Request()->getParam('dealId');\n $fee = $this->Request()->getParam('fee');\n $sendTime = $this->Request()->getParam('sendTime');\n\n\n if ($config->get('merchantNo') == $merchantNO\n && md5($merchantNO . $orderNo . $orderAmount . $sendTime . $config->get('appSecrect')) == $signMsg\n ) {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n $order = $builder->getQuery()->getOneOrNullResult();\n\n if ($payResult == 10) {\n\n $this->setPaymentStatus($order->getTransactionId(), 12);\n $url = $this->basePathUrl . '/paymentpilipay/finish?orderNo='.$orderNo;\n\n echo '<result>1</result><redirecturl>' . $url . '</redirecturl>';\n $this->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if ($order->getOrderStatus() && $order->getOrderStatus()->getId() == 0) {\n $this->setOrderStatus($order->getTransactionId(), 0); // in process\n }\n } elseif ($payResult == 11) {\n $this->setPaymentStatus($order->getTransactionId(), 21);\n\n }\n }\n\n }", "public function minAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function actionDeliveryCost($code){\n //check country\n $city= City::find()->where('Name=\"'.$code.'\"')->one();\n //var_dump($city);\n if($city->CountryCode == 'EGY'){\n //calculate weight\n $sum=0;\n foreach(Shopcart::goods() as $good) {\n $sum+= $good->item->product_weight ;\n\n }\n // return \"the new cost--\".$city->Name .$city->CountryCode;\n //$city->CountryCode;\n $cost= $this->GetCost($city->Name,$sum);\n if($cost =='' or $cost ==0){\n return Setting::get('deliver_cost');\n }else{return $cost ;}\n\n }else{\n return Setting::get('deliver_cost'); //.'-99'. $city->CountryCode;\n }\n\n }", "public function getLocalProductCode(): ?string\n {\n return $this->localProductCode;\n }", "function calc_required_en(){\r\n\tif(strpos($this->Tactics['spec'],'DoubleStrike') !== false) $this->Eq['A']['enc'] *= 2;\r\n\tif(strpos($this->Tactics['spec'],'TripleStrike') !== false) $this->Eq['A']['enc'] *= 3;\r\n\t$MSEnCpos = strpos($this->MS['spec'],'CostEN');\r\n\tif($MSEnCpos !== false) {\r\n\t\t$temp = array();\r\n\t\tpreg_match('/CostEN<([0-9.]+)>/',$this->MS['spec'],$temp,0,$MSEnCpos);\r\n\t\t$MSEnC = floatval($temp[1]);\r\n\t\tif($MSEnC < 1) $MSEnC = floor($this->Player['enmax'] * $MSEnC);\r\n\t\t$this->Eq['A']['enc'] += $MSEnC;\r\n\t}\r\n\t$this->RequireEN = ($this->Eq['A']['enc'] + $this->Eq['D']['enc'] + $this->Eq['E']['enc']);\r\n}", "public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }", "private function validateAvailableProduct() {\n\n\t\t$studio_data = &$this->session->data['studio_data'][$this->request->post['price_studio_id']]; //make it short\n\n\t\t//if price_id_product is not empty\n\t\tif (!isset($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t///if product exists\n\t\t} elseif (!$this->model_opentshirts_product->getTotalProductsByID($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t//if product price is setted up\n\t\t}else if ($this->model_opentshirts_price_product->getMinQuantity($studio_data['id_product'])===false) {\n\t\t\t$this->error['warning'] = $this->language->get('error_not_available');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function dsf_protx_release_order($order_number){\n\nglobal $ReleaseURL, $Verify, $ProtocolVersion;\n\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please release the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'Protx Item not Found';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please release the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'More than one protx item found';\n\tbreak;\n }\n \t\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n\n // we must have a valid transaction item if we are here, get the array of items.\n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$TargetURL = $ReleaseURL;\n$VerifyServer = $Verify;\n\n// echo 'URL = ' . $TargetURL;\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => 'RELEASE',\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response ='';\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been released witin protx.\n\t\t\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '13');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '13', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as released however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn $response;\n}", "function dsf_process_sagepay($savedorder){\n\nglobal $protx_order,$GiftAidPayment, $ApplyAVSCV2, $CAVV, $XID, $ECI, $ClientNumber, $cc_issue_number, $cc_ccv_number, $cc_owner, $cc_number, $cc_start_month, $cc_start_year, $cc_expires_month, $cc_expires_year, $cc_ctype, $protx_attempts, $currencies, $ProtocolVersion, $DefaultCurrency,$PurchaseURL,$Verify, $VendorTxCode;\n\n \t\t\t\t\t$protx_ipn_currency = MODULE_PAYMENT_PROTXCC_DEFAULT_CURRENCY;\n\n\t\t\t\t\t\t // ORDER VALUE\n\t\t\t\t\t\t $strip_values_array = array(\"£\",\",\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['deposit_value']);\n\t\t\t\t\t\t }else{ // full order value\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['total_value']);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $protx_ipn_order_amount = number_format($protx_ipn_order_amount , 2,'.','');\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t// CREATE ALL values to be passed through to Protx.\n\t\t\t\t\t\t$VendorTxCode= SAP_ORDER_PREFIX . $savedorder->info['id'] . '--' . date('YmdHis');\n\t\t\t\t\t\t$Amount= $protx_ipn_order_amount;\n\t\t\t\t\t\t$Currency= $protx_ipn_currency;\n\t\t\t\t\t\t$Description= 'Basket ID ' . $savedorder->info['id'] . ' - ' . dsf_get_ip_address();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( strtoupper($savedorder->customer['email_address']) <> strtoupper(TELEPHONE_ORDER)){\n\t\t\t\t\t\t\t$CustomerEMail= $savedorder->customer['email_address'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$CustomerEMail='';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (($savedorder->customer['telephone']) && (strlen($savedorder->customer['telephone']) >5)){\n\t\t\t\t\t\t$ContactNumber= substr($savedorder->customer['telephone'],20);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$ContactNumber= substr(dsf_lookup_mobile($savedorder->customer['id']),20);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// BILLING INFORMATION\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingSurname= substr($savedorder->customer['lastname'],0,200);\n\t\t\t\t\t\t$BillingFirstnames= substr($savedorder->customer['firstname'],0,200);\n\n\t\t\t\t\t\t if (isset($savedorder->customer['house']) && strlen($savedorder->customer['house']) > 0){\n\t\t\t\t\t\t \t $BillingAddress1 = $savedorder->customer['house'] . ', ';\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$BillingAddress1 = '';\n\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingAddress1 .= $savedorder->customer['street'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['district']) && strlen($savedorder->customer['district']) > 1){\n\t\t\t\t\t\t\t$BillingAddress2 = $savedorder->customer['district'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingCity = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['town']) && strlen($savedorder->customer['town']) > 1){\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['town'];\n\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['county'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\tif (strlen($BillingCity) < 1){\n\t\t\t\t\t\t\t$BillingCity = 'Not Supplied';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingPostCode= $savedorder->customer['postcode'];\n\n\n\t\t\t\t\t\tif ($savedorder->customer['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// DELIVERY INFO - if no delivery address has been supplied, then we need to populate the variables\n\t\t\t\t\t\t// with the same values as billing.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->delivery['postcode']) && strlen($savedorder->delivery['postcode'])>4){ // delivery address exists\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// get customers name and split it into firstname, lastname\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (strpos($savedorder->delivery['name'],' ') > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t$splits = explode(' ', trim($savedorder->delivery['name']));\n\t\t\t\t\t\t\t\t\t\t\t\t// take into account that the customer could have put mr, mrs etc.. therefore use only the last two splits\n\t\t\t\t\t\t\t\t\t\t\t\t$total_splits = sizeof($splits);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($total_splits > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = $total_splits - 2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = $total_splits -1;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $splits[$first_split];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $splits[$second_split];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t// no breaks, ensure something is there\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t if (isset($savedorder->delivery['house']) && strlen($savedorder->delivery['house']) > 0){\n\t\t\t\t\t\t\t\t\t\t $DeliveryAddress1 = $savedorder->delivery['house'] . ', ';\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = '';\n\t\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryAddress1 .= $savedorder->delivery['street'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['district']) && strlen($savedorder->delivery['district']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $savedorder->delivery['district'];\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$DeliveryCity = '';\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\tif (isset($savedorder->delivery['town']) && strlen($savedorder->delivery['town']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['town'];\n\t\t\t\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['county'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\t\t\t\tif (strlen($DeliveryCity) < 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity = 'Not Supplied';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryPostCode= $savedorder->delivery['postcode'];\n\n\t\t\t\t\t\t\t\t\tif ($savedorder->delivery['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else { // we havent got a delivery address so we need to duplicate the billing information.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliverySurname = $BillingSurname;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryFirstnames = $BillingFirstnames;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = $BillingAddress1;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $BillingAddress2;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCity = $BillingCity;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryPostCode = $BillingPostCode;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = $BillingCountry;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\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 $pagerows = (sizeof($savedorder->products));\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $prod_basket = '';\n\t\t\t\t\t\t\t\t\t $tot_basket = '';\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=($pagerows+1); $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($savedorder->products[$i]['price']){ // there are records\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// products options code added 09-may-2006\n\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (sizeof($savedorder->products[$i]['attributes']) > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attributes_exist = '1';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \" (\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($j = 0, $k = sizeof($savedorder->products[$i]['attributes']); $j < $k; $j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $products_ordered_attributes .= ' '. $savedorder->products[$i]['attributes'][$j]['option'] . '-> ' . $savedorder->products[$i]['attributes'][$j]['value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes .= \" )\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// end of products options section.\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . str_replace(':', ' ', $savedorder->products[$i]['model'] . ' - ' . $savedorder->products[$i]['name'] . ' ' . $products_ordered_attributes); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $savedorder->products[$i]['qty']; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'] * $savedorder->products[$i]['qty'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\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\t\t\tfor ($i=0, $n=sizeof($savedorder->totals)+1; $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totalclass = $savedorder->totals[$i]['class'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($savedorder->totals[$i]['class']) > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$order_total[$totalclass] = array('title' => $savedorder->totals[$i]['title'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'text' => $savedorder->totals[$i]['text'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'value' => $savedorder->totals[$i]['value']\n\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\t\t\t\t\t\t}\n\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// discount if necessary\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_discount']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_discount']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':-' . $order_total['ot_discount']['value']; // line total\n\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\n\t\t\t\t\t\t\t\t\t // delivery charge (0.00 if necessary);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_shipping']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_shipping']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $order_total['ot_shipping']['value']; // line total\n\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 if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . 'Deposit Required'; // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $savedorder->info['deposit_value']; // line total\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\n\t\t\t\t\t\t\t\t// make new basket\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $basket = $pagerows . $prod_basket . $tot_basket;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// end of basket creation details.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t// register this order so we don't create an other one if this fails.\n\t\t\n\t\t\t$protx_order = $savedorder->info['id'];\n\t\t\tdsf_session_register('protx_order');\n \t\t\t\n\t\t\t// register the txCode created - we use this to allocate the payment to order\n\t\t\tdsf_session_register('VendorTxCode');\n\t\t\n\n\n// submit the information to SagePay\n\n\t\t\t\t\t// Set some variables\n\t\t\t\t\t$TargetURL = $PurchaseURL;\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t$VerifyServer = $Verify;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t\n\t\t\t\t\tif ($Description){\n\t\t\t\t\t\t$Description = substr($Description,0,100);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$Description = $DefaultDescription;\t\t\t\t\t\t\t\t// Specified in init-protx.php\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Create an array of values to send\n\t\t\t\t\t$required = array (\n\t\t\t\t\t\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t\t\t\t\t\t'TxType' => MODULE_PAYMENT_PROTXCC_TXTYPE,\t\t\t\t\t\t\t\t\t\t\t// Transaction type\n\t\t\t\t\t\t\t'Vendor' => MODULE_PAYMENT_PROTXCC_ID,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t\t\t\t\t\t'VendorTxCode' => $VendorTxCode,\t\t\t\t\t// Unique transaction code (generated by vendor)\n\t\t\t\t\t\t\t'Amount' => $Amount,\t\t\t\t\t\t\t\t\t\t\t// Value of order (supplied by vendor)\n\t\t\t\t\t\t\t'Currency' => $DefaultCurrency,\t\t\t\t\t\t\t\t\t// Currency of order (default specified in init-protx.php)\n\t\t\t\t\t\t\t'Description' => $Description,\t\t\t\t\t\t\t\t\t// Description of order \n\t\t\t\t\t\t\t 'BillingSurname' => $BillingSurname,\n\t\t\t\t\t\t\t 'BillingFirstnames' => $BillingFirstnames,\n\t\t\t\t\t\t\t 'BillingAddress1' => $BillingAddress1,\n\t\t\t\t\t\t\t 'BillingAddress2' => $BillingAddress2,\n\t\t\t\t\t\t\t 'BillingCity' => $BillingCity,\n\t\t\t\t\t\t\t 'BillingPostCode' => $BillingPostCode,\n\t\t\t\t\t\t\t 'BillingCountry' => $BillingCountry,\n\t\t\t\t\t\t\t 'DeliverySurname' => $DeliverySurname,\n\t\t\t\t\t\t\t 'DeliveryFirstnames' => $DeliveryFirstnames,\n\t\t\t\t\t\t\t 'DeliveryAddress1' => $DeliveryAddress1,\n\t\t\t\t\t\t\t 'DeliveryAddress2' => $DeliveryAddress2,\n\t\t\t\t\t\t\t 'DeliveryCity' => $DeliveryCity,\n\t\t\t\t\t\t\t 'DeliveryPostCode' => $DeliveryPostCode,\n\t\t\t\t\t\t\t 'DeliveryCountry' => $DeliveryCountry\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\n\t\t\t\t\t\n\t\t\t\t\t// add optional fields to the data array only if they've been set\n\t\t\t\t\t\n\t\t\t\t\t$optional_fields = array('ContactNumber' => $ContactNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'ContactFax' => $ContactFax,\n\t\t\t\t\t\t\t\t\t\t\t 'CustomerEMail' => $CustomerEMail,\n\t\t\t\t\t\t\t\t\t\t\t 'GiftAidPayment' => $GiftAidPayment,\n\t\t\t\t\t\t\t\t\t\t\t 'ApplyAVSCV2' => $ApplyAVSCV2,\n\t\t\t\t\t\t\t\t\t\t\t 'CAVV' => $CAVV,\n\t\t\t\t\t\t\t\t\t\t\t 'XID' => $XID,\n\t\t\t\t\t\t\t\t\t\t\t 'ECI' => $ECI,\n\t\t\t\t\t\t\t\t\t\t\t '3DSecureStatus' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'Basket' => $Basket,\n\t\t\t\t\t\t\t\t\t\t\t 'ClientNumber' => $ClientNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'IssueNumber' => $cc_issue_number,\n\t\t\t\t\t\t\t\t\t\t\t 'CV2' => $cc_ccv_number\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t// add the optional fields to the required array only if there are values set.\n\t\t\t\t\t$data = addOptionalFields( $optional_fields, $required, array ( \n\t\t\t\t\t 'ContactNumber',\n\t\t\t\t\t 'ContactFax',\n\t\t\t\t\t 'CustomerEMail',\n\t\t\t\t\t 'GiftAidPayment',\n\t\t\t\t\t 'ApplyAVSCV2',\n\t\t\t\t\t 'ClientIPAddress',\n\t\t\t\t\t 'CAVV',\n\t\t\t\t\t 'XID',\n\t\t\t\t\t 'ECI',\n\t\t\t\t\t '3DSecureStatus',\n\t\t\t\t\t 'Basket',\n\t\t\t\t\t 'ClientNumber', \n\t\t\t\t\t 'IssueNumber', \n\t\t\t\t\t 'CV2', \n\t\t\t\t\t) );\n\t\t\t\t\t\n\t\t\t\t\t$data['CardHolder'] =\t$cc_owner;\n\t\t\t\t\t$data['CardNumber'] = \t$cc_number;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Check if start date is supplied\n\t\t\t\t\tif($cc_start_month){\n\t\t\t\t\t\t// If so, add start date to data array to be appended to POST\n\t\t\t\t\t\t$data['StartDate'] = $cc_start_month . $cc_start_year;\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t// Add expiry date\n\t\t\t\t\t$data['ExpiryDate'] = $cc_expires_month . $cc_expires_year;\n\t\t\t\t\t\n\t\t\t\t\t// Add card type\n\t\t\t\t\t$data['CardType'] = $cc_ctype;\n\n\n\t\t\t\t\t$ipnum = dsf_get_ip_address();\n\n\t\t\t\t\t\t$data['Apply3DSecure'] = '0';\n\t\t\t\t\t\n\t\t\t\t\t$posted_data = $data;\n\t\t\t\t\t\n\t\t\t\t\t$data = formatData($data);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sage_response = requestPost($TargetURL, $data);\t\n\n\n\n\t\t\t\t\t// (1) add 1 to attempts counter\n\t\t\t\t\t\n\t\t\t\t\t\t$protx_attempts ++;\n\t\t\t\t\t\tdsf_session_unregister('protx_attempts');\n\t\t\t\t\t\tdsf_session_register('protx_attempts');\n\n\n\n\n\n\t// return the response back to the calling script.\n\t\treturn $sage_response;\n\t\t\n\n\n}", "public function deliveryPriceDhaka()\n {\n }", "public function normalAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function createFulfillmentRequestToDr($lineItems, $order) {\n $items = [];\n $request = [];\n $status = 'Completed';\n $responseCode = 'Success'; \n \n try {\n if ($order->getDrOrderId()) {\n $storeCode = $order->getStore()->getCode();\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n\n if(!$drModel->getId() || $drModel->getPostStatus() == 1) {\n return;\n } // end: if\n \n foreach ($lineItems as $itemId => $item) {\n $items['item'][] = [\n \"requisitionID\" => $item['requisitionID'],\n \"noticeExternalReferenceID\" => $item['noticeExternalReferenceID'],\n \"lineItemID\" => $itemId,\n\t\t\t\t\t\t\"magentoLineItemID\" => $item['magentoLineItemID'],\n \"fulfillmentCompanyID\" => $this->getCompanyId($storeCode),\n \"electronicFulfillmentNoticeItems\" => [\n \"item\" => [\n [\n \"status\" => $status,\n \"reasonCode\" => $responseCode,\n \"quantity\" => $item['quantity'],\n \"electronicContentType\" => \"EntitlementDetail\",\n \"electronicContent\" => \"magentoEventID\"\n ]\n ]\n ]\n ];\n } // end: foreach\n\n $request['ElectronicFulfillmentNoticeArray'] = $items;\n\n $this->curl->setOption(CURLOPT_RETURNTRANSFER, true);\n $this->curl->setOption(CURLOPT_TIMEOUT, 40);\n $this->curl->addHeader(\"Content-Type\", \"application/json\");\n $this->curl->post($this->getDrPostUrl($storeCode), $this->jsonHelper->jsonEncode($request));\n $result = $this->curl->getBody();\n $statusCode = $this->curl->getStatus();\n\n // Status Update: Exsisting code used according to review changes\n if ($statusCode == '200') {\n // Post Status updated only if entire order items are fulfilled\n if($this->getPendingFulfillment($order)) {\n // if all the quantites are satisfied then mark as 1\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n $drModel->setPostStatus(1);\n $drModel->save();\n } // end: if\n $comment = 'Magento & DR order status are matched';\n } else {\n $comment = 'Magento & DR order status are mis-matched';\n } // end: if\n\n $order->addStatusToHistory($order->getStatus(), __($comment));\n\n $this->_logger->info('createFulfillmentRequestToDr Request : '.json_encode($request));\n $this->_logger->info('createFulfillmentRequestToDr Response : '.json_encode($result)); \n } else {\n $this->_logger->error('Error createFulfillmentRequestToDr : Empty DR Order Id');\n } // end: if\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $le) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '.json_encode($le->getRawMessage()));\n } catch (\\Exception $ex) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '. $ex->getMessage());\n } // end: try \n \n return $result;\n }", "function deliver($code)\n{ \n\n\techo \"// http://license.mxgraph.com/hosted \\n\";\n\techo $code;\n}", "function _getDmstcQuote($pkg, $method = '') {\r\n\t\tglobal $order;\r\n\t\tif (tep_not_null($method) && in_array($method, $this->dmstc_available)) {\r\n\t\t\t$request_types = array($method);\r\n\t\t} else {\r\n\t\t\t$request_types = $this->dmstc_available;\r\n\t\t}\r\n\t\t$shipping_weight = ($pkg['item_weight'] < 0.0625 ? 0.0625 : $pkg['item_weight']);\r\n\t\t$shipping_pounds = floor($shipping_weight);\r\n\t\t$shipping_ounces = ceil((16 * ($shipping_weight - $shipping_pounds)) * 100) / 100; // rounded to two decimal digits\r\n\t\t$ounces = $shipping_weight * 16.0;\r\n\t\t$pkgvalue = $pkg['item_price'];\r\n\t\tif ($pkgvalue > MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX) $pkgvalue = MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX;\r\n\t\tif ($pkgvalue <= 0) $pkgvalue = 0.01;\r\n\t\t$nonuspsinsurancecost = 0;\r\n\t\tif (MODULE_SHIPPING_USPS_NON_USPS_INSURE == 'True') {\r\n\t\t\tif ($pkg['item_price'] <= 50) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS1;\r\n\t\t\t} else if ($pkg['item_price'] <= 100) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS2;\r\n\t\t\t}\telse if ($pkg['item_price'] <= 200) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS3;\r\n\t\t\t} else if ($pkg['item_price'] <= 300) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4;\r\n\t\t\t} else {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4 + ((ceil($pkg['item_price']/100) - 3) * MODULE_SHIPPING_USPS_INS5);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sservs = array(); // any special services to request\r\n\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $sservs = array(1, 11); //request insurance, both regular & express mail\r\n\t\tif ((MODULE_SHIPPING_USPS_DMST_SIG_CONF == 'True') && ($order->info['subtotal'] >= MODULE_SHIPPING_USPS_SIG_THRESH)) {\r\n\t\t\t$sservs[] = 15;\r\n\t\t} elseif (MODULE_SHIPPING_USPS_DMST_DEL_CONF == 'True') {\r\n\t\t\t$sservs[] = 13;\r\n\t\t}\r\n\t\t$sservice = '';\r\n\t\tif (!empty($sservs)) {\r\n\t\t\tforeach ($sservs as $id) $sservice .= '<SpecialService>' . $id . '</SpecialService>';\r\n\t\t\t$sservice = '<SpecialServices>' . $sservice . '</SpecialServices>';\r\n\t\t}\r\n\t\t$box = array($pkg['item_length'], $pkg['item_width'], $pkg['item_height']);\r\n\t\trsort($box); // put package size in large to small order for purposes of checking dimensions\r\n\t\tlist($length, $width, $height) = $box;\r\n\t\t$id = 0;\r\n\t\t$quotes = $request_group = array();\r\n\t\t$group_count = 1;\r\n\t\t$type_count = 0;\r\n\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\tforeach ($request_types as $service) { // break the requested shipping methods into groups\r\n\t\t\tif (strpos($service, 'First') !== false) { // if first class mail service check if will fit type\r\n\t\t\t\t$fcmt = $this->first_class_to_mail_type[$service];\r\n\t\t\t\tif (($fcmt == 'LETTER') && (($length > $this->first_class_letter['length']) || ($width > $this->first_class_letter['width']) || ($height > $this->first_class_letter['height']) || ($ounces > $this->first_class_letter['ounces']))) continue; // don't check letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'FLAT') && (($length > $this->first_class_large_letter['length']) || ($width > $this->first_class_large_letter['width']) || ($height > $this->first_class_large_letter['height']) || ($ounces > $this->first_class_large_letter['ounces']))) continue; // don't check large letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'POSTCARD') && (($length > 6) || ($width > 4.25) || ($height > 0.016) || ($ounces > 3.5))) continue; // don't check postcard type if package doesn't fit\r\n\t\t\t\tif ($ounces > $this->first_class_parcel_max_ounces) continue; // don't check First Class if too heavy\r\n\t\t\t}\r\n\t\t\t$cont = $this->type_to_container[$service]; // begin checking for packages larger than USPS containers\r\n\t\t\t// if this service type specifies a container and this package won't fit then skip this service\r\n\t\t\tif (strpos($cont, 'Envelope') !== false) { // if service container is envelope\r\n\t\t\t\tif ($height > 1) continue; // anything thicker than one inch won't fit an envelope\r\n\t\t\t\tif ((strpos($cont, 'SM') !== false) && (($length > 10) || ($width > 6))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Window') !== false) && (($length > 10) || ($width > 5))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Gift') !== false) && (($length > 10) || ($width > 7))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Legal') !== false) && (($length > 15) || ($width > 9.5))) continue;\r\n\t\t\t\tif (($length > 12.5) || ($width > 9.5)) continue; // other envelopes\r\n\t\t\t}\r\n\t\t\tif (($cont == 'SM Flat Rate Box') && (($length > 8.625) || ($width > 5.375) || ($height > 1.625))) continue;\r\n\t\t\tif (($cont == 'MD Flat Rate Box') || ($cont == 'Flat Rate Box')) {\r\n\t\t\t\tif ($length > 13.625) continue; // too big for longest medium box\r\n\t\t\t\tif ($length > 11) { // check medium type 2 box\r\n\t\t\t\t\tif (($length > 13.625) || ($width > 11.875) || ($height > 3.375)) continue; // won't fit medium type 2 box\r\n\t\t\t\t} elseif (($length > 11) || ($width > 8.5) || ($height > 5.5)) continue; // won't fit either type medium box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'LG Flat Rate Box') && (($length > 12) || ($width > 12) || ($height > 5.5))) continue;\r\n\t\t\tif ($cont == 'Regional Rate Box A') {\r\n\t\t\t\tif ($length > 12.8125) continue; // too big for longest A box\r\n\t\t\t\tif ($length > 10) { // check A2 box\r\n\t\t\t\t\tif (($length > 12.8125) || ($width > 10.9375) || ($height > 2.375)) continue; // won't fit A2 box\r\n\t\t\t\t} elseif (($length > 10) || ($width > 7) || ($height > 4.75)) continue; // won't fit either type A box\r\n\t\t\t}\r\n\t\t\tif ($cont == 'Regional Rate Box B') {\r\n\t\t\t\tif ($length > 15.875) continue; // too big for longest B box\r\n\t\t\t\tif ($length > 12) { // check B2 box\r\n\t\t\t\t\tif (($length > 15.875) || ($width > 14.375) || ($height > 2.875)) continue; // won't fit B2 box\r\n\t\t\t\t} elseif (($length > 12) || ($width > 10.25) || ($height > 5)) continue; // won't fit either type B box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'Regional Rate Box C') && (($length > 14.75) || ($width > 11.75) || ($height > 11.5))) continue;\r\n\t\t\t// passed all size checks so build request\r\n\t\t\t$request = '<Package ID=\"'. $id . '\"><Service>' . $this->type_to_request[$service] . '</Service>';\r\n\t\t\tif (strpos($service, 'First') !== false) $request .= '<FirstClassMailType>' . $fcmt . '</FirstClassMailType>';\r\n\t\t\t$request .= '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .\r\n\t\t\t\t\t'<ZipDestination>' . $this->dest_zip . '</ZipDestination>' .\r\n\t\t\t\t\t'<Pounds>' . $shipping_pounds . '</Pounds>' .\r\n\t \t\t'<Ounces>' . $shipping_ounces . '</Ounces>';\r\n\t\t\tif ((strpos($cont, 'Rate') === false) && (max($length, $width, $height) > 12)) {\r\n\t\t\t\t$request .= '<Container>RECTANGULAR</Container><Size>LARGE</Size>' .\r\n\t\t\t\t\t\t'<Width>' . $width . '</Width>' .\r\n\t\t\t\t\t\t'<Length>' . $length . '</Length>'.\r\n\t\t\t\t\t\t'<Height>' . $height . '</Height>';\r\n\t\t\t} else {\r\n\t\t\t\t$request .= '<Container>' . $cont . '</Container><Size>REGULAR</Size>';\r\n\t\t\t}\r\n\t\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $request .= '<Value>' . number_format($pkgvalue, 2, '.', '') . '</Value>';\r\n\t\t\t$request .= $sservice;\r\n\t\t\tif ((strpos($service, 'First') !== false) || (strpos($service, 'Post') !== false)) $request .= '<Machinable>true</Machinable>';\r\n\t\t\t$request .= '</Package>';\r\n\t\t\t$id++;\r\n\t\t\t$type_count++;\r\n\t\t\tif (($type_count > 25) || (($urllength + strlen(urlencode($request))) > 2000)) { // only 25 services allowed per request or 2000 characters per url\r\n\t\t\t\t$group_count++;\r\n\t\t\t\t$type_count = 1;\r\n\t\t\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\t\t}\r\n\t\t\t$urllength += strlen(urlencode($request));\r\n\t\t\t$request_group[$group_count][$type_count] = $request;\r\n\t\t} // end foreach request type as service\r\n\t\tif (empty($request_group)) return array('error' => MODULE_SHIPPING_USPS_ERROR_NO_SERVICES);\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES .'http_client.php');\r\n\t\t} //print_r($request_group);\r\n\t\tforeach ($request_group as $service_group) {\r\n\t\t\t$request = '<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision>';\r\n\t\t\tforeach ($service_group as $service_request) {\r\n\t\t\t\t$request .= $service_request;\r\n\t\t\t}\r\n\t\t\t$request .= '</RateV4Request>';\r\n\t\t\t$request = \t'API=RateV4&XML=' . urlencode($request);\r\n\t\t\t$body = '';\r\n\t\t\t$http = new httpClient();\r\n\t\t\tif ($http->Connect('production.shippingapis.com', 80)) {\r\n\t\t\t\t$http->addHeader('Host', 'production.shippingapis.com');\r\n\t\t\t\t$http->addHeader('User-Agent', 'IntenseCart');\r\n\t\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\t\tif ($http->Get('/shippingAPI.dll?' . $request)) $body = $http->getBody();\r\n\t\t\t\t$http->Disconnect();\r\n\t\t\t} else {\r\n\t\t\t\t$body = '<Error><Number></Number><Description>' . MODULE_SHIPPING_USPS_TEXT_CONNECTION_ERROR . '</Description></Error>';\r\n\t\t\t}\r\n\t\t\t$doc = XML_unserialize($body); //print_r($doc);\r\n\t\t\tif (isset($doc['Error'])) return array('error' => $doc['Error']['Number'] . ' ' . $doc['Error']['Description']);\r\n\t\t\tif (isset($doc['RateV4Response']['Package']['Postage'])) { // single mail service response\r\n\t\t\t\t$tmp = $this->_decode_domestic_response($doc['RateV4Response']['Package']['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t} elseif (isset($doc['RateV4Response']['Package'][0])) { // multiple mailing services returned\r\n\t\t\t\tforeach ($doc['RateV4Response']['Package'] as $mailsvc) {\r\n\t\t\t\t\tif (isset($mailsvc['Postage'])) {\r\n\t\t\t\t\t\t$tmp = $this->_decode_domestic_response($mailsvc['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end foreach $request_group\r\n\t\treturn $quotes;\r\n\t}", "protected function _drcRequest($service)\r\n\t{\r\t\t$db = Mage::getSingleton('core/resource')->getConnection('core_write');\r\t\t\r\n\t\t$origCountry = Mage::getStoreConfig('shipping/origin/country_id', $this->getStore());\r\n\t\tif ($origCountry != \"AU\") \r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\r\r\n\t\t// TODO: Add some more validations\r\t\t$path_smartsend = \"carriers/smartsend/\";\r\t\t\r\n\t\t//$frompcode = Mage::getStoreConfig('shipping/origin/postcode', $this->getStore());\r\n\t\t//$fromsuburb = Mage::getStoreConfig('shipping/origin/city', $this->getStore());\r\t\t\r\t\t$frompcode = Mage::getStoreConfig($path_smartsend.'post_code', $this->getStore());\r\t\t$fromsuburb = Mage::getStoreConfig($path_smartsend.'suburban', $this->getStore());\r\t\t\r\n\t\t$topcode = $service->getDestPostcode();\r\n\t\t$tosuburb = $service->getDestCity();\r\r\t\tMage::Log($frompcode);\r\t\tMage::Log($fromsuburb);\r\t\t\r\n\t\tif ($service->getDestCountryId()) {\r\n\t\t\t$destCountry = $service->getDestCountryId();\r\n\t\t} \r\r\n\t\telse{\r\n\t\t\t$destCountry = \"AU\";\r\n\t\t}\t\t\r\t\r\n\t\t// Here we get the weight (and convert it to grams) and set some\r\n\t\t// sensible defaults for other shipping parameters.\t\r\r\n\t\t$weight = (int)$service->getPackageWeight();\r\t\t\r\t\t$height = $width = $length = 100;\r\n\t\t$shipping_num_boxes = 1;\r\n\t\t$Description = \"CARTON\";\r\n\t\t$post_url = \"http://api.smartsend.com.au/\"; \r\r\t\r\n \r\t//$result = $db->query(\"SELECT depth,length,height,description,taillift FROM 'smartsend_products'\");\r\t\r\t\r\n $post_param_values[\"METHOD\"] = \"GetQuote\";\r\n $post_param_values[\"FROMCOUNTRYCODE\"] = $origCountry;\r\n $post_param_values[\"FROMPOSTCODE\"] = $frompcode; //\"2000\";\r\n $post_param_values[\"FROMSUBURB\"] = $fromsuburb; //\"SYDNEY\";\r\n $post_param_values[\"TOCOUNTRYCODE\"] = $destCountry;\r\n $post_param_values[\"TOPOSTCODE\"] = $topcode;\r\n $post_param_values[\"TOSUBURB\"] = $tosuburb;\r\r\n\r\t\r\n # tail lift - init \r\n $taillift = array();\r\n $key = 0;\r\r\n\t$freeBoxes = 0;\r\n if ($service->getAllItems()) {\r\n foreach ($service->getAllItems() as $item) {\r\r\n\t/* fetching the values of lenght,weight,height,description in smartsend_products table */\r\t\t\t\t$prod_id = $item->getProduct()->getId();\r\t\t\t\t\r\t\t\t\t\r\n if ($item->getProduct()->isVirtual() || $item->getParentItem()) {\r\r\n continue;\r\r\n }\r\r\n\r\r\n if ($item->getHasChildren() && $item->isShipSeparately()) {\r\r\n foreach ($item->getChildren() as $child) {\r\r\n if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {\r\r\n $freeBoxes += $item->getQty() * $child->getQty();\r\r\n }\r\r\n }\r\r\n } elseif ($item->getFreeShipping()) {\r\r\n $freeBoxes += $item->getQty();\r\r\n }\r\t\t\t\t\r\t\t\t\t$prod_id \t= $item->getProduct()->getId();\r\t\t\t\t$result \t= $db->query('Select * from `smartsend_products` where id='.\"'\".$prod_id.\"'\");\r\t\t\t\t$rows \t\t= $result->fetch(PDO::FETCH_ASSOC);\r\t\t\t\t\r\t\t\t\t\r\t\t\t\tif($rows){\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = $rows['height'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = $rows['length'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = $rows['depth'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $rows['description'];\r\t\t\t\t}else{\r\t\t\t\t\t/* default values */\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = 'none';\t\t\t\t\r\t\t\t\t}\r\r # tail lift - assigns value\r switch($rows['taillift']){\r case 'none':\r $taillift[] = \"none\";break;\r case 'atpickup':\r $taillift[] = \"atpickup\";break; \r case 'atdestination':\r $taillift[] = \"atdestination\";break; \r case 'both':\r $taillift[] = \"both\";break; \r }\r\t\t\t\t\t\r\t\t\t\t$key++;\r\n }\r\r\n }\r\t\t\r\t\t\r\r\n $this->setFreeBoxes($freeBoxes);\r\t\t\t\t\t\t\t\r/*\r\n $post_value_items[\"ITEM({$key})_HEIGHT\"] = $height;\r\n $post_value_items[\"ITEM({$key})_LENGTH\"] = $length;\r\n $post_value_items[\"ITEM({$key})_DEPTH\"] = $width;\r\n $post_value_items[\"ITEM({$key})_WEIGHT\"] = $width;\r\n $post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $Description;\r*/\r \r \t\t\r\r\n # tail lift - choose appropriate value\r\r\n $post_param_values[\"TAILLIFT\"] = \"none\"; \r\r\n if (in_array(\"none\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"none\"; \r\n if (in_array(\"atpickup\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atpickup\";\r\n if (in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atdestination\";\r\n if (in_array(\"atpickup\", $taillift) && in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\";\r\n if (in_array(\"both\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\"; \r\r\n \r\r\n $post_final_values = array_merge($post_param_values,$post_value_items);\r\r\n # POST PARAMETER AND ITEMS VALUE URLENCODE\r\r\n $post_string = \"\";\r\r\n foreach( $post_final_values as $key => $value )\r\n { $post_string .= \"$key=\" . urlencode( $value ) . \"&\"; }\r\n $post_string = rtrim( $post_string, \"& \" );\r\r\n\tif ($service->getFreeShipping() === true || $service->getPackageQty() == $this->getFreeBoxes()) {\r $shippingPrice = '0.00';\r\t\t\t\t\r\r\n $arr_resp['ACK'] = 'Success';\r $arr_resp['QUOTE(0)_TOTAL'] = $shippingPrice;\r $arr_resp['QUOTE(0)_ESTIMATEDTRANSITTIME'] = 'Fixed';\r $arr_resp['QUOTECOUNT'] = 1;\r\r\n }else{\r\r\n \r\r\n # START CURL PROCESS\r\r\n $request = curl_init($post_url); \r\tcurl_setopt($request, CURLOPT_HEADER, 0); \r\tcurl_setopt($request, CURLOPT_RETURNTRANSFER, 1); \r\n curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);\r\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n $post_response = curl_exec($request); \r\n curl_close ($request); // close curl object \r\r\n\t# parse output\r\n parse_str($post_response, $arr_resp);\r\r\n\t}\r\r\n\treturn $arr_resp;\r\r\n\t}", "function get_item_code()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n\t\t\t$invoiceNumber = $_POST['inv'];\n\t\t\t$batch = $_POST['batch'];\n\t\t\t$tableName = \"london_stock\";\n\t\t\t$condition = array(\n\t\t\t\t'invoice_number' => $invoiceNumber,\n\t\t\t\t'invoice_date' => $batch\n\n\t\t\t);\n\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\tif ($result > 0) {\n\t\t\t\techo $response = json_encode($result, true);\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'No item', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "function general_enquiry_process($gen_post_data)\n\t{\n\t\t$villaName = $gen_post_data['hidVillaName'];\n\t\t$params['VillaID'] = $gen_post_data['villaID'];\n\t\t$params['CIDate'] = '1 January 1900';\n\t\t$params['CODate'] = '3 January 1900';\n\t\t$params['GuestFirstName'] = stripslashes($gen_post_data['txtFirstname']);\n\t\t$params['GuestLastName'] = stripslashes($gen_post_data['txtLastName']);\n\t\t$params['CountryOfResidence'] = $gen_post_data['selCountry'];\n\t\t$params['Email'] = $gen_post_data['txtEmail'];\n\t\t$params['TelNo'] = $gen_post_data['txtPhoneAreaCode'].$gen_post_data['txtPhoneNumber'];\n\t\t$params['TotalAdults'] = '1';\n\t\t$params['BookingSourceID'] = \"11\";\n\t\t$params['MobileNo'] = '';\n\t\t$params['BedRooms'] = '1';\n\t\t$params['SpecialRequest'] = stripslashes('Subject:'.strip_tags($gen_post_data['messageSubject']).', Message: '.$gen_post_data['txtMessage']);\n\t\t$params['SuggestOtherVilla'] = 'N';\n\t\t$params['TotalChildren'] = 0;\n\t\t$params['TotalInfants'] = 0;\n\t\t$params['RURL'] = urlencode($gen_post_data['hfrurl']);\n\t\t$params['IsGenInquiry'] = 'Y';\n\t\t$params['CIPAddress'] = $gen_post_data['hid_cip'];\n\t\t$params['IsEvent'] = 'Y';\n\t\t$params['AreDatesFlexible'] = 'N';\n\t\t$params['OptInMailList'] = 'Y';\n\t\t$params['LCID'] = 'en';\n\t\t\t\n\t\t$timeTokenHash = $this->cheeze_curls('Security_GetTimeToken', \"\", TRUE, FALSE,\"\",\"\",\"prod\");\n\t\tif (!is_array($timeTokenHash))\n\t\t\t$timeTokenHash = html_entity_decode($timeTokenHash);\n\t\n\t\t$params['p_ToHash'] = 'villaprtl|Xr4g2RmU|'.$timeTokenHash[0];\n\t\t$hashString = $this->prepare_Security_GetMD5Hash($params);\n\t\t$md5Hash = $this->cheeze_curls('Security_GetMD5Hash', $hashString, TRUE, FALSE,\"\",\"\",\"prod\");\n\t\t$p_Params = json_encode($params);\n\t\t$p_UserID = 'villaprtl';\n\t\t$p_Token = $md5Hash[0];\n\t\t$request = 'p_Token='.$p_Token.'&p_UserID='.$p_UserID.'&p_Params='.$p_Params;\n\t\t$newBooking = $this->cheeze_curls('insertInquiry',$request,TRUE,FALSE,\"\",\"\",\"prod\");\n\t\t$newBooking['thank_you_message'] = '<p>Your Reservation Enquiry Form has been successfully sent for '.$villaName.'.</p>\n\t\t\t<p>The Elite Havens Group, luxury villa rentals, manage all the reservations for '.$villaName.'. One of our villa specialists will be in touch shortly.</p>\n\t\t\t<p>Your Reference I.D. is <strong>'.$newBooking['Transactions']['InquiryID'].'</strong></p>\n\t\t\t<p>The Elite Havens Group presents a stunning portfolio of luxury private villas throughout Bali and Lombok in Indonesia, Thailand, Sri Lanka and Maldives. Staffed to the highest quality, each villa offers a blissfully relaxing and highly individual experience. Ranging in size from one to nine bedrooms and boasting private pools, luxurious living spaces, equipped kitchens (with chef) and tropical gardens, our villas are situated in the heart of the action, beside blissful beaches, upon jungle-clad hillsides and amongst idyllic rural landscapes ensuring the perfect holiday experience for all.</p>';\n\t\treturn $newBooking;\n\t\t\n\t}", "function checkdelivery($package) {\n\n\t$item = $package['item'];\t\n\t$quantity = $package['quantity'];\t\n\t$to = $package['to'];\t\n\t$from = $package['from'];\t\n\n// Based on the location of the delivery address and \n// the warehouse the courier can decide if they can \n// make the delivery. If yes, they could then let the \n// warehouse know the cost and delivery date.\n\n\t$accepted = 1;\n\n\tif ( $accepted )\n\t{\n\t\t$cost = 10;\n\t\t$date = '12-05-2004';\n\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => $cost,\n\t\t\t\t\t'date' => $date\n\t\t\t\t\t);\n\t} else {\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => 0,\n\t\t\t\t\t'date' => 'null'\n\t\t\t\t\t);\n\t}\n\n return new soapval('return', 'DeliveryDetail', $output, false, 'urn:MyURN');\n}", "public function getPrepareOutgoingConsignmentRequest()\n {\n $request = new PrepareOutgoingConsignmentRequest();\n $request->localTransactionId = $this->localTransactionId;\n $request->initiator = $this->initiator;\n\n $enterprise = mercDicconst::getSetting('enterprise_guid');\n $hc = mercDicconst::getSetting('issuer_id');\n\n $delivery = new Delivery();\n $delivery->consignor = new BusinessMember();\n $delivery->consignor->enterprise = new Enterprise();\n $delivery->consignor->enterprise->guid = $enterprise;\n $delivery->consignor->businessEntity = new BusinessEntity();\n $delivery->consignor->businessEntity->guid = $hc;\n\n $delivery->consignee = new BusinessMember();\n $delivery->consignee->enterprise = new Enterprise();\n $delivery->consignee->enterprise->guid = $this->step3['recipient'];\n $delivery->consignee->businessEntity = new BusinessEntity();\n $delivery->consignee->businessEntity->guid = $this->step3['hc'];\n\n $consigments = [];\n $vetCertificates = [];\n\n if(isset($this->conditions)) {\n $this->conditions = json_decode($this->conditions, true);\n }\n\n foreach ($this->step1 as $id => $product) {\n $consigment = new Consignment();\n $consigment->id = 'con'.$id;\n $stock = MercStockEntry::findOne(['id' => $id]);\n $stock_raw = unserialize($stock->raw_data);\n if($stock->product_name != $product['product_name'])\n {\n\n }\n $consigment->volume = $product['select_amount'];\n $consigment->unit = new Unit();\n $consigment->unit = $stock_raw->batch->unit;\n\n $consigment->sourceStockEntry = new StockEntry();\n //$consigment->sourceStockEntry->uuid = $stock->uuid;\n $consigment->sourceStockEntry->guid = $stock->guid;\n\n $consigments[] = $consigment;\n\n $vetCertificate = new VetDocument();\n $vetCertificate->for = 'con'.$id;\n $authentication['purpose']['guid'] = $this->step2['purpose'];\n $authentication['cargoExpertized'] = $this->step2['cargoExpertized'];\n $authentication['locationProsperity'] = $this->step2['locationProsperity'];\n\n //Заполняем условия регионализации при необходимости\n //var_dump($this->conditions); die();\n if(isset($this->conditions[$product['product_name']])) {\n $conditions = null;\n $buff = $this->conditions[$product['product_name']];\n foreach ($buff as $key=>$item) {\n $r13nClause = new RegionalizationClause();\n $r13nClause->condition = new RegionalizationCondition();\n $r13nClause->condition->guid = $key;\n $conditions[] = $r13nClause;\n }\n $authentication['r13nClause'] = $conditions;\n }\n $vetCertificate->authentication = $authentication;\n $vetCertificates[] = $vetCertificate;\n }\n\n $delivery->consignment = $consigments;\n\n $delivery->transportInfo = new TransportInfo();\n $delivery->transportInfo->transportType = $this->step4['type'];\n $delivery->transportInfo->transportNumber = new TransportNumber();\n $delivery->transportInfo->transportNumber->vehicleNumber = $this->step4['car_number'];\n if (isset($this->step4['trailer_number'])) {\n $delivery->transportInfo->transportNumber->trailerNumber = $this->step4['trailer_number'];\n }\n if (isset($this->step4['container_number'])) {\n $delivery->transportInfo->transportNumber->containerNumber = $this->step4['container_number'];\n }\n $delivery->transportStorageType = $this->step4['storage_type'];\n\n $delivery->accompanyingForms = new ConsignmentDocumentList();\n if($this->step3['isTTN']) {\n $delivery->accompanyingForms->waybill = new Waybill();\n $delivery->accompanyingForms->waybill->issueSeries = $this->step3['seriesTTN'];\n $delivery->accompanyingForms->waybill->issueNumber = $this->step3['numberTTN'];\n $delivery->accompanyingForms->waybill->issueDate = date('Y-m-d', strtotime($this->step3['dateTTN']));\n $delivery->accompanyingForms->waybill->type = $this->step3['typeTTN'];\n }\n\n $delivery->accompanyingForms->vetCertificate = $vetCertificates;\n\n $request->delivery = $delivery;\n\n /* echo \"<pre>\";\n var_dump($request); die();*/\n return $request;\n }", "public function execute()\n {\n /** @var \\Magento\\Framework\\Controller\\Result\\Json $result */\n $result = $this->resultJsonFactory->create();\n\n $productId = $this->getRequest()->getParam('productId');\n $qty = $this->getRequest()->getParam('qty');\n\n\n if (!$productId) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product ID is required'),\n ]);\n }\n\n\n // check product is in stock\n /** @var \\Magento\\Catalog\\Model\\Product $product */\n $product = $this->productFactory->create();\n $product->load($productId);\n if (!$product->getId()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product not found'),\n ]);\n }\n if (!$product->isAvailable()) {\n // TODO: product placeholders\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n if ($product->isVirtual()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Virtual products cannot be shipped'),\n ]);\n }\n\n $messages = \"\";\n if ($this->getProductSalableQty && $this->isProductSalable) {\n if ($this->helper->getInventoryStock() != null) {\n if($product->getTypeId() == 'simple') {\n $qtyInStock = $this->getProductSalableQty->execute($product->getSku(), $this->helper->getInventoryStock());\n if ($qty > $qtyInStock) {\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n } else {\n $messages = \"stock = \" . $this->helper->getInventoryStock() . \" \" . $product->getSku() . \" \" . $qty . \" in stock \" . $qtyInStock . \" \" . $product->getTypeId();\n }\n }else{\n if($this->isProductSalable->execute($product->getSku(), $this->helper->getInventoryStock())){\n $messages = \"product is saleable\";\n }else{\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n }\n } else {\n $messages = \"inventory stock null\";\n }\n } else {\n $messages = __(\"MSI not supported: \") . $product->getSku() . \" \" . $product->getTypeId();\n //probably just means MSI not supported here.\n }\n\n\n $transport = new DataObject([\n 'available' => true,\n ]);\n $this->eventManager->dispatch('porterbuddy_availability', array(\n 'product' => $product,\n 'qty' => $qty,\n 'result' => $transport,\n ));\n\n if ($transport->getError()) {\n return $result->setData([\n 'error' => true,\n 'messages' => $transport->getMessage() ?: $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n\n return $result->setData([\n 'error' => false,\n 'available' => true,\n 'messages' => $messages\n ]);\n }", "function main( $isFuturePay ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : handling WorldPay payment response IPN\");\r\n\r\n $objects = $ids = $input = array( );\r\n\r\n $component = self::retrieve('MC_module','String','POST',true);\r\n $input[\"component\"] = $component;\r\n $contact = self::retrieve('MC_contact_id','Integer','POST',true);\r\n\r\n $this->getInput($input,$ids);\r\n\r\n if (!$isFuturePay) {\r\n // not a future payment notication but may be a future payment\r\n // agreement being made...\r\n\r\n // get ids\r\n $ids[\"contact\"] = self::retrieve('MC_contact_id','String','POST',true);\r\n $ids[\"contribution\"] = self::retrieve('MC_contribution_id','String','POST',true);\r\n $ids[\"thankyoupage\"] = self::retrieve('MC_civi_thankyou_url','String','POST',true);\r\n $ids[\"cancelpage\"] = self::retrieve('MC_civi_cancel_url','String','POST',true);\r\n if ($component=='event') {\r\n $ids[\"event\"] = self::retrieve('MC_event_id','String','POST',true);\r\n $ids[\"participant\"] = self::retrieve('MC_participant_id','String','POST',true);\r\n }\r\n else {\r\n // contribution optional id's\r\n $ids['membership'] = self::retrieve('MC_membership_id','String','POST',false);\r\n $ids['contributionRecur'] = self::retrieve( 'MC_contribution_recur_id', 'Integer', 'GET', false );\r\n $ids['contributionPage'] = self::retrieve( 'MC_contribution_page_id' , 'Integer', 'GET', false );\r\n }\r\n\r\n if (is_numeric($input[\"futurePayId\"])) {\r\n // this is a futurepay agreement being made \r\n // so store the ids and do nothing more here\r\n // since no money has actually been transferred yet\r\n // ...watch futurepay repsonse for such transfers\r\n self::storeFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n return;\r\n }\r\n }\r\n else {\r\n if (!is_numeric($input[\"futurePayId\"])) {\r\n CRM_Core_Error::debug_log_message(\"futurePayId is missing for recurring payment.\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : futurePayId is missing for recurring payment. input=\".print_r($input,true));\r\n exit();\r\n }\r\n self::retrieveFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n if (!$ids) {\r\n CRM_Core_Error::debug_log_message(\"Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n exit();\r\n }\r\n }\r\n\r\n $paymentProcessorID = self::retrieve('processor_id', 'Integer', 'POST', FALSE);\r\n if (empty($paymentProcessorID)) {\r\n $processorParams = array(\r\n 'user_name' => self::retrieve('installation', 'String', 'POST', FALSE),\r\n 'payment_processor_type_id' => CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', 'WorldPay', 'id', 'name'),\r\n 'is_test' => empty($input['is_test']) ? 0 : 1,\r\n );\r\n\r\n $processorInfo = array();\r\n if (!CRM_Financial_BAO_PaymentProcessor::retrieve($processorParams, $processorInfo)) {\r\n return FALSE;\r\n }\r\n $paymentProcessorID = $processorInfo['id'];\r\n }\r\n\r\n // validateData also loads the obects\r\n if (!$this->validateData($input,$ids,$objects,TRUE,$paymentProcessorID)) {\r\n error_log(__FILE__.\":\".__LINE__.\": validate data failed, input=\".print_r($input,true).\" ids=\".print_r($ids,true));\r\n return false;\r\n }\r\n\r\n self::$_paymentProcessor =& $objects['paymentProcessor'];\r\n if ($isFuturePay) {\r\n // future pay payment notification\r\n return $this->handleFuturepayPayment($input,$ids,$objects);\r\n }\r\n else if (is_numeric($input[\"futurePayId\"])) {\r\n // future pay payment initial agreement set up\r\n // appears like a single payment but no money changes hands\r\n return $this->handleFuturepayAgreement($input,$ids,$objects);\r\n }\r\n else {\r\n // single payment\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : now processing single payment\");\r\n return $this->handleSinglePayment($input,$ids,$objects);\r\n }\r\n }", "public function process ()\n {\n /**\n * Sets pricing for which offer is applicable.\n */\n $this->setOfferApplicablePricing();\n\n /**\n * Checks if offer is valid.\n */\n if ( $this->isOfferValid() ) {\n\n /**\n * Sets benefits gained from offer.\n */\n $this->setBenefit();\n }\n\n return $this->request;\n }", "public function getProductCode()\n {\n if (array_key_exists(\"productCode\", $this->_propDict)) {\n return $this->_propDict[\"productCode\"];\n } else {\n return null;\n }\n }", "private function getProductInformation()\r\n {\r\n \r\n // if product is repairable get the repair agents details as well as products and suppliers\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" || \r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplierRepairAgent_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n // if the product is not repairable grab the product information and supplier information only\r\n else\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplier_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n }", "public function make3DPayPayment()\n {\n $status = 'declined';\n $response = 'Declined';\n $proc_return_code = $this->request->get('procreturncode');\n\n $transaction_security = 'MPI fallback';\n if (in_array($this->request->get('mdstatus'), [1, 2, 3, 4])) {\n if ($this->request->get('mdstatus') == '1') {\n $transaction_security = 'Full 3D Secure';\n } elseif (in_array($this->request->get('mdstatus'), [2, 3, 4])) {\n $transaction_security = 'Half 3D Secure';\n }\n\n $status = 'approved';\n $response = 'Approved';\n }\n\n $this->response = (object) [\n 'id' => (string) $this->request->get('authcode'),\n 'order_id' => (string) $this->request->get('oid'),\n 'trans_id' => (string) $this->request->get('transid'),\n 'auth_code' => (string) $this->request->get('authcode'),\n 'host_ref_num' => (string) $this->request->get('hostrefnum'),\n 'response' => $response,\n 'transaction_type' => $this->type,\n 'transaction' => $this->order->transaction,\n 'transaction_security' => $transaction_security,\n 'proc_return_code' => $proc_return_code,\n 'code' => $proc_return_code,\n 'md_status' => $this->request->get('mdStatus'),\n 'status' => $status,\n 'status_detail' => isset($this->codes[$this->request->get('ProcReturnCode')]) ? (string) $this->request->get('ProcReturnCode') : null,\n 'hash' => (string) $this->request->get('secure3dhash'),\n 'rand' => (string) $this->request->get('rnd'),\n 'hash_params' => (string) $this->request->get('hashparams'),\n 'hash_params_val' => (string) $this->request->get('hashparamsval'),\n 'masked_number' => (string) $this->request->get('MaskedPan'),\n 'amount' => (string) $this->request->get('amount'),\n 'currency' => (string) $this->request->get('currency'),\n 'tx_status' => (string) $this->request->get('txstatus'),\n 'eci' => (string) $this->request->get('eci'),\n 'cavv' => (string) $this->request->get('cavv'),\n 'xid' => (string) $this->request->get('xid'),\n 'error_code' => (string) $this->request->get('errcode'),\n 'error_message' => (string) $this->request->get('errmsg'),\n 'md_error_message' => (string) $this->request->get('mderrormessage'),\n 'campaign_url' => null,\n 'name' => (string) $this->request->get('firmaadi'),\n 'email' => (string) $this->request->get('Email'),\n 'extra' => $this->request->get('Extra'),\n 'all' => $this->request->all(),\n ];\n\n return $this;\n }", "protected function get_request(){\n\t\treturn \"value_cashflows\";\n\t}", "function dsf_protx_decline_order($order_number){\n\nglobal $VoidURL, $AbortURL, $Verify, $ProtocolVersion;\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please decline the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'invalid protx item';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please decline the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'more than one protx item found';\n\tbreak;\n }\n \t\n\n // we must have a valid transaction item if we are here.\n \n // we therefore need to check our logs to see if the item has been previously charged.\n \n $check_history_query = dsf_db_query(\"select orders_id, orders_status_id from \" . DS_DB_SHOP . \".orders_status_history where orders_id='\" . $order_number . \"' and orders_status_id='90006'\");\n \n if (dsf_db_num_rows($check_history_query)==0){\n \t$TargetURL = $AbortURL; // never charged.\n\t$TxType = 'ABORT';\n }else{\n \t$TargetURL = $VoidURL; // has been charged\n\t$TxType = 'VOID';\n }\n \n \n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$VerifyServer = $Verify;\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => $TxType,\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been voided / aborted witin protx.\n\n\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '50005');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '50005', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t\t\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases except failed\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn 'error';\n}", "private function dataCodeAction()\n {\n $code_action = array(\n 'ABO' => array('Abonnement', '1'),\n 'PROSP' => array('Prospection', '2'),\n 'PROSP1' => array('Prospection tracer 1', '2'),\n 'PROSP11' => array('Prospection tracer 11', '2'),\n 'PROSP12' => array('Prospection tracer 12', '2'),\n 'PROSP13' => array('Prospection tracer 13', '2'),\n 'PROSP2' => array('Prospection tracer 2', '2'),\n 'PROSP21' => array('Prospection tracer 21', '2'),\n 'PROSP22' => array('Prospection tracer 22', '2'),\n 'PROSP23' => array('Prospection tracer 23', '2'),\n 'PROSP24' => array('Prospection tracer 24', '2'),\n 'PROSP3' => array('Prospection tracer 3', '2'),\n 'PROSP5' => array('Prospection tracer 5', '2'),\n 'PROSP51' => array('Prospection tracer 51', '2'),\n 'PROSP52' => array('Prospection tracer 52', '2'),\n 'PROSP53' => array('Prospection tracer 53', '2'),\n 'PROSP ENTR' => array('Contact entrant sans fiche client', '2'),\n 'PROSP REL' => array('Prospection REL', '2'),\n 'PROSPWEB' => array('Prospection Web', '2'),\n 'FID' => array('FID', '20'),\n 'FID PROMO' => array('FID suite promo', '20'),\n 'FID PROG F' => array('FID programme fidélité', '20'),\n 'FID WEB PRGF' => array('FID web PRGF', '20'),\n 'FID WEB PROMO' => array('FID web PROMO', '20'),\n 'FID WEB PROM' => array('FID web PROMO', '20'),\n 'FID WEB' => array('FID web', '20'),\n 'PAR' => array('Parrainage', '27'),\n 'REACT+4M' => array('Reactivation fichier clients +4mois', '28'),\n 'REACT+4MPROMO' => array('Reactivation fichier clients +4mois suite à promo', '28'),\n 'REACT SPONT' => array('Reactivation client spontanée', '28'),\n 'REACT SPONT PROMO' => array('Reactivation client spontanée suite à promo', '28'),\n 'REACTSPONT' => array('Reactivation client AC formulaire', '28'),\n 'REACT AC FORM' => array('Reactivation client AC formulaire', '28'),\n 'REACTIV' => array('Reactivation REACTIV', '28'),\n 'CONT ENTR' => array('CONT ENTR', '35')\n );\n $data = array();\n $c = 1;\n foreach ($code_action as $key => $value) {\n $data[] = array(\n 'id_code_action' => (int)$c,\n 'name' => pSQL($key),\n 'description' => pSQL($value[0]),\n 'groupe' => (int)$value[1]\n );\n $c++;\n }\n\n return $data;\n }", "public function fixAction()\n {\n $mMainReq = Qss_Model_Db::Table('OYeuCauMuaSam');\n $mMainReq->where(sprintf('IFID_M412 = %1$d', $this->_form->i_IFID));\n $oMainReq = $mMainReq->fetchOne();\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n\n $this->html->main = $oMainReq;\n $this->html->sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n $this->load->model('esls_model');\n\n $formData = $this->input->post(NULL, TRUE);\n\n //DATA THAT COMES FROM PRODUCERS\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"delivery_ready\"){\n $this->process_delivery_ready_event($formData);\n }\n else if($name === \"bid_awarded\"){\n $this->process_bid_awarded_event($formData);\n }\n }", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "function buildHostRequest() {\r\n\t\t$strRequest = \"\";\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->amt ) > 0) {\r\n\t\t\t\t$strRequest .= \"amt=\" . $this->amt . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->action ) > 0) {\r\n\t\t\t\t$strRequest .= \"action=\" . $this->action . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->responseURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"responseURL=\" . $this->responseURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->errorURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"errorURL=\" . $this->errorURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->trackId ) > 0) {\r\n\t\t\t\t$strRequest .= \"trackid=\" . $this->trackId . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf1 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf1=\" . $this->udf1 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf2 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf2=\" . $this->udf2 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf3 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf3=\" . $this->udf3 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf4 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf4=\" . $this->udf4 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf5 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf5=\" . $this->udf5 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf6 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf6=\" . $this->udf6 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf7 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf7=\" . $this->udf7 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf8 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf8=\" . $this->udf8 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf9 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf9=\" . $this->udf9 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf10 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf10=\" . $this->udf10 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf11 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf11=\" . $this->udf11 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf12 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf12=\" . $this->udf12 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf13 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf13=\" . $this->udf13 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf14 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf14=\" . $this->udf14 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf15 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf15=\" . $this->udf15 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf16 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf16=\" . $this->udf16 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf17 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf17=\" . $this->udf17 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf18 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf18=\" . $this->udf18 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf19 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf19=\" . $this->udf19 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf20 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf20=\" . $this->udf20 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf21 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf21=\" . $this->udf21 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf22 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf22=\" . $this->udf22 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf23 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf23=\" . $this->udf23 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf24 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf24=\" . $this->udf24 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf25 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf25=\" . $this->udf25 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf26 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf26=\" . $this->udf26 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf27 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf27=\" . $this->udf27 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf28 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf28=\" . $this->udf28 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf29 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf29=\" . $this->udf29 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf30 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf30=\" . $this->udf30 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf31 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf31=\" . $this->udf31 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf32 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf32=\" . $this->udf32 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->currency ) > 0) {\r\n\t\t\t\t$strRequest .= \"currencycode=\" . $this->currency . \"&\";\r\n\t\t\t}\r\n\t\t\tif ($this->language != null && strlen ( $this->language ) > 0) {\r\n\t\t\t\t$strRequest .= \"langid=\" . $this->language . \"&\";\r\n\t\t\t}\r\n\t\t\treturn $strRequest;\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * finally{\r\n\t\t * $strRequest = null;\r\n\t\t * }\r\n\t\t */\r\n\t}", "public function getOcentureProductCode($freedomProductCode) {\r\n $products = [\r\n 'YSDPROTECHM1MO' => 'YP8383',\r\n 'YSDPROTECHM1YR' => 'YP83811',\r\n 'YSDPROIDM1MO' => 'YP8381',\r\n 'YSDPROIDM1YR' => 'YP8389',\r\n 'YSDPROIDF1MO' => 'YP8382',\r\n 'YSDPROIDF1YR' => 'YP83810',\r\n 'YSDPROIDMP1MO' => 'YP8387',\r\n 'YSDPROIDMP1YR' => 'YP83815',\r\n 'YSDPROIDFP1MO' => 'YP8388',\r\n 'YSDPROIDFP1YR' => 'YP83816',\r\n 'YSDPROROADM1MO' => 'YP8384',\r\n 'YSDPROROADM1YR' => 'YP83812',\r\n 'YSDPROBUNDLM1MO' => 'YP8385',\r\n 'YSDPROBUNDLM1YR' => 'YP83813',\r\n 'YSDPROBUNDLF1MO' => 'YP8386',\r\n 'YSDPROBUNDLF1YR' => 'YP83814',\r\n 'testproduct' => 'IG7985'\r\n ];\r\n\r\n if (isset($products[$freedomProductCode])) {\r\n return $products[$freedomProductCode];\r\n } else {\r\n die(\"no product found matching with ocenture\");\r\n }\r\n }", "public function designProfit(){\n\t\treturn $this->campaigns()\n\t\t\t->join('order_detail', 'product_campaign.id', 'order_detail.campaign_id')\n\t\t\t->join('order', 'order_detail.order_id', 'order.id')\n\t\t\t->join('order_status', 'order.id', 'order_status.order_id')\n\t\t\t->where('order_status.value', 4)\n\t\t\t->sum('product_quantity') * 25000;\n\t}", "abstract protected function getPaymentMethodCode();", "function getCartArr ($cartStr)\n{\n\t// 1 -> OK\n\t// 2 -> invalid item\n\tglobal $currency,$currfactor,$cartArr,$isAllowExpressDlvry;\n\t$returnVal = 1;\n\tif ($invSrv == \"\") { $invSrv = new Inventory(); }\n\n\t$factory = new Product_service_factory();\n\t$prod_serv = $factory->get_instance('SE', $currency);\n\n\tif(strlen($cartStr)==0) return 0;\n\telse\n\t{\n\t\t$strArr = explode(',', $cartStr);\n\n\t\t//$addedfreexmas=\"N\";\n\n\t\tforeach ($strArr as $thisStr)\n\t\t{\n\t\t\t$pg_source = 0;\n\t\t\tif (strlen($thisStr)!=0)\n\t\t\t{\n\t\t\t\tlist($thisPid, $thisQty,$thisPrice) = explode('-',$thisStr);\n\t\t\t\tif ($currency == 'usd')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity, IF(ISNULL(sp.mainid), 1, 0) pg_source\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\tSELECT mainid\n\t\t\t\t\t\t\tFROM supplierprodstb\n\t\t\t\t\t\t\tWHERE iscurrentUS = '1'\n\t\t\t\t\t\t\t) sp\n\t\t\t\t\t\t\tON productstb.prodid = sp.mainid\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\n\t\t\t\t$thisPid = prevention_numeric($thisPid, 1, $cartStr);\n\t\t\t\t$sql .= \"\n\t\t\t\t\t\tWHERE prodid='\" . $thisPid . \"'\n\t\t\t\t\t\tAND site='SE'\n\t\t\t\t\t\tAND active='1'\n\t\t\t\t\t\t$additional_where\n\t\t\t\t\t\t\";\n\t\t\t\t$get_price = mysql_query_escape($sql) or die(\"Error @\".__LINE__);\n\t\t\t\t//echo $isAllowExpressDlvry;\n\t\t\t\tif ($isAllowExpressDlvry)\n\t\t\t\t{\n\t\t\t\t\tif (!$invSrv->isStockAvail($thisPid, \"IM\")) {\n\t\t\t\t\t\t$isAllowExpressDlvry = false;\n\t\t\t\t\t\t//echo \"falsenow(\".$thisPid.\")<br>\";\n\t\t\t\t\t\t//echo \"2\";\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"now(\".$thisPid.\")<br>\";\n\t\t\t\t}\n\t\t\t\t//Tommy check pg_source;\n\t\t\t\tif ($currency == 'usd' || $currency == 'aud')\n\t\t\t\t{\n\t\t\t\t\t//$pg_source = mysql_result($get_price,0,'pg_source');\n\t\t\t\t\t$prod_info = $prod_serv->get_product_info($thisid);\n\n\t\t\t\t\t$pg_source = $prod_serv->is_pg_sourcing($prod_info);\n\t\t\t\t}\n\t\t\t\t// End of modification for CR090319-001\n\t\t\t\tif(mysql_num_rows($get_price)!=1 || $thisQty<1 || $pg_source)\n\t\t\t\t{\n\t\t\t\t\t$returnVal = 2;\n\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Daniel - 20090409 - also check the advertised quantity with quantity in cart\n\t\t\t\t\t$listqty = mysql_result($get_price,0,'quantity');\n\t\t\t\t\tif($listqty==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$returnVal = 2;\n\t\t\t\t\t}\n\t\t\t\t\telseif($thisQty<=$listqty)\n\t\t\t\t\t{\n\t\t\t\t\t\t//end of 20090409\n\n\t\t\t\t\t\t// get listprice starts here\n\t\t\t\t\t\tinclude_once(COMMONPATH . 'srv_list.php');\n\t\t\t\t\t \t$dto = $srv->get_product_info($thisPid);\n\t\t\t\t\t\t$price = $dto->get_price();\n\n\t\t\t\t\t\t$thisListprice = $price;\n\n\t\t\t\t\t\tif($currency == 'hkd')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = number_format($thisListprice * $dto->get_rate_hkd(),2,'.','');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// get listprice ends here\n\n\t\t\t\t\t\t//added for xmas - start\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$mycarttotal = $mycarttotal-(-($thisQty*$thisListprice));\n\n\n\n\t\t\t\t\t\tif($mycarttotal>99 && $thisPid==\"1823\" && $addedfreexmas!=\"Y\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$addedfreexmas=\"Y\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//echo \"A added - $thisPid-$thisQty-$thisListprice <br><br>\";\n\t\t\t\t\t\t//added for xmas - end\n\t\t\t\t\t\tif($thisPid==\"1823\" && ($thisPrice=='0.00'||$thisPrice=='0'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t\t//do nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// added for xmas - start\n\t\t//check if there is already a 1823-1-0.00 in the cartarr\n\t\t/*\n\t\tforeach ($cartArr as $thisxmaspromo)\n\t\t{\n\t\t\t//echo \"A\".$thisxmaspromo[0].\"-\".$thisxmaspromo[2].\"<br>\";\n\n\n\t\t\tif(($thisxmaspromo[0]==\"1823\") && ($thisxmaspromo[2]==\"0.00\"||$thisxmaspromo[2]==\"0\"))\n\t\t\t{\n\t\t\t\t$addedfreexmas = \"Y\";\n\t\t\t}\n\t\t}\n\n\n\t\tif($mycarttotal>99 && $addedfreexmas!=\"Y\")\n\t\t{\n\t\t\t$cartArr[] = array(\"1823\",\"1\",\"0.00\");\n\t\t\t$addedfreexmas=\"Y\";\n\t\t\t//echo \"B added <br><br>\";\n\t\t}\n\t\t*/\n\t\t//added for xmas - end\n\t}\n\treturn $returnVal;\n}", "public function quote_request_new() {\n\t /*\t$step_one_sidebar = '<div class=\"col-md-2\">\n\t <div class=\"sidebar\">\n\t <h3>Talk TO A REPRESENTATIVE</h3>\n\t <div class=\"selection-container\">\n\t <ul>\n\t <li>1 (877) 589-2214 (US/Canada)<br/><a href=\"mailto:[email protected]\">[email protected]</a></li>\n\t </ul>\n\t \n\t </div>\n\t </div>\n\t </div>'; */ \n\t\t$step_four = 'test';\n\t //return $this->new_product_finder('quote_request', NULL, $step_four);\n\t\t$path = \\Drupal::request()->getpathInfo();\n $arg = explode('/', $path);\t\t\n $cur_page = $arg[1];\n\t\t\n\t\t$pid = $_GET['pid'];\n\t\t\n\t\t$newrfq = $fpage;\n\t\t//$newrfq = $step_four;\n\t\t\n\t\treturn array(\n\t '#theme' => 'quote_request',\n\t\t '#cur_page' => $cur_page,\n\t\t '#pid' => $pid,\n\t '#quote_related_products' => $step_four,\n\t );\n \t}", "public function getDeliveryMode()\n {\n }", "function paymentech() {\n global $order;\n $this->code = 'paymentech';\n // Payment module title in Admin\n $this->title = MODULE_PAYMENT_PAYMENTECH_TEXT_TITLE;\n if (MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD == '' && MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD == '') {\n $this->title .= '<span class=\"alert\"> (Not Configured)</span>'; \n } elseif (MODULE_PAYMENT_PAYMENTECH_TESTMODE == 'Test') {\n $this->title .= '<span class=\"alert\"> (in Testing mode)</span>';\n }\n $this->description = MODULE_PAYMENT_PAYMENTECH_TEXT_DESCRIPTION; // Descriptive Info about module in Admin\n $this->enabled = ((MODULE_PAYMENT_PAYMENTECH_STATUS == 'True') ? true : false); // Whether the module is installed or not\n $this->sort_order = MODULE_PAYMENT_PAYMENTECH_SORT_ORDER; // Sort Order of this payment option on the customer payment page\n\n if ((int)MODULE_PAYMENT_PAYMENTECH_ORDER_STATUS_ID > 0) {\n $this->order_status = MODULE_PAYMENT_PAYMENTECH_ORDER_STATUS_ID;\n }\n\n\t// save the information\n\t// Card numbers are not saved, instead keep the first and last four digits and fill middle with *'s\n\t$card_number = trim($_POST['paymentech_field_1']);\n\t$card_number = substr($card_number, 0, 4) . '********' . substr($card_number, -4);\n\t$this->payment_fields = implode(':',array($_POST['paymentech_field_0'], $card_number, $_POST['paymentech_field_2'], $_POST['paymentech_field_3'], $_POST['paymentech_field_4']));\n\n\t$this->AVSRespCode = array(\n\t\t'1 ' => \"No address supplied\",\n\t\t'2 ' => \"Bill-to address did not pass Auth Host edit checks\",\n\t\t'3 ' => \"AVS not performed\",\n\t\t'4 ' => \"Issuer does not participate in AVS\",\n\t\t'R ' => \"Issuer does not participate in AVS\",\n\t\t'5 ' => \"Edit-error - AVS data is invalid\",\n\t\t'6 ' => \"System unavailable or time-out\",\n\t\t'7 ' => \"Address information unavailable\",\n\t\t'8 ' => \"Transaction Ineligible for AVS\",\n\t\t'9 ' => \"Zip Match / Zip4 Match / Locale match\",\n\t\t'A ' => \"Zip Match / Zip 4 Match / Locale no match\",\n\t\t'B ' => \"Zip Match / Zip 4 no Match / Locale match\",\n\t\t'C ' => \"Zip Match / Zip 4 no Match / Locale no match\",\n\t\t'D ' => \"Zip No Match / Zip 4 Match / Locale match\",\n\t\t'E ' => \"Zip No Match / Zip 4 Match / Locale no match\",\n\t\t'F ' => \"Zip No Match / Zip 4 No Match / Locale match\",\n\t\t'G ' => \"No match at all\",\n\t\t'H ' => \"Zip Match / Locale match\",\n\t\t'J ' => \"Issuer does not participate in Global AVS\", \n\t\t'JA' => \"International street address and postal match\",\n\t\t'JB' => \"International street address match. Postal code not verified.\",\n\t\t'JC' => \"International street address and postal code not verified.\",\n\t\t'JD' => \"International postal code match. Street address not verified.\",\n\t\t'M1' => \"Cardholder name matches\",\n\t\t'M2' => \"Cardholder name, billing address, and postal code matches\",\n\t\t'M3' => \"Cardholder name and billing code matches\",\n\t\t'M4' => \"Cardholder name and billing address match\",\n\t\t'M5' => \"Cardholder name incorrect, billing address and postal code match\",\n\t\t'M6' => \"Cardholder name incorrect, billing address matches\",\n\t\t'M7' => \"Cardholder name incorrect, billing address matches\",\n\t\t'M8' => \"Cardholder name, billing address and postal code are all incorrect\",\n\t\t'N3' => \"Address matches, ZIP not verified\",\n\t\t'N4' => \"Address and ZIP code match (International only)\",\n\t\t'N5' => \"Address not verified (International only)\",\n\t\t'N6' => \"Address and ZIP code match (International only)\",\n\t\t'N7' => \"ZIP matches, address not verified\",\n\t\t'N8' => \"Address and ZIP code match (International only)\",\n\t\t'UK' => \"Unknown\",\n\t\t'X ' => \"Zip Match / Zip 4 Match / Address Match\",\n\t\t'Y ' => \"Not Performed\",\n\t\t'Z ' => \"Zip Match / Locale no match\");\n\n\t$this->CVV2RespCode = array(\n\t\t'M' => \"CVV Match\",\n\t\t'N' => \"CVV No match\",\n\t\t'P' => \"Not processed\",\n\t\t'S' => \"Should have been present\",\n\t\t'U' => \"Unsupported by issuer\",\n\t\t'I' => \"Invalid\",\n\t\t'Y' => \"Invalid\");\n\n }", "protected function _buildRequest()\n {\n // prepare API\n $this->setShippingMethod('Other');\n $this->setCustomerIP(Mage::helper('core/http')->getRemoteAddr());\n $version = Mage::helper('ewayrapid')->getExtensionVersion();\n $this->setDeviceID('Magento ' . Mage::getEdition() . ' ' . Mage::getVersion().' - eWAY '.$version);\n if (Mage::helper('ewayrapid')->isBackendOrder()) {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_MOTO);\n } else {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_PURCHASE);\n }\n $this->setCustomerReadOnly(true);\n\n // add Billing Address\n $billingAddress = $this->_quote->getBillingAddress();\n $customerParam = Mage::getModel('ewayrapid/field_customer');\n \n $title = $this->_fixTitle($billingAddress->getPrefix());\n \n $customerParam->setTitle($title)\n ->setFirstName($billingAddress->getFirstname())\n ->setLastName($billingAddress->getLastname())\n ->setCompanyName($billingAddress->getCompany())\n ->setJobDescription($billingAddress->getJobDescription())\n ->setStreet1($billingAddress->getStreet1())\n ->setStreet2($billingAddress->getStreet2())\n ->setCity($billingAddress->getCity())\n ->setState($billingAddress->getRegion())\n ->setPostalCode($billingAddress->getPostcode())\n ->setCountry(strtolower($billingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($billingAddress->getEmail())\n ->setPhone($billingAddress->getTelephone())\n ->setMobile($billingAddress->getMobile())\n ->setComments('')\n ->setFax($billingAddress->getFax())\n ->setUrl('');\n $this->setCustomer($customerParam);\n\n // add Shipping Address\n $shippingAddress = $this->_quote->getShippingAddress();\n\n // copy BillingAddress to ShippingAddress if checkout with guest or register\n $checkoutMethod = $this->_quote->getCheckoutMethod();\n if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST\n || $checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER\n ) {\n $shippingAddress = $billingAddress;\n }\n\n $shippingParam = Mage::getModel('ewayrapid/field_shippingAddress');\n $shippingParam->setFirstName($shippingAddress->getFirstname())\n ->setLastName($shippingAddress->getLastname())\n ->setStreet1($shippingAddress->getStreet1())\n ->setStreet2($shippingAddress->getStreet2())\n ->setCity($shippingAddress->getCity())\n ->setState($shippingAddress->getRegion())\n ->setPostalCode($shippingAddress->getPostcode())\n ->setCountry(strtolower($shippingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($shippingAddress->getEmail())\n ->setPhone($shippingAddress->getTelephone())\n ->setFax($shippingAddress->getFax());\n $this->setShippingAddress($shippingParam);\n\n return $this;\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 }", "abstract function can_use_premium_code();", "abstract protected function getRequirement(): string;", "public function productScanning(){\n $user = $this->auth();\n if(empty($this->auth())){\n Utils::response(['status'=>false,'message'=>'Forbidden access.'],403);\n }\n $data = $this->getInput();\n if(($this->input->method() != 'post') || empty($data)){ \n Utils::response(['status'=>false,'message'=>'Bad request.'],400);\n }\n $validate = [\n ['field' =>'bar_code','label'=>'Barcode','rules' => 'required' ],\n\t\t\t['field' =>'scan_city','label'=>'Scan City','rules' => 'trim' ],\n\t\t\t['field' =>'pin_code','label'=>'Scan PIN Code','rules' => 'trim' ],\n ['field' =>'latitude','label'=>'Latitude','rules' => 'trim'],\n ['field' =>'longitude','label'=>'Longitude','rules' => 'trim' ],\n\t\t\t//['field' =>'registration_address','label'=>'Registration Address','rules' => 'trim|required' ],\n ];\n $errors = $this->ScannedproductsModel->validate($data,$validate);\n if(is_array($errors)){\n Utils::response(['status'=>false,'message'=>'Validation errorss.','errors'=>$errors]);\n }\n $result = $this->ScannedproductsModel->findProduct($data['bar_code']);\n $bar_code_data = $data['bar_code'];\n\t\t$bar_code2_data = $data['bar_code'];\n\t\t$product_id = $result->id;\n\t\t$consumerId = $user['id'];\n\t\t$data['ps_ip_address'] = $this->input->ip_address();\n\t\t\n\t\t// function to get product registration status\n $isRegistered = $this->ScannedproductsModel->isProductRegistered($bar_code_data, $bar_code2_data); \n\t\n $isLoyaltyForVideoFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForVideoFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForAudioFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForAudioFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForImageFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForImageFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForPDFFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForPDFFBQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdPDFFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdPDFFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdImageFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdImageFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$isLoyaltyForProductSurveyVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyPDFFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyPDFFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyImageFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyImageFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$isLoyaltyForProductDemoVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductDemoVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductDemoAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductDemoAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$mnv25_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 25)->get()->row();\n\t\t$mnvtext25 = $mnv25_result->message_notification_value;\n\t\t$mnv26_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 26)->get()->row();\n\t\t$mnvtext26 = $mnv26_result->message_notification_value;\n\t\t$mnv27_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 27)->get()->row();\n\t\t$mnvtext27 = $mnv27_result->message_notification_value;\n\t\t$mnv28_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 28)->get()->row();\n\t\t$mnvtext28 = $mnv28_result->message_notification_value;\n\t\t$mnv29_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 29)->get()->row();\n\t\t$mnvtext29 = $mnv29_result->message_notification_value;\n\t\t$mnv30_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 30)->get()->row();\n\t\t$mnvtext30 = $mnv30_result->message_notification_value;\n \n if(empty($result)){\n $data['user_id'] = $user['id'];\n $data['created'] = date('Y-m-d H:i:s');\n $this->db->insert('scanned_product_logs', $data);\n\t\t$mnv24_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 24)->get()->row();\n\t\t$mnvtext24 = $mnv24_result->message_notification_value;\n //$this->response(['status'=>false,'message'=>'This product and barcode is not supported by TRUSTAT.'],200);\n\t\t\t$this->response(['status'=>false,'message'=>$mnvtext24],200);\n }\n\t\tif(!empty($result->product_thumb_images)){\n $result->product_thumb_images = Utils::setFileUrl($result->product_thumb_images);\n }\n\t\t\n if(!empty($result->product_image)){\n $result->product_image = Utils::setFileUrl($result->product_image);\n }\n\t\tif(!empty($result->product_code_print_bg_images)){\n $result->product_code_print_bg_images = Utils::setFileUrl($result->product_code_print_bg_images);\n }\n if(!empty($result->product_video)){\n $result->product_video = Utils::setFileUrl($result->product_video);\n }\n if(!empty($result->product_audio)){\n $result->product_audio = Utils::setFileUrl($result->product_audio);\n }\n if(!empty($result->product_pdf)){\n $result->product_pdf = Utils::setFileUrl($result->product_pdf);\n }\n\t\tif(!empty($result->product_demo_video)){\n $result->product_demo_video = Utils::setFileUrl($result->product_demo_video);\n }\n\t\tif(!empty($result->product_demo_audio)){\n $result->product_demo_audio = Utils::setFileUrl($result->product_demo_audio);\n }\n\t\tif(!empty($result->product_user_manual)){\n $result->product_user_manual = Utils::setFileUrl($result->product_user_manual);\n }\n\t\t$result->product_registration_status = $isRegistered;\n\n\t\t$result->isLoyaltyForVideoFBQuesGiven = $isLoyaltyForVideoFBQuesGiven;\n\t\t$result->isLoyaltyForAudioFBQuesGiven = $isLoyaltyForAudioFBQuesGiven;\n\t\t$result->isLoyaltyForImageFBQuesGiven = $isLoyaltyForImageFBQuesGiven;\n\t\t$result->isLoyaltyForPDFFBQuesGiven = $isLoyaltyForPDFFBQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdVideoFeedbackQuesGiven = $isLoyaltyForProductPushedAdVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdAudioFeedbackQuesGiven = $isLoyaltyForProductPushedAdAudioFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdPDFFeedbackQuesGiven = $isLoyaltyForProductPushedAdPDFFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdImageFeedbackQuesGiven = $isLoyaltyForProductPushedAdImageFeedbackQuesGiven;\n\t\t\n\t\t$result->isLoyaltyForProductSurveyVideoFeedbackQuesGiven = $isLoyaltyForProductSurveyVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyAudioFeedbackQuesGiven = $isLoyaltyForProductSurveyAudioFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyPDFFeedbackQuesGiven = $isLoyaltyForProductSurveyPDFFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyImageFeedbackQuesGiven = $isLoyaltyForProductSurveyImageFeedbackQuesGiven;\n\t\t\n\t\t$result->isLoyaltyForProductDemoVideoFeedbackQuesGiven = $isLoyaltyForProductDemoVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductDemoAudioFeedbackQuesGiven = $isLoyaltyForProductDemoAudioFeedbackQuesGiven;\n\t\t\n\t\t\n\n\t\t$result->scanned_code = $data['bar_code']; \n\t\tif($data['bar_code'] == ($result->barcode_qr_code_no)) {\n\t\t\t\n\t\t$result->activation_level = $result->pack_level; \n\t\t\n\t\t$activation_packaging_level = $result->pack_level; \n\t\t\n\t\t\n\t\t} else {\n\t\t\t\n\t\t$result->activation_level = $result->pack_level2; \n\t\t$activation_packaging_level = $result->pack_level2;\n\t\t\t\n\t\t} \n $data['consumer_id'] = $user['id'];\n\t\t\n $data['product_id'] = $result->id;\n\t\t$data['customer_id'] = $result->created_by;\n $data['code_scan_date'] = date(\"Y-m-d H:i:s\");\n\t\t$data['del_by_cs'] = 0;\n //$result->pack_level = $result->pack_level; registration_status\n\t\t\n\t\t$consumer_id = $data['consumer_id'];\n\t\t$customer_id = $data['customer_id'];\n\t\t$product_id = $data['product_id'];\n\t\t\n\t\t$isConsAlreadyLinkedtoCust = $this->ScannedproductsModel->isConsAlreadyLinkedtoCust($consumer_id, $customer_id);\t\t\n\t\t\n\t\t$mnv1_result62 = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 62)->get()->row();\n\t\t$message_notification_value62 = $mnv1_result62->message_notification_value;\n\t\t\n if($this->db->insert($this->ScannedproductsModel->table, $data)){\t\n\t\t\n\t\tif($isConsAlreadyLinkedtoCust==false){\n\t\t$data['registration_status'] = \"Registered\";\n\t\t$this->db->insert('consumer_customer_link', $data);\n\t\t}\n\t\t\n\t\t\tif($activation_packaging_level==1){\n\t\t\t// Consumer Activity Log Data insert start\n\t\t\t$CALdata['date_time'] = date('Y-m-d H:i:s'); \n\t\t\t$CALdata['consumer_name'] = get_consumer_name_by_consumer_id($consumerId);\n\t\t\t$CALdata['consumer_id'] = $consumerId; \n\t\t\t$CALdata['consumer_mobile'] = getConsumerMobileNumberById($consumerId); \n\t\t\t$CALdata['customer_name'] = getUserNameById($customer_id); \n\t\t\t$CALdata['customer_id'] = $customer_id; \n\t\t\t$CALdata['unique_customer_code'] = getCustomerCodeById($customer_id); \n\t\t\t$CALdata['product_name'] = get_products_name_by_id($product_id); \n\t\t\t$CALdata['product_id'] = $product_id; \n\t\t\t$CALdata['product_sku'] = get_product_sku_by_id($product_id); \n\t\t\t$CALdata['product_code'] = $data['bar_code']; \n\t\t\t$CALdata['gloc_latitude'] = $data['latitude'];\n\t\t\t$CALdata['gloc_longitude'] = $data['longitude'];\n\t\t\t$CALdata['gloc_city'] = $data['scan_city'];\n\t\t\t$CALdata['gloc_pin_code'] = $data['pin_code'];\n\t\t\t$CALdata['consumer_activity_type'] = $message_notification_value62;\n\t\t\t$CALdata['loyalty_rewards_points'] = 0;\n\t\t\t$CALdata['loyalty_rewards_type'] = getCustomerLoyaltyTypeById($customer_id);\n\t\t\t\n\t\t\t$this->db->insert('consumer_activity_log_table', $CALdata);\n\t\t\t// Consumer Log Data insert end\n\t\t\t}\n\t\t\t$updateDataCityScan = array(\n\t\t\t\t\t 'city_last_scan' => $data['scan_city']\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('consumers', $updateDataCityScan, array('id' => $consumerId));\n\t\t\t\t\t\n\t\t\t//$this->db->insert('consumer_customer_link', $data);\n\t\t\t\n\t\t\t\n\t\t\t// Super Loyalty start\t\t\n\t\t\t// Insert number if Scans \n\t\t\t//check if the product code is already registerd\n\t\t\tif($activation_packaging_level==1){\n\t\t$ifSuperLoyaltyAlreadyGivenConsumerProduct = $this->ScannedproductsModel->ifSuperLoyaltyAlreadyGivenConsumerProduct($product_id, $consumerId); \n\t\t\t}else{\n\t\t$ifSuperLoyaltyAlreadyGivenConsumerProduct = \"NotGiven\";\n\t\t\t}\n\t\t$isSuperLoyaltyYes\t= SuperLoyaltyStatusonProductByProductID($product_id);\n\t\tif($isSuperLoyaltyYes==\"Yes\"){\n\t\t\tif($isRegistered==false){\n\t\t\t\tif($ifSuperLoyaltyAlreadyGivenConsumerProduct==\"NotGiven\"){\n\t\t$resultC = $this->db->select('number_of_scans')->from('consumers')->where('id', $consumerId)->get()->row();\n\t\t$number_of_scansBD = $resultC->number_of_scans;\n\t\t$number_of_scansAD = $number_of_scansBD + 1;\n\t\t$updateData = array(\n\t\t\t\t\t 'number_of_scans' => $number_of_scansAD\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('consumers', $updateData, array('id' => $consumerId));\n\t\t\t\t\t\n\t\t$resultP = $this->db->select('*')->from('products')->where('id', $product_id)->get()->row();\n\t\t$include_the_product_in_super_loyalty = $resultP->include_the_product_in_super_loyalty;\n\t\t$number_of_scans_for_super_loyalty = $resultP->number_of_scans_for_super_loyalty;\n\t\t$number_of_loyalty_points_for_super_loyalty = $resultP->number_of_loyalty_points_for_super_loyalty;\t\n\t\t$number_of_scans_for_productBD = $resultP->number_of_scans_for_product;\n\t\t\n\t\t$number_of_scans_for_productAD = $number_of_scans_for_productBD + 1;\n\t\t$updateDataP = array(\n\t\t\t\t\t 'number_of_scans_for_product' => $number_of_scans_for_productAD\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('products', $updateDataP, array('id' => $product_id));\n\t\t\n\t$remainder = $number_of_scans_for_productAD%$number_of_scans_for_super_loyalty;\n\t\tif(($remainder ==0)&&($number_of_loyalty_points_for_super_loyalty!=0)) {\t\t\n\t\t//$Product_id = getProductIDbyProductCode($data['bar_code']);\n\t\t\t$customerId = get_customer_id_by_product_id($product_id);\t\t\t\n\t\t\t\t$purchased_points = total_approved_points2($customerId);\n\t\t\t\t$consumed_points = get_total_consumed_points($customerId);\n\t\t\t\t$customer_loyalty_type = get_customer_loyalty_type_by_customer_id($customerId);\n\t\t\t\t$product_name = get_products_name_by_id($product_id);\n\t\t\t\t$consumer_name = getConsumerNameById($consumerId);\t\n\t\t\t\t$product_brand_name = get_products_brand_name_by_id($product_id);\n\t\t\t\t$customer_id = get_customer_id_by_product_id($product_id);\n\t\t\t\t\n\t\t\t\t$customer_name = getUserFullNameById($customerId);\t\t\n\t\t\t\t$product_name = get_products_name_by_id($product_id);\n\t\t\t\t$consumer_name = getConsumerNameById($consumerId);\n\t\t\n\t\t\t\t\n\t\t\t\t$LPconsumed_points = $consumed_points+$number_of_loyalty_points_for_super_loyalty;\n\t\t\t\t//echo \"<pre>\";print_r($LPconsumed_points); die;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($purchased_points > ($consumed_points+$number_of_loyalty_points_for_super_loyalty)){\n $message = 'Thank You for Product Registration. '. $number_of_loyalty_points_for_super_loyalty .' loyalty points will be added to your TRUSTAT loyalty account';\n\t\t\t\t//echo \"<pre>Jyada\";print_r($LPconsumed_points); die;\n\t\t\t\t}else{\n\t\t\t\t\t$message = 'Thank You for Scan!';\n\t\t\t\t\t//echo \"<pre>kam\";print_r($LPconsumed_points); die;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t // $transactionType = 'product-registration-without-warranty'; \n\t\t\t\t$transactionType = \"Super Loyalty\";\n\t\t\t\t//$mnv61_result = $this->db->select('message_notification_value,message_notification_value_part2')->from('message_notification_master')->where('id', 61)->get()->row();\n\t\t\t\t//$mnvtext61 = $mnv61_result->message_notification_value;\n\t\t\t\t$mnvtext61 = getAPPPassbookOnScreenDisplayMessageSLByProductId($product_id);\n\t\t\t\t//$mnvtext61_p2 = $mnv61_result->message_notification_value_part2;\n\t\t\t //$transactionTypeName = $mnvtext61 . $number_of_scans_for_productAD . $mnvtext52_p2;\n\t\t\t $transactionTypeName = $mnvtext61;\n\t\t\t\t//$userId = $user['id'];\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($purchased_points > ($consumed_points+$number_of_loyalty_points_for_super_loyalty)){\n\t\t\t\t$this->Productmodel->saveSuperLoylty($transactionType, $consumerId, $product_id, ['verification_date' => date(\"Y-m-d H:i:s\"), 'consumer_id' =>$consumerId, 'consumer_name' => $consumer_name, 'brand_name' => $product_brand_name, 'customer_name' => $customer_name, 'product_name' => $product_name, 'product_id' => $product_id, 'product_code' => $data['bar_code'],'customer_loyalty_type' => $customer_loyalty_type], $customer_id, $customer_loyalty_type, $number_of_loyalty_points_for_super_loyalty);\n\t\t\t\n\t\t\t\t$this->Productmodel->saveConsumerPassbookSuperLoyalty($transactionType, ['verification_date' => date(\"Y-m-d H:i:s\"), 'brand_name' => $product_brand_name, 'customer_name' => $customer_name, 'product_name' => $product_name, 'product_id' => $product_id, 'product_code' => $data['bar_code'],'customer_loyalty_type' => $customer_loyalty_type], $customer_id, $product_id, $consumerId, $transactionTypeName, 'Loyalty', $customer_loyalty_type, $number_of_loyalty_points_for_super_loyalty);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$fb_token = getConsumerFb_TokenById($consumerId);\n // $this->ConsumerModel->sendFCM('Thank you for Product Registration, Please check the details in \"my purchase list\" in TRUSTAT App.', $fb_token);\n\t\t\t //$mnv52_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 52)->get()->row();\n\t\t\t //$mnvtext52 = $mnv52_result->message_notification_value;\n\t\t\t $mnvtext52 = getAPPNotificationMessageforSuperLoyaltyByProductId($product_id);\n\t\t\t $this->ConsumerModel->sendFCM($mnvtext52, $fb_token);\n\t\t\t\t$NTFdata['consumer_id'] = $consumerId; \n\t\t\t\t$NTFdata['title'] = \"TRUSTAT Super Loyalty\";\n\t\t\t\t$NTFdata['body'] = $mnvtext52; \n\t\t\t\t$NTFdata['timestamp'] = date(\"Y-m-d H:i:s\",time()); \n\t\t\t\t$NTFdata['status'] = 0; \n\t\t\t\n\t\t\t$this->db->insert('list_notifications_table', $NTFdata);\n\t\t\t\n\t\t\t$TRNNC_result = $this->db->select('billin_particular_name, billin_particular_slug')->from('customer_billing_particular_master')->where('cbpm_id', 10)->get()->row();\n\t\t\t$TRNNC_billin_particular_name = $TRNNC_result->billin_particular_name;\n\t\t\t$TRNNC_billin_particular_slug = $TRNNC_result->billin_particular_slug;\n\t\t\t\n\t\t\t$TRNNCData['customer_id'] = $customer_id;\n\t\t\t$TRNNCData['consumer_id'] = $consumerId;\n\t\t\t$TRNNCData['billing_particular_name'] = $TRNNC_billin_particular_name.' TRUSTAT Super Loyalty';\t\t\n\t\t\t$TRNNCData['billing_particular_slug'] = $TRNNC_billin_particular_slug.'_TRUSTAT_Super_Loyalty';\n\t\t\t$TRNNCData['trans_quantity'] = 1; \n\t\t\t$TRNNCData['trans_date_time'] = date(\"Y-m-d H:i:s\",time()); \n\t\t\t$TRNNCData['trans_status'] = 1; \t\t\t\n\t\t\t$this->db->insert('tr_customer_bill_book', $TRNNCData);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Super Loyalty end\t\n\t\t\n\t\t\t\n\t\t\tif($result->barcode_qr_code_no == $data['bar_code']) {\n if( $result->pack_level == 0 ){\n if( $isRegistered ){\n\t\t\t\t\t\n\t\t\t\t\tif( $isRegistered == completed ){\n\t\t\t\t\t\n //$result->message1 = 'This product is already registered, please contact your retailer/manufacturer for further details.';\n\t\t\t\t\t$result->message1 = $mnvtext25;\n }else {\n\t\t\t\t\t//$result->message1 = 'This product registration is already under process. Outcome of product registration will be notified to TRUSTAT member, who had initiated the registration process.';\n\t\t\t\t\t$result->message1 = $mnvtext26;\n\t\t\t\t}\n\t\t\t\t}else{\n //$result->message1 = 'Thank You for initiating Product Registration, Click Ok to scan and upload valid invoice for this product purchase and activate the warranty.';\n\t\t\t\t\t$result->message1 = $mnvtext27;\n }\n }elseif( $result->pack_level == 1 ){\n //$result->message1 = 'Scanned product details for lavel '.$result->pack_level.'.';\n\t\t\t\t//$result->message1 = 'The barcode you have scanned is on the product packing, please scan the barcode on the product for registration.';\n\t\t\t\t$result->message1 = $mnvtext29;\n }elseif($result->pack_level > 1){\n //$result->message1 = 'This is not a product barcode for consumer, Please scan barcode placed on consumer pack';\n\t\t\t\t$result->message1 = $mnvtext30;\n }\n\t\t\t} else {\n\t\t\t\t\n\t\t\tif( $result->pack_level2 == 0 ){\n if( $isRegistered ){\n\t\t\t\t\t\n\t\t\t\t\tif( $isRegistered == completed ){\n\t\t\t\t\t\n //$result->message1 = 'This product is already registered, please contact your retailer/manufacturer for further details';\n\t\t\t\t\t$result->message1 = $mnvtext25;\n }else {\n\t\t\t\t\t//$result->message1 = 'This product registration is already under process. Outcome of product registration will be notified to TRUSTAT member, who had initiated the registration process';\n\t\t\t\t\t$result->message1 = $mnvtext26;\n\t\t\t\t}\n\t\t\t\t}else{\n // $result->message1 = 'Thank You for initiating Product Registration, Click Ok to scan and upload valid invoice for this product purchase and activate the warranty';\n\t\t\t\t\t $result->message1 = $mnvtext27;\n }\n }elseif( $result->pack_level2 == 1 ){\n //$result->message1 = 'Scanned product details for lavel '.$result->pack_level.'.';\n\t\t\t\t//$result->message1 = 'The barcode you have scanned is on the product packing, please scan the barcode on the product for registration.';\n\t\t\t\t$result->message1 = $mnvtext29;\n }elseif($result->pack_level2 > 1){\n //$result->message1 = 'This is not a product barcode for consumer, Please scan barcode placed on consumer pack';\n\t\t\t\t$result->message1 = $mnvtext30;\n }\t\n\t\t\t}\n\t\t\t\n //$this->response(['status'=>true,'message'=>'Scanned product details for lavel '.$result->pack_level.'.','data'=>$result]);\n\t\t$mnv31_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 31)->get()->row();\n\t\t$mnvtext31 = $mnv31_result->message_notification_value;\n\t\t\t//$this->response(['status'=>true,'message'=>'Thanks for scanning the product.','data'=>$result]);\n\t\t\t$this->response(['status'=>true,'message'=>$mnvtext31,'data'=>$result]);\n\t\t\t\n }else{\n\t\t$mnv32_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 32)->get()->row();\n\t\t$mnvtext32 = $mnv32_result->message_notification_value;\t\n // $this->response(['status'=>false,'message'=>'System failed to scan the record.'],200); \n\t\t\t$this->response(['status'=>false,'message'=>$mnvtext32],200); \n }\n }", "public function request(){\n return \\Gaia\\ShortCircuit::request();\n }", "private function getCodigoPresupuestarioApuestaLicita()\r\n\t\t{\r\n\t\t\t$codigoPresupuesto['codigo'] = '301021100';\r\n\t\t\treturn $codigo = self::getCodigoPresupuestarioByCodigo($codigoPresupuesto['codigo']);\r\n\t\t}", "public function getDeliveryMode(): int\n {\n }", "function fn_warehouses_get_product_data_post(&$product_data, $auth, $preview, $lang_code)\n{\n if (empty($product_data['product_id'])) {\n return;\n }\n\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n /** @var Tygh\\Addons\\Warehouses\\ProductStock $product_stock */\n $product_stock = $manager->getProductWarehousesStock($product_data['product_id']);\n\n if (!$product_stock->hasStockSplitByWarehouses()) {\n return;\n }\n\n if (AREA == 'C') {\n /** @var \\Tygh\\Location\\Manager $manager */\n $manager = Tygh::$app['location'];\n $destination_id = $manager->getDestinationId();\n\n $product_data['amount'] = $product_stock->getAmountForDestination($destination_id);\n } else {\n $product_data['amount'] = $product_stock->getAmount();\n }\n}", "public function codeRechargement()\n {\n $code_secret = $this->utils->securite_xss($_POST['codesecret']);\n $fk_agence = $this->utils->securite_xss($_POST['fkagence']);\n $frais = $this->compteModel->verifCodeRechargement($fk_agence, $code_secret);\n if ($frais == 1) echo 1;\n elseif ($frais == 0) echo 0;\n else echo -2;\n }", "public function express()\n {\n $this->set_step(0);\n\n $data = new ViewObject();\n\n // Get the express checkout object\n $ec = $this->getExpressObject();\n\n //if not exist and false, then redirect\n $ec OR redirect( NC_ROUTE . '/checkout' );\n \n\n //need these libs for deep pass req.\n //$this->load->model('nitrocart/addresses_m');\n //$this->load->model('nitrocart/orders_m');\n $this->load->library('nitrocart/Gateway_library');\n\n //if form validation pass\n $this->session->set_userdata('gateway_id', $ec->gateway->id);\n $this->session->set_userdata('user_id', $this->current_user->id);\n $this->session->set_userdata('billing', $ec->billing_address->id);\n //$this->session->set_userdata('shipping', $ec->shipping_address->id);\n $this->set_shipping_address_id( $ec->shipping_address->id );\n\n $data->gateway = $this->gateway_library->get($ec->gateway->id);\n $data->gateway_id = $ec->gateway->id; //deprecated\n \n $data->billing_address = $ec->billing_address;\n $data->shipping_address = $ec->shipping_address;\n $data->shipments = $ec->shipments;\n\n $so = $this->set_shipment_method( $ec->shipments->id ); //this also does a calc\n $data->ship_cost = $so->cost;\n\n\n if( $input = $this->input->post() )\n {\n\n $this->load->model('nitrocart/orders_m');\n\n if($order_id = $this->place_order())\n {\n redirect( NC_ROUTE . '/payment/order/' . $order_id );\n }\n //else\n $this->session->set_flashdata( JSONStatus::Error ,\"Unable to place order.\");\n redirect( NC_ROUTE. '/cart' );\n }\n\n\n $this->template\n ->title(Settings::get('shop_name'), 'Account') \n ->set_breadcrumb('Express Checkout')\n ->build( 'checkout/express/confirm',$data);\n }", "public static function PRO_LOGIC_II()\n {\n return new DolbyDigitalPlusDownmixingPreferredMode(self::PRO_LOGIC_II);\n }", "public function payWayPurchase()\n\t{\n\t}", "function shipPriceAccepted($id,$logisticportalid,$prepriceid) {\n global $objGeneral;\n global $objCore;\n $arrColumnUpdate = array('pricestatus' => 1);\n $varUsersWhere = \" pkpriceid ='\" . $id . \"'\";\n $this->update(TABLE_ZONEPRICE, $arrColumnUpdate, $varUsersWhere);\n // pre($logisticportalid);\n $arrLogisticdetails = $objGeneral->GetCompleteDetailsofLogisticPortalbyid($logisticportalid);\n $logistictitle = $arrLogisticdetails[0]['logisticTitle'];\n $logisticmailid = $arrLogisticdetails[0]['logisticEmail'];\n if($prepriceid==0)\n {\n $editedmessage='';\n }\n else\n {\n $editedmessage='This value will be applied after 24 hours'; \n }\n \n if ($_SERVER[HTTP_HOST] != '192.168.100.97') {\n //Send Mail To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo.png' . '\"/>';\n $varToUser = $logisticmailid;\n $varFromUser = SITE_EMAIL_ADDRESS;\n $sitelink = SITE_ROOT_URL . 'logistic/';\n $varSubject = SITE_NAME . ':Price Apporval';\n $varBody = '\n \t\t<table width=\"700\" cellspacing=\"0\" cellpadding=\"5\" border=\"0\">\n\t\t\t\t\t\t\t <tbody>\n\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t <td width=\"600\" style=\"padding-left:10px;\">\n\t\t\t\t\t\t\t <p>\n\t\t\t\t\t\t\tWelcome! <br/><br/>\n\t\t\t\t\t\t\t<strong>Dear ' . $logistictitle . ',</strong>\n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\tWe are pleased to inform about your Zone Price Apporval. '.$editedmessage.' \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t <br /><br />\n\t\t\t\t\t\t\tIf there is anything that we can do to enhance your Tela Mela experience, please feel free to <a href=\"{CONTACT_US_LINK}\">contact us</a>.\n\t\t\t\t\t\t\t<br/><br/>\n\t\t\t\t\t\t\t </p>\n\t\t\t\t\t\t\t </td>\n\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t </tbody>\n\t\t\t\t\t\t\t </table>\n \t\t';\n// $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/admin_user_registration.html');\n// $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5($argArrPost['frmUserEmail']) . '\" target=\"_blank\">here</a> to unsubscribe.';\n// $varActivationLink = '';\n// $arrBodyKeywords = array('{USER}', '{USER_NAME}', '{PASSWORD}', '{EMAIL}', '{ROLE}', '{SITE_NAME}', '{ACTIVATION_LINK}', '{IMAGE_PATH}', '{UNSUBSCRIBE_LINK}');\n// $arrBodyKeywordsValues = array(trim(stripslashes($argArrPost['frmName'])), trim(stripslashes($argArrPost['frmName'])), trim($argArrPost['frmPassword']), trim(stripslashes($argArrPost['frmUserEmail'])), 'Country Portal', SITE_NAME, $varActivationLink, $varPath); //,$varUnsubscribeLink\n// $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $_SESSION['sessArrUsers'] = '';\n }\n //return all record\n return 1;\n }", "public function getProductOption();", "public function request_product(){\n $save_data['req_product_name'] = $_REQUEST['req_product_name'];\n $save_data['req_product_person'] = $_REQUEST['req_product_person'];\n $save_data['req_product_email'] = $_REQUEST['req_product_email'];\n $save_data['req_product_mobile'] = $_REQUEST['req_product_mobile'];\n $save_data['req_product_msg'] = $_REQUEST['req_product_msg'];\n $save_data['req_product_date'] = date('d-m-Y h:i:s A');\n $req_product_id = $this->User_Model->save_data('req_product', $save_data);\n if($req_product_id){\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Product Request Saved Successfully\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Product Request Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "function SAP_set_order($rec_id)\n{\n/*\n\tThis FUNCTION posts SD order \n\tINPUT: id of invoice\n\tOUTPUT:\n\t\t\t- \"ID\" of SD order\n\t\t\tOR \"0\" - if failed\n*/\n\tinclude(\"login_re.php\");\n\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\t\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t//$cond_value='10';\n\t$service_mode='SO_C';\t// CREATE\t\n\t$req = new Request();\n\t \n\t\t\t//Setting up the object\n\t\t\t$item= new Item();\n\t\t\n\t\t//Set up mySQL connection\n\t\t\t$db_server = mysqli_connect($db_hostname, $db_username,$db_password);\n\t\t\t$db_server->set_charset(\"utf8\");\n\t\t\tIf (!$db_server) die(\"Can not connect to a database!!\".mysqli_connect_error($db_server));\n\t\t\tmysqli_select_db($db_server,$db_database)or die(mysqli_error($db_server));\n\t//1.\t\n\t\t// LOCATE data for the invoice\n\t\t\t$invoice_sql=\"SELECT invoice.date,invoice.value,contract.id_SAP,currency.code,decade,month,year \n\t\t\t\t\t\t\tFROM invoice \n\t\t\t\t\t\t\tLEFT JOIN contract ON invoice.contract_id=contract.id \n LEFT JOIN currency ON invoice.currency=currency.id\n\t\t\t\t\t\t\tWHERE invoice.id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql=mysqli_query($db_server,$invoice_sql);\n\t\t\t\t\n\t\t\tif(!$answsql) die(\"Database SELECT TO invoice table failed: \".mysqli_error($db_server));\t\n\t\t\tif (!$answsql->num_rows)\n\t\t\t{\n\t\t\t\techo \"WARNING: No invoice found for a given ID in invoice TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t$i_data= mysqli_fetch_row($answsql);\n\t\t\t\t\n\t\t\t\n\t//2.\t\n\t\t\t// Prepare request for SAP ERPclass Item\n\t\n\t\t\t// Set up params\n\t\t\t\n\t\t\t$c_date=$i_data[0];\n\t\t\t$val=$i_data[1];\n\t\t\t$contract_id=$i_data[2];\n\t\t\t$curr=$i_data[3];\t// Currency in invoice\n\t\t\t$decade=$i_data[4];\n\t\t\t$month=$i_data[5];\n\t\t\t$year=$i_data[6];\n\t\t\t//SERVICE DATE\n\t\t\t$service_date='';\n\t\t\tswitch($month)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$service_date='-01-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$service_date='-02-';\n\t\t\t\t\tif((int)$year%4)\n\t\t\t\t\t\t$day='28';\n\t\t\t\t\telse\n\t\t\t\t\t\t$day='29';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$service_date='-03-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$service_date='-04-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$service_date='-05-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$service_date='-06-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\t$service_date='-07-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\t$service_date='-08-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\t$service_date='-09-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\t$service_date='-10-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\t$service_date='-11-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\t$service_date='-12-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG MONTH IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch($decade)\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t$day='01';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='10';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$day='20';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='28';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG DECADE IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$service_date='20'.$year.$service_date.$day;\n\t\t\t// Preparing Items for Invoice\n\t\t\t$count_in=1;// only one position by Invoice now\n\t\t\t$items=new ItemList();\n\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t{\t\n\t\t\t\t$item1 = new Item();\n\t\t\t\t// 1. Item number\n\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t// 2. Material code\n\t\t\t\t$item1->MATERIAL='901200000';//now it's fixed\n\t\t\t\n\t\t\t/*2.1 BLOCK LEFT FOR LOCATING SAP MATERIAL ID\n\t\t\t\n\t\t\t\t$servicesql='SELECT id_SAP,id FROM services WHERE id_NAV=\"'.$service_id.'\"';\t\n\t\t\t\t$answsql=mysqli_query($db_server,$servicesql);\t\n\t\t\t\tif(!$answsql) die(\"Database SELECT in services table failed: \".mysqli_error($db_server));\t\n\n\t\t\t\t$sap_service_id= mysqli_fetch_row($answsql);\n\t\t\t*/\n\t\t\t\t// 3. Currency\n\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t// 4. SD conditions\n\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t// 4. Quantity\n\t\t\t\t$item1->TARGET_QTY='1'; //FIXED!\n\t\t\t\t\n\t\t\t\n\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t$items->item[$it] = $item1;\n\t\t\t}\n\t\t\t\n\t\t// GENERAL SECTION (HEADER)\n\t\t\n\t\t\t$req->ID_SALESCONTRACT = $contract_id;\t\n\t\t\t$req->SERVICEMODE = $service_mode;\n\t\t\t$req->SERVICEDATE = $service_date;\t\t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->RETURN2 = '';\n\t\t\t\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order)\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}", "public function addProductCode($code)\n {\n //$pieces = preg_split(\"/-/\", $code);\n //$programId = preg_replace(\"/\\D/\", \"\", $pieces[0]);\n }", "function SAP_set_order_multy($rec_id)\n{\n/*\n\tThis FUNCTION posts SD order \n\tINPUT: id of invoice\n\tOUTPUT:\n\t\t\t- \"ID\" of SD order\n\t\t\tOR \"0\" - if failed\n*/\n\tinclude(\"login_re.php\");\n\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t\n\t$service_mode='SO_C';\t// CREATE\t\n\t$req = new Request();\n\t \n\t\t\t//Setting up the object\n\t\t\t$item= new Item();\n\t\t\n\t\t//Set up mySQL connection\n\t\t\t$db_server = mysqli_connect($db_hostname, $db_username,$db_password);\n\t\t\t$db_server->set_charset(\"utf8\");\n\t\t\tIf (!$db_server) die(\"Can not connect to a database!!\".mysqli_connect_error($db_server));\n\t\t\tmysqli_select_db($db_server,$db_database)or die(mysqli_error($db_server));\n\t//1.\t\n\t\t// LOCATE data for the invoice\n\t\t\t$invoice_sql=\"SELECT invoice.date,invoice.value,contract.id_SAP,currency.code,invoice.month,invoice.year \n\t\t\t\t\t\t\tFROM invoice \n\t\t\t\t\t\t\tLEFT JOIN contract ON invoice.contract_id=contract.id \n LEFT JOIN currency ON invoice.currency=currency.id\n\t\t\t\t\t\t\tWHERE invoice.id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql=mysqli_query($db_server,$invoice_sql);\n\t\t\t\t\n\t\t\tif(!$answsql) die(\"Database SELECT TO invoice table failed: \".mysqli_error($db_server));\t\n\t\t\tif (!$answsql->num_rows)\n\t\t\t{\n\t\t\t\techo \"WARNING: No invoice found for a given ID in invoice TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t$i_data= mysqli_fetch_row($answsql);\n\t\t\t\t\n\t\t\t\n\t//2.\t\n\t\t\t// Prepare request for SAP ERPclass Item\n\t\n\t\t\t// Set up params\n\t\t\t\n\t\t\t$c_date=$i_data[0];\n\t\t\t$val=$i_data[1];\n\t\t\t$contract_id=$i_data[2];\n\t\t\t$curr=$i_data[3];\t// Currency in invoice\n\t\t\t$c_month=$i_data[4];\n\t\t\t$c_year=$i_data[5];\n\t\t\t$srv_date='';\n\t\t\t$m_date='';\n\t\t\t//SET UP SERVICE DATE - END OF THE BILLING PERIOD\n\t\t\tswitch($c_month)\n\t\t\t{\n\t\t\t\tcase '1':\n\t\t\t\t$m_date='-01-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t$m_date='-02-28';\n\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t$m_date='-03-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t$m_date='-04-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t$m_date='-05-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '6':\n\t\t\t\t$m_date='-06-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '7':\n\t\t\t\t$m_date='-07-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '8':\n\t\t\t\t$m_date='-08-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '9':\n\t\t\t\t$m_date='-09-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '10':\n\t\t\t\t$m_date='-10-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '11':\n\t\t\t\t$m_date='-11-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '12':\n\t\t\t\t$m_date='-12-31';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$srv_date='20'.$c_year.$m_date;\n\t\t\t\n\t\t\t// Preparing Items for Invoice\n\t\t\t\n\t\t\t// LOCATE POSITIONS for the invoice\n\t\t\t$positions_sql=\"SELECT service_id,quantity,service.id_SAP \n\t\t\t\t\t\t\tFROM invoice_reg \n\t\t\t\t\t\t\tLEFT JOIN service ON invoice_reg.service_id=service.id\n\t\t\t\t\t\t\tWHERE invoice_id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql1=mysqli_query($db_server,$positions_sql);\n\t\t\t\t\n\t\t\tif(!$answsql1) die(\"Database SELECT TO invoice_reg table failed: \".mysqli_error($db_server));\t\n\t\t\t$count_in=$answsql1->num_rows;\n\t\t\tif (!$count_in)\n\t\t\t{\n\t\t\t\techo \"WARNING: No POSITIONS found for a given ID in invoice_reg TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$items=new ItemList();\n\t\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t\t{\t\n\t\t\t\t\t$pos_data= mysqli_fetch_row($answsql1);\n\t\t\t\t\t$item1 = new Item();\n\t\t\t\t\t// 1. Item number\n\t\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t\t// 2. Material code\n\t\t\t\t\t$item1->MATERIAL=$pos_data[2];\n\t\t\t\n\t\t\t\t\n\t\t\t\t// 3. Currency ?? - need it?\n\t\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t\t// 4. SD conditions\n\t\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t\t// 4. Quantity\n\t\t\t\t\t$item1->TARGET_QTY=$pos_data[1];; \n\t\t\t\t\n\t\t\t\n\t\t\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t\t$items->item[$it] = $item1;\n\t\t\t\t}\n\t\t\t\n\t\t// GENERAL SECTION (HEADER)\n\t\t\n\t\t\t$req->ID_SALESCONTRACT = $contract_id;\t\n\t\t\t$req->SERVICEMODE = $service_mode; \t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->SERVICEDATE=$srv_date;\n\t\t\t$req->RETURN2 = '';\n\t\t\t//echo \"SENDING TO SAP\";\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order->RETURN2->item->MESSAGE==\"SUCCESS\")\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\t\t\telse\n\t\t\t\t$doc_id=0;\n\t\t\t\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}", "function huiten_daifu_pay($parms){\n\n $huiten_config = $GLOBALS['huiten_config'];\n\n $url = 'http://121.42.248.56:8080/pay-platform-api/doQhyHtGateBusiness';//请求地址\n\n $merNo = $huiten_config['merchantNo'];//\n\n $signKey = $huiten_config['signKey'];//\n\n $resMap=array();\n\n $resMap['requestNo']=$parms['requestNo'];\n\n $resMap['version']='V1.0';\n\n $resMap['productId']='0203';\n\n $resMap['transId']='005';\n\n $resMap['merNo']=$merNo;\n\n $resMap['orderDate']=date('Ymd');\n\n $resMap['orderNo']=$parms['orderNo'];\n\n $resMap['notifyUrl']='http://www.euamote.me/index.php/Home/Deposit/huiten_notify.html';\n\n $resMap['dfType']='001';\n\n $resMap['transAmt']=$parms['transAmt'];\n\n $resMap['isCompay']='0';\n\n $resMap['phoneNo']=$parms['phoneNo'];\n\n $resMap['customerName']=$parms['customerName'];\n\n $resMap['accBankNo']=$parms['accBankNo'];\n\n $resMap['accBankName']=$parms['accBankName'];\n\n $resMap['acctNo']=$parms['acctNo'];\n\n $resMap['signature']=strtoupper(md5($resMap['requestNo'].$resMap['productId'].$resMap['merNo'].$signKey));\n\n\n\n $data=array();\n\n $data['reqJson']=json_encode($resMap,256);\n\n return json_decode(post($url,$data), true);\n}", "protected abstract function isSingleProduct();", "function trackingno($carrier, $trno, $shipmentMethod){\n\t$carrier1=$carrier;\t\n\t$carrier=strtolower($carrier);\n\t\n\t//$trno=strtolower($trno);\n\t$shipmentMethod1=$shipmentMethod; \n\t$shipmentMethod=strtolower($shipmentMethod);\n\t\n\t$carrierdata=\" (Not Specified)\";\n\t$carrierRG=\"Not Specified\";\n\t\n\t\tif($carrier !=\"\" ){$carrierdata=\" (\".$carrier1.\")\";}\n\tif($carrier=='ups (usa)' || $carrier=='ups' || $carrier=='ups (us)'){\n\t\t\n\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t}\n\t\telseif($carrier==\"\" && substr($shipmentMethod, 0, 3) === 'ups'){\n\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='fedex (usa)' || $carrier=='fedex' || $carrier=='fedex (us)'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t}\n\t\telseif($carrier=='' && substr($shipmentMethod, 0, 3) =='fedex'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='us postal service'){\n\t\t\t$clink=\"https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=\";\n\t\t}\n\t\t\n\t\telseif($carrier=='miscellaneous' || $carrier=='miscellaneous (us)'){$clink=\"\";}\n\t\telse{$clink=\"\";}\n\t\t\n\t\tif($clink == \"\"){\n\t\t\tif($carrier1!=\"\"){$carrierRG=$carrier1;}\n\t\t\tif (preg_match(\"/\\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\\dT]\\d\\d\\d ?\\d\\d\\d\\d ?\\d\\d\\d)\\b/\", $trno)) {\n\t\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\t\n\t\t\telseif (preg_match(\"/(\\b96\\d{20}\\b)|(\\b\\d{15}\\b)|(\\b\\d{12}\\b)/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/\\b((98\\d\\d\\d\\d\\d?\\d\\d\\d\\d|98\\d\\d) ?\\d\\d\\d\\d ?\\d\\d\\d\\d( ?\\d\\d\\d)?)\\b/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/^[0-9]{15}$/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($clink != \"\"){\n\t\t\t$trdata=\"<a href='\".$clink.\"\".$trno.\"' target='_blank'>\".$trno.\"</a>\".$carrierdata.\", \";\n\t\t}\n\t\telse{\n\t\t\t$trdata=$trno.\"\".$carrierdata.\", \";\n\t\t\t}\n\t\tif($trno==\"\"){$trdata=\"\";}\n\t\treturn $trdata;\n\t}", "function request_shipping_label($data)\n {\n // Note you may want to associate this in some other way, like with a database ID.\n $this->PartnerTransactionID = substr(uniqid(rand(), true), 0, 10);\n\n $xml = '<LabelRequest Test=\"NO\" LabelSize=\"4X6\" LabelType=\"Default\" LabelSubtype=\"None\" ImageFormat=\"GIF\">\n\t\t\t\t\t<RequesterID>' . $this->RequesterID . '</RequesterID>\n\t\t\t\t\t<AccountID>' . $this->AccountID . '</AccountID>\n\t\t\t\t\t<PassPhrase>' . $this->PassPhrase . '</PassPhrase>\n\t\t\t\t\t<PartnerTransactionID>' . $this->PartnerTransactionID . '</PartnerTransactionID>';\n\n $xml .= '<IntegratedFormType>Form2976</IntegratedFormType>';\n\n if (!empty($data)) {\n foreach ($data as $node_key => $node_value) {\n $xml .= '<' . $node_key . '>' . $node_value . '</' . $node_key . '>';\n }\n }\n\n $xml .= '<ResponseOptions PostagePrice=\"TRUE\"/>\n\t\t\t\t</LabelRequest>';\n\n $data = array(\"labelRequestXML\" => $xml);\n\n\n\n $request = $this->client->post('/LabelService/EwsLabelService.asmx/GetPostageLabelXML', array(), $data);\n return $this->send_request($request);\n }", "public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}", "public function prod($prod);", "public function getProductType()\n {\n }", "function before_process() {\n global $order, $db, $currencies, $messageStack;\n\n\t// if the card number has the blanked out middle number fields, it has been processed, the message that \n\t// the charges were not processed were set in pre_confirmation_check, just return to continue without processing.\n\tif (strpos($_POST['paymentech_field_1'], '*') !== false) {\n\t\treturn false;\n\t}\n\n $order->info['cc_expires'] = $_POST['paymentech_field_2'] . $_POST['paymentech_field_3'];\n $order->info['cc_owner'] = $_POST['paymentech_field_0'];\n\t$this->cc_card_owner = $_POST['paymentech_field_0'];\n $order->info['cc_cvv'] = $_POST['paymentech_field_4'];\n\n // Create a string that contains a listing of products ordered for the description field\n $description = $order->description;\n\n\t// Generate the XML file to be sent to Paymentech\n\tif (MODULE_PAYMENT_PAYMENTECH_TESTMODE == 'Test') {\n\t\t$MerchantID = MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_TEST;\n\t} else {\n\t\tswitch (DEFAULT_CURRENCY) {\n\t\t\tcase 'USD': $MerchantID = MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD; break;\n\t\t\tcase 'CAD': $MerchantID = MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD; break;\n\t\t}\n\t}\n\n\t$post_string = \"\n\t\t<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n\t\t<Request>\n\t\t\t<NewOrder>\n\t\t\t\t<IndustryType>EC</IndustryType>\n\t\t\t\t<MessageType>\" . (MODULE_PAYMENT_PAYMENTECH_AUTHORIZATION_TYPE == 'Authorize' ? 'A' : 'AC') . \"</MessageType>\n\t\t\t\t<BIN>\" . MODULE_PAYMENT_PAYMENTECH_BIN . \"</BIN>\n\t\t\t\t<MerchantID>\" . $MerchantID . \"</MerchantID>\n\t\t\t\t<TerminalID>\" . MODULE_PAYMENT_PAYMENTECH_TERMINAL_ID . \"</TerminalID>\n\t\t\t\t<AccountNum>\" . $_POST['paymentech_field_1'] . \"</AccountNum>\n\t\t\t\t<Exp>\" . $order->info['cc_expires'] . \"</Exp>\n\t\t\t\t<CurrencyCode>\" . (DEFAULT_CURRENCY == 'USD' ? '840' : '124') . \"</CurrencyCode>\n\t\t\t\t<CurrencyExponent>2</CurrencyExponent>\n\t\t\t\t<CardSecValInd>\" . ($this->cc_cvv2 ? 1 : 9 ) . \"</CardSecValInd>\n\t\t\t\t<CardSecVal>\" . ($this->cc_cvv2 ? $this->cc_cvv2 : '') . \"</CardSecVal>\n\t\t\t\t<AVSzip>\" . preg_replace(\"/[^A-Za-z0-9]/\", \"\", $order->bill_postal_code) . \"</AVSzip>\n\t\t\t\t<AVSaddress1>\" . substr($order->bill_address1, 0, 20) . \"</AVSaddress1>\"\n\t\t\t\t. ( $order->bill_address2 ? '\n\t\t\t\t<AVSaddress2>' . $order->bill_address2 . '</AVSaddress2>' : '' ) . \"\n\t\t\t\t<AVScity>\" . $order->bill_city_town . \"</AVScity>\n\t\t\t\t<AVSstate>\" . $order->bill_state_province . \"</AVSstate>\n\t\t\t\t<AVSphoneNum>\" . $order->bill_telephone . \"</AVSphoneNum>\n\t\t\t\t<AVSname>\" . $this->cc_card_owner . \"</AVSname>\n\t\t\t\t<AVScountryCode>\" . gen_get_country_iso_2_from_3($order->bill_country_code) . \"</AVScountryCode>\n\t\t\t\t<AVSDestzip>\" . preg_replace(\"/[^A-Za-z0-9]/\", \"\", $order->ship_postal_code) . \"</AVSDestzip>\n\t\t\t\t<AVSDestaddress1>\" . $order->ship_address1 . \"</AVSDestaddress1>\"\n\t\t\t\t . ( $order->ship_address2 ? '\n\t\t\t\t<AVSDestaddress2>' . $order->ship_address2 . '</AVSDestaddress2>' : '' ) . \"\n\t\t\t\t<AVSDestcity>\" . $order->ship_city_town . \"</AVSDestcity>\n\t\t\t\t<AVSDeststate>\" . $order->ship_state_province . \"</AVSDeststate>\n\t\t\t\t<AVSDestphoneNum>\" . $order->ship_telephone . \"</AVSDestphoneNum>\n\t\t\t\t<AVSDestname>\" . $order->ship_primary_name . \"</AVSDestname>\n\t\t\t\t<AVSDestcountryCode>\" . gen_get_country_iso_2_from_3($order->ship_country_code) . \"</AVSDestcountryCode>\n\t\t\t\t<OrderID>\" . $order->purchase_invoice_id . \"</OrderID>\n\t\t\t\t<Amount>\" . ($order->total_amount * pow(10, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places'])) . \"</Amount>\n\t\t\t</NewOrder>\n\t\t</Request>\n\t\";\n\n\t$header = \"POST /AUTHORIZE HTTP/1.0\\r\\n\"; //HTTP/1.1 should work fine also\n\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t$header .= \"Content-type: application/PTI41\\r\\n\";\n\t$header .= \"Content-length: \" . strlen($post_string) . \"\\r\\n\";\n\t$header .= \"Content-transfer-encoding: text\\r\\n\";\n\t$header .= \"Request-number: 1\\r\\n\";\n\t$header .= \"Document-type: Request\\r\\n\";\n\t$header .= \"Merchant-id: \" . $MerchantID . \"\\r\\n\\r\\n\";\n//\t$header .= \"Connection: close \\r\\n\\r\\n\"; //Must have two CR/LF's here\n\t$header .= $post_string;\n\n // SEND DATA BY CURL SECTION\n // Post order info data to Paymentech gateway, make sure you have cURL support installed\n\n if (MODULE_PAYMENT_PAYMENTECH_TESTMODE == 'Test') {\n\t\t$url = MODULE_PAYMENT_PAYMENTECH_TEST_URL_PRIMARY;\n\t} else {\n\t\t$url = MODULE_PAYMENT_PAYMENTECH_PRODUCTION_URL_PRIMARY;\n\t}\n\n//echo 'transmit xml = '; echo htmlspecialchars($header); echo '<br><br>';\n\n\t$GetPost = 'POST';\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\tcurl_setopt($ch, CURLOPT_HEADER, false); // You are providing a header manually so turn off auto header generation\n curl_setopt($ch, CURLOPT_VERBOSE, false);\n\n\n//*\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); // The following two options are necessary to properly set up SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);\n//*/\n\n/*\n\tcurl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\tif ($GetPost == 'POST') {\n\t curl_setopt($ch, CURLOPT_POST, 1);\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, $header);\n }\n*/\n\n if (CURL_PROXY_REQUIRED == 'True') {\n curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, true);\n curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);\n curl_setopt ($ch, CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS);\n }\n\n\t$authorize = curl_exec($ch); \n\t// Check for curl errors\n\t$curlerrornum = curl_errno($ch);\n\t$curlerror = curl_error($ch);\n\tcurl_close ($ch);\n\tif ($curlerrornum) { \n\t\t$messageStack->add('XML Read Error (cURL) #' . $curlerrornum . '. Description = ' . $curlerror,'error');\n\t\treturn true;\n\t}\n\n//echo 'response xml = ' . htmlspecialchars($authorize) . '<br><br>';\n\n\t// since the response is only one level deep, we can do a simple parse\n\t$authorize = trim($authorize);\n\t$authorize = substr($authorize, strpos($authorize, '<NewOrderResp>') + 14); // remove up to and including the container tag\n\t$authorize = substr($authorize, 0, strpos($authorize, '</NewOrderResp>')); // remove from end container tag on\n\t$results = array();\n\t$runaway_loop_counter = 0;\n\twhile ($authorize) {\n\t\t$key = substr($authorize, strpos($authorize, '<') + 1, strpos($authorize, '>') - 1);\n\t\t$authorize = substr($authorize, strpos($authorize, '>') + 1); // remove start tag\n\t\t$value = substr($authorize, 0, strpos($authorize, '<')); // until start of end tag\n\t\t$authorize = substr($authorize, strpos($authorize, '>') + 1); // remove end tag\n\t\t$results[$key] = $value;\n\t\tif ($runaway_loop_counter++ > 1000) break;\n\t}\n\n//echo 'RespCode = ' . $results['RespCode'] . '<br>';\n//echo 'AVSRespCode = ' . $results['AVSRespCode'] . '<br>';\n//echo 'CVV2RespCode = ' . $results['CVV2RespCode'] . '<br>';\n//echo 'TxRefNum = ' . $results['TxRefNum'] . '<br><br>';\n\n\tif ($results['ProcStatus'] == 0) { //initial gateway test passed\n\t\tif ($results['ApprovalStatus'] == 1) { //Gateway returned approved\n\t\t\t$this->auth_code = $results['AuthCode'];\n\t\t\t$this->transaction_id = $results['TxRefNum'];\n\t\t $messageStack->add($results['StatusMsg'] . ' - Approval code: ' . $this->auth_code . ' --> CVV2 results: ' . $this->CVV2RespCode[$results['CVV2RespCode']], 'success');\n\t\t $messageStack->add('Address verification results: ' . $this->AVSRespCode[$results['AVSRespCode']], 'success');\n/* DELETE ME */ return true; // force a fail to not post\n\t\t return false;\n\t\t} else {\n\t\t\t\n\t\t\t$messageStack->add(sprintf(MODULE_PAYMENT_PAYMENTECH_TEXT_DECLINED_MESSAGE, $results['StatusMsg']), 'error');\n\t\t\treturn true;\n\t\t}\n\t}\n\t//gateway test failed\n\t$messageStack->add(MODULE_PAYMENT_PAYMENTECH_TEXT_GATEWAY_ERROR, 'error');\n\treturn true;\n }", "abstract public function getPaymentMethod();", "public function get_Code_produit()\n\t\t{\n\t\t\treturn $this->Code_produit;\n\t\t}", "public function store()\n {\n $input = Request::onlyLegacy('category_id', 'name', 'unit', 'unit_cost', 'code', 'description', 'selling_price', 'supplier_id', 'abc_additional_data', 'styles', 'sizes', 'colors', 'sub_id', 'qbd_id', 'sync_on_qbd', 'trade_id');\n $validator = Validator::make($input, FinancialProduct::getRules());\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $companyId = $this->scope->has() ? $this->scope->id() : 0;\n\t\t$category = FinancialCategory::where('company_id', $companyId)\n\t\t\t->findOrFail($input['category_id']);\n\n $validator = Validator::make($input, FinancialProduct::getRulesByCategory($category));\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n if (ine($input, 'supplier_id')) {\n if (!$this->supplierRepo->isSupplierExist($input['supplier_id'])) {\n return ApiResponse::errorNotFound(trans('response.error.not_found', ['attribute' => 'Supplier']));\n }\n\n if ($this->supplierRepo->isSystemSupplier($input['supplier_id'])) {\n return ApiResponse::errorGeneral(\"You can't add supplier product from here.\");\n }\n }\n\n $message = trans('response.success.saved', ['attribute' => 'Product']);\n\n if (ine($input, 'sub_id')) {\n $subContractor = User::whereCompanyId($this->scope->id())\n ->whereGroupId(User::GROUP_SUB_CONTRACTOR)\n ->findOrFail($input['sub_id']);\n\n $category = FinancialCategory::whereName(FinancialCategory::LABOR)\n ->whereCompanyId($this->scope->id())\n ->firstOrFail();\n\n $input['category_id'] = $category->id;\n $message = trans('response.success.saved', ['attribute' => 'Rate sheet']);\n }\n\n $name = isSetNotEmpty($input, 'name') ?: null;\n\n try {\n $product = $this->repo->saveProduct(\n $input['category_id'],\n $name,\n $input['unit'],\n $input['unit_cost'],\n $input\n );\n\n return ApiResponse::success([\n 'message' => $message,\n 'data' => $this->response->item($product, new FinancialProductsTransformer)\n ]);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "public function actionrequestingEscrow(){\n \n \n \n \n $model = new Escrow;\n \n $member_id = Yii::app()->user->id;\n \n if(isset($_POST['quoted_id'])){\n $model->quote_id = $_POST['quote_id'];\n }else{\n $model->quote_id = 0;\n }\n \n $model->product_id = $_POST['product_id'];\n $model->escrow_number = $model->generateTheEscrowNumberForThisTransaction($model->quote_id,$model->product_id);\n if(isset($_POST['is_quotable'])){\n if($_POST['is_quotable'] == true){\n $model->is_quoted =1;\n }else{\n $model->is_quoted =0;\n }\n \n }else{\n $model->is_quoted = 0;\n }\n if(isset($_POST['future_trading'])){\n $model->is_futuristic = $_POST['future_trading'];\n }else{\n $model->is_futuristic = 0;\n \n }\n \n \n $model->minimum_number_of_product_to_buy = $_POST['minimum_number_of_product_to_buy_for_computation'];\n $model->whats_product_per_item = $_POST['whats_represents_an_item'];\n $model->status = strtolower('live');\n $model->escrow_operation_for = $_POST['escrow_request_from'];\n if($_POST['subscription_type'] == strtolower('post')){\n $model->quantity = $_POST['subscription_quantity'];\n }else{\n $model->quantity = $_POST['quantity_of_purchase'];\n }\n \n $model->price_per_item = $_POST['prevailing_retail_selling_price'];\n $model->total_amount_purchased=$_POST['amount_to_be_paid'];\n $model->escrow_initiation_date = new CDbExpression('NOW()');\n $model->escrow_initiated_by = Yii::app()->user->id;\n $model->direction = strtolower('initiation');\n \n $is_escrowed = 1;\n $is_escrow_accepted = 0;\n $start_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['start_price_validity_period'])); \n $end_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['end_price_validity_period'])); \n $cobuy_member_selling_price = 0;\n $amount_saved_on_purchase = 0;\n if($this->isMemberWithOpenOrder($member_id)){\n $order_id = $this->getTheOpenOrderInitiatedByMember($member_id);\n }else{\n $order_id = $this->createNewOrderForThisMember($member_id);\n }\n \n $escrow_file_error = 0;\n \n if($_FILES['escrow_agreement_file']['name'] != \"\"){\n if($_FILES['escrow_agreement_file']['type'] == 'application/pdf'){\n $escrow_filename = $_FILES['escrow_agreement_file']['name'];\n $escrow_filesize = $_FILES['escrow_agreement_file']['size'];\n }else{\n $escrow_file_error = $escrow_file_error + 1;\n \n }\n \n if($escrow_file_error == 0){\n if($model->validate()) {\n \n //move the escrow agreement file to the escrow directory \n $model->escrow_agreement_file = $model->moveTheEscrowAgreementToItsPathAndReturnItsFileName($escrow_filename);\n if($model->escrow_operation_for ==strtolower('noncart')){\n if($model->save()) {\n // if($this->isProductSubscriptionUpdatedSuccessfully($member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n /** }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section to consummate this transaction\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n } \n * \n */ \n \n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n if($model->hasTheEscrowOfThisSubscriptionAlreadyInitiated($member_id,$model->status,$model->product_id,$model->escrow_operation_for)==false){\n if($model->save()) {\n if($this->isProductSubscriptionUpdatedSuccessfully($model->id,$member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n \n }else{\n if($model->escrow_operation_for == 'pre'){\n $msg = \"This pre-subscribed product had been sent to the escrow administrator. If the escrow is accepted, the product will be added to your cart so as to effect payment. However, you may visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }\n \n \n } \n \n \n }else{\n \n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n $msg = \"You already have an escrow on this product subscription waiting for acceptance.You may need to wait for the escrow to be accepted before initiating a new one\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }\n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"Validaion Error: Check the forms fields for correctness\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg\n )\n );\n \n }\n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"File Format Error: There was an error in the uploaded escrow agreement document. Please check the uploaded file and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n }else{\n \n if($model->escrow_operation_for ==strtolower('noncart')){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n if($this->isProductEscrowable($model->product_id )){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n $msg = \"This product is not escrowable. Please choose another product and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n }\n \n } \n \n \n }", "function teligence_purchase_buypackage31_form_submit($form, &$form_state)\r\n{\r\n\tif($form_state['clicked_button']['#id'] == 'edit-submitpurchase')\r\n\t{\r\n\t\t// parse package elements; id, price, minutes\r\n\t\t$package = explode('|',$form_state['values']['packages']);\r\n\t\t\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc')\r\n\t\t{\r\n\t\t\t// ValidateAsuNotSignedIn\r\n\t\t\t$params = new stdClass ();\r\n\t\t $params->ivrBrandId = variable_get('teligence_purchase_brandid', 1);\r\n\t\t\t$params->email = $form_state['values']['email'];\r\n\t\t\t$params->password = $form_state['values']['password'];\r\n\t\t\t$params->marketId = $form_state['values']['city'];\r\n\t\t\t$params->packageId = $package[0];\r\n\t\t\t$params->creditCardNumber = $form_state['values']['cardnumber'];\r\n\t\t\t$params->expiryDateMmYy = str_pad($form_state['values']['cc_expiration']['month'].$form_state['values']['cc_expiration']['year'],4,\"0\",STR_PAD_LEFT);\r\n\t\t\t$params->cardholderName = $form_state['values']['cardholdername'];\r\n\t\t\t$params->zip = $form_state['values']['zippostal'];\r\n\t\t\t$result = teligence_purchase_soap_call($params, 'ValidateAsuNotSignedIn', variable_get('teligence_purchase_wsdl_ordermanagement',''),TRUE);\r\n\t\t\tswitch ($result->ValidateAsuNotSignedInResult->ResponseCode) \r\n\t\t\t{\r\n\t\t\t\tcase 'Success':\r\n\t\t\t\t\t$form_state['storage']['values']['ValidateResult'] = $result->ValidateAsuNotSignedInResult;\r\n\t\t\t\t\t$form_state['storage']['step'] = 'verifyorder';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'ExistingMembershipBrandHub': \r\n\t\t\t\t\t// signin as ivr_user, send validation email and redirect to 3.3\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// send validation email\r\n\t\t\t\t\t$tokens = teligence_purchase_tokens('emailValidateAccount');\r\n\t\t\t\t\t$tokens['[email]'] = $form_state['storage']['values']['email'];\r\n\t\t\t\t\t$tokens['[password]'] = $form_state['storage']['values']['password'];\r\n\t\t\t\t\t$tokens['[url]'] = url('cart/validate-web-account/' . \r\n\t\t\t\t\t\t$result->ValidateAsuNotSignedInResult->ValidationCode . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['email'] . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['password'], array('absolute' => TRUE)\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_mail('teligence_purchase', 'emailValidateAccount', $form_state['storage']['values']['email'], language_default(), $tokens);\r\n\t\t\t\t\tdrupal_set_message(t('We have sent you an email with a validation link. Please click it to validate your account.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// load user\r\n\t\t\t\t\tglobal $user;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// update drupal user\r\n\t\t\t\t\t$form_state['WebActiveMemberships'] = $result->ValidateAsuNotSignedInResult->WebActiveMemberships;\r\n\t\t\t\t\t$user = teligence_purchase_drupaluser($form_state);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// save values in the session\r\n\t\t\t\t\t$sessionValues = $result->ValidateAsuNotSignedInResult;\r\n\t\t\t\t\tteligence_purchase_setsessionvalues($sessionValues);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// message to user\r\n\t\t\t\t\tdrupal_set_message(t('We found you in our system. You can select from the packages below.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// redirect to success page\r\n\t\t\t\t\tdrupal_goto('cart/add-time');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InactivePaymethod':\r\n\t\t\t\tcase 'EmailLinkedToWebAccount':\r\n\t\t\t\tcase 'CreditCardBelongsToOtherMember':\r\n\t\t\t\tcase 'CreditCardLinkedToWebAccount':\r\n\t\t\t\t\tdrupal_set_message(t('We found you in our system already. Please !sign', array('!sign' => l(t('click here to sign-in'),'cart/login'))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'NegativeCreditStatus':\r\n\t\t\t\tcase 'NoSalesPaymentRestriction':\r\n\t\t\t\tcase 'DebtOrPaymentRestriction':\r\n\t\t\t\tcase 'OlderExpirationDate':\r\n\t\t\t\tcase 'DuplicateRequestGuid':\r\n\t\t\t\tcase 'FraudulentPaymethod':\r\n\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ValidateAsuNotSignedInResult->ErrMsg)),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// paypal\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'pp')\r\n\t\t{\r\n\t\t\t// send request to paypal.teligence.net\r\n\t\t\tmodule_load_include('inc', 'teligence_purchase', 'teligence_purchase-paypal');\r\n\t\t\t$urlquery = array(\r\n\t\t\t\t// 'areaCode' => '', // from previous implementation\r\n\t\t\t\t// 'Ani' => '', // from previous implementation\r\n\t\t\t\t'SequenceId' => teligence_cart_uuid(TRUE),\r\n\t\t\t\t'Password' => $form_state['storage']['values']['password'],\r\n\t\t\t\t'Email' => $form_state['storage']['values']['email'],\r\n\t\t\t\t'PackageId' => $package[0],\r\n\t\t\t\t'VendorPass' => md5(variable_get('teligence_cart_paypal_vendor_pass_asu', '')),\r\n\t\t\t\t'lang' => $GLOBALS['language']->language,\r\n\t\t\t\t'IvrBrandId' => variable_get('teligence_purchase_brandid', 1),\r\n\t\t\t);\r\n\t\t\tif(!teligence_purchase_paypalSetSessionData($urlquery, variable_get('teligence_cart_paypal_vendor_id_asu', '')))\r\n\t\t\t{\r\n\t\t\t\t// could not connect to paypal.teligence.net\r\n\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// place order\r\n\tif($form_state['clicked_button']['#id'] == 'edit-placeorder')\r\n\t{\r\n\t\t// drupal_set_message('<pre>'.check_plain(print_r($form_state['storage']['values'],1)).'</pre>');\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc')\r\n\t\t{\r\n\t\t\t// ProcessPayment\r\n\t\t\t$params = new stdClass ();\r\n\t\t\t$params->orderId = $form_state['storage']['values']['ValidateResult']->OrderId;\r\n\t\t\t$params->paymethodId = $form_state['storage']['values']['ValidateResult']->PaymethodId;\r\n\t\t\t$params->cvn = $form_state['storage']['values']['securitycode'];\r\n\t\t\t$params->email = $form_state['storage']['values']['email'];\r\n\t\t\t$params->password = $form_state['storage']['values']['password'];\r\n\t\t\t$result = teligence_purchase_soap_call($params, 'ProcessPayment', variable_get('teligence_purchase_wsdl_ordermanagement',''));\r\n\t\t\tswitch ($result->ProcessPaymentResult->ResponseCode) \r\n\t\t\t{\r\n\t\t\t\tcase 'Success':\r\n\t\t\t\t\t// send validation email\r\n\t\t\t\t\t$tokens = teligence_purchase_tokens('emailValidateAccount');\r\n\t\t\t\t\t$tokens['[email]'] = $form_state['storage']['values']['email'];\r\n\t\t\t\t\t$tokens['[password]'] = $form_state['storage']['values']['password'];\r\n\t\t\t\t\t$tokens['[url]'] = url('cart/validate-web-account/' . \r\n\t\t\t\t\t\t$result->ProcessPaymentResult->ValidationCode . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['email'] . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['password'], array('absolute' => TRUE)\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_mail('teligence_purchase', 'emailValidateAccount', $form_state['storage']['values']['email'], language_default(), $tokens);\r\n\t\t\t\t\tdrupal_set_message(t('We have sent you an email with a validation link. Please click it to validate your account.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// drupal_set_message('<pre>'.check_plain(print_r($result->ProcessPaymentResult->WebActiveMemberships,1)).'</pre>');\r\n\t\t\t\t\t// redirect to success page\r\n\t\t\t\t\t$querystring = array(\r\n\t\t\t\t\t\t'City' => trim(str_replace(\"2\", \"\",$result->ProcessPaymentResult->WebActiveMemberships->MarketName)),\r\n\t\t\t\t\t\t'Email' => $form_state['storage']['values']['email'],\r\n\t\t\t\t\t\t'TotalAmountCents' => $form_state['storage']['values']['ValidateResult']->TotalAmountCents,\r\n\t\t\t\t\t\t'PackageMinutes' => $form_state['storage']['values']['ValidateResult']->PackageMinutes,\r\n\t\t\t\t\t\t'IvrMembershipNumber' => $result->ProcessPaymentResult->IvrMembershipNumber,\r\n\t\t\t\t\t\t'IvrPasscode' => $result->ProcessPaymentResult->IvrPasscode,\r\n\t\t\t\t\t\t'LocalAccessNumber' => $result->ProcessPaymentResult->LocalAccessNumber,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_goto('cart/result/creditcardasu',$querystring);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'AuthorizationDeclined':\r\n\t\t\t\tcase 'RiskScoreReject':\r\n\t\t\t\tcase 'RiskScoreReview':\r\n\t\t\t\tcase 'AuthorizationTechnicalIssue':\r\n\t\t\t\tcase 'RtmFailure':\r\n\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ProcessPaymentResult->ErrMsg)),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\t// go back to modify a value\r\n\tif($form_state['clicked_button']['#id'] == 'edit-back')\r\n\t{\r\n\t\tunset($form_state['storage']['step']);\r\n\t\t$form_state['storage']['values']['packages'] = $form_state['values']['packages'];\r\n\t\t\r\n\t}\r\n}", "function respond()\r\n\t{\r\n\t\t$ROOT_PATH__= str_replace ( 'includes/modules/payment/alipayapp.php', '', str_replace ( '\\\\', '/', __FILE__ ) ) ;\r\n\t\tinclude_once ($ROOT_PATH__ . 'api/EBaoApp/eba_logManager.class.php');\r\n\t\tEba_LogManager::logPayResonse('postdata from alipay for alipay sdk ');\r\n\t\t//end\r\n\t\t//订单号\r\n\t\t$out_trade_no = $_REQUEST['out_trade_no'];\r\n\t\t//订单金额\r\n\t\t$total_fee = $_REQUEST['total_fee'];\r\n\t\t//订单状态\r\n\t\t$trade_status = $_REQUEST['trade_status'];\r\n\t\t\r\n\t\t//日志号\r\n\t\t$log_id = explode('-',$out_trade_no);\r\n\t\t$log_id = $log_id[1];\r\n// \t\t/* 检查支付的金额是否相符 */\r\n// \t\tif (!check_money($log_id, $total_fee))\r\n// \t\t{\r\n// \t\t\tEba_LogManager::log('postdata from alipaysdk for alipayapp total_fee is checked fail '.$total_fee .' order_sn'.$order_sn);\r\n// \t\t\treturn false;\r\n// \t\t}\r\n\t\r\n\t\tif ($trade_status == 'WAIT_SELLER_SEND_GOODS')\r\n\t\t{\r\n\t\t\tss_log(\"alipay into order_paid ,WAIT_SELLER_SEND_GOODS, order_sn: \".$out_trade_no);\r\n\t\t\t/* 改变订单状态 */\r\n\t\t\torder_paid($log_id, 2);\r\n\t\t\techo \"success\";\t\t//请不要修改或删除\r\n\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telseif ($trade_status == 'TRADE_FINISHED')\r\n\t\t{\r\n\t\t\tss_log(\"alipay into order_paid ,TRADE_FINISHED, order_sn: \".$out_trade_no);\r\n\t\t\t/* 改变订单状态 */\r\n\t\t\torder_paid($log_id);\r\n\t\t\techo \"success\";\t\t//请不要修改或删除\r\n\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telseif ($trade_status == 'TRADE_SUCCESS')\r\n\t\t{\r\n\t\t\tss_log(\"alipay into order_paid ,TRADE_SUCCESS, order_sn: \".$out_trade_no);\r\n\t\t\t \r\n\t\t\t/* 改变订单状态 */\r\n\t\t\torder_paid($log_id, 2);\r\n\t\t\techo \"success\";\t\t//请不要修改或删除\r\n\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }", "public function getPaymentRequest(): string;", "public function getProduct() {\n\t\t// if this is just a model made on our end, we might not the serialized product yet\n\t\t// alternatively: newer BillForward may omit serialized product and necessitate a fetch\n\t\tif (!$this->product) {\n\t\t\tif (!$this->productID) {\n\t\t\t\tthrow new Bf_PreconditionFailedException(\"This Bf_ProductRatePlan has neither a 'product' specified, nor a 'productID' by which to obtain said product.\");\n\t\t\t}\n\t\t\t$this->product = Bf_Product::getByID($this->productID);\n\t\t}\n\t\treturn $this->product;\n\t}", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "function teligence_purchase_buypackage32_form($form_state)\r\n{\r\n\tif($form_state['storage']['step'] == 'verifyorder')\r\n\t{\r\n\t\tdrupal_set_title(t('Review Purchase'));\r\n\t\t$form['verifyorder32'] = array(\r\n\t\t\t'#theme'=> 'teligence_purchase_verifyorder',\r\n\t\t\t'#value' => $form_state['storage']['values'],\r\n\t\t);\r\n\t\t$form['packages'] = array(\r\n\t\t\t'#type' => 'hidden',\r\n\t\t\t'#default_value' => $form_state['storage']['values']['packages'],\r\n\t\t);\r\n\t\t$form['back'] = array(\r\n\t\t\t'#type' => 'submit',\r\n\t\t\t'#value' => t('Go Back'),\r\n\t\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t\t);\r\n\t\t$form['placeorder'] = array(\r\n\t\t\t'#type' => 'submit',\r\n\t\t\t'#value' => t('Place Order'),\r\n\t\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t\t);\r\n\t\treturn $form;\r\n\t}\r\n\t\r\n\t$form['#pre_render'] = array('teligence_purchase_buypackage_form_prerender');\r\n\t$form['#after_build'] = array('teligence_purchase_buypackage_form_afterbuild');\r\n\t\r\n\t// get markets\r\n\t// find default region and market; localization\r\n\t$region = key((array)$_SESSION['stateprovincecity']['city']);\r\n\tif(key_exists(strtoupper(filter_var($_SESSION['localization']->Region,FILTER_SANITIZE_URL)), $_SESSION['stateprovincecity']['city']))\r\n\t\t$region = $_SESSION['localization']->Region;\r\n\t$sanitizedRegion = strtoupper(filter_var($region,FILTER_SANITIZE_URL));\r\n\t$form['location']['stateprovince'] = array(\r\n\t\t'#type' => 'select',\r\n\t\t'#title' => t('State/Province'),\r\n\t\t'#default_value' => isset($form_state['storage']['values']['stateprovince'])?$form_state['storage']['values']['stateprovince']:$sanitizedRegion,\r\n\t\t'#options' => (array)$_SESSION['stateprovincecity']['stateprovince'],\r\n\t);\r\n\t$marketId = key((array)$_SESSION['stateprovincecity']['city'][$sanitizedRegion]);\r\n\tif(key_exists($_SESSION['localization']->MarketId, (array)$_SESSION['stateprovincecity']['city'][$sanitizedRegion]))\r\n\t\t$marketId = $_SESSION['localization']->MarketId;\r\n\t$form['location']['city'] = array(\r\n\t\t'#type' => 'select',\r\n\t\t'#title' => t('City'),\r\n\t\t'#default_value' => isset($form_state['storage']['values']['city'])?$form_state['storage']['values']['city']:$marketId,\r\n\t);\r\n\t\r\n\t// get packages\r\n\t$form['packages'] = array(\r\n\t\t'#type' => 'radios',\r\n\t\t'#theme' => 'teligence_purchase_packagesradios',\r\n\t\t'#default_value' => $form_state['storage']['values']['packages'],\r\n\t);\r\n\t\r\n\t// payment information\r\n\t$form['payment']['paymethods'] = array(\r\n\t\t'#type' => 'radios',\r\n\t\t'#options' => array('pp'=>'PayPal', 'cc'=>t('Credit Card')),\r\n\t\t'#default_value' => $form_state['storage']['values']['paymethods'],\r\n\t);\r\n\t$form['payment']['cardholdername'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t(\"Cardholder's Name\"),\r\n\t\t'#default_value' => $form_state['storage']['values']['cardholdername'],\r\n\t);\r\n\t$form['payment']['cardnumber'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Card Number'),\r\n\t\t'#default_value' => $form_state['storage']['values']['cardnumber'],\r\n\t\t'#pre_render' => array('teligence_purchase_ccn_prerender'),\r\n\t);\r\n\t$form['payment']['securitycode'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Security Code'),\r\n\t\t'#default_value' => $form_state['storage']['values']['securitycode'],\r\n\t\t'#pre_render' => array('teligence_purchase_cvv_prerender'),\r\n\t);\r\n\t$form['payment']['zippostal'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Billing ').($_SESSION['localization']->Country == 'Canada' ? t('Postal Code') : t('Zip Code')),\r\n\t\t'#default_value' => $form_state['storage']['values']['zippostal'],\r\n\t);\r\n\t$form['payment']['cc_expiration'] = array (\r\n \t'#type'=>'date',\r\n \t'#title'=>t('Expiration Date'),\r\n \t'#theme' => 'teligence_purchase_ccexpirationdate',\r\n \t'#description'=>t('Enter expiration date on card'),\r\n \t'#default_value' => $form_state['storage']['values']['cc_expiration'],\r\n );\r\n\t\r\n\t$form['submitpurchase'] = array(\r\n\t\t'#type' => 'submit',\r\n\t\t'#value' => t('Complete My Purchase'),\r\n\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t);\r\n\t\r\n\treturn $form;\r\n}", "function validateEDPrice($field = Null){\n\t\tif(isset($this->data['ProductSeller']['express_delivery'])) {\n\t\t\tif(($this->data['ProductSeller']['express_delivery'] == '0') || ($this->data['ProductSeller']['express_delivery'] == '')){\n\t\t\t\treturn true;\n\t\t\t} else{\n\t\t\t\tif(!empty($this->data['ProductSeller']['express_delivery_price'])){\n\t\t\t\t\tif($this->data['ProductSeller']['express_delivery_price'] < 0){\n\t\t\t\t\t\treturn 'Express delivery price should be positive';\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn \"Enter express delivery price\";\n\t\t\t\t}\n\t\t\t}\n\t\t} else{\n\t\t\treturn true;\n\t\t}\n\t}", "public function hookactionUpdateQuantity($params)\n {\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n \n $context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n $product = new Product($id_product, false, $id_lang, $id_shop, $context);\n \n if (empty($product)) {\n return;\n }\n \n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $product_has_attributes = $product->hasAttributes();\n $productInfo = array(\n 'product_name' => $product_name,\n 'product_id' => $id_product\n );\n $check_oos = ($product_has_attributes && $id_product_attribute)\n || (!$product_has_attributes && !$id_product_attribute);\n $product_quantity = (int)$params['quantity'];\n if (Module::isInstalled('mailalerts')) {\n // For out of stock notification to admin\n $isActivate = $this->isRulesetActive('out_of_stock_alerts');\n if ($check_oos\n && $product->active == 1\n && $isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity <= $this->outStock) {\n $legendstemp = $this->replaceProductLegends(\n $isActivate[0]['template'],\n $productInfo\n );\n // Use send SMS API here\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $this->adminMobile\n );\n \n $this->sendSMSByAPI($postAPIdata);\n Onehopsmsservice::onehopSaveLog('OutStock', $legendstemp, $this->adminMobile);\n }\n \n // For back in stock\n $isActivate = $this->isRulesetActive('back_of_stock_alerts');\n if ($isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity > 0) {\n $bosSql = 'SELECT DISTINCT adr.phone_mobile, oos.id_customer';\n $bosSql .= ' FROM '._DB_PREFIX_. 'mailalert_customer_oos as oos';\n $bosSql .= ' INNER JOIN '._DB_PREFIX_. 'address as adr ON oos.id_customer = adr.id_customer';\n $bosSql .= ' WHERE oos.id_product = \"' . (int)$id_product . '\" AND deleted = 0';\n $bosResults = Db::getInstance()->ExecuteS($bosSql);\n \n if ($bosResults) {\n foreach ($bosResults as $customerVal) {\n $customerInfo = array(\n 'id_customer' => $customerVal['id_customer'],\n 'phone_mobile' => $customerVal['phone_mobile']\n );\n $legendstemp = $this->replaceProductCustomerLegends(\n $isActivate[0]['template'],\n $customerInfo,\n $productInfo\n );\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n // Use send SMS API here\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $customerVal['phone_mobile']\n );\n $this->sendSMSByAPI($postAPIdata);\n $delQuery = 'DELETE FROM ' . _DB_PREFIX_ . 'mailalert_customer_oos';\n $delQuery .= ' WHERE id_customer = \"' . (int)$customerVal['id_customer'] . '\"';\n Db::getInstance()->execute($delQuery);\n Onehopsmsservice::onehopSaveLog('BackStock', $legendstemp, $customerVal['phone_mobile']);\n }\n }\n }\n }\n }", "private function isFlow(){\r\n return $this->getPaymentMethod() == 9;\r\n }", "public function paypalRequest() {\r\n $this->dashboard_p_model->paypalConfig();\r\n if ($_POST) {\r\n $ItemName = $_POST[\"itemname\"]; //Item Name\r\n $ItemPrice = $_POST[\"itemprice\"]; //Item Price\r\n $ItemNumber = $_POST[\"itemnumber\"]; //Item Number\r\n $ItemDesc = $_POST[\"itemdesc\"]; //Item Number\r\n //$ItemQty = $_POST[\"itemQty\"]; // Item Quantity\r\n $ItemQty = 1;\r\n //$ItemTotalPrice = ($ItemPrice * $ItemQty); //(Item Price x Quantity = Total) Get total amount of product; \r\n $ItemTotalPrice = $ItemPrice;\r\n //call the paypal API \r\n\r\n $GrandTotal = $ItemTotalPrice;\r\n $TotalTaxAmount = 0;\r\n $ShippinCost = 0;\r\n $HandalingCost = 0;\r\n $ShippinDiscount = 0;\r\n $InsuranceCost = 0;\r\n\r\n //Parameters for SetExpressCheckout, which will be sent to PayPal\r\n $padata = '&METHOD=SetExpressCheckout' .\r\n '&RETURNURL=' . urlencode(PayPalReturnURL) .\r\n '&CANCELURL=' . urlencode(PayPalCancelURL) .\r\n '&PAYMENTREQUEST_0_PAYMENTACTION=' . urlencode(\"SALE\") .\r\n '&L_PAYMENTREQUEST_0_NAME0=' . urlencode($ItemName) .\r\n '&L_PAYMENTREQUEST_0_NUMBER0=' . urlencode($ItemNumber) .\r\n '&L_PAYMENTREQUEST_0_DESC0=' . urlencode($ItemDesc) .\r\n '&L_PAYMENTREQUEST_0_AMT0=' . urlencode($ItemPrice) .\r\n '&L_PAYMENTREQUEST_0_QTY0=' . urlencode($ItemQty) .\r\n '&NOSHIPPING=0' . //set 1 to hide buyer's shipping address, in-case products that does not require shipping\r\n\r\n '&PAYMENTREQUEST_0_ITEMAMT=' . urlencode($ItemTotalPrice) .\r\n '&PAYMENTREQUEST_0_TAXAMT=' . urlencode($TotalTaxAmount) .\r\n '&PAYMENTREQUEST_0_SHIPPINGAMT=' . urlencode($ShippinCost) .\r\n '&PAYMENTREQUEST_0_HANDLINGAMT=' . urlencode($HandalingCost) .\r\n '&PAYMENTREQUEST_0_SHIPDISCAMT=' . urlencode($ShippinDiscount) .\r\n '&PAYMENTREQUEST_0_INSURANCEAMT=' . urlencode($InsuranceCost) .\r\n '&PAYMENTREQUEST_0_AMT=' . urlencode($GrandTotal) .\r\n '&PAYMENTREQUEST_0_CURRENCYCODE=' . urlencode(PayPalCurrencyCode) .\r\n '&LOCALECODE=GB' . //PayPal pages to match the language on your website.\r\n '&LOGOIMG=http://www.sanwebe.com/wp-content/themes/sanwebe/img/logo.png' . //site logo\r\n '&CARTBORDERCOLOR=FFFFFF' . //border color of cart\r\n '&ALLOWNOTE=1';\r\n ############# set session variable we need later for \"DoExpressCheckoutPayment\" #######\r\n $_SESSION['ItemName'] = $ItemName; //Item Name\r\n $_SESSION['ItemPrice'] = $ItemPrice; //Item Price\r\n $_SESSION['ItemNumber'] = $ItemNumber; //Item Number\r\n $_SESSION['ItemDesc'] = $ItemDesc; //Item Number\r\n $_SESSION['ItemQty'] = $ItemQty; // Item Quantity\r\n $_SESSION['ItemTotalPrice'] = $ItemTotalPrice; //(Item Price x Quantity = Total) Get total amount of product; \r\n $_SESSION['TotalTaxAmount'] = $TotalTaxAmount; //Sum of tax for all items in this order. \r\n $_SESSION['HandalingCost'] = $HandalingCost; //Handling cost for this order.\r\n $_SESSION['InsuranceCost'] = $InsuranceCost; //shipping insurance cost for this order.\r\n $_SESSION['ShippinDiscount'] = $ShippinDiscount; //Shipping discount for this order. Specify this as negative number.\r\n $_SESSION['ShippinCost'] = $ShippinCost; //Although you may change the value later, try to pass in a shipping amount that is reasonably accurate.\r\n $_SESSION['GrandTotal'] = $GrandTotal;\r\n\r\n //We need to execute the \"SetExpressCheckOut\" method to obtain paypal token\r\n\r\n $httpParsedResponseAr = $this->dashboard_p_model->PPHttpPost('SetExpressCheckout', $padata, PayPalApiUsername, PayPalApiPassword, PayPalApiSignature, PayPalMode);\r\n /* echo '-------------------------';\r\n echo(\"<pre>\");\r\n print_r($httpParsedResponseAr);\r\n echo(\"</pre>\");*/\r\n //Respond according to message we receive from Paypal\r\n if (\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\r\n //Redirect user to PayPal store with Token received.\r\n $paypalurl = 'https://www.'.PayPalMode.'.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=' . $httpParsedResponseAr[\"TOKEN\"] . '';\r\n // echo $paypalurl;\r\n header('Location: ' . $paypalurl);\r\n return true;\r\n } else {\r\n //Show error message\r\n $this->session->userdata[\"paypal_msg\"] = ' <div style=\"color:red\"><b>Error : </b>' . urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]) . '</div>';\r\n redirect(base_url().'dasboardProfessional');\r\n\t\t\t /* echo '<pre>';\r\n print_r($httpParsedResponseAr);\r\n echo '</pre>';*/\r\n // return false;\r\n }\r\n }\r\n //***\r\n //Paypal redirects back to this page using ReturnURL, We should receive TOKEN and Payer ID\r\n if (isset($_GET[\"token\"]) && isset($_GET[\"PayerID\"])) {\r\n //we will be using these two variables to execute the \"DoExpressCheckoutPayment\"\r\n //Note: we haven't received any payment yet.\r\n $token = $_GET[\"token\"];\r\n $payer_id = $_GET[\"PayerID\"];\r\n //get session variables\r\n $ItemName = $_SESSION['ItemName']; //Item Name\r\n $ItemPrice = $_SESSION['ItemPrice']; //Item Price\r\n $ItemNumber = $_SESSION['ItemNumber']; //Item Number\r\n $ItemDesc = $_SESSION['ItemDesc']; //Item Number\r\n $ItemQty = $_SESSION['ItemQty']; // Item Quantity\r\n $ItemTotalPrice = $_SESSION['ItemTotalPrice']; //(Item Price x Quantity = Total) Get total amount of product; \r\n $TotalTaxAmount = $_SESSION['TotalTaxAmount']; //Sum of tax for all items in this order. \r\n $HandalingCost = $_SESSION['HandalingCost']; //Handling cost for this order.\r\n $InsuranceCost = $_SESSION['InsuranceCost']; //shipping insurance cost for this order.\r\n $ShippinDiscount = $_SESSION['ShippinDiscount']; //Shipping discount for this order. Specify this as negative number.\r\n $ShippinCost = $_SESSION['ShippinCost']; //Although you may change the value later, try to pass in a shipping amount that is reasonably accurate.\r\n $GrandTotal = $_SESSION['GrandTotal'];\r\n\r\n $padata = '&TOKEN=' . urlencode($token) .\r\n '&PAYERID=' . urlencode($payer_id) .\r\n '&PAYMENTREQUEST_0_PAYMENTACTION=' . urlencode(\"SALE\") .\r\n //set item info here, otherwise we won't see product details later\t\r\n '&L_PAYMENTREQUEST_0_NAME0=' . urlencode($ItemName) .\r\n '&L_PAYMENTREQUEST_0_NUMBER0=' . urlencode($ItemNumber) .\r\n '&L_PAYMENTREQUEST_0_DESC0=' . urlencode($ItemDesc) .\r\n '&L_PAYMENTREQUEST_0_AMT0=' . urlencode($ItemPrice) .\r\n '&L_PAYMENTREQUEST_0_QTY0=' . urlencode($ItemQty) .\r\n /*\r\n //Additional products (L_PAYMENTREQUEST_0_NAME0 becomes L_PAYMENTREQUEST_0_NAME1 and so on)\r\n '&L_PAYMENTREQUEST_0_NAME1='.urlencode($ItemName2).\r\n '&L_PAYMENTREQUEST_0_NUMBER1='.urlencode($ItemNumber2).\r\n '&L_PAYMENTREQUEST_0_DESC1=Description text'.\r\n '&L_PAYMENTREQUEST_0_AMT1='.urlencode($ItemPrice2).\r\n '&L_PAYMENTREQUEST_0_QTY1='. urlencode($ItemQty2).\r\n */\r\n\r\n '&PAYMENTREQUEST_0_ITEMAMT=' . urlencode($ItemTotalPrice) .\r\n '&PAYMENTREQUEST_0_TAXAMT=' . urlencode($TotalTaxAmount) .\r\n '&PAYMENTREQUEST_0_SHIPPINGAMT=' . urlencode($ShippinCost) .\r\n '&PAYMENTREQUEST_0_HANDLINGAMT=' . urlencode($HandalingCost) .\r\n '&PAYMENTREQUEST_0_SHIPDISCAMT=' . urlencode($ShippinDiscount) .\r\n '&PAYMENTREQUEST_0_INSURANCEAMT=' . urlencode($InsuranceCost) .\r\n '&PAYMENTREQUEST_0_AMT=' . urlencode($GrandTotal) .\r\n '&PAYMENTREQUEST_0_CURRENCYCODE=' . urlencode($PayPalCurrencyCode);\r\n\r\n //We need to execute the \"DoExpressCheckoutPayment\" at this point to Receive payment from user.\r\n $httpParsedResponseAr = $this->dashboard_p_model->PPHttpPost('DoExpressCheckoutPayment', $padata, PayPalApiUsername, PayPalApiPassword, PayPalApiSignature, PayPalMode);\r\n\r\n //Check if everything went ok..\r\n if (\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\r\n\r\n //echo '<h2>Success</h2>';\r\n // echo 'Your Transaction ID : ' . urldecode($httpParsedResponseAr[\"PAYMENTINFO_0_TRANSACTIONID\"]);\r\n\r\n /*\r\n //Sometimes Payment are kept pending even when transaction is complete.\r\n //hence we need to notify user about it and ask him manually approve the transiction\r\n */\r\n\r\n if ('Completed' == $httpParsedResponseAr[\"PAYMENTINFO_0_PAYMENTSTATUS\"]) {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:green\">Payment Received! Your product will be sent to you very soon!</div>';\r\n\t\t\t\t\t// do data insertions here\r\n } elseif ('Pending' == $httpParsedResponseAr[\"PAYMENTINFO_0_PAYMENTSTATUS\"]) {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:red\">Transaction Complete, but payment is still pending! ' .\r\n 'You need to manually authorize this payment in your <a target=\"_new\" href=\"http://www.paypal.com\">Paypal Account</a></div>';\r\n }\r\n\r\n // we can retrive transection details using either GetTransactionDetails or GetExpressCheckoutDetails\r\n // GetTransactionDetails requires a Transaction ID, and GetExpressCheckoutDetails requires Token returned by SetExpressCheckOut\r\n $padata = '&TOKEN=' . urlencode($token);\r\n\r\n $httpParsedResponseAr = $this->dashboard_p_model->PPHttpPost('GetExpressCheckoutDetails', $padata, $PayPalApiUsername, $PayPalApiPassword, $PayPalApiSignature, $PayPalMode);\r\n\r\n if (\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\r\n\r\n \t\t\t\t\t\r\n\t\t\t\t\t$buyerName = $httpParsedResponseAr[\"FIRSTNAME\"].' '.$httpParsedResponseAr[\"LASTNAME\"];\r\n\t\t\t\t\t$buyerEmail = urldecode($httpParsedResponseAr[\"EMAIL\"]);\r\n\t\t\t\t\t$transactionID =urldecode($httpParsedResponseAr[\"PAYMENTREQUEST_0_TRANSACTIONID\"]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$insert_row = $this->dashboard_p_model->savePaypalTransaction($buyerName,$buyerEmail,$transactionID,$ItemName,$ItemNumber, $ItemTotalPrice,$ItemQTY,$ItemDesc);\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($insert_row){\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \tredirect(base_url().'dasboardProfessional');\r\n\t\t\t\t\t}\r\n\r\n // return true;\r\n } else {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:red\"><b>GetTransactionDetails failed:</b>' . urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]) . '</div>';\r\n\t\t\t\t\tredirect(base_url().'dasboardProfessional');\r\n \r\n\t\t\t\t // echo '<pre>';\r\n // print_r($httpParsedResponseAr);\r\n // echo '</pre>';\r\n // return false;\r\n }\r\n \r\n } else {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:red\"><b>Error : </b>' . urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]) . '</div>';\r\n redirect(base_url().'dasboardProfessional');\r\n\t\t\t\t//echo '<pre>';\r\n //print_r($httpParsedResponseAr);\r\n //echo '</pre>';\r\n //return false;\r\n }\r\n\r\n //*** \r\n }\r\n }", "function teligence_purchase_buypackage31_form($form_state)\r\n{\r\n\tif($form_state['storage']['step'] == 'verifyorder')\r\n\t{\r\n\t\tdrupal_set_title(t('Review Purchase'));\r\n\t\t$form['verifyorder31'] = array(\r\n\t\t\t'#theme'=> 'teligence_purchase_verifyorder',\r\n\t\t\t'#value' => $form_state['storage']['values'],\r\n\t\t);\r\n\t\t$form['packages'] = array(\r\n\t\t\t'#type' => 'hidden',\r\n\t\t\t'#default_value' => $form_state['storage']['values']['packages'],\r\n\t\t);\r\n\t\t$form['back'] = array(\r\n\t\t\t'#type' => 'submit',\r\n\t\t\t'#value' => t('Go Back'),\r\n\t\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t\t);\r\n\t\t$form['placeorder'] = array(\r\n\t\t\t'#type' => 'submit',\r\n\t\t\t'#value' => t('Place Order'),\r\n\t\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t\t);\r\n\t\treturn $form;\r\n\t}\r\n\t\r\n\t$form['#pre_render'] = array('teligence_purchase_buypackage_form_prerender');\r\n\t$form['#after_build'] = array('teligence_purchase_buypackage_form_afterbuild');\r\n\t\r\n\t// debug logging\t\r\n\tif(variable_get('teligence_purchase_debug', 0))\r\n\t\twatchdog('debug',\"SESSION['localization']: @loc\",array('@loc'=>print_r($_SESSION['localization'],TRUE)));\r\n\t\r\n\t// get markets\r\n\t// find default region and market; localization\r\n\t$region = key((array)$_SESSION['stateprovincecity']['city']);\r\n\tif(key_exists(strtoupper(filter_var($_SESSION['localization']->Region,FILTER_SANITIZE_URL)), $_SESSION['stateprovincecity']['city']))\r\n\t\t$region = $_SESSION['localization']->Region;\r\n\t$sanitizedRegion = strtoupper(filter_var($region,FILTER_SANITIZE_URL));\r\n\t$form['location']['stateprovince'] = array(\r\n\t\t'#type' => 'select',\r\n\t\t'#title' => t('State/Province'),\r\n\t\t'#default_value' => isset($form_state['storage']['values']['stateprovince'])?$form_state['storage']['values']['stateprovince']:$sanitizedRegion,\r\n\t\t'#options' => (array)$_SESSION['stateprovincecity']['stateprovince'],\r\n\t);\r\n\t$marketId = key((array)$_SESSION['stateprovincecity']['city'][$sanitizedRegion]);\r\n\tif(key_exists($_SESSION['localization']->MarketId, (array)$_SESSION['stateprovincecity']['city'][$sanitizedRegion]))\r\n\t\t$marketId = $_SESSION['localization']->MarketId;\n\t$form['location']['city'] = array(\r\n\t\t'#type' => 'select',\r\n\t\t'#title' => t('City'),\r\n\t\t'#default_value' => isset($form_state['storage']['values']['city'])?$form_state['storage']['values']['city']:$marketId,\r\n\t);\r\n\t\r\n\t// get packages\r\n\t$form['packages'] = array(\r\n\t\t'#type' => 'radios',\r\n\t\t'#theme' => 'teligence_purchase_packagesradios',\r\n\t\t'#default_value' => $form_state['storage']['values']['packages'],\r\n\t);\r\n\t\r\n\t// account information\r\n\t$form['account']['email'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Email'),\r\n\t\t'#pre_render' => array('teligence_purchase_email_prerender'),\r\n\t\t'#default_value' => $form_state['storage']['values']['email'],\r\n\t);\r\n\t$form['account']['password'] = array(\r\n\t\t'#type' => 'password',\r\n\t\t'#title' => t('Password'),\r\n\t\t'#pre_render' => array('teligence_purchase_password_prerender'),\r\n\t\t'#description' => t('Password must be at least 6 characters long.'),\r\n\t\t'#default_value' => $form_state['storage']['values']['password'],\r\n\t);\r\n\t$form['account']['confirm'] = array(\r\n\t\t'#type' => 'password',\r\n\t\t'#title' => t('Confirm Password'),\r\n\t\t'#pre_render' => array('teligence_purchase_password_prerender'),\r\n\t\t'#description' => t('Password must be at least 6 characters long.'),\r\n\t\t'#default_value' => $form_state['storage']['values']['confirm'],\r\n\t);\r\n\t\r\n\t// payment information\r\n\t$form['payment']['paymethods'] = array(\r\n\t\t'#type' => 'radios',\r\n\t\t'#options' => array('pp'=>'PayPal', 'cc'=>t('Credit Card')),\r\n\t\t'#default_value' => $form_state['storage']['values']['paymethods'],\r\n\t);\r\n\t$form['payment']['cardholdername'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t(\"Cardholder's Name\"),\r\n\t\t'#default_value' => $form_state['storage']['values']['cardholdername'],\r\n\t);\r\n\t$form['payment']['cardnumber'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Card Number'),\r\n\t\t'#default_value' => $form_state['storage']['values']['cardnumber'],\r\n\t\t'#pre_render' => array('teligence_purchase_ccn_prerender'),\r\n\t);\r\n\t$form['payment']['securitycode'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Security Code'),\r\n\t\t'#default_value' => $form_state['storage']['values']['securitycode'],\r\n\t\t'#pre_render' => array('teligence_purchase_cvv_prerender'),\r\n\t);\r\n\t$form['payment']['zippostal'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Billing ').($_SESSION['localization']->Country == 'Canada' ? t('Postal Code') : t('Zip Code')),\r\n\t\t'#default_value' => $form_state['storage']['values']['zippostal'],\r\n\t);\r\n\t$form['payment']['cc_expiration'] = array (\r\n \t'#type'=>'date',\r\n \t'#title'=>t('Expiration Date'),\r\n \t'#theme' => 'teligence_purchase_ccexpirationdate',\r\n \t'#description'=>t('Enter expiration date on card'),\r\n \t'#default_value' => $form_state['storage']['values']['cc_expiration'],\r\n );\r\n\t\r\n\t$form['submitpurchase'] = array(\r\n\t\t'#type' => 'submit',\r\n\t\t'#value' => t('Complete My Purchase'),\r\n\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t);\r\n\t\r\n\treturn $form;\r\n}", "function upgrade_400()\n {\n }", "function IndusIndPL($strnet_salary, $company, $category, $DOB, $clubbed_emi, $city, $reqtenure, $reqloanamount) {\n $net_salary = $strnet_salary;\n\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n\n if ($category == \"A+\" || $category == \"CAT A\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = \"12.99\";\n $intr = $interestrate;\n $proc_fee = \"0.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"13.75\";\n $intr = $interestrate ;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"14.75\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"13.50\";\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.25\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } elseif ($term == 60) {\n $getterm = 5;\n } else {\n $getterm = 5;\n }\n } else if ($category == \"CAT B\" || $category == \"CAT G\" || $category == \"C1000\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 14.00;\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 15.00;\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 16.00;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else if ($category == \"CAT C\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 17.50;\n $intr = $interestrate;\n $proc_fee = \"1.25%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 18;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 19;\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"18.50\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"19\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"20\";\n $intr = $interestrate;\n $proc_fee = \"2.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else {\n /* if ($net_salary >= 100000) {\n $interestrate = \"17\";\n $intr = 17;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 50000 && $net_salary < 100000) {\n $interestrate = \"17.5\";\n $intr = 17.5;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"18\";\n $intr = 18;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }*/\n }\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $princ = 100000;\n if ($intr > 0) {\n $perlacemi = round($princ * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($princ, $intr, $term);\n //Calculate Loan Amount\n if ($net_salary >= 50000) {\n $firstnet_salary = ($net_salary * (70 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else if ($net_salary >= 25000 && $net_salary < 50000) {\n $firstnet_salary = ($net_salary * (50 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else {\n $finalloanamount_dbr = 0;\n }\n } else {\n $finalloanamount_dbr = 0;\n }\n //other eiligibility\n if ($net_salary >= 50000) {\n $finalloanamount_other = $net_salary * 18;\n } else {\n $finalloanamount_other = $net_salary * 18;\n }\n $finalloanamount = 0;\n if ($finalloanamount_other < $finalloanamount_dbr) {\n $finalloanamount = $finalloanamount_other;\n } else {\n $finalloanamount = $finalloanamount_dbr;\n }\n if ($finalloanamount > 2500000) {\n if (strlen($category) > 1) {\n $getloanamout = 2500000;\n } else {\n $getloanamout = 700000;\n }\n } else {\n if (strlen($category) > 1) {\n $getloanamout = $finalloanamount;\n } else {\n if ($finalloanamount > 700000) {\n $getloanamout = 700000;\n } else {\n $getloanamout = $finalloanamount;\n }\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n if ($intr > 0) {\n if (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 700000 && $getloanamout < 1500000 && $net_salary >= 75000) {\n $interestrate = \"13.49\";\n $intr = 13.49;\n $proc_fee = \"0.49%\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 1500000 && $net_salary >= 100000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_fee = \"Rs. 4999\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n }\n } else {\n $getemicalc = 0;\n }\n\t\t\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $term))));\n $details['bank_code'] = \"Indus Ind Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $proc_fee;\n $details['category'] = $category;\n return($details);\n }", "public function sendData($data)\n {\n return $this->response = new LegacyExpressPurchaseResponse($this, $data);\n }", "public function createPurchaseOrder(Request $request)\n {\n $data = $request->input();\n\n $suppliers = array();\n\n foreach ($data as $key => $value) {\n $bestSupplier = ProductSuppliers::getBestSupplierForProduct($key);\n\n if(array_key_exists($bestSupplier['entity'], $suppliers))\n array_push($suppliers[$bestSupplier['entity']], $bestSupplier);\n else\n $suppliers[$bestSupplier['entity']] = [$bestSupplier];\n }\n\n foreach($suppliers as $supplier) {\n $documentLines = [];\n\n for($i = 0; $i < count($supplier); $i++) {\n $product = [\n 'description' => $supplier[$i]['description'],\n 'quantity' => $data[$supplier[$i]['product']],\n 'unitPrice' => number_format(floatval($supplier[$i]['price']), 2),\n 'deliveryDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\")+1, date(\"Y\"))),\n 'unit' => 'UN',\n 'itemTaxSchema' => 'ISENTO',\n 'purchasesItem' => $supplier[$i]['product'],\n 'documentLineStatus' => 'OPEN'\n ];\n\n array_push($documentLines, $product);\n }\n\n try {\n $result = JasminConnect::callJasmin('/purchases/orders', '', 'GET');\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n $seriesNumber = count(json_decode($result->getBody(), true)) + 1;\n\n try {\n $body = [\n 'documentType' => 'ECF',\n 'company' => 'TP-INDUSTRIES',\n 'serie' => '2019',\n 'seriesNumber' => $seriesNumber,\n 'documentDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'postingDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'SellerSupplierParty' => $supplier[0]['entity'],\n 'SellerSupplierPartyName' => $supplier[0]['name'],\n 'accountingParty' => $supplier[0]['entity'],\n 'exchangeRate' => 1,\n 'discount' => 0,\n 'loadingCountry' => $supplier[0]['country'],\n 'unloadingCountry' => 'PT',\n 'currency' => 'EUR',\n 'paymentMethod' => 'NUM',\n 'paymentTerm' => '01',\n 'documentLines' => $documentLines\n ];\n\n JasminConnect::callJasmin('/purchases/orders', '', 'POST', $body);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }\n\n return $data;\n }", "public function showServerResponse($product_data, $status, $display)\n {\n $successMessages = array(\n VALID => __('Your license key is activated('.$product_data['pluginName'].')', $this->pluginSlug),\n );\n\n $errorMessages = array(\n 'server_did_not_respond' => __('No response from server. Please try again later.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'license_activation_failed' => __('License Activation Failed. Please try again or contact support on [email protected]('.$product_data['pluginName'].')', $this->pluginSlug),\n 'no_license_key_entered' => __('Please enter license key.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'no_activations_left' => (!empty($display)) ? sprintf(__('Your License Key is already activated at : %s Please deactivate the license from one of the above site(s) to successfully activate it on your current site.('.$product_data['pluginName'].')', $this->pluginSlug), $display) : __('No Activations Left.('.$product_data['pluginName'].')', $this->pluginSlug),\n EXPIRED => __('Your license key has Expired. Please, Renew it.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'disabled' => __('Your License key is disabled('.$product_data['pluginName'].')', $this->pluginSlug),\n INVALID => __('Please enter valid license key('.$product_data['pluginName'].')', $this->pluginSlug),\n 'inactive' => __('Please try to activate license again. If it does not activate, contact support on [email protected]('.$product_data['pluginName'].')', $this->pluginSlug),\n 'site_inactive' => (!empty($display)) ? sprintf(__('Your License Key is already activated at : %s Please deactivate the license from one of the above site(s) to successfully activate it on your current site.('.$product_data['pluginName'].')', $this->pluginSlug), $display) : __('Site inactive (Press Activate license to activate plugin('.$product_data['pluginName'].'))', $this->pluginSlug),\n 'deactivated' => __('License Key is deactivated('.$product_data['pluginName'].')', $this->pluginSlug),\n 'default' => sprintf(__('Following Error Occurred: %s. Please contact support on [email protected] if you are not sure why this error is occurring('.$product_data['pluginName'].')', $this->pluginSlug), $status),\n 'server_curl_error' => __('There was an error while connecting to the server. please try again later.('.$product_data['pluginName'].')', $this->pluginSlug),\n );\n\n if ($status !== false) {\n if (array_key_exists($status, $successMessages)) {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $successMessages[$status],\n 'updated'\n );\n } else {\n if (array_key_exists($status, $errorMessages)) {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $errorMessages[$status],\n 'error'\n );\n } else {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $errorMessages['default'],\n 'error'\n );\n }\n }\n }\n }", "public function activate_license() {\n\n\t\t// listen for our activate button to be clicked\n\t\tif( isset( $_POST[ $this->product_slug . '_license_activate' ] ) ) {\n\n\t\t\t// run a quick security check\n\t\t \tif( ! check_admin_referer( $this->product_slug . '_license_nonce', $this->product_slug . '_license_nonce' ) )\n\t\t\t\treturn; // get out if we didn't click the Activate button\n\n\t\t\t// retrieve the license from the database\n\t\t\t$license = $_POST[ $this->product_slug . '-license-key' ];\n\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'activate_license',\n\t\t\t\t'license' => $license,\n\t\t\t\t'item_id' => urlencode( EAEL_SL_ITEM_ID ), // the ID of our product in EDD\n\t\t\t\t'url' => home_url()\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post( EAEL_STORE_URL,\n\t\t\t\tarray(\n\t\t\t\t\t'timeout' \t=> 15,\n\t\t\t\t\t'sslverify' => false,\n\t\t\t\t\t'body' \t\t=> $api_params\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\n\t\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t\t$message = $response->get_error_message();\n\t\t\t\t} else {\n\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t\tif ( false === $license_data->success ) {\n\n\t\t\t\t\tswitch( $license_data->error ) {\n\n\t\t\t\t\t\tcase 'expired' :\n\n\t\t\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\t\t__( 'Your license key expired on %s.' ),\n\t\t\t\t\t\t\t\tdate_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'revoked' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has been disabled.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'missing' :\n\n\t\t\t\t\t\t\t$message = __( 'Invalid license.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'invalid' :\n\t\t\t\t\t\tcase 'site_inactive' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license is not active for this URL.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'item_name_mismatch' :\n\n\t\t\t\t\t\t\t$message = sprintf( __( 'This appears to be an invalid license key for %s.' ), EAEL_SL_ITEM_NAME );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'no_activations_left':\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has reached its activation limit.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault :\n\n\t\t\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Check if anything passed on a message constituting a failure\n\t\t\tif ( ! empty( $message ) ) {\n\t\t\t\t$base_url = admin_url( 'admin.php?page=' . $this->get_settings_page_slug() );\n\t\t\t\t$redirect = add_query_arg( array( 'sl_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );\n\n\t\t\t\twp_redirect( $redirect );\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// $license_data->license will be either \"valid\" or \"invalid\"\n\n\t\t\t$this->set_license_key( $license );\n\t\t\t$this->set_license_status( $license_data->license );\n\n\t\t\twp_redirect( admin_url( 'admin.php?page=' . $this->get_settings_page_slug() ) );\n\t\t\texit();\n\t\t}\n\t}", "function _getIntlQuote($pkg, $method) {\r\n\t\tglobal $order;\r\n\t\tif (tep_not_null($method) && in_array($method, $this->intl_available)) {\r\n\t\t\t$request_types = array($method);\r\n\t\t} else {\r\n\t\t\t$request_types = $this->intl_available;\r\n\t\t}\r\n\t\t$this->intl_request_types = $request_types;\r\n\t\t$shipping_weight = ($pkg['item_weight'] < 0.0625 ? 0.0625 : $pkg['item_weight']);\r\n\t\t$shipping_pounds = floor($shipping_weight);\r\n\t\t$shipping_ounces = ceil((16 * ($shipping_weight - $shipping_pounds)) * 100) / 100; // rounded to two decimal digits\r\n\r\n\t\t// # if shipment is under one lb convert to ounces.\r\n\r\n\t\tif (SHIPPING_UNIT_WEIGHT == 'LBS' && $shipping_weight < 1.00) { \r\n\t\t\t$shipping_weight = ($shipping_weight / 16);\r\n\t\t}\r\n\r\n\t\t$nonuspsinsurancecost = 0;\r\n\t\tif (MODULE_SHIPPING_USPS_NON_USPS_INSURE == 'True') {\r\n\t\t\tif ($pkg['item_price'] <= 50) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS1;\r\n\t\t\t} else if ($pkg['item_price'] <= 100) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS2;\r\n\t\t\t}\telse if ($pkg['item_price'] <= 200) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS3;\r\n\t\t\t} else if ($pkg['item_price'] <= 300) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4;\r\n\t\t\t} else {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4 + ((ceil($pkg['item_price']/100) - 3) * MODULE_SHIPPING_USPS_INS5);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (empty($this->intl_maxinsure) || (MODULE_SHIPPING_USPS_INTL_INSURANCE_OPTION == 'False')) {\r\n\t\t\t$checkvalues = array($pkg['item_price']);\r\n\t\t} else {\r\n\t\t\t$checkvalues = array();\r\n\t\t\tforeach ($this->intl_maxinsure as $maxins) {\r\n\t\t\t\tif ($pkg['item_price'] <= $maxins) {\r\n\t\t\t\t\t$checkvalues[] = $pkg['item_price'];\r\n\t\t\t\t\tbreak; // stop once we find package value is less than allowed maximum\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$checkvalues[] = $maxins;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\trsort($checkvalues); // values must be checked in reverse order\r\n\t\t$request = \t'<IntlRateV2Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\">' .\r\n\t\t\t\t'<Revision>2</Revision>';\r\n\t\tforeach ($checkvalues as $pkgvalue) {\r\n\t\t\t$request .= '<Package ID=\"' . intval($pkgvalue) . '\">' .\r\n\t\t\t\t\t'<Pounds>' . $shipping_pounds . '</Pounds>' .\r\n\t\t\t\t\t'<Ounces>' . $shipping_ounces . '</Ounces>' .\r\n\t\t\t\t\t'<Machinable>True</Machinable>' .\r\n\t\t\t\t\t'<MailType>All</MailType>' .\r\n\t\t\t\t\t'<GXG>' .\r\n\t\t\t\t\t'<POBoxFlag>N</POBoxFlag>' .\r\n\t\t\t\t\t'<GiftFlag>N</GiftFlag>' .\r\n\t\t\t\t\t'</GXG>' .\r\n\t\t\t\t\t'<ValueOfContents>' . number_format($pkgvalue, 2, '.', '') . '</ValueOfContents>' .\r\n\t\t\t\t\t'<Country>' . $this->countries[$order->delivery['country']['iso_code_2']] . '</Country>' .\r\n\t\t\t\t\t'<Container>RECTANGULAR</Container>' .\r\n\t\t\t\t\t'<Size>' . ((max($pkg['item_length'], $pkg['item_width'], $pkg['item_height']) > 12) ? ' LARGE' : 'REGULAR') . '</Size>' .\r\n\t\t\t\t\t'<Width>' . $pkg['item_width'] . '</Width>' .\r\n\t\t\t\t\t'<Length>' . $pkg['item_length'] . '</Length>' .\r\n\t\t\t\t\t'<Height>' . $pkg['item_height'] . '</Height>' .\r\n\t\t\t\t\t'<Girth>' . ($pkg['item_height'] + $pkg['item_height'] + $pkg['item_width'] + $pkg['item_width']) . '</Girth>' .\r\n\t\t\t\t\t'<OriginZip>' . SHIPPING_ORIGIN_ZIP . '</OriginZip>' .\r\n\t\t\t\t\t\r\n\t\t\t\t\t'<CommercialFlag>Y</CommercialFlag>' .\r\n\t\t\t\t\t'<ExtraServices>' .\r\n\t\t\t\t\t'<ExtraService>1</ExtraService>' .\r\n\t\t\t\t\t'</ExtraServices>' .\r\n\t\t\t\t\t'</Package>';\r\n\t\t}\r\n\t\t$request .= '</IntlRateV2Request>';\r\n\t\t\r\n\t\t$request = \t'API=IntlRateV2&XML=' . urlencode($request);\r\n\t\t$usps_server = 'production.shippingapis.com';\r\n\t\t$api_dll = 'shippingAPI.dll';\r\n\t\t$body = '';\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES . 'http_client.php');\r\n\t\t}\r\n\t\t$http = new httpClient();\r\n\t\tif ($http->Connect($usps_server, 80)) {\r\n\t\t\t$http->addHeader('Host', $usps_server);\r\n\t\t\t$http->addHeader('User-Agent', 'IntenseCart eCommerce');\r\n\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\tif ($http->Get('/' . $api_dll . '?' . $request)) $body = $http->getBody();\r\n\t\t\t$http->Disconnect();\r\n\t\t} else {\r\n\t\t\t$body = '<Error><Number></Number><Description>' . MODULE_SHIPPING_USPS_TEXT_CONNECTION_ERROR . '</Description></Error>';\r\n\t\t}\r\n\t\t$doc = XML_unserialize($body);\r\n\t\t\r\n\t\t\r\n// \t\tprint_R( $doc );\r\n// \t\texit;\r\n\t\t\r\n\t\t\r\n\t\t$quotes = array();\r\n\t\tif (isset($doc['Error'])) return array('error' => $doc['Error']['Number'] . ' ' . $doc['Error']['Description']);\r\n\t\tif (isset($doc['IntlRateV2Response']['Package']['Error'])) return array('error' => $doc['IntlRateV2Response']['Package']['Error']['Number'] . ' ' . $doc['IntlRateV2Response']['Package']['Error']['Description']);\r\n\t\tif (isset($doc['IntlRateV2Response']['Package'][0]['Error'])) return array('error' => $doc['IntlRateV2Response']['Package']['Error'][0]['Number'] . ' ' . $doc['IntlRateV2Response']['Package'][0]['Error']['Description']);\r\n\t\tif (isset($doc['IntlRateV2Response']['Package']['Service']['SvcDescription'])) { // single mail service response\r\n\t\t\t$tmp = $this->_decode_intl_response($doc['RateV4Response']['Package']['Service'], $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t} elseif (isset($doc['IntlRateV2Response']['Package']['Service'][0])) { // multiple mailing services returned\r\n\t\t\tforeach ($doc['IntlRateV2Response']['Package']['Service'] as $mailsvc) {\r\n\t\t\t\tif (isset($mailsvc['SvcDescription'])) {\r\n\t\t\t\t\t$tmp = $this->_decode_intl_response($mailsvc, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} elseif (isset($doc['IntlRateV2Response']['Package'][0]['Service'])) { // multiple packages requested for insurance purposes\r\n\t\t\tforeach ($doc['IntlRateV2Response']['Package'] as $package) {\r\n\t\t\t\tif (isset($package['Service']['SvcDescription'])) { // single mail service response for package\r\n\t\t\t\t\t$tmp = $this->_decode_intl_response($package['Service'], $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\tif (!empty($tmp)) if (!isset($quotes[$tmp['id']])) $quotes[$tmp['id']] = $tmp; // save only first valid response\r\n\t\t\t\t} elseif (isset($package['Service'][0])) { // multiple mailing services returned for package\r\n\t\t\t\t\tforeach ($package['Service'] as $mailsvc) {\r\n\t\t\t\t\t\tif (isset($mailsvc['SvcDescription'])) {\r\n\t\t\t\t\t\t\t$tmp = $this->_decode_intl_response($mailsvc, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\t\t\tif (!empty($tmp)) if (!isset($quotes[$tmp['id']])) $quotes[$tmp['id']] = $tmp; // save only first valid response\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $quotes;\r\n\t}" ]
[ "0.53944427", "0.53511393", "0.5349683", "0.5337892", "0.5308377", "0.516954", "0.5146196", "0.50744647", "0.50678635", "0.5064892", "0.5059646", "0.5043782", "0.5042561", "0.50407887", "0.50379145", "0.5032669", "0.5023446", "0.5014851", "0.50129956", "0.5010874", "0.5003925", "0.49883306", "0.4977623", "0.49480286", "0.49388677", "0.49357054", "0.4934738", "0.49343467", "0.49253267", "0.49227825", "0.49212906", "0.4917421", "0.49153113", "0.49139658", "0.49045295", "0.48973572", "0.48923886", "0.48904344", "0.48902023", "0.48857576", "0.48789823", "0.48783213", "0.48725846", "0.48721278", "0.48542884", "0.48447022", "0.4817098", "0.48159176", "0.48147795", "0.48129192", "0.4799794", "0.4799373", "0.4798638", "0.47890967", "0.47824615", "0.47724524", "0.47714314", "0.4770694", "0.4769111", "0.4765517", "0.47605175", "0.4748764", "0.4744187", "0.47372043", "0.47369295", "0.47319198", "0.47309434", "0.47288153", "0.47279137", "0.4718907", "0.47152594", "0.47116557", "0.47094837", "0.46931285", "0.467312", "0.46659225", "0.46609038", "0.4654847", "0.4654529", "0.4654181", "0.4650631", "0.46470958", "0.4642102", "0.46350333", "0.46347037", "0.46263185", "0.46217945", "0.46200186", "0.46192485", "0.46165195", "0.4614763", "0.4614755", "0.4613819", "0.46136034", "0.46073982", "0.46064937", "0.46062148", "0.4604371", "0.46028328", "0.46018365" ]
0.488531
40
This is the global DHL Express product code for which the delivery is feasible respecting the input data from the request.
public function setProductCode(?string $productCode): self { $this->initialized['productCode'] = true; $this->productCode = $productCode; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function determainclaimType()\r\n {\r\n // 9 digits\r\n if (preg_match($this->keycodeRegex, $this->keycode) == false)\r\n {\r\n $this->claimType = \"invaild-keycode\";\r\n }\r\n \r\n // if keycode is NOT null, then search in the database\r\n else if ($this->keycode != null)\r\n {\r\n $result = mysql_query(\"SELECT Keycode, Claimable, Repairable, WarrantyMonths\r\n FROM Product \r\n WHERE Product.Keycode = $this->keycode\");\r\n\r\n $array = mysql_fetch_array($result);\r\n\r\n // if keycode is null, item does not exist in the database\r\n //if ($array[\"Keycode\"] == false)\r\n if (empty($array))\r\n {\r\n $this->claimType = \"keycode-not-found\";\r\n }\r\n // if product is claimable and repairable\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 1)\r\n { \r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) \r\n {\r\n //// check warranty period\r\n $this->claimType = \"repair-warranty\";\r\n }\r\n else\r\n {\r\n // check warranty period\r\n $this->claimType = \"repair-no-warranty\";\r\n }\r\n }\r\n else // transactionResult number rows is zero, this means no transaction was founds\r\n { \r\n $this->claimType = \"repair-no-transaction\";\r\n }\r\n }\r\n // if product offers a finanical claim\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"finanical-warranty\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"finanical-outside-warranty\";\r\n }\r\n }\r\n else // transactionResult's rows was zero so no tranaction number was found\r\n {\r\n $this->claimType = \"finanical-no-transaction\";\r\n }\r\n }\r\n // if a product is NOT claimable with supplier\r\n else if ($array[\"Claimable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are above zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"not-claimable-refund\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"not-claimable-outside-warranty\";\r\n }\r\n }\r\n else // no vaild transaction number provided\r\n {\r\n $this->claimType = \"not-claimable-no-transaction\";\r\n }\r\n }\r\n }\r\n \r\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function productFlowProcess(){\r\n\t\t$query = $this->request->data ;\r\n\t\t$status = $query[\"status\"] ;\r\n\t\t$description = $query[\"description\"] ;\r\n\t\t$filterId = $query[\"filterId\"] ;\r\n\t\t$asin = $query[\"asin\"] ;\r\n\t\t$strategy = $query[\"strategy\"] ;\r\n\t\t/*print_r( $this->request ) ; \r\n\t\tprint_r($this->request->data) ;\r\n\t\techo \">>>>>>>>>>>>>>>>>\".$description ;*/\r\n\t\t\r\n\t\t\r\n\t\t//更新状态\r\n\t\t$this->Sale->updateProductFilterStatus($this->request->data) ;\r\n\t\t\r\n\t\t//添加备注\r\n\t\t//if( trim($description) != \"\" ){\r\n\t\t$this->Product->updateProductComment($asin,$description,$strategy) ;\r\n\t\t//}\r\n\t\t\r\n\t\t//加入黑名单\r\n\t\tif( $status == 3 ){\r\n\t\t\t$user = $this->getCookUser() ;\r\n\t\t\t$this->Sale->removeProduct($this->request->data,$user) ;\r\n\t\t}else{\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$this->response->type(\"json\") ;\r\n\t\t$this->response->body( \"success\") ;\r\n\r\n\t\treturn $this->response ;\r\n\t}", "public function cs_proress_request($params = array()) {\n global $post, $cs_gateway_options, $cs_form_fields2;\n extract($params);\n\n $cs_current_date = date('Y-m-d H:i:s');\n $output = '';\n $rand_id = $this->cs_get_string(5);\n $business_email = $cs_gateway_options['cs_paypal_email'];\n\n\n $currency = isset($cs_gateway_options['cs_currency_type']) && $cs_gateway_options['cs_currency_type'] != '' ? $cs_gateway_options['cs_currency_type'] : 'USD';\n $cs_opt_hidden1_array = array(\n 'id' => '',\n 'std' => '_xclick',\n 'cust_id' => \"\",\n 'cust_name' => \"cmd\",\n 'return' => true,\n );\n $cs_opt_hidden2_array = array(\n 'id' => '',\n 'std' => sanitize_email($business_email),\n 'cust_id' => \"\",\n 'cust_name' => \"business\",\n 'return' => true,\n );\n $cs_opt_hidden3_array = array(\n 'id' => '',\n 'std' => $cs_trans_amount,\n 'cust_id' => \"\",\n 'cust_name' => \"amount\",\n 'return' => true,\n );\n $cs_opt_hidden4_array = array(\n 'id' => '',\n 'std' => $currency,\n 'cust_id' => \"\",\n 'cust_name' => \"currency_code\",\n 'return' => true,\n );\n $cs_opt_hidden5_array = array(\n 'id' => '',\n 'std' => $cs_package_title,\n 'cust_id' => \"\",\n 'cust_name' => \"item_name\",\n 'return' => true,\n );\n $cs_opt_hidden6_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_job_id),\n 'cust_id' => \"\",\n 'cust_name' => \"item_number\",\n 'return' => true,\n );\n $cs_opt_hidden7_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"cancel_return\",\n 'return' => true,\n );\n $cs_opt_hidden8_array = array(\n 'id' => '',\n 'std' => '1',\n 'cust_id' => \"\",\n 'cust_name' => \"no_note\",\n 'return' => true,\n );\n $cs_opt_hidden9_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"invoice\",\n 'return' => true,\n );\n $cs_opt_hidden10_array = array(\n 'id' => '',\n 'std' => esc_url($this->listner_url),\n 'cust_id' => \"\",\n 'cust_name' => \"notify_url\",\n 'return' => true,\n );\n $cs_opt_hidden11_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"lc\",\n 'return' => true,\n );\n $cs_opt_hidden12_array = array(\n 'id' => '',\n 'std' => '2',\n 'cust_id' => \"\",\n 'cust_name' => \"rm\",\n 'return' => true,\n );\n $cs_opt_hidden13_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"custom\",\n 'return' => true,\n );\n $cs_opt_hidden14_array = array(\n 'id' => '',\n 'std' => esc_url(home_url('/')),\n 'cust_id' => \"\",\n 'cust_name' => \"return\",\n 'return' => true,\n );\n\n $output .= '<form name=\"PayPalForm\" id=\"direcotry-paypal-form\" action=\"' . $this->gateway_url . '\" method=\"post\"> \n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden1_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden2_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden3_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden4_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden5_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden6_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden7_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden8_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden9_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden10_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden11_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden12_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden13_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden14_array) . '\n </form>';\n\n\n $data = CS_FUNCTIONS()->cs_special_chars($output);\n $data .= '<script>\n\t\t\t\t\t \t jQuery(\"#direcotry-paypal-form\").submit();\n\t\t\t\t\t </script>';\n echo CS_FUNCTIONS()->cs_special_chars($data);\n }", "function external_code($request)\n\t{\n\t\tlist($success, $return) = $this->system->is_valid_access4($request);\n\t\tif (!$success) return [FALSE, $return];\n\n\t\t//cek parameter: SecuritiesMarketCode\n\t\tif (!isset($request->params->SecuritiesMarketCode) || empty($request->params->SecuritiesMarketCode)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter SecuritiesMarketCode'])]];\n\t\t}\n\n\t\t//cek parameter: MarketID --> sumber external identification \n\t\tif (!isset($request->params->MarketID) || empty($request->params->MarketID)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter MarketID'])]];\n\t\t}\n\n\t\t$this->db->select('T2.SecuritiesCode');\n\t\t$this->db->from('market_instrument_id_market T1');\n\t\t$this->db->join('market_instrument T2', 'T1.SecuritiesID = T2.SecuritiesID'); \n\t\t$this->db->where('T1.MarketID', $request->params->MarketID);\n\t\t$this->db->where('T1.SecuritiesMarketCode', $request->params->SecuritiesMarketCode);\n\t\t$row = $this->db->get()->row();\n if (!$row) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-2', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-2'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'market company'])]];\n }\n\n\t\t$request->log_size = mb_strlen(serialize($row), '8bit');\n\t\t$request->log_type\t= 'data';\t\n\t\t$this->system->save_billing($request);\n\n\t\treturn [TRUE, ['result' => ['SecuritiesCode' => $row->SecuritiesCode]]];\n\t}", "public static function postsubmit_derive_product($lead) {\n\t\t$wsProduct = '';\n\t\tif( empty($lead->wsMaxProductLine) || 'Unknown' == $lead->wsMaxProductLine ) { // no Product Line context on the form page\n\t\t\tif ( 'History-Culture Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\tif( !empty($lead->domesticOrInternational ) && 'us' == $lead->domesticOrInternational ) {\n\t\t\t\t\t$wsProduct = 'Middle School - History'; // default to History\n\t\t\t\t} else {\n\t\t\t\t\t$wsProduct = 'High School - International'; // abroad means Perspectives Division\n\t\t\t\t}\n\t\t\t} elseif ( 'Science Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Middle School - Science';\n\t\t\t} elseif ( 'Undergraduate Tours' == $lead->leadFormProduct || \n\t\t\t\t\t 'Graduate-Level Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'University'; // does not exist in Maximizer yet\n\t\t\t} elseif ( 'Music Festivals' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Concert and Performing Tours' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Marching Band Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Dance-Cheer Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Theatre Opportunities' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Performing';\n\t\t\t} elseif ( 'Sports Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Sports'; // does not exist in Maximizer yet\n\t\t\t} else {\n\t\t\t\t$wsProduct = 'Unknown';\n\t\t\t}\n\t\t} else {\n\t\t\t$wsProduct = $lead->wsMaxProductLine;\n\t\t}\n\t\treturn $wsProduct;\n\t}", "public function process_request () {\n \n add_action( 'admin_notices', array( $this, 'admin_notices' ) );\n \n $supported_actions = array( 'activate-products', 'deactivate-product' );\n if ( !isset( $_REQUEST['action'] ) || !in_array( $_REQUEST['action'], $supported_actions ) || !check_admin_referer( 'bulk-' . 'licenses' ) ) {\n return null;\n }\n \n $response = false;\n $status = 'false';\n $type = $_REQUEST['action'];\n\n switch ( $type ) {\n case 'activate-products':\n $products = array();\n if ( isset( $_POST[ 'products' ] ) && 0 < count( $_POST[ 'products' ] ) ) {\n foreach ( $_POST[ 'products' ] as $k => $v ) {\n if ( !empty( $v[ 'license_key' ] ) ) {\n $products[$k] = $v;\n }\n }\n }\n if ( 0 < count( $products ) ) {\n //echo \"<pre>\"; print_r( $products ); echo \"</pre>\"; die();\n $response = $this->activate_products( $products );\n } else {\n $response = false;\n $type = 'no-license-keys';\n }\n break;\n\n case 'deactivate-product':\n if ( isset( $_GET['filepath'] ) && ( '' != $_GET['filepath'] ) ) {\n $response = $this->deactivate_product( $_GET['filepath'] );\n }\n break;\n\n default:\n break;\n }\n\n if ( $response == true ) {\n $status = 'true';\n }\n \n $redirect_url = \\UsabilityDynamics\\Utility::current_url( array( 'type' => urlencode( $type ), 'status' => urlencode( $status ) ), array( 'action', 'filepath', '_wpnonce' ) );\n wp_safe_redirect( $redirect_url );\n exit;\n }", "public function getProdCode()\n {\n return $this->prod_code;\n }", "function getProductCode()\n {\n return $this->productCode;\n }", "public function compliteAction()\n {\n\n $config = $this->get('plugins')->Frontend()->PilibabaPilipaySystem()->Config();\n $merchantNO = $this->Request()->getParam('merchantNO');\n $orderNo = $this->Request()->getParam('orderNo');\n $orderAmount = $this->Request()->getParam('orderAmount');\n $signType = $this->Request()->getParam('signType');\n $payResult = $this->Request()->getParam('payResult');\n $signMsg = $this->Request()->getParam('signMsg');\n $dealId = $this->Request()->getParam('dealId');\n $fee = $this->Request()->getParam('fee');\n $sendTime = $this->Request()->getParam('sendTime');\n\n\n if ($config->get('merchantNo') == $merchantNO\n && md5($merchantNO . $orderNo . $orderAmount . $sendTime . $config->get('appSecrect')) == $signMsg\n ) {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n $order = $builder->getQuery()->getOneOrNullResult();\n\n if ($payResult == 10) {\n\n $this->setPaymentStatus($order->getTransactionId(), 12);\n $url = $this->basePathUrl . '/paymentpilipay/finish?orderNo='.$orderNo;\n\n echo '<result>1</result><redirecturl>' . $url . '</redirecturl>';\n $this->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if ($order->getOrderStatus() && $order->getOrderStatus()->getId() == 0) {\n $this->setOrderStatus($order->getTransactionId(), 0); // in process\n }\n } elseif ($payResult == 11) {\n $this->setPaymentStatus($order->getTransactionId(), 21);\n\n }\n }\n\n }", "public function minAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function actionDeliveryCost($code){\n //check country\n $city= City::find()->where('Name=\"'.$code.'\"')->one();\n //var_dump($city);\n if($city->CountryCode == 'EGY'){\n //calculate weight\n $sum=0;\n foreach(Shopcart::goods() as $good) {\n $sum+= $good->item->product_weight ;\n\n }\n // return \"the new cost--\".$city->Name .$city->CountryCode;\n //$city->CountryCode;\n $cost= $this->GetCost($city->Name,$sum);\n if($cost =='' or $cost ==0){\n return Setting::get('deliver_cost');\n }else{return $cost ;}\n\n }else{\n return Setting::get('deliver_cost'); //.'-99'. $city->CountryCode;\n }\n\n }", "public function getLocalProductCode(): ?string\n {\n return $this->localProductCode;\n }", "function calc_required_en(){\r\n\tif(strpos($this->Tactics['spec'],'DoubleStrike') !== false) $this->Eq['A']['enc'] *= 2;\r\n\tif(strpos($this->Tactics['spec'],'TripleStrike') !== false) $this->Eq['A']['enc'] *= 3;\r\n\t$MSEnCpos = strpos($this->MS['spec'],'CostEN');\r\n\tif($MSEnCpos !== false) {\r\n\t\t$temp = array();\r\n\t\tpreg_match('/CostEN<([0-9.]+)>/',$this->MS['spec'],$temp,0,$MSEnCpos);\r\n\t\t$MSEnC = floatval($temp[1]);\r\n\t\tif($MSEnC < 1) $MSEnC = floor($this->Player['enmax'] * $MSEnC);\r\n\t\t$this->Eq['A']['enc'] += $MSEnC;\r\n\t}\r\n\t$this->RequireEN = ($this->Eq['A']['enc'] + $this->Eq['D']['enc'] + $this->Eq['E']['enc']);\r\n}", "public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }", "private function validateAvailableProduct() {\n\n\t\t$studio_data = &$this->session->data['studio_data'][$this->request->post['price_studio_id']]; //make it short\n\n\t\t//if price_id_product is not empty\n\t\tif (!isset($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t///if product exists\n\t\t} elseif (!$this->model_opentshirts_product->getTotalProductsByID($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t//if product price is setted up\n\t\t}else if ($this->model_opentshirts_price_product->getMinQuantity($studio_data['id_product'])===false) {\n\t\t\t$this->error['warning'] = $this->language->get('error_not_available');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function dsf_protx_release_order($order_number){\n\nglobal $ReleaseURL, $Verify, $ProtocolVersion;\n\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please release the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'Protx Item not Found';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please release the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'More than one protx item found';\n\tbreak;\n }\n \t\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n\n // we must have a valid transaction item if we are here, get the array of items.\n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$TargetURL = $ReleaseURL;\n$VerifyServer = $Verify;\n\n// echo 'URL = ' . $TargetURL;\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => 'RELEASE',\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response ='';\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been released witin protx.\n\t\t\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '13');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '13', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as released however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn $response;\n}", "function dsf_process_sagepay($savedorder){\n\nglobal $protx_order,$GiftAidPayment, $ApplyAVSCV2, $CAVV, $XID, $ECI, $ClientNumber, $cc_issue_number, $cc_ccv_number, $cc_owner, $cc_number, $cc_start_month, $cc_start_year, $cc_expires_month, $cc_expires_year, $cc_ctype, $protx_attempts, $currencies, $ProtocolVersion, $DefaultCurrency,$PurchaseURL,$Verify, $VendorTxCode;\n\n \t\t\t\t\t$protx_ipn_currency = MODULE_PAYMENT_PROTXCC_DEFAULT_CURRENCY;\n\n\t\t\t\t\t\t // ORDER VALUE\n\t\t\t\t\t\t $strip_values_array = array(\"£\",\",\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['deposit_value']);\n\t\t\t\t\t\t }else{ // full order value\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['total_value']);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $protx_ipn_order_amount = number_format($protx_ipn_order_amount , 2,'.','');\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t// CREATE ALL values to be passed through to Protx.\n\t\t\t\t\t\t$VendorTxCode= SAP_ORDER_PREFIX . $savedorder->info['id'] . '--' . date('YmdHis');\n\t\t\t\t\t\t$Amount= $protx_ipn_order_amount;\n\t\t\t\t\t\t$Currency= $protx_ipn_currency;\n\t\t\t\t\t\t$Description= 'Basket ID ' . $savedorder->info['id'] . ' - ' . dsf_get_ip_address();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( strtoupper($savedorder->customer['email_address']) <> strtoupper(TELEPHONE_ORDER)){\n\t\t\t\t\t\t\t$CustomerEMail= $savedorder->customer['email_address'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$CustomerEMail='';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (($savedorder->customer['telephone']) && (strlen($savedorder->customer['telephone']) >5)){\n\t\t\t\t\t\t$ContactNumber= substr($savedorder->customer['telephone'],20);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$ContactNumber= substr(dsf_lookup_mobile($savedorder->customer['id']),20);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// BILLING INFORMATION\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingSurname= substr($savedorder->customer['lastname'],0,200);\n\t\t\t\t\t\t$BillingFirstnames= substr($savedorder->customer['firstname'],0,200);\n\n\t\t\t\t\t\t if (isset($savedorder->customer['house']) && strlen($savedorder->customer['house']) > 0){\n\t\t\t\t\t\t \t $BillingAddress1 = $savedorder->customer['house'] . ', ';\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$BillingAddress1 = '';\n\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingAddress1 .= $savedorder->customer['street'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['district']) && strlen($savedorder->customer['district']) > 1){\n\t\t\t\t\t\t\t$BillingAddress2 = $savedorder->customer['district'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingCity = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['town']) && strlen($savedorder->customer['town']) > 1){\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['town'];\n\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['county'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\tif (strlen($BillingCity) < 1){\n\t\t\t\t\t\t\t$BillingCity = 'Not Supplied';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingPostCode= $savedorder->customer['postcode'];\n\n\n\t\t\t\t\t\tif ($savedorder->customer['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// DELIVERY INFO - if no delivery address has been supplied, then we need to populate the variables\n\t\t\t\t\t\t// with the same values as billing.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->delivery['postcode']) && strlen($savedorder->delivery['postcode'])>4){ // delivery address exists\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// get customers name and split it into firstname, lastname\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (strpos($savedorder->delivery['name'],' ') > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t$splits = explode(' ', trim($savedorder->delivery['name']));\n\t\t\t\t\t\t\t\t\t\t\t\t// take into account that the customer could have put mr, mrs etc.. therefore use only the last two splits\n\t\t\t\t\t\t\t\t\t\t\t\t$total_splits = sizeof($splits);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($total_splits > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = $total_splits - 2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = $total_splits -1;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $splits[$first_split];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $splits[$second_split];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t// no breaks, ensure something is there\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t if (isset($savedorder->delivery['house']) && strlen($savedorder->delivery['house']) > 0){\n\t\t\t\t\t\t\t\t\t\t $DeliveryAddress1 = $savedorder->delivery['house'] . ', ';\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = '';\n\t\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryAddress1 .= $savedorder->delivery['street'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['district']) && strlen($savedorder->delivery['district']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $savedorder->delivery['district'];\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$DeliveryCity = '';\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\tif (isset($savedorder->delivery['town']) && strlen($savedorder->delivery['town']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['town'];\n\t\t\t\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['county'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\t\t\t\tif (strlen($DeliveryCity) < 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity = 'Not Supplied';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryPostCode= $savedorder->delivery['postcode'];\n\n\t\t\t\t\t\t\t\t\tif ($savedorder->delivery['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else { // we havent got a delivery address so we need to duplicate the billing information.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliverySurname = $BillingSurname;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryFirstnames = $BillingFirstnames;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = $BillingAddress1;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $BillingAddress2;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCity = $BillingCity;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryPostCode = $BillingPostCode;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = $BillingCountry;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\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 $pagerows = (sizeof($savedorder->products));\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $prod_basket = '';\n\t\t\t\t\t\t\t\t\t $tot_basket = '';\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=($pagerows+1); $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($savedorder->products[$i]['price']){ // there are records\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// products options code added 09-may-2006\n\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (sizeof($savedorder->products[$i]['attributes']) > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attributes_exist = '1';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \" (\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($j = 0, $k = sizeof($savedorder->products[$i]['attributes']); $j < $k; $j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $products_ordered_attributes .= ' '. $savedorder->products[$i]['attributes'][$j]['option'] . '-> ' . $savedorder->products[$i]['attributes'][$j]['value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes .= \" )\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// end of products options section.\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . str_replace(':', ' ', $savedorder->products[$i]['model'] . ' - ' . $savedorder->products[$i]['name'] . ' ' . $products_ordered_attributes); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $savedorder->products[$i]['qty']; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'] * $savedorder->products[$i]['qty'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\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\t\t\tfor ($i=0, $n=sizeof($savedorder->totals)+1; $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totalclass = $savedorder->totals[$i]['class'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($savedorder->totals[$i]['class']) > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$order_total[$totalclass] = array('title' => $savedorder->totals[$i]['title'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'text' => $savedorder->totals[$i]['text'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'value' => $savedorder->totals[$i]['value']\n\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\t\t\t\t\t\t}\n\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// discount if necessary\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_discount']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_discount']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':-' . $order_total['ot_discount']['value']; // line total\n\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\n\t\t\t\t\t\t\t\t\t // delivery charge (0.00 if necessary);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_shipping']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_shipping']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $order_total['ot_shipping']['value']; // line total\n\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 if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . 'Deposit Required'; // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $savedorder->info['deposit_value']; // line total\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\n\t\t\t\t\t\t\t\t// make new basket\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $basket = $pagerows . $prod_basket . $tot_basket;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// end of basket creation details.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t// register this order so we don't create an other one if this fails.\n\t\t\n\t\t\t$protx_order = $savedorder->info['id'];\n\t\t\tdsf_session_register('protx_order');\n \t\t\t\n\t\t\t// register the txCode created - we use this to allocate the payment to order\n\t\t\tdsf_session_register('VendorTxCode');\n\t\t\n\n\n// submit the information to SagePay\n\n\t\t\t\t\t// Set some variables\n\t\t\t\t\t$TargetURL = $PurchaseURL;\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t$VerifyServer = $Verify;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t\n\t\t\t\t\tif ($Description){\n\t\t\t\t\t\t$Description = substr($Description,0,100);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$Description = $DefaultDescription;\t\t\t\t\t\t\t\t// Specified in init-protx.php\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Create an array of values to send\n\t\t\t\t\t$required = array (\n\t\t\t\t\t\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t\t\t\t\t\t'TxType' => MODULE_PAYMENT_PROTXCC_TXTYPE,\t\t\t\t\t\t\t\t\t\t\t// Transaction type\n\t\t\t\t\t\t\t'Vendor' => MODULE_PAYMENT_PROTXCC_ID,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t\t\t\t\t\t'VendorTxCode' => $VendorTxCode,\t\t\t\t\t// Unique transaction code (generated by vendor)\n\t\t\t\t\t\t\t'Amount' => $Amount,\t\t\t\t\t\t\t\t\t\t\t// Value of order (supplied by vendor)\n\t\t\t\t\t\t\t'Currency' => $DefaultCurrency,\t\t\t\t\t\t\t\t\t// Currency of order (default specified in init-protx.php)\n\t\t\t\t\t\t\t'Description' => $Description,\t\t\t\t\t\t\t\t\t// Description of order \n\t\t\t\t\t\t\t 'BillingSurname' => $BillingSurname,\n\t\t\t\t\t\t\t 'BillingFirstnames' => $BillingFirstnames,\n\t\t\t\t\t\t\t 'BillingAddress1' => $BillingAddress1,\n\t\t\t\t\t\t\t 'BillingAddress2' => $BillingAddress2,\n\t\t\t\t\t\t\t 'BillingCity' => $BillingCity,\n\t\t\t\t\t\t\t 'BillingPostCode' => $BillingPostCode,\n\t\t\t\t\t\t\t 'BillingCountry' => $BillingCountry,\n\t\t\t\t\t\t\t 'DeliverySurname' => $DeliverySurname,\n\t\t\t\t\t\t\t 'DeliveryFirstnames' => $DeliveryFirstnames,\n\t\t\t\t\t\t\t 'DeliveryAddress1' => $DeliveryAddress1,\n\t\t\t\t\t\t\t 'DeliveryAddress2' => $DeliveryAddress2,\n\t\t\t\t\t\t\t 'DeliveryCity' => $DeliveryCity,\n\t\t\t\t\t\t\t 'DeliveryPostCode' => $DeliveryPostCode,\n\t\t\t\t\t\t\t 'DeliveryCountry' => $DeliveryCountry\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\n\t\t\t\t\t\n\t\t\t\t\t// add optional fields to the data array only if they've been set\n\t\t\t\t\t\n\t\t\t\t\t$optional_fields = array('ContactNumber' => $ContactNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'ContactFax' => $ContactFax,\n\t\t\t\t\t\t\t\t\t\t\t 'CustomerEMail' => $CustomerEMail,\n\t\t\t\t\t\t\t\t\t\t\t 'GiftAidPayment' => $GiftAidPayment,\n\t\t\t\t\t\t\t\t\t\t\t 'ApplyAVSCV2' => $ApplyAVSCV2,\n\t\t\t\t\t\t\t\t\t\t\t 'CAVV' => $CAVV,\n\t\t\t\t\t\t\t\t\t\t\t 'XID' => $XID,\n\t\t\t\t\t\t\t\t\t\t\t 'ECI' => $ECI,\n\t\t\t\t\t\t\t\t\t\t\t '3DSecureStatus' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'Basket' => $Basket,\n\t\t\t\t\t\t\t\t\t\t\t 'ClientNumber' => $ClientNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'IssueNumber' => $cc_issue_number,\n\t\t\t\t\t\t\t\t\t\t\t 'CV2' => $cc_ccv_number\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t// add the optional fields to the required array only if there are values set.\n\t\t\t\t\t$data = addOptionalFields( $optional_fields, $required, array ( \n\t\t\t\t\t 'ContactNumber',\n\t\t\t\t\t 'ContactFax',\n\t\t\t\t\t 'CustomerEMail',\n\t\t\t\t\t 'GiftAidPayment',\n\t\t\t\t\t 'ApplyAVSCV2',\n\t\t\t\t\t 'ClientIPAddress',\n\t\t\t\t\t 'CAVV',\n\t\t\t\t\t 'XID',\n\t\t\t\t\t 'ECI',\n\t\t\t\t\t '3DSecureStatus',\n\t\t\t\t\t 'Basket',\n\t\t\t\t\t 'ClientNumber', \n\t\t\t\t\t 'IssueNumber', \n\t\t\t\t\t 'CV2', \n\t\t\t\t\t) );\n\t\t\t\t\t\n\t\t\t\t\t$data['CardHolder'] =\t$cc_owner;\n\t\t\t\t\t$data['CardNumber'] = \t$cc_number;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Check if start date is supplied\n\t\t\t\t\tif($cc_start_month){\n\t\t\t\t\t\t// If so, add start date to data array to be appended to POST\n\t\t\t\t\t\t$data['StartDate'] = $cc_start_month . $cc_start_year;\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t// Add expiry date\n\t\t\t\t\t$data['ExpiryDate'] = $cc_expires_month . $cc_expires_year;\n\t\t\t\t\t\n\t\t\t\t\t// Add card type\n\t\t\t\t\t$data['CardType'] = $cc_ctype;\n\n\n\t\t\t\t\t$ipnum = dsf_get_ip_address();\n\n\t\t\t\t\t\t$data['Apply3DSecure'] = '0';\n\t\t\t\t\t\n\t\t\t\t\t$posted_data = $data;\n\t\t\t\t\t\n\t\t\t\t\t$data = formatData($data);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sage_response = requestPost($TargetURL, $data);\t\n\n\n\n\t\t\t\t\t// (1) add 1 to attempts counter\n\t\t\t\t\t\n\t\t\t\t\t\t$protx_attempts ++;\n\t\t\t\t\t\tdsf_session_unregister('protx_attempts');\n\t\t\t\t\t\tdsf_session_register('protx_attempts');\n\n\n\n\n\n\t// return the response back to the calling script.\n\t\treturn $sage_response;\n\t\t\n\n\n}", "public function deliveryPriceDhaka()\n {\n }", "public function normalAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function createFulfillmentRequestToDr($lineItems, $order) {\n $items = [];\n $request = [];\n $status = 'Completed';\n $responseCode = 'Success'; \n \n try {\n if ($order->getDrOrderId()) {\n $storeCode = $order->getStore()->getCode();\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n\n if(!$drModel->getId() || $drModel->getPostStatus() == 1) {\n return;\n } // end: if\n \n foreach ($lineItems as $itemId => $item) {\n $items['item'][] = [\n \"requisitionID\" => $item['requisitionID'],\n \"noticeExternalReferenceID\" => $item['noticeExternalReferenceID'],\n \"lineItemID\" => $itemId,\n\t\t\t\t\t\t\"magentoLineItemID\" => $item['magentoLineItemID'],\n \"fulfillmentCompanyID\" => $this->getCompanyId($storeCode),\n \"electronicFulfillmentNoticeItems\" => [\n \"item\" => [\n [\n \"status\" => $status,\n \"reasonCode\" => $responseCode,\n \"quantity\" => $item['quantity'],\n \"electronicContentType\" => \"EntitlementDetail\",\n \"electronicContent\" => \"magentoEventID\"\n ]\n ]\n ]\n ];\n } // end: foreach\n\n $request['ElectronicFulfillmentNoticeArray'] = $items;\n\n $this->curl->setOption(CURLOPT_RETURNTRANSFER, true);\n $this->curl->setOption(CURLOPT_TIMEOUT, 40);\n $this->curl->addHeader(\"Content-Type\", \"application/json\");\n $this->curl->post($this->getDrPostUrl($storeCode), $this->jsonHelper->jsonEncode($request));\n $result = $this->curl->getBody();\n $statusCode = $this->curl->getStatus();\n\n // Status Update: Exsisting code used according to review changes\n if ($statusCode == '200') {\n // Post Status updated only if entire order items are fulfilled\n if($this->getPendingFulfillment($order)) {\n // if all the quantites are satisfied then mark as 1\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n $drModel->setPostStatus(1);\n $drModel->save();\n } // end: if\n $comment = 'Magento & DR order status are matched';\n } else {\n $comment = 'Magento & DR order status are mis-matched';\n } // end: if\n\n $order->addStatusToHistory($order->getStatus(), __($comment));\n\n $this->_logger->info('createFulfillmentRequestToDr Request : '.json_encode($request));\n $this->_logger->info('createFulfillmentRequestToDr Response : '.json_encode($result)); \n } else {\n $this->_logger->error('Error createFulfillmentRequestToDr : Empty DR Order Id');\n } // end: if\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $le) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '.json_encode($le->getRawMessage()));\n } catch (\\Exception $ex) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '. $ex->getMessage());\n } // end: try \n \n return $result;\n }", "function deliver($code)\n{ \n\n\techo \"// http://license.mxgraph.com/hosted \\n\";\n\techo $code;\n}", "function _getDmstcQuote($pkg, $method = '') {\r\n\t\tglobal $order;\r\n\t\tif (tep_not_null($method) && in_array($method, $this->dmstc_available)) {\r\n\t\t\t$request_types = array($method);\r\n\t\t} else {\r\n\t\t\t$request_types = $this->dmstc_available;\r\n\t\t}\r\n\t\t$shipping_weight = ($pkg['item_weight'] < 0.0625 ? 0.0625 : $pkg['item_weight']);\r\n\t\t$shipping_pounds = floor($shipping_weight);\r\n\t\t$shipping_ounces = ceil((16 * ($shipping_weight - $shipping_pounds)) * 100) / 100; // rounded to two decimal digits\r\n\t\t$ounces = $shipping_weight * 16.0;\r\n\t\t$pkgvalue = $pkg['item_price'];\r\n\t\tif ($pkgvalue > MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX) $pkgvalue = MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX;\r\n\t\tif ($pkgvalue <= 0) $pkgvalue = 0.01;\r\n\t\t$nonuspsinsurancecost = 0;\r\n\t\tif (MODULE_SHIPPING_USPS_NON_USPS_INSURE == 'True') {\r\n\t\t\tif ($pkg['item_price'] <= 50) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS1;\r\n\t\t\t} else if ($pkg['item_price'] <= 100) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS2;\r\n\t\t\t}\telse if ($pkg['item_price'] <= 200) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS3;\r\n\t\t\t} else if ($pkg['item_price'] <= 300) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4;\r\n\t\t\t} else {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4 + ((ceil($pkg['item_price']/100) - 3) * MODULE_SHIPPING_USPS_INS5);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sservs = array(); // any special services to request\r\n\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $sservs = array(1, 11); //request insurance, both regular & express mail\r\n\t\tif ((MODULE_SHIPPING_USPS_DMST_SIG_CONF == 'True') && ($order->info['subtotal'] >= MODULE_SHIPPING_USPS_SIG_THRESH)) {\r\n\t\t\t$sservs[] = 15;\r\n\t\t} elseif (MODULE_SHIPPING_USPS_DMST_DEL_CONF == 'True') {\r\n\t\t\t$sservs[] = 13;\r\n\t\t}\r\n\t\t$sservice = '';\r\n\t\tif (!empty($sservs)) {\r\n\t\t\tforeach ($sservs as $id) $sservice .= '<SpecialService>' . $id . '</SpecialService>';\r\n\t\t\t$sservice = '<SpecialServices>' . $sservice . '</SpecialServices>';\r\n\t\t}\r\n\t\t$box = array($pkg['item_length'], $pkg['item_width'], $pkg['item_height']);\r\n\t\trsort($box); // put package size in large to small order for purposes of checking dimensions\r\n\t\tlist($length, $width, $height) = $box;\r\n\t\t$id = 0;\r\n\t\t$quotes = $request_group = array();\r\n\t\t$group_count = 1;\r\n\t\t$type_count = 0;\r\n\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\tforeach ($request_types as $service) { // break the requested shipping methods into groups\r\n\t\t\tif (strpos($service, 'First') !== false) { // if first class mail service check if will fit type\r\n\t\t\t\t$fcmt = $this->first_class_to_mail_type[$service];\r\n\t\t\t\tif (($fcmt == 'LETTER') && (($length > $this->first_class_letter['length']) || ($width > $this->first_class_letter['width']) || ($height > $this->first_class_letter['height']) || ($ounces > $this->first_class_letter['ounces']))) continue; // don't check letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'FLAT') && (($length > $this->first_class_large_letter['length']) || ($width > $this->first_class_large_letter['width']) || ($height > $this->first_class_large_letter['height']) || ($ounces > $this->first_class_large_letter['ounces']))) continue; // don't check large letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'POSTCARD') && (($length > 6) || ($width > 4.25) || ($height > 0.016) || ($ounces > 3.5))) continue; // don't check postcard type if package doesn't fit\r\n\t\t\t\tif ($ounces > $this->first_class_parcel_max_ounces) continue; // don't check First Class if too heavy\r\n\t\t\t}\r\n\t\t\t$cont = $this->type_to_container[$service]; // begin checking for packages larger than USPS containers\r\n\t\t\t// if this service type specifies a container and this package won't fit then skip this service\r\n\t\t\tif (strpos($cont, 'Envelope') !== false) { // if service container is envelope\r\n\t\t\t\tif ($height > 1) continue; // anything thicker than one inch won't fit an envelope\r\n\t\t\t\tif ((strpos($cont, 'SM') !== false) && (($length > 10) || ($width > 6))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Window') !== false) && (($length > 10) || ($width > 5))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Gift') !== false) && (($length > 10) || ($width > 7))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Legal') !== false) && (($length > 15) || ($width > 9.5))) continue;\r\n\t\t\t\tif (($length > 12.5) || ($width > 9.5)) continue; // other envelopes\r\n\t\t\t}\r\n\t\t\tif (($cont == 'SM Flat Rate Box') && (($length > 8.625) || ($width > 5.375) || ($height > 1.625))) continue;\r\n\t\t\tif (($cont == 'MD Flat Rate Box') || ($cont == 'Flat Rate Box')) {\r\n\t\t\t\tif ($length > 13.625) continue; // too big for longest medium box\r\n\t\t\t\tif ($length > 11) { // check medium type 2 box\r\n\t\t\t\t\tif (($length > 13.625) || ($width > 11.875) || ($height > 3.375)) continue; // won't fit medium type 2 box\r\n\t\t\t\t} elseif (($length > 11) || ($width > 8.5) || ($height > 5.5)) continue; // won't fit either type medium box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'LG Flat Rate Box') && (($length > 12) || ($width > 12) || ($height > 5.5))) continue;\r\n\t\t\tif ($cont == 'Regional Rate Box A') {\r\n\t\t\t\tif ($length > 12.8125) continue; // too big for longest A box\r\n\t\t\t\tif ($length > 10) { // check A2 box\r\n\t\t\t\t\tif (($length > 12.8125) || ($width > 10.9375) || ($height > 2.375)) continue; // won't fit A2 box\r\n\t\t\t\t} elseif (($length > 10) || ($width > 7) || ($height > 4.75)) continue; // won't fit either type A box\r\n\t\t\t}\r\n\t\t\tif ($cont == 'Regional Rate Box B') {\r\n\t\t\t\tif ($length > 15.875) continue; // too big for longest B box\r\n\t\t\t\tif ($length > 12) { // check B2 box\r\n\t\t\t\t\tif (($length > 15.875) || ($width > 14.375) || ($height > 2.875)) continue; // won't fit B2 box\r\n\t\t\t\t} elseif (($length > 12) || ($width > 10.25) || ($height > 5)) continue; // won't fit either type B box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'Regional Rate Box C') && (($length > 14.75) || ($width > 11.75) || ($height > 11.5))) continue;\r\n\t\t\t// passed all size checks so build request\r\n\t\t\t$request = '<Package ID=\"'. $id . '\"><Service>' . $this->type_to_request[$service] . '</Service>';\r\n\t\t\tif (strpos($service, 'First') !== false) $request .= '<FirstClassMailType>' . $fcmt . '</FirstClassMailType>';\r\n\t\t\t$request .= '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .\r\n\t\t\t\t\t'<ZipDestination>' . $this->dest_zip . '</ZipDestination>' .\r\n\t\t\t\t\t'<Pounds>' . $shipping_pounds . '</Pounds>' .\r\n\t \t\t'<Ounces>' . $shipping_ounces . '</Ounces>';\r\n\t\t\tif ((strpos($cont, 'Rate') === false) && (max($length, $width, $height) > 12)) {\r\n\t\t\t\t$request .= '<Container>RECTANGULAR</Container><Size>LARGE</Size>' .\r\n\t\t\t\t\t\t'<Width>' . $width . '</Width>' .\r\n\t\t\t\t\t\t'<Length>' . $length . '</Length>'.\r\n\t\t\t\t\t\t'<Height>' . $height . '</Height>';\r\n\t\t\t} else {\r\n\t\t\t\t$request .= '<Container>' . $cont . '</Container><Size>REGULAR</Size>';\r\n\t\t\t}\r\n\t\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $request .= '<Value>' . number_format($pkgvalue, 2, '.', '') . '</Value>';\r\n\t\t\t$request .= $sservice;\r\n\t\t\tif ((strpos($service, 'First') !== false) || (strpos($service, 'Post') !== false)) $request .= '<Machinable>true</Machinable>';\r\n\t\t\t$request .= '</Package>';\r\n\t\t\t$id++;\r\n\t\t\t$type_count++;\r\n\t\t\tif (($type_count > 25) || (($urllength + strlen(urlencode($request))) > 2000)) { // only 25 services allowed per request or 2000 characters per url\r\n\t\t\t\t$group_count++;\r\n\t\t\t\t$type_count = 1;\r\n\t\t\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\t\t}\r\n\t\t\t$urllength += strlen(urlencode($request));\r\n\t\t\t$request_group[$group_count][$type_count] = $request;\r\n\t\t} // end foreach request type as service\r\n\t\tif (empty($request_group)) return array('error' => MODULE_SHIPPING_USPS_ERROR_NO_SERVICES);\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES .'http_client.php');\r\n\t\t} //print_r($request_group);\r\n\t\tforeach ($request_group as $service_group) {\r\n\t\t\t$request = '<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision>';\r\n\t\t\tforeach ($service_group as $service_request) {\r\n\t\t\t\t$request .= $service_request;\r\n\t\t\t}\r\n\t\t\t$request .= '</RateV4Request>';\r\n\t\t\t$request = \t'API=RateV4&XML=' . urlencode($request);\r\n\t\t\t$body = '';\r\n\t\t\t$http = new httpClient();\r\n\t\t\tif ($http->Connect('production.shippingapis.com', 80)) {\r\n\t\t\t\t$http->addHeader('Host', 'production.shippingapis.com');\r\n\t\t\t\t$http->addHeader('User-Agent', 'IntenseCart');\r\n\t\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\t\tif ($http->Get('/shippingAPI.dll?' . $request)) $body = $http->getBody();\r\n\t\t\t\t$http->Disconnect();\r\n\t\t\t} else {\r\n\t\t\t\t$body = '<Error><Number></Number><Description>' . MODULE_SHIPPING_USPS_TEXT_CONNECTION_ERROR . '</Description></Error>';\r\n\t\t\t}\r\n\t\t\t$doc = XML_unserialize($body); //print_r($doc);\r\n\t\t\tif (isset($doc['Error'])) return array('error' => $doc['Error']['Number'] . ' ' . $doc['Error']['Description']);\r\n\t\t\tif (isset($doc['RateV4Response']['Package']['Postage'])) { // single mail service response\r\n\t\t\t\t$tmp = $this->_decode_domestic_response($doc['RateV4Response']['Package']['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t} elseif (isset($doc['RateV4Response']['Package'][0])) { // multiple mailing services returned\r\n\t\t\t\tforeach ($doc['RateV4Response']['Package'] as $mailsvc) {\r\n\t\t\t\t\tif (isset($mailsvc['Postage'])) {\r\n\t\t\t\t\t\t$tmp = $this->_decode_domestic_response($mailsvc['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end foreach $request_group\r\n\t\treturn $quotes;\r\n\t}", "protected function _drcRequest($service)\r\n\t{\r\t\t$db = Mage::getSingleton('core/resource')->getConnection('core_write');\r\t\t\r\n\t\t$origCountry = Mage::getStoreConfig('shipping/origin/country_id', $this->getStore());\r\n\t\tif ($origCountry != \"AU\") \r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\r\r\n\t\t// TODO: Add some more validations\r\t\t$path_smartsend = \"carriers/smartsend/\";\r\t\t\r\n\t\t//$frompcode = Mage::getStoreConfig('shipping/origin/postcode', $this->getStore());\r\n\t\t//$fromsuburb = Mage::getStoreConfig('shipping/origin/city', $this->getStore());\r\t\t\r\t\t$frompcode = Mage::getStoreConfig($path_smartsend.'post_code', $this->getStore());\r\t\t$fromsuburb = Mage::getStoreConfig($path_smartsend.'suburban', $this->getStore());\r\t\t\r\n\t\t$topcode = $service->getDestPostcode();\r\n\t\t$tosuburb = $service->getDestCity();\r\r\t\tMage::Log($frompcode);\r\t\tMage::Log($fromsuburb);\r\t\t\r\n\t\tif ($service->getDestCountryId()) {\r\n\t\t\t$destCountry = $service->getDestCountryId();\r\n\t\t} \r\r\n\t\telse{\r\n\t\t\t$destCountry = \"AU\";\r\n\t\t}\t\t\r\t\r\n\t\t// Here we get the weight (and convert it to grams) and set some\r\n\t\t// sensible defaults for other shipping parameters.\t\r\r\n\t\t$weight = (int)$service->getPackageWeight();\r\t\t\r\t\t$height = $width = $length = 100;\r\n\t\t$shipping_num_boxes = 1;\r\n\t\t$Description = \"CARTON\";\r\n\t\t$post_url = \"http://api.smartsend.com.au/\"; \r\r\t\r\n \r\t//$result = $db->query(\"SELECT depth,length,height,description,taillift FROM 'smartsend_products'\");\r\t\r\t\r\n $post_param_values[\"METHOD\"] = \"GetQuote\";\r\n $post_param_values[\"FROMCOUNTRYCODE\"] = $origCountry;\r\n $post_param_values[\"FROMPOSTCODE\"] = $frompcode; //\"2000\";\r\n $post_param_values[\"FROMSUBURB\"] = $fromsuburb; //\"SYDNEY\";\r\n $post_param_values[\"TOCOUNTRYCODE\"] = $destCountry;\r\n $post_param_values[\"TOPOSTCODE\"] = $topcode;\r\n $post_param_values[\"TOSUBURB\"] = $tosuburb;\r\r\n\r\t\r\n # tail lift - init \r\n $taillift = array();\r\n $key = 0;\r\r\n\t$freeBoxes = 0;\r\n if ($service->getAllItems()) {\r\n foreach ($service->getAllItems() as $item) {\r\r\n\t/* fetching the values of lenght,weight,height,description in smartsend_products table */\r\t\t\t\t$prod_id = $item->getProduct()->getId();\r\t\t\t\t\r\t\t\t\t\r\n if ($item->getProduct()->isVirtual() || $item->getParentItem()) {\r\r\n continue;\r\r\n }\r\r\n\r\r\n if ($item->getHasChildren() && $item->isShipSeparately()) {\r\r\n foreach ($item->getChildren() as $child) {\r\r\n if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {\r\r\n $freeBoxes += $item->getQty() * $child->getQty();\r\r\n }\r\r\n }\r\r\n } elseif ($item->getFreeShipping()) {\r\r\n $freeBoxes += $item->getQty();\r\r\n }\r\t\t\t\t\r\t\t\t\t$prod_id \t= $item->getProduct()->getId();\r\t\t\t\t$result \t= $db->query('Select * from `smartsend_products` where id='.\"'\".$prod_id.\"'\");\r\t\t\t\t$rows \t\t= $result->fetch(PDO::FETCH_ASSOC);\r\t\t\t\t\r\t\t\t\t\r\t\t\t\tif($rows){\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = $rows['height'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = $rows['length'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = $rows['depth'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $rows['description'];\r\t\t\t\t}else{\r\t\t\t\t\t/* default values */\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = 'none';\t\t\t\t\r\t\t\t\t}\r\r # tail lift - assigns value\r switch($rows['taillift']){\r case 'none':\r $taillift[] = \"none\";break;\r case 'atpickup':\r $taillift[] = \"atpickup\";break; \r case 'atdestination':\r $taillift[] = \"atdestination\";break; \r case 'both':\r $taillift[] = \"both\";break; \r }\r\t\t\t\t\t\r\t\t\t\t$key++;\r\n }\r\r\n }\r\t\t\r\t\t\r\r\n $this->setFreeBoxes($freeBoxes);\r\t\t\t\t\t\t\t\r/*\r\n $post_value_items[\"ITEM({$key})_HEIGHT\"] = $height;\r\n $post_value_items[\"ITEM({$key})_LENGTH\"] = $length;\r\n $post_value_items[\"ITEM({$key})_DEPTH\"] = $width;\r\n $post_value_items[\"ITEM({$key})_WEIGHT\"] = $width;\r\n $post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $Description;\r*/\r \r \t\t\r\r\n # tail lift - choose appropriate value\r\r\n $post_param_values[\"TAILLIFT\"] = \"none\"; \r\r\n if (in_array(\"none\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"none\"; \r\n if (in_array(\"atpickup\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atpickup\";\r\n if (in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atdestination\";\r\n if (in_array(\"atpickup\", $taillift) && in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\";\r\n if (in_array(\"both\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\"; \r\r\n \r\r\n $post_final_values = array_merge($post_param_values,$post_value_items);\r\r\n # POST PARAMETER AND ITEMS VALUE URLENCODE\r\r\n $post_string = \"\";\r\r\n foreach( $post_final_values as $key => $value )\r\n { $post_string .= \"$key=\" . urlencode( $value ) . \"&\"; }\r\n $post_string = rtrim( $post_string, \"& \" );\r\r\n\tif ($service->getFreeShipping() === true || $service->getPackageQty() == $this->getFreeBoxes()) {\r $shippingPrice = '0.00';\r\t\t\t\t\r\r\n $arr_resp['ACK'] = 'Success';\r $arr_resp['QUOTE(0)_TOTAL'] = $shippingPrice;\r $arr_resp['QUOTE(0)_ESTIMATEDTRANSITTIME'] = 'Fixed';\r $arr_resp['QUOTECOUNT'] = 1;\r\r\n }else{\r\r\n \r\r\n # START CURL PROCESS\r\r\n $request = curl_init($post_url); \r\tcurl_setopt($request, CURLOPT_HEADER, 0); \r\tcurl_setopt($request, CURLOPT_RETURNTRANSFER, 1); \r\n curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);\r\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n $post_response = curl_exec($request); \r\n curl_close ($request); // close curl object \r\r\n\t# parse output\r\n parse_str($post_response, $arr_resp);\r\r\n\t}\r\r\n\treturn $arr_resp;\r\r\n\t}", "function general_enquiry_process($gen_post_data)\n\t{\n\t\t$villaName = $gen_post_data['hidVillaName'];\n\t\t$params['VillaID'] = $gen_post_data['villaID'];\n\t\t$params['CIDate'] = '1 January 1900';\n\t\t$params['CODate'] = '3 January 1900';\n\t\t$params['GuestFirstName'] = stripslashes($gen_post_data['txtFirstname']);\n\t\t$params['GuestLastName'] = stripslashes($gen_post_data['txtLastName']);\n\t\t$params['CountryOfResidence'] = $gen_post_data['selCountry'];\n\t\t$params['Email'] = $gen_post_data['txtEmail'];\n\t\t$params['TelNo'] = $gen_post_data['txtPhoneAreaCode'].$gen_post_data['txtPhoneNumber'];\n\t\t$params['TotalAdults'] = '1';\n\t\t$params['BookingSourceID'] = \"11\";\n\t\t$params['MobileNo'] = '';\n\t\t$params['BedRooms'] = '1';\n\t\t$params['SpecialRequest'] = stripslashes('Subject:'.strip_tags($gen_post_data['messageSubject']).', Message: '.$gen_post_data['txtMessage']);\n\t\t$params['SuggestOtherVilla'] = 'N';\n\t\t$params['TotalChildren'] = 0;\n\t\t$params['TotalInfants'] = 0;\n\t\t$params['RURL'] = urlencode($gen_post_data['hfrurl']);\n\t\t$params['IsGenInquiry'] = 'Y';\n\t\t$params['CIPAddress'] = $gen_post_data['hid_cip'];\n\t\t$params['IsEvent'] = 'Y';\n\t\t$params['AreDatesFlexible'] = 'N';\n\t\t$params['OptInMailList'] = 'Y';\n\t\t$params['LCID'] = 'en';\n\t\t\t\n\t\t$timeTokenHash = $this->cheeze_curls('Security_GetTimeToken', \"\", TRUE, FALSE,\"\",\"\",\"prod\");\n\t\tif (!is_array($timeTokenHash))\n\t\t\t$timeTokenHash = html_entity_decode($timeTokenHash);\n\t\n\t\t$params['p_ToHash'] = 'villaprtl|Xr4g2RmU|'.$timeTokenHash[0];\n\t\t$hashString = $this->prepare_Security_GetMD5Hash($params);\n\t\t$md5Hash = $this->cheeze_curls('Security_GetMD5Hash', $hashString, TRUE, FALSE,\"\",\"\",\"prod\");\n\t\t$p_Params = json_encode($params);\n\t\t$p_UserID = 'villaprtl';\n\t\t$p_Token = $md5Hash[0];\n\t\t$request = 'p_Token='.$p_Token.'&p_UserID='.$p_UserID.'&p_Params='.$p_Params;\n\t\t$newBooking = $this->cheeze_curls('insertInquiry',$request,TRUE,FALSE,\"\",\"\",\"prod\");\n\t\t$newBooking['thank_you_message'] = '<p>Your Reservation Enquiry Form has been successfully sent for '.$villaName.'.</p>\n\t\t\t<p>The Elite Havens Group, luxury villa rentals, manage all the reservations for '.$villaName.'. One of our villa specialists will be in touch shortly.</p>\n\t\t\t<p>Your Reference I.D. is <strong>'.$newBooking['Transactions']['InquiryID'].'</strong></p>\n\t\t\t<p>The Elite Havens Group presents a stunning portfolio of luxury private villas throughout Bali and Lombok in Indonesia, Thailand, Sri Lanka and Maldives. Staffed to the highest quality, each villa offers a blissfully relaxing and highly individual experience. Ranging in size from one to nine bedrooms and boasting private pools, luxurious living spaces, equipped kitchens (with chef) and tropical gardens, our villas are situated in the heart of the action, beside blissful beaches, upon jungle-clad hillsides and amongst idyllic rural landscapes ensuring the perfect holiday experience for all.</p>';\n\t\treturn $newBooking;\n\t\t\n\t}", "function get_item_code()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n\t\t\t$invoiceNumber = $_POST['inv'];\n\t\t\t$batch = $_POST['batch'];\n\t\t\t$tableName = \"london_stock\";\n\t\t\t$condition = array(\n\t\t\t\t'invoice_number' => $invoiceNumber,\n\t\t\t\t'invoice_date' => $batch\n\n\t\t\t);\n\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\tif ($result > 0) {\n\t\t\t\techo $response = json_encode($result, true);\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'No item', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "function checkdelivery($package) {\n\n\t$item = $package['item'];\t\n\t$quantity = $package['quantity'];\t\n\t$to = $package['to'];\t\n\t$from = $package['from'];\t\n\n// Based on the location of the delivery address and \n// the warehouse the courier can decide if they can \n// make the delivery. If yes, they could then let the \n// warehouse know the cost and delivery date.\n\n\t$accepted = 1;\n\n\tif ( $accepted )\n\t{\n\t\t$cost = 10;\n\t\t$date = '12-05-2004';\n\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => $cost,\n\t\t\t\t\t'date' => $date\n\t\t\t\t\t);\n\t} else {\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => 0,\n\t\t\t\t\t'date' => 'null'\n\t\t\t\t\t);\n\t}\n\n return new soapval('return', 'DeliveryDetail', $output, false, 'urn:MyURN');\n}", "public function getPrepareOutgoingConsignmentRequest()\n {\n $request = new PrepareOutgoingConsignmentRequest();\n $request->localTransactionId = $this->localTransactionId;\n $request->initiator = $this->initiator;\n\n $enterprise = mercDicconst::getSetting('enterprise_guid');\n $hc = mercDicconst::getSetting('issuer_id');\n\n $delivery = new Delivery();\n $delivery->consignor = new BusinessMember();\n $delivery->consignor->enterprise = new Enterprise();\n $delivery->consignor->enterprise->guid = $enterprise;\n $delivery->consignor->businessEntity = new BusinessEntity();\n $delivery->consignor->businessEntity->guid = $hc;\n\n $delivery->consignee = new BusinessMember();\n $delivery->consignee->enterprise = new Enterprise();\n $delivery->consignee->enterprise->guid = $this->step3['recipient'];\n $delivery->consignee->businessEntity = new BusinessEntity();\n $delivery->consignee->businessEntity->guid = $this->step3['hc'];\n\n $consigments = [];\n $vetCertificates = [];\n\n if(isset($this->conditions)) {\n $this->conditions = json_decode($this->conditions, true);\n }\n\n foreach ($this->step1 as $id => $product) {\n $consigment = new Consignment();\n $consigment->id = 'con'.$id;\n $stock = MercStockEntry::findOne(['id' => $id]);\n $stock_raw = unserialize($stock->raw_data);\n if($stock->product_name != $product['product_name'])\n {\n\n }\n $consigment->volume = $product['select_amount'];\n $consigment->unit = new Unit();\n $consigment->unit = $stock_raw->batch->unit;\n\n $consigment->sourceStockEntry = new StockEntry();\n //$consigment->sourceStockEntry->uuid = $stock->uuid;\n $consigment->sourceStockEntry->guid = $stock->guid;\n\n $consigments[] = $consigment;\n\n $vetCertificate = new VetDocument();\n $vetCertificate->for = 'con'.$id;\n $authentication['purpose']['guid'] = $this->step2['purpose'];\n $authentication['cargoExpertized'] = $this->step2['cargoExpertized'];\n $authentication['locationProsperity'] = $this->step2['locationProsperity'];\n\n //Заполняем условия регионализации при необходимости\n //var_dump($this->conditions); die();\n if(isset($this->conditions[$product['product_name']])) {\n $conditions = null;\n $buff = $this->conditions[$product['product_name']];\n foreach ($buff as $key=>$item) {\n $r13nClause = new RegionalizationClause();\n $r13nClause->condition = new RegionalizationCondition();\n $r13nClause->condition->guid = $key;\n $conditions[] = $r13nClause;\n }\n $authentication['r13nClause'] = $conditions;\n }\n $vetCertificate->authentication = $authentication;\n $vetCertificates[] = $vetCertificate;\n }\n\n $delivery->consignment = $consigments;\n\n $delivery->transportInfo = new TransportInfo();\n $delivery->transportInfo->transportType = $this->step4['type'];\n $delivery->transportInfo->transportNumber = new TransportNumber();\n $delivery->transportInfo->transportNumber->vehicleNumber = $this->step4['car_number'];\n if (isset($this->step4['trailer_number'])) {\n $delivery->transportInfo->transportNumber->trailerNumber = $this->step4['trailer_number'];\n }\n if (isset($this->step4['container_number'])) {\n $delivery->transportInfo->transportNumber->containerNumber = $this->step4['container_number'];\n }\n $delivery->transportStorageType = $this->step4['storage_type'];\n\n $delivery->accompanyingForms = new ConsignmentDocumentList();\n if($this->step3['isTTN']) {\n $delivery->accompanyingForms->waybill = new Waybill();\n $delivery->accompanyingForms->waybill->issueSeries = $this->step3['seriesTTN'];\n $delivery->accompanyingForms->waybill->issueNumber = $this->step3['numberTTN'];\n $delivery->accompanyingForms->waybill->issueDate = date('Y-m-d', strtotime($this->step3['dateTTN']));\n $delivery->accompanyingForms->waybill->type = $this->step3['typeTTN'];\n }\n\n $delivery->accompanyingForms->vetCertificate = $vetCertificates;\n\n $request->delivery = $delivery;\n\n /* echo \"<pre>\";\n var_dump($request); die();*/\n return $request;\n }", "public function execute()\n {\n /** @var \\Magento\\Framework\\Controller\\Result\\Json $result */\n $result = $this->resultJsonFactory->create();\n\n $productId = $this->getRequest()->getParam('productId');\n $qty = $this->getRequest()->getParam('qty');\n\n\n if (!$productId) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product ID is required'),\n ]);\n }\n\n\n // check product is in stock\n /** @var \\Magento\\Catalog\\Model\\Product $product */\n $product = $this->productFactory->create();\n $product->load($productId);\n if (!$product->getId()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product not found'),\n ]);\n }\n if (!$product->isAvailable()) {\n // TODO: product placeholders\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n if ($product->isVirtual()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Virtual products cannot be shipped'),\n ]);\n }\n\n $messages = \"\";\n if ($this->getProductSalableQty && $this->isProductSalable) {\n if ($this->helper->getInventoryStock() != null) {\n if($product->getTypeId() == 'simple') {\n $qtyInStock = $this->getProductSalableQty->execute($product->getSku(), $this->helper->getInventoryStock());\n if ($qty > $qtyInStock) {\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n } else {\n $messages = \"stock = \" . $this->helper->getInventoryStock() . \" \" . $product->getSku() . \" \" . $qty . \" in stock \" . $qtyInStock . \" \" . $product->getTypeId();\n }\n }else{\n if($this->isProductSalable->execute($product->getSku(), $this->helper->getInventoryStock())){\n $messages = \"product is saleable\";\n }else{\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n }\n } else {\n $messages = \"inventory stock null\";\n }\n } else {\n $messages = __(\"MSI not supported: \") . $product->getSku() . \" \" . $product->getTypeId();\n //probably just means MSI not supported here.\n }\n\n\n $transport = new DataObject([\n 'available' => true,\n ]);\n $this->eventManager->dispatch('porterbuddy_availability', array(\n 'product' => $product,\n 'qty' => $qty,\n 'result' => $transport,\n ));\n\n if ($transport->getError()) {\n return $result->setData([\n 'error' => true,\n 'messages' => $transport->getMessage() ?: $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n\n return $result->setData([\n 'error' => false,\n 'available' => true,\n 'messages' => $messages\n ]);\n }", "function main( $isFuturePay ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : handling WorldPay payment response IPN\");\r\n\r\n $objects = $ids = $input = array( );\r\n\r\n $component = self::retrieve('MC_module','String','POST',true);\r\n $input[\"component\"] = $component;\r\n $contact = self::retrieve('MC_contact_id','Integer','POST',true);\r\n\r\n $this->getInput($input,$ids);\r\n\r\n if (!$isFuturePay) {\r\n // not a future payment notication but may be a future payment\r\n // agreement being made...\r\n\r\n // get ids\r\n $ids[\"contact\"] = self::retrieve('MC_contact_id','String','POST',true);\r\n $ids[\"contribution\"] = self::retrieve('MC_contribution_id','String','POST',true);\r\n $ids[\"thankyoupage\"] = self::retrieve('MC_civi_thankyou_url','String','POST',true);\r\n $ids[\"cancelpage\"] = self::retrieve('MC_civi_cancel_url','String','POST',true);\r\n if ($component=='event') {\r\n $ids[\"event\"] = self::retrieve('MC_event_id','String','POST',true);\r\n $ids[\"participant\"] = self::retrieve('MC_participant_id','String','POST',true);\r\n }\r\n else {\r\n // contribution optional id's\r\n $ids['membership'] = self::retrieve('MC_membership_id','String','POST',false);\r\n $ids['contributionRecur'] = self::retrieve( 'MC_contribution_recur_id', 'Integer', 'GET', false );\r\n $ids['contributionPage'] = self::retrieve( 'MC_contribution_page_id' , 'Integer', 'GET', false );\r\n }\r\n\r\n if (is_numeric($input[\"futurePayId\"])) {\r\n // this is a futurepay agreement being made \r\n // so store the ids and do nothing more here\r\n // since no money has actually been transferred yet\r\n // ...watch futurepay repsonse for such transfers\r\n self::storeFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n return;\r\n }\r\n }\r\n else {\r\n if (!is_numeric($input[\"futurePayId\"])) {\r\n CRM_Core_Error::debug_log_message(\"futurePayId is missing for recurring payment.\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : futurePayId is missing for recurring payment. input=\".print_r($input,true));\r\n exit();\r\n }\r\n self::retrieveFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n if (!$ids) {\r\n CRM_Core_Error::debug_log_message(\"Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n exit();\r\n }\r\n }\r\n\r\n $paymentProcessorID = self::retrieve('processor_id', 'Integer', 'POST', FALSE);\r\n if (empty($paymentProcessorID)) {\r\n $processorParams = array(\r\n 'user_name' => self::retrieve('installation', 'String', 'POST', FALSE),\r\n 'payment_processor_type_id' => CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', 'WorldPay', 'id', 'name'),\r\n 'is_test' => empty($input['is_test']) ? 0 : 1,\r\n );\r\n\r\n $processorInfo = array();\r\n if (!CRM_Financial_BAO_PaymentProcessor::retrieve($processorParams, $processorInfo)) {\r\n return FALSE;\r\n }\r\n $paymentProcessorID = $processorInfo['id'];\r\n }\r\n\r\n // validateData also loads the obects\r\n if (!$this->validateData($input,$ids,$objects,TRUE,$paymentProcessorID)) {\r\n error_log(__FILE__.\":\".__LINE__.\": validate data failed, input=\".print_r($input,true).\" ids=\".print_r($ids,true));\r\n return false;\r\n }\r\n\r\n self::$_paymentProcessor =& $objects['paymentProcessor'];\r\n if ($isFuturePay) {\r\n // future pay payment notification\r\n return $this->handleFuturepayPayment($input,$ids,$objects);\r\n }\r\n else if (is_numeric($input[\"futurePayId\"])) {\r\n // future pay payment initial agreement set up\r\n // appears like a single payment but no money changes hands\r\n return $this->handleFuturepayAgreement($input,$ids,$objects);\r\n }\r\n else {\r\n // single payment\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : now processing single payment\");\r\n return $this->handleSinglePayment($input,$ids,$objects);\r\n }\r\n }", "public function process ()\n {\n /**\n * Sets pricing for which offer is applicable.\n */\n $this->setOfferApplicablePricing();\n\n /**\n * Checks if offer is valid.\n */\n if ( $this->isOfferValid() ) {\n\n /**\n * Sets benefits gained from offer.\n */\n $this->setBenefit();\n }\n\n return $this->request;\n }", "public function getProductCode()\n {\n if (array_key_exists(\"productCode\", $this->_propDict)) {\n return $this->_propDict[\"productCode\"];\n } else {\n return null;\n }\n }", "private function getProductInformation()\r\n {\r\n \r\n // if product is repairable get the repair agents details as well as products and suppliers\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" || \r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplierRepairAgent_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n // if the product is not repairable grab the product information and supplier information only\r\n else\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplier_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n }", "public function make3DPayPayment()\n {\n $status = 'declined';\n $response = 'Declined';\n $proc_return_code = $this->request->get('procreturncode');\n\n $transaction_security = 'MPI fallback';\n if (in_array($this->request->get('mdstatus'), [1, 2, 3, 4])) {\n if ($this->request->get('mdstatus') == '1') {\n $transaction_security = 'Full 3D Secure';\n } elseif (in_array($this->request->get('mdstatus'), [2, 3, 4])) {\n $transaction_security = 'Half 3D Secure';\n }\n\n $status = 'approved';\n $response = 'Approved';\n }\n\n $this->response = (object) [\n 'id' => (string) $this->request->get('authcode'),\n 'order_id' => (string) $this->request->get('oid'),\n 'trans_id' => (string) $this->request->get('transid'),\n 'auth_code' => (string) $this->request->get('authcode'),\n 'host_ref_num' => (string) $this->request->get('hostrefnum'),\n 'response' => $response,\n 'transaction_type' => $this->type,\n 'transaction' => $this->order->transaction,\n 'transaction_security' => $transaction_security,\n 'proc_return_code' => $proc_return_code,\n 'code' => $proc_return_code,\n 'md_status' => $this->request->get('mdStatus'),\n 'status' => $status,\n 'status_detail' => isset($this->codes[$this->request->get('ProcReturnCode')]) ? (string) $this->request->get('ProcReturnCode') : null,\n 'hash' => (string) $this->request->get('secure3dhash'),\n 'rand' => (string) $this->request->get('rnd'),\n 'hash_params' => (string) $this->request->get('hashparams'),\n 'hash_params_val' => (string) $this->request->get('hashparamsval'),\n 'masked_number' => (string) $this->request->get('MaskedPan'),\n 'amount' => (string) $this->request->get('amount'),\n 'currency' => (string) $this->request->get('currency'),\n 'tx_status' => (string) $this->request->get('txstatus'),\n 'eci' => (string) $this->request->get('eci'),\n 'cavv' => (string) $this->request->get('cavv'),\n 'xid' => (string) $this->request->get('xid'),\n 'error_code' => (string) $this->request->get('errcode'),\n 'error_message' => (string) $this->request->get('errmsg'),\n 'md_error_message' => (string) $this->request->get('mderrormessage'),\n 'campaign_url' => null,\n 'name' => (string) $this->request->get('firmaadi'),\n 'email' => (string) $this->request->get('Email'),\n 'extra' => $this->request->get('Extra'),\n 'all' => $this->request->all(),\n ];\n\n return $this;\n }", "protected function get_request(){\n\t\treturn \"value_cashflows\";\n\t}", "function dsf_protx_decline_order($order_number){\n\nglobal $VoidURL, $AbortURL, $Verify, $ProtocolVersion;\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please decline the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'invalid protx item';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please decline the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'more than one protx item found';\n\tbreak;\n }\n \t\n\n // we must have a valid transaction item if we are here.\n \n // we therefore need to check our logs to see if the item has been previously charged.\n \n $check_history_query = dsf_db_query(\"select orders_id, orders_status_id from \" . DS_DB_SHOP . \".orders_status_history where orders_id='\" . $order_number . \"' and orders_status_id='90006'\");\n \n if (dsf_db_num_rows($check_history_query)==0){\n \t$TargetURL = $AbortURL; // never charged.\n\t$TxType = 'ABORT';\n }else{\n \t$TargetURL = $VoidURL; // has been charged\n\t$TxType = 'VOID';\n }\n \n \n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$VerifyServer = $Verify;\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => $TxType,\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been voided / aborted witin protx.\n\n\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '50005');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '50005', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t\t\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases except failed\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn 'error';\n}", "private function dataCodeAction()\n {\n $code_action = array(\n 'ABO' => array('Abonnement', '1'),\n 'PROSP' => array('Prospection', '2'),\n 'PROSP1' => array('Prospection tracer 1', '2'),\n 'PROSP11' => array('Prospection tracer 11', '2'),\n 'PROSP12' => array('Prospection tracer 12', '2'),\n 'PROSP13' => array('Prospection tracer 13', '2'),\n 'PROSP2' => array('Prospection tracer 2', '2'),\n 'PROSP21' => array('Prospection tracer 21', '2'),\n 'PROSP22' => array('Prospection tracer 22', '2'),\n 'PROSP23' => array('Prospection tracer 23', '2'),\n 'PROSP24' => array('Prospection tracer 24', '2'),\n 'PROSP3' => array('Prospection tracer 3', '2'),\n 'PROSP5' => array('Prospection tracer 5', '2'),\n 'PROSP51' => array('Prospection tracer 51', '2'),\n 'PROSP52' => array('Prospection tracer 52', '2'),\n 'PROSP53' => array('Prospection tracer 53', '2'),\n 'PROSP ENTR' => array('Contact entrant sans fiche client', '2'),\n 'PROSP REL' => array('Prospection REL', '2'),\n 'PROSPWEB' => array('Prospection Web', '2'),\n 'FID' => array('FID', '20'),\n 'FID PROMO' => array('FID suite promo', '20'),\n 'FID PROG F' => array('FID programme fidélité', '20'),\n 'FID WEB PRGF' => array('FID web PRGF', '20'),\n 'FID WEB PROMO' => array('FID web PROMO', '20'),\n 'FID WEB PROM' => array('FID web PROMO', '20'),\n 'FID WEB' => array('FID web', '20'),\n 'PAR' => array('Parrainage', '27'),\n 'REACT+4M' => array('Reactivation fichier clients +4mois', '28'),\n 'REACT+4MPROMO' => array('Reactivation fichier clients +4mois suite à promo', '28'),\n 'REACT SPONT' => array('Reactivation client spontanée', '28'),\n 'REACT SPONT PROMO' => array('Reactivation client spontanée suite à promo', '28'),\n 'REACTSPONT' => array('Reactivation client AC formulaire', '28'),\n 'REACT AC FORM' => array('Reactivation client AC formulaire', '28'),\n 'REACTIV' => array('Reactivation REACTIV', '28'),\n 'CONT ENTR' => array('CONT ENTR', '35')\n );\n $data = array();\n $c = 1;\n foreach ($code_action as $key => $value) {\n $data[] = array(\n 'id_code_action' => (int)$c,\n 'name' => pSQL($key),\n 'description' => pSQL($value[0]),\n 'groupe' => (int)$value[1]\n );\n $c++;\n }\n\n return $data;\n }", "public function fixAction()\n {\n $mMainReq = Qss_Model_Db::Table('OYeuCauMuaSam');\n $mMainReq->where(sprintf('IFID_M412 = %1$d', $this->_form->i_IFID));\n $oMainReq = $mMainReq->fetchOne();\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n\n $this->html->main = $oMainReq;\n $this->html->sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function getProductCode(): ?string\n {\n return $this->productCode;\n }", "public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n $this->load->model('esls_model');\n\n $formData = $this->input->post(NULL, TRUE);\n\n //DATA THAT COMES FROM PRODUCERS\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"delivery_ready\"){\n $this->process_delivery_ready_event($formData);\n }\n else if($name === \"bid_awarded\"){\n $this->process_bid_awarded_event($formData);\n }\n }", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "function buildHostRequest() {\r\n\t\t$strRequest = \"\";\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->amt ) > 0) {\r\n\t\t\t\t$strRequest .= \"amt=\" . $this->amt . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->action ) > 0) {\r\n\t\t\t\t$strRequest .= \"action=\" . $this->action . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->responseURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"responseURL=\" . $this->responseURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->errorURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"errorURL=\" . $this->errorURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->trackId ) > 0) {\r\n\t\t\t\t$strRequest .= \"trackid=\" . $this->trackId . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf1 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf1=\" . $this->udf1 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf2 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf2=\" . $this->udf2 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf3 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf3=\" . $this->udf3 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf4 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf4=\" . $this->udf4 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf5 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf5=\" . $this->udf5 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf6 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf6=\" . $this->udf6 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf7 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf7=\" . $this->udf7 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf8 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf8=\" . $this->udf8 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf9 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf9=\" . $this->udf9 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf10 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf10=\" . $this->udf10 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf11 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf11=\" . $this->udf11 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf12 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf12=\" . $this->udf12 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf13 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf13=\" . $this->udf13 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf14 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf14=\" . $this->udf14 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf15 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf15=\" . $this->udf15 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf16 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf16=\" . $this->udf16 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf17 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf17=\" . $this->udf17 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf18 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf18=\" . $this->udf18 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf19 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf19=\" . $this->udf19 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf20 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf20=\" . $this->udf20 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf21 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf21=\" . $this->udf21 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf22 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf22=\" . $this->udf22 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf23 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf23=\" . $this->udf23 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf24 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf24=\" . $this->udf24 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf25 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf25=\" . $this->udf25 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf26 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf26=\" . $this->udf26 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf27 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf27=\" . $this->udf27 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf28 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf28=\" . $this->udf28 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf29 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf29=\" . $this->udf29 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf30 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf30=\" . $this->udf30 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf31 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf31=\" . $this->udf31 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf32 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf32=\" . $this->udf32 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->currency ) > 0) {\r\n\t\t\t\t$strRequest .= \"currencycode=\" . $this->currency . \"&\";\r\n\t\t\t}\r\n\t\t\tif ($this->language != null && strlen ( $this->language ) > 0) {\r\n\t\t\t\t$strRequest .= \"langid=\" . $this->language . \"&\";\r\n\t\t\t}\r\n\t\t\treturn $strRequest;\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * finally{\r\n\t\t * $strRequest = null;\r\n\t\t * }\r\n\t\t */\r\n\t}", "public function getOcentureProductCode($freedomProductCode) {\r\n $products = [\r\n 'YSDPROTECHM1MO' => 'YP8383',\r\n 'YSDPROTECHM1YR' => 'YP83811',\r\n 'YSDPROIDM1MO' => 'YP8381',\r\n 'YSDPROIDM1YR' => 'YP8389',\r\n 'YSDPROIDF1MO' => 'YP8382',\r\n 'YSDPROIDF1YR' => 'YP83810',\r\n 'YSDPROIDMP1MO' => 'YP8387',\r\n 'YSDPROIDMP1YR' => 'YP83815',\r\n 'YSDPROIDFP1MO' => 'YP8388',\r\n 'YSDPROIDFP1YR' => 'YP83816',\r\n 'YSDPROROADM1MO' => 'YP8384',\r\n 'YSDPROROADM1YR' => 'YP83812',\r\n 'YSDPROBUNDLM1MO' => 'YP8385',\r\n 'YSDPROBUNDLM1YR' => 'YP83813',\r\n 'YSDPROBUNDLF1MO' => 'YP8386',\r\n 'YSDPROBUNDLF1YR' => 'YP83814',\r\n 'testproduct' => 'IG7985'\r\n ];\r\n\r\n if (isset($products[$freedomProductCode])) {\r\n return $products[$freedomProductCode];\r\n } else {\r\n die(\"no product found matching with ocenture\");\r\n }\r\n }", "public function designProfit(){\n\t\treturn $this->campaigns()\n\t\t\t->join('order_detail', 'product_campaign.id', 'order_detail.campaign_id')\n\t\t\t->join('order', 'order_detail.order_id', 'order.id')\n\t\t\t->join('order_status', 'order.id', 'order_status.order_id')\n\t\t\t->where('order_status.value', 4)\n\t\t\t->sum('product_quantity') * 25000;\n\t}", "abstract protected function getPaymentMethodCode();", "function getCartArr ($cartStr)\n{\n\t// 1 -> OK\n\t// 2 -> invalid item\n\tglobal $currency,$currfactor,$cartArr,$isAllowExpressDlvry;\n\t$returnVal = 1;\n\tif ($invSrv == \"\") { $invSrv = new Inventory(); }\n\n\t$factory = new Product_service_factory();\n\t$prod_serv = $factory->get_instance('SE', $currency);\n\n\tif(strlen($cartStr)==0) return 0;\n\telse\n\t{\n\t\t$strArr = explode(',', $cartStr);\n\n\t\t//$addedfreexmas=\"N\";\n\n\t\tforeach ($strArr as $thisStr)\n\t\t{\n\t\t\t$pg_source = 0;\n\t\t\tif (strlen($thisStr)!=0)\n\t\t\t{\n\t\t\t\tlist($thisPid, $thisQty,$thisPrice) = explode('-',$thisStr);\n\t\t\t\tif ($currency == 'usd')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity, IF(ISNULL(sp.mainid), 1, 0) pg_source\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\tSELECT mainid\n\t\t\t\t\t\t\tFROM supplierprodstb\n\t\t\t\t\t\t\tWHERE iscurrentUS = '1'\n\t\t\t\t\t\t\t) sp\n\t\t\t\t\t\t\tON productstb.prodid = sp.mainid\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\n\t\t\t\t$thisPid = prevention_numeric($thisPid, 1, $cartStr);\n\t\t\t\t$sql .= \"\n\t\t\t\t\t\tWHERE prodid='\" . $thisPid . \"'\n\t\t\t\t\t\tAND site='SE'\n\t\t\t\t\t\tAND active='1'\n\t\t\t\t\t\t$additional_where\n\t\t\t\t\t\t\";\n\t\t\t\t$get_price = mysql_query_escape($sql) or die(\"Error @\".__LINE__);\n\t\t\t\t//echo $isAllowExpressDlvry;\n\t\t\t\tif ($isAllowExpressDlvry)\n\t\t\t\t{\n\t\t\t\t\tif (!$invSrv->isStockAvail($thisPid, \"IM\")) {\n\t\t\t\t\t\t$isAllowExpressDlvry = false;\n\t\t\t\t\t\t//echo \"falsenow(\".$thisPid.\")<br>\";\n\t\t\t\t\t\t//echo \"2\";\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"now(\".$thisPid.\")<br>\";\n\t\t\t\t}\n\t\t\t\t//Tommy check pg_source;\n\t\t\t\tif ($currency == 'usd' || $currency == 'aud')\n\t\t\t\t{\n\t\t\t\t\t//$pg_source = mysql_result($get_price,0,'pg_source');\n\t\t\t\t\t$prod_info = $prod_serv->get_product_info($thisid);\n\n\t\t\t\t\t$pg_source = $prod_serv->is_pg_sourcing($prod_info);\n\t\t\t\t}\n\t\t\t\t// End of modification for CR090319-001\n\t\t\t\tif(mysql_num_rows($get_price)!=1 || $thisQty<1 || $pg_source)\n\t\t\t\t{\n\t\t\t\t\t$returnVal = 2;\n\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Daniel - 20090409 - also check the advertised quantity with quantity in cart\n\t\t\t\t\t$listqty = mysql_result($get_price,0,'quantity');\n\t\t\t\t\tif($listqty==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$returnVal = 2;\n\t\t\t\t\t}\n\t\t\t\t\telseif($thisQty<=$listqty)\n\t\t\t\t\t{\n\t\t\t\t\t\t//end of 20090409\n\n\t\t\t\t\t\t// get listprice starts here\n\t\t\t\t\t\tinclude_once(COMMONPATH . 'srv_list.php');\n\t\t\t\t\t \t$dto = $srv->get_product_info($thisPid);\n\t\t\t\t\t\t$price = $dto->get_price();\n\n\t\t\t\t\t\t$thisListprice = $price;\n\n\t\t\t\t\t\tif($currency == 'hkd')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = number_format($thisListprice * $dto->get_rate_hkd(),2,'.','');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// get listprice ends here\n\n\t\t\t\t\t\t//added for xmas - start\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$mycarttotal = $mycarttotal-(-($thisQty*$thisListprice));\n\n\n\n\t\t\t\t\t\tif($mycarttotal>99 && $thisPid==\"1823\" && $addedfreexmas!=\"Y\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$addedfreexmas=\"Y\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//echo \"A added - $thisPid-$thisQty-$thisListprice <br><br>\";\n\t\t\t\t\t\t//added for xmas - end\n\t\t\t\t\t\tif($thisPid==\"1823\" && ($thisPrice=='0.00'||$thisPrice=='0'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t\t//do nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// added for xmas - start\n\t\t//check if there is already a 1823-1-0.00 in the cartarr\n\t\t/*\n\t\tforeach ($cartArr as $thisxmaspromo)\n\t\t{\n\t\t\t//echo \"A\".$thisxmaspromo[0].\"-\".$thisxmaspromo[2].\"<br>\";\n\n\n\t\t\tif(($thisxmaspromo[0]==\"1823\") && ($thisxmaspromo[2]==\"0.00\"||$thisxmaspromo[2]==\"0\"))\n\t\t\t{\n\t\t\t\t$addedfreexmas = \"Y\";\n\t\t\t}\n\t\t}\n\n\n\t\tif($mycarttotal>99 && $addedfreexmas!=\"Y\")\n\t\t{\n\t\t\t$cartArr[] = array(\"1823\",\"1\",\"0.00\");\n\t\t\t$addedfreexmas=\"Y\";\n\t\t\t//echo \"B added <br><br>\";\n\t\t}\n\t\t*/\n\t\t//added for xmas - end\n\t}\n\treturn $returnVal;\n}", "public function quote_request_new() {\n\t /*\t$step_one_sidebar = '<div class=\"col-md-2\">\n\t <div class=\"sidebar\">\n\t <h3>Talk TO A REPRESENTATIVE</h3>\n\t <div class=\"selection-container\">\n\t <ul>\n\t <li>1 (877) 589-2214 (US/Canada)<br/><a href=\"mailto:[email protected]\">[email protected]</a></li>\n\t </ul>\n\t \n\t </div>\n\t </div>\n\t </div>'; */ \n\t\t$step_four = 'test';\n\t //return $this->new_product_finder('quote_request', NULL, $step_four);\n\t\t$path = \\Drupal::request()->getpathInfo();\n $arg = explode('/', $path);\t\t\n $cur_page = $arg[1];\n\t\t\n\t\t$pid = $_GET['pid'];\n\t\t\n\t\t$newrfq = $fpage;\n\t\t//$newrfq = $step_four;\n\t\t\n\t\treturn array(\n\t '#theme' => 'quote_request',\n\t\t '#cur_page' => $cur_page,\n\t\t '#pid' => $pid,\n\t '#quote_related_products' => $step_four,\n\t );\n \t}", "public function getDeliveryMode()\n {\n }", "function paymentech() {\n global $order;\n $this->code = 'paymentech';\n // Payment module title in Admin\n $this->title = MODULE_PAYMENT_PAYMENTECH_TEXT_TITLE;\n if (MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD == '' && MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD == '') {\n $this->title .= '<span class=\"alert\"> (Not Configured)</span>'; \n } elseif (MODULE_PAYMENT_PAYMENTECH_TESTMODE == 'Test') {\n $this->title .= '<span class=\"alert\"> (in Testing mode)</span>';\n }\n $this->description = MODULE_PAYMENT_PAYMENTECH_TEXT_DESCRIPTION; // Descriptive Info about module in Admin\n $this->enabled = ((MODULE_PAYMENT_PAYMENTECH_STATUS == 'True') ? true : false); // Whether the module is installed or not\n $this->sort_order = MODULE_PAYMENT_PAYMENTECH_SORT_ORDER; // Sort Order of this payment option on the customer payment page\n\n if ((int)MODULE_PAYMENT_PAYMENTECH_ORDER_STATUS_ID > 0) {\n $this->order_status = MODULE_PAYMENT_PAYMENTECH_ORDER_STATUS_ID;\n }\n\n\t// save the information\n\t// Card numbers are not saved, instead keep the first and last four digits and fill middle with *'s\n\t$card_number = trim($_POST['paymentech_field_1']);\n\t$card_number = substr($card_number, 0, 4) . '********' . substr($card_number, -4);\n\t$this->payment_fields = implode(':',array($_POST['paymentech_field_0'], $card_number, $_POST['paymentech_field_2'], $_POST['paymentech_field_3'], $_POST['paymentech_field_4']));\n\n\t$this->AVSRespCode = array(\n\t\t'1 ' => \"No address supplied\",\n\t\t'2 ' => \"Bill-to address did not pass Auth Host edit checks\",\n\t\t'3 ' => \"AVS not performed\",\n\t\t'4 ' => \"Issuer does not participate in AVS\",\n\t\t'R ' => \"Issuer does not participate in AVS\",\n\t\t'5 ' => \"Edit-error - AVS data is invalid\",\n\t\t'6 ' => \"System unavailable or time-out\",\n\t\t'7 ' => \"Address information unavailable\",\n\t\t'8 ' => \"Transaction Ineligible for AVS\",\n\t\t'9 ' => \"Zip Match / Zip4 Match / Locale match\",\n\t\t'A ' => \"Zip Match / Zip 4 Match / Locale no match\",\n\t\t'B ' => \"Zip Match / Zip 4 no Match / Locale match\",\n\t\t'C ' => \"Zip Match / Zip 4 no Match / Locale no match\",\n\t\t'D ' => \"Zip No Match / Zip 4 Match / Locale match\",\n\t\t'E ' => \"Zip No Match / Zip 4 Match / Locale no match\",\n\t\t'F ' => \"Zip No Match / Zip 4 No Match / Locale match\",\n\t\t'G ' => \"No match at all\",\n\t\t'H ' => \"Zip Match / Locale match\",\n\t\t'J ' => \"Issuer does not participate in Global AVS\", \n\t\t'JA' => \"International street address and postal match\",\n\t\t'JB' => \"International street address match. Postal code not verified.\",\n\t\t'JC' => \"International street address and postal code not verified.\",\n\t\t'JD' => \"International postal code match. Street address not verified.\",\n\t\t'M1' => \"Cardholder name matches\",\n\t\t'M2' => \"Cardholder name, billing address, and postal code matches\",\n\t\t'M3' => \"Cardholder name and billing code matches\",\n\t\t'M4' => \"Cardholder name and billing address match\",\n\t\t'M5' => \"Cardholder name incorrect, billing address and postal code match\",\n\t\t'M6' => \"Cardholder name incorrect, billing address matches\",\n\t\t'M7' => \"Cardholder name incorrect, billing address matches\",\n\t\t'M8' => \"Cardholder name, billing address and postal code are all incorrect\",\n\t\t'N3' => \"Address matches, ZIP not verified\",\n\t\t'N4' => \"Address and ZIP code match (International only)\",\n\t\t'N5' => \"Address not verified (International only)\",\n\t\t'N6' => \"Address and ZIP code match (International only)\",\n\t\t'N7' => \"ZIP matches, address not verified\",\n\t\t'N8' => \"Address and ZIP code match (International only)\",\n\t\t'UK' => \"Unknown\",\n\t\t'X ' => \"Zip Match / Zip 4 Match / Address Match\",\n\t\t'Y ' => \"Not Performed\",\n\t\t'Z ' => \"Zip Match / Locale no match\");\n\n\t$this->CVV2RespCode = array(\n\t\t'M' => \"CVV Match\",\n\t\t'N' => \"CVV No match\",\n\t\t'P' => \"Not processed\",\n\t\t'S' => \"Should have been present\",\n\t\t'U' => \"Unsupported by issuer\",\n\t\t'I' => \"Invalid\",\n\t\t'Y' => \"Invalid\");\n\n }", "protected function _buildRequest()\n {\n // prepare API\n $this->setShippingMethod('Other');\n $this->setCustomerIP(Mage::helper('core/http')->getRemoteAddr());\n $version = Mage::helper('ewayrapid')->getExtensionVersion();\n $this->setDeviceID('Magento ' . Mage::getEdition() . ' ' . Mage::getVersion().' - eWAY '.$version);\n if (Mage::helper('ewayrapid')->isBackendOrder()) {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_MOTO);\n } else {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_PURCHASE);\n }\n $this->setCustomerReadOnly(true);\n\n // add Billing Address\n $billingAddress = $this->_quote->getBillingAddress();\n $customerParam = Mage::getModel('ewayrapid/field_customer');\n \n $title = $this->_fixTitle($billingAddress->getPrefix());\n \n $customerParam->setTitle($title)\n ->setFirstName($billingAddress->getFirstname())\n ->setLastName($billingAddress->getLastname())\n ->setCompanyName($billingAddress->getCompany())\n ->setJobDescription($billingAddress->getJobDescription())\n ->setStreet1($billingAddress->getStreet1())\n ->setStreet2($billingAddress->getStreet2())\n ->setCity($billingAddress->getCity())\n ->setState($billingAddress->getRegion())\n ->setPostalCode($billingAddress->getPostcode())\n ->setCountry(strtolower($billingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($billingAddress->getEmail())\n ->setPhone($billingAddress->getTelephone())\n ->setMobile($billingAddress->getMobile())\n ->setComments('')\n ->setFax($billingAddress->getFax())\n ->setUrl('');\n $this->setCustomer($customerParam);\n\n // add Shipping Address\n $shippingAddress = $this->_quote->getShippingAddress();\n\n // copy BillingAddress to ShippingAddress if checkout with guest or register\n $checkoutMethod = $this->_quote->getCheckoutMethod();\n if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST\n || $checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER\n ) {\n $shippingAddress = $billingAddress;\n }\n\n $shippingParam = Mage::getModel('ewayrapid/field_shippingAddress');\n $shippingParam->setFirstName($shippingAddress->getFirstname())\n ->setLastName($shippingAddress->getLastname())\n ->setStreet1($shippingAddress->getStreet1())\n ->setStreet2($shippingAddress->getStreet2())\n ->setCity($shippingAddress->getCity())\n ->setState($shippingAddress->getRegion())\n ->setPostalCode($shippingAddress->getPostcode())\n ->setCountry(strtolower($shippingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($shippingAddress->getEmail())\n ->setPhone($shippingAddress->getTelephone())\n ->setFax($shippingAddress->getFax());\n $this->setShippingAddress($shippingParam);\n\n return $this;\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 }", "abstract function can_use_premium_code();", "abstract protected function getRequirement(): string;", "public function productScanning(){\n $user = $this->auth();\n if(empty($this->auth())){\n Utils::response(['status'=>false,'message'=>'Forbidden access.'],403);\n }\n $data = $this->getInput();\n if(($this->input->method() != 'post') || empty($data)){ \n Utils::response(['status'=>false,'message'=>'Bad request.'],400);\n }\n $validate = [\n ['field' =>'bar_code','label'=>'Barcode','rules' => 'required' ],\n\t\t\t['field' =>'scan_city','label'=>'Scan City','rules' => 'trim' ],\n\t\t\t['field' =>'pin_code','label'=>'Scan PIN Code','rules' => 'trim' ],\n ['field' =>'latitude','label'=>'Latitude','rules' => 'trim'],\n ['field' =>'longitude','label'=>'Longitude','rules' => 'trim' ],\n\t\t\t//['field' =>'registration_address','label'=>'Registration Address','rules' => 'trim|required' ],\n ];\n $errors = $this->ScannedproductsModel->validate($data,$validate);\n if(is_array($errors)){\n Utils::response(['status'=>false,'message'=>'Validation errorss.','errors'=>$errors]);\n }\n $result = $this->ScannedproductsModel->findProduct($data['bar_code']);\n $bar_code_data = $data['bar_code'];\n\t\t$bar_code2_data = $data['bar_code'];\n\t\t$product_id = $result->id;\n\t\t$consumerId = $user['id'];\n\t\t$data['ps_ip_address'] = $this->input->ip_address();\n\t\t\n\t\t// function to get product registration status\n $isRegistered = $this->ScannedproductsModel->isProductRegistered($bar_code_data, $bar_code2_data); \n\t\n $isLoyaltyForVideoFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForVideoFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForAudioFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForAudioFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForImageFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForImageFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForPDFFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForPDFFBQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdPDFFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdPDFFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdImageFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdImageFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$isLoyaltyForProductSurveyVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyPDFFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyPDFFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyImageFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyImageFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$isLoyaltyForProductDemoVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductDemoVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductDemoAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductDemoAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$mnv25_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 25)->get()->row();\n\t\t$mnvtext25 = $mnv25_result->message_notification_value;\n\t\t$mnv26_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 26)->get()->row();\n\t\t$mnvtext26 = $mnv26_result->message_notification_value;\n\t\t$mnv27_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 27)->get()->row();\n\t\t$mnvtext27 = $mnv27_result->message_notification_value;\n\t\t$mnv28_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 28)->get()->row();\n\t\t$mnvtext28 = $mnv28_result->message_notification_value;\n\t\t$mnv29_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 29)->get()->row();\n\t\t$mnvtext29 = $mnv29_result->message_notification_value;\n\t\t$mnv30_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 30)->get()->row();\n\t\t$mnvtext30 = $mnv30_result->message_notification_value;\n \n if(empty($result)){\n $data['user_id'] = $user['id'];\n $data['created'] = date('Y-m-d H:i:s');\n $this->db->insert('scanned_product_logs', $data);\n\t\t$mnv24_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 24)->get()->row();\n\t\t$mnvtext24 = $mnv24_result->message_notification_value;\n //$this->response(['status'=>false,'message'=>'This product and barcode is not supported by TRUSTAT.'],200);\n\t\t\t$this->response(['status'=>false,'message'=>$mnvtext24],200);\n }\n\t\tif(!empty($result->product_thumb_images)){\n $result->product_thumb_images = Utils::setFileUrl($result->product_thumb_images);\n }\n\t\t\n if(!empty($result->product_image)){\n $result->product_image = Utils::setFileUrl($result->product_image);\n }\n\t\tif(!empty($result->product_code_print_bg_images)){\n $result->product_code_print_bg_images = Utils::setFileUrl($result->product_code_print_bg_images);\n }\n if(!empty($result->product_video)){\n $result->product_video = Utils::setFileUrl($result->product_video);\n }\n if(!empty($result->product_audio)){\n $result->product_audio = Utils::setFileUrl($result->product_audio);\n }\n if(!empty($result->product_pdf)){\n $result->product_pdf = Utils::setFileUrl($result->product_pdf);\n }\n\t\tif(!empty($result->product_demo_video)){\n $result->product_demo_video = Utils::setFileUrl($result->product_demo_video);\n }\n\t\tif(!empty($result->product_demo_audio)){\n $result->product_demo_audio = Utils::setFileUrl($result->product_demo_audio);\n }\n\t\tif(!empty($result->product_user_manual)){\n $result->product_user_manual = Utils::setFileUrl($result->product_user_manual);\n }\n\t\t$result->product_registration_status = $isRegistered;\n\n\t\t$result->isLoyaltyForVideoFBQuesGiven = $isLoyaltyForVideoFBQuesGiven;\n\t\t$result->isLoyaltyForAudioFBQuesGiven = $isLoyaltyForAudioFBQuesGiven;\n\t\t$result->isLoyaltyForImageFBQuesGiven = $isLoyaltyForImageFBQuesGiven;\n\t\t$result->isLoyaltyForPDFFBQuesGiven = $isLoyaltyForPDFFBQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdVideoFeedbackQuesGiven = $isLoyaltyForProductPushedAdVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdAudioFeedbackQuesGiven = $isLoyaltyForProductPushedAdAudioFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdPDFFeedbackQuesGiven = $isLoyaltyForProductPushedAdPDFFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdImageFeedbackQuesGiven = $isLoyaltyForProductPushedAdImageFeedbackQuesGiven;\n\t\t\n\t\t$result->isLoyaltyForProductSurveyVideoFeedbackQuesGiven = $isLoyaltyForProductSurveyVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyAudioFeedbackQuesGiven = $isLoyaltyForProductSurveyAudioFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyPDFFeedbackQuesGiven = $isLoyaltyForProductSurveyPDFFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyImageFeedbackQuesGiven = $isLoyaltyForProductSurveyImageFeedbackQuesGiven;\n\t\t\n\t\t$result->isLoyaltyForProductDemoVideoFeedbackQuesGiven = $isLoyaltyForProductDemoVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductDemoAudioFeedbackQuesGiven = $isLoyaltyForProductDemoAudioFeedbackQuesGiven;\n\t\t\n\t\t\n\n\t\t$result->scanned_code = $data['bar_code']; \n\t\tif($data['bar_code'] == ($result->barcode_qr_code_no)) {\n\t\t\t\n\t\t$result->activation_level = $result->pack_level; \n\t\t\n\t\t$activation_packaging_level = $result->pack_level; \n\t\t\n\t\t\n\t\t} else {\n\t\t\t\n\t\t$result->activation_level = $result->pack_level2; \n\t\t$activation_packaging_level = $result->pack_level2;\n\t\t\t\n\t\t} \n $data['consumer_id'] = $user['id'];\n\t\t\n $data['product_id'] = $result->id;\n\t\t$data['customer_id'] = $result->created_by;\n $data['code_scan_date'] = date(\"Y-m-d H:i:s\");\n\t\t$data['del_by_cs'] = 0;\n //$result->pack_level = $result->pack_level; registration_status\n\t\t\n\t\t$consumer_id = $data['consumer_id'];\n\t\t$customer_id = $data['customer_id'];\n\t\t$product_id = $data['product_id'];\n\t\t\n\t\t$isConsAlreadyLinkedtoCust = $this->ScannedproductsModel->isConsAlreadyLinkedtoCust($consumer_id, $customer_id);\t\t\n\t\t\n\t\t$mnv1_result62 = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 62)->get()->row();\n\t\t$message_notification_value62 = $mnv1_result62->message_notification_value;\n\t\t\n if($this->db->insert($this->ScannedproductsModel->table, $data)){\t\n\t\t\n\t\tif($isConsAlreadyLinkedtoCust==false){\n\t\t$data['registration_status'] = \"Registered\";\n\t\t$this->db->insert('consumer_customer_link', $data);\n\t\t}\n\t\t\n\t\t\tif($activation_packaging_level==1){\n\t\t\t// Consumer Activity Log Data insert start\n\t\t\t$CALdata['date_time'] = date('Y-m-d H:i:s'); \n\t\t\t$CALdata['consumer_name'] = get_consumer_name_by_consumer_id($consumerId);\n\t\t\t$CALdata['consumer_id'] = $consumerId; \n\t\t\t$CALdata['consumer_mobile'] = getConsumerMobileNumberById($consumerId); \n\t\t\t$CALdata['customer_name'] = getUserNameById($customer_id); \n\t\t\t$CALdata['customer_id'] = $customer_id; \n\t\t\t$CALdata['unique_customer_code'] = getCustomerCodeById($customer_id); \n\t\t\t$CALdata['product_name'] = get_products_name_by_id($product_id); \n\t\t\t$CALdata['product_id'] = $product_id; \n\t\t\t$CALdata['product_sku'] = get_product_sku_by_id($product_id); \n\t\t\t$CALdata['product_code'] = $data['bar_code']; \n\t\t\t$CALdata['gloc_latitude'] = $data['latitude'];\n\t\t\t$CALdata['gloc_longitude'] = $data['longitude'];\n\t\t\t$CALdata['gloc_city'] = $data['scan_city'];\n\t\t\t$CALdata['gloc_pin_code'] = $data['pin_code'];\n\t\t\t$CALdata['consumer_activity_type'] = $message_notification_value62;\n\t\t\t$CALdata['loyalty_rewards_points'] = 0;\n\t\t\t$CALdata['loyalty_rewards_type'] = getCustomerLoyaltyTypeById($customer_id);\n\t\t\t\n\t\t\t$this->db->insert('consumer_activity_log_table', $CALdata);\n\t\t\t// Consumer Log Data insert end\n\t\t\t}\n\t\t\t$updateDataCityScan = array(\n\t\t\t\t\t 'city_last_scan' => $data['scan_city']\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('consumers', $updateDataCityScan, array('id' => $consumerId));\n\t\t\t\t\t\n\t\t\t//$this->db->insert('consumer_customer_link', $data);\n\t\t\t\n\t\t\t\n\t\t\t// Super Loyalty start\t\t\n\t\t\t// Insert number if Scans \n\t\t\t//check if the product code is already registerd\n\t\t\tif($activation_packaging_level==1){\n\t\t$ifSuperLoyaltyAlreadyGivenConsumerProduct = $this->ScannedproductsModel->ifSuperLoyaltyAlreadyGivenConsumerProduct($product_id, $consumerId); \n\t\t\t}else{\n\t\t$ifSuperLoyaltyAlreadyGivenConsumerProduct = \"NotGiven\";\n\t\t\t}\n\t\t$isSuperLoyaltyYes\t= SuperLoyaltyStatusonProductByProductID($product_id);\n\t\tif($isSuperLoyaltyYes==\"Yes\"){\n\t\t\tif($isRegistered==false){\n\t\t\t\tif($ifSuperLoyaltyAlreadyGivenConsumerProduct==\"NotGiven\"){\n\t\t$resultC = $this->db->select('number_of_scans')->from('consumers')->where('id', $consumerId)->get()->row();\n\t\t$number_of_scansBD = $resultC->number_of_scans;\n\t\t$number_of_scansAD = $number_of_scansBD + 1;\n\t\t$updateData = array(\n\t\t\t\t\t 'number_of_scans' => $number_of_scansAD\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('consumers', $updateData, array('id' => $consumerId));\n\t\t\t\t\t\n\t\t$resultP = $this->db->select('*')->from('products')->where('id', $product_id)->get()->row();\n\t\t$include_the_product_in_super_loyalty = $resultP->include_the_product_in_super_loyalty;\n\t\t$number_of_scans_for_super_loyalty = $resultP->number_of_scans_for_super_loyalty;\n\t\t$number_of_loyalty_points_for_super_loyalty = $resultP->number_of_loyalty_points_for_super_loyalty;\t\n\t\t$number_of_scans_for_productBD = $resultP->number_of_scans_for_product;\n\t\t\n\t\t$number_of_scans_for_productAD = $number_of_scans_for_productBD + 1;\n\t\t$updateDataP = array(\n\t\t\t\t\t 'number_of_scans_for_product' => $number_of_scans_for_productAD\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('products', $updateDataP, array('id' => $product_id));\n\t\t\n\t$remainder = $number_of_scans_for_productAD%$number_of_scans_for_super_loyalty;\n\t\tif(($remainder ==0)&&($number_of_loyalty_points_for_super_loyalty!=0)) {\t\t\n\t\t//$Product_id = getProductIDbyProductCode($data['bar_code']);\n\t\t\t$customerId = get_customer_id_by_product_id($product_id);\t\t\t\n\t\t\t\t$purchased_points = total_approved_points2($customerId);\n\t\t\t\t$consumed_points = get_total_consumed_points($customerId);\n\t\t\t\t$customer_loyalty_type = get_customer_loyalty_type_by_customer_id($customerId);\n\t\t\t\t$product_name = get_products_name_by_id($product_id);\n\t\t\t\t$consumer_name = getConsumerNameById($consumerId);\t\n\t\t\t\t$product_brand_name = get_products_brand_name_by_id($product_id);\n\t\t\t\t$customer_id = get_customer_id_by_product_id($product_id);\n\t\t\t\t\n\t\t\t\t$customer_name = getUserFullNameById($customerId);\t\t\n\t\t\t\t$product_name = get_products_name_by_id($product_id);\n\t\t\t\t$consumer_name = getConsumerNameById($consumerId);\n\t\t\n\t\t\t\t\n\t\t\t\t$LPconsumed_points = $consumed_points+$number_of_loyalty_points_for_super_loyalty;\n\t\t\t\t//echo \"<pre>\";print_r($LPconsumed_points); die;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($purchased_points > ($consumed_points+$number_of_loyalty_points_for_super_loyalty)){\n $message = 'Thank You for Product Registration. '. $number_of_loyalty_points_for_super_loyalty .' loyalty points will be added to your TRUSTAT loyalty account';\n\t\t\t\t//echo \"<pre>Jyada\";print_r($LPconsumed_points); die;\n\t\t\t\t}else{\n\t\t\t\t\t$message = 'Thank You for Scan!';\n\t\t\t\t\t//echo \"<pre>kam\";print_r($LPconsumed_points); die;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t // $transactionType = 'product-registration-without-warranty'; \n\t\t\t\t$transactionType = \"Super Loyalty\";\n\t\t\t\t//$mnv61_result = $this->db->select('message_notification_value,message_notification_value_part2')->from('message_notification_master')->where('id', 61)->get()->row();\n\t\t\t\t//$mnvtext61 = $mnv61_result->message_notification_value;\n\t\t\t\t$mnvtext61 = getAPPPassbookOnScreenDisplayMessageSLByProductId($product_id);\n\t\t\t\t//$mnvtext61_p2 = $mnv61_result->message_notification_value_part2;\n\t\t\t //$transactionTypeName = $mnvtext61 . $number_of_scans_for_productAD . $mnvtext52_p2;\n\t\t\t $transactionTypeName = $mnvtext61;\n\t\t\t\t//$userId = $user['id'];\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($purchased_points > ($consumed_points+$number_of_loyalty_points_for_super_loyalty)){\n\t\t\t\t$this->Productmodel->saveSuperLoylty($transactionType, $consumerId, $product_id, ['verification_date' => date(\"Y-m-d H:i:s\"), 'consumer_id' =>$consumerId, 'consumer_name' => $consumer_name, 'brand_name' => $product_brand_name, 'customer_name' => $customer_name, 'product_name' => $product_name, 'product_id' => $product_id, 'product_code' => $data['bar_code'],'customer_loyalty_type' => $customer_loyalty_type], $customer_id, $customer_loyalty_type, $number_of_loyalty_points_for_super_loyalty);\n\t\t\t\n\t\t\t\t$this->Productmodel->saveConsumerPassbookSuperLoyalty($transactionType, ['verification_date' => date(\"Y-m-d H:i:s\"), 'brand_name' => $product_brand_name, 'customer_name' => $customer_name, 'product_name' => $product_name, 'product_id' => $product_id, 'product_code' => $data['bar_code'],'customer_loyalty_type' => $customer_loyalty_type], $customer_id, $product_id, $consumerId, $transactionTypeName, 'Loyalty', $customer_loyalty_type, $number_of_loyalty_points_for_super_loyalty);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$fb_token = getConsumerFb_TokenById($consumerId);\n // $this->ConsumerModel->sendFCM('Thank you for Product Registration, Please check the details in \"my purchase list\" in TRUSTAT App.', $fb_token);\n\t\t\t //$mnv52_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 52)->get()->row();\n\t\t\t //$mnvtext52 = $mnv52_result->message_notification_value;\n\t\t\t $mnvtext52 = getAPPNotificationMessageforSuperLoyaltyByProductId($product_id);\n\t\t\t $this->ConsumerModel->sendFCM($mnvtext52, $fb_token);\n\t\t\t\t$NTFdata['consumer_id'] = $consumerId; \n\t\t\t\t$NTFdata['title'] = \"TRUSTAT Super Loyalty\";\n\t\t\t\t$NTFdata['body'] = $mnvtext52; \n\t\t\t\t$NTFdata['timestamp'] = date(\"Y-m-d H:i:s\",time()); \n\t\t\t\t$NTFdata['status'] = 0; \n\t\t\t\n\t\t\t$this->db->insert('list_notifications_table', $NTFdata);\n\t\t\t\n\t\t\t$TRNNC_result = $this->db->select('billin_particular_name, billin_particular_slug')->from('customer_billing_particular_master')->where('cbpm_id', 10)->get()->row();\n\t\t\t$TRNNC_billin_particular_name = $TRNNC_result->billin_particular_name;\n\t\t\t$TRNNC_billin_particular_slug = $TRNNC_result->billin_particular_slug;\n\t\t\t\n\t\t\t$TRNNCData['customer_id'] = $customer_id;\n\t\t\t$TRNNCData['consumer_id'] = $consumerId;\n\t\t\t$TRNNCData['billing_particular_name'] = $TRNNC_billin_particular_name.' TRUSTAT Super Loyalty';\t\t\n\t\t\t$TRNNCData['billing_particular_slug'] = $TRNNC_billin_particular_slug.'_TRUSTAT_Super_Loyalty';\n\t\t\t$TRNNCData['trans_quantity'] = 1; \n\t\t\t$TRNNCData['trans_date_time'] = date(\"Y-m-d H:i:s\",time()); \n\t\t\t$TRNNCData['trans_status'] = 1; \t\t\t\n\t\t\t$this->db->insert('tr_customer_bill_book', $TRNNCData);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Super Loyalty end\t\n\t\t\n\t\t\t\n\t\t\tif($result->barcode_qr_code_no == $data['bar_code']) {\n if( $result->pack_level == 0 ){\n if( $isRegistered ){\n\t\t\t\t\t\n\t\t\t\t\tif( $isRegistered == completed ){\n\t\t\t\t\t\n //$result->message1 = 'This product is already registered, please contact your retailer/manufacturer for further details.';\n\t\t\t\t\t$result->message1 = $mnvtext25;\n }else {\n\t\t\t\t\t//$result->message1 = 'This product registration is already under process. Outcome of product registration will be notified to TRUSTAT member, who had initiated the registration process.';\n\t\t\t\t\t$result->message1 = $mnvtext26;\n\t\t\t\t}\n\t\t\t\t}else{\n //$result->message1 = 'Thank You for initiating Product Registration, Click Ok to scan and upload valid invoice for this product purchase and activate the warranty.';\n\t\t\t\t\t$result->message1 = $mnvtext27;\n }\n }elseif( $result->pack_level == 1 ){\n //$result->message1 = 'Scanned product details for lavel '.$result->pack_level.'.';\n\t\t\t\t//$result->message1 = 'The barcode you have scanned is on the product packing, please scan the barcode on the product for registration.';\n\t\t\t\t$result->message1 = $mnvtext29;\n }elseif($result->pack_level > 1){\n //$result->message1 = 'This is not a product barcode for consumer, Please scan barcode placed on consumer pack';\n\t\t\t\t$result->message1 = $mnvtext30;\n }\n\t\t\t} else {\n\t\t\t\t\n\t\t\tif( $result->pack_level2 == 0 ){\n if( $isRegistered ){\n\t\t\t\t\t\n\t\t\t\t\tif( $isRegistered == completed ){\n\t\t\t\t\t\n //$result->message1 = 'This product is already registered, please contact your retailer/manufacturer for further details';\n\t\t\t\t\t$result->message1 = $mnvtext25;\n }else {\n\t\t\t\t\t//$result->message1 = 'This product registration is already under process. Outcome of product registration will be notified to TRUSTAT member, who had initiated the registration process';\n\t\t\t\t\t$result->message1 = $mnvtext26;\n\t\t\t\t}\n\t\t\t\t}else{\n // $result->message1 = 'Thank You for initiating Product Registration, Click Ok to scan and upload valid invoice for this product purchase and activate the warranty';\n\t\t\t\t\t $result->message1 = $mnvtext27;\n }\n }elseif( $result->pack_level2 == 1 ){\n //$result->message1 = 'Scanned product details for lavel '.$result->pack_level.'.';\n\t\t\t\t//$result->message1 = 'The barcode you have scanned is on the product packing, please scan the barcode on the product for registration.';\n\t\t\t\t$result->message1 = $mnvtext29;\n }elseif($result->pack_level2 > 1){\n //$result->message1 = 'This is not a product barcode for consumer, Please scan barcode placed on consumer pack';\n\t\t\t\t$result->message1 = $mnvtext30;\n }\t\n\t\t\t}\n\t\t\t\n //$this->response(['status'=>true,'message'=>'Scanned product details for lavel '.$result->pack_level.'.','data'=>$result]);\n\t\t$mnv31_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 31)->get()->row();\n\t\t$mnvtext31 = $mnv31_result->message_notification_value;\n\t\t\t//$this->response(['status'=>true,'message'=>'Thanks for scanning the product.','data'=>$result]);\n\t\t\t$this->response(['status'=>true,'message'=>$mnvtext31,'data'=>$result]);\n\t\t\t\n }else{\n\t\t$mnv32_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 32)->get()->row();\n\t\t$mnvtext32 = $mnv32_result->message_notification_value;\t\n // $this->response(['status'=>false,'message'=>'System failed to scan the record.'],200); \n\t\t\t$this->response(['status'=>false,'message'=>$mnvtext32],200); \n }\n }", "public function request(){\n return \\Gaia\\ShortCircuit::request();\n }", "private function getCodigoPresupuestarioApuestaLicita()\r\n\t\t{\r\n\t\t\t$codigoPresupuesto['codigo'] = '301021100';\r\n\t\t\treturn $codigo = self::getCodigoPresupuestarioByCodigo($codigoPresupuesto['codigo']);\r\n\t\t}", "public function getDeliveryMode(): int\n {\n }", "function fn_warehouses_get_product_data_post(&$product_data, $auth, $preview, $lang_code)\n{\n if (empty($product_data['product_id'])) {\n return;\n }\n\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n /** @var Tygh\\Addons\\Warehouses\\ProductStock $product_stock */\n $product_stock = $manager->getProductWarehousesStock($product_data['product_id']);\n\n if (!$product_stock->hasStockSplitByWarehouses()) {\n return;\n }\n\n if (AREA == 'C') {\n /** @var \\Tygh\\Location\\Manager $manager */\n $manager = Tygh::$app['location'];\n $destination_id = $manager->getDestinationId();\n\n $product_data['amount'] = $product_stock->getAmountForDestination($destination_id);\n } else {\n $product_data['amount'] = $product_stock->getAmount();\n }\n}", "public function codeRechargement()\n {\n $code_secret = $this->utils->securite_xss($_POST['codesecret']);\n $fk_agence = $this->utils->securite_xss($_POST['fkagence']);\n $frais = $this->compteModel->verifCodeRechargement($fk_agence, $code_secret);\n if ($frais == 1) echo 1;\n elseif ($frais == 0) echo 0;\n else echo -2;\n }", "public function express()\n {\n $this->set_step(0);\n\n $data = new ViewObject();\n\n // Get the express checkout object\n $ec = $this->getExpressObject();\n\n //if not exist and false, then redirect\n $ec OR redirect( NC_ROUTE . '/checkout' );\n \n\n //need these libs for deep pass req.\n //$this->load->model('nitrocart/addresses_m');\n //$this->load->model('nitrocart/orders_m');\n $this->load->library('nitrocart/Gateway_library');\n\n //if form validation pass\n $this->session->set_userdata('gateway_id', $ec->gateway->id);\n $this->session->set_userdata('user_id', $this->current_user->id);\n $this->session->set_userdata('billing', $ec->billing_address->id);\n //$this->session->set_userdata('shipping', $ec->shipping_address->id);\n $this->set_shipping_address_id( $ec->shipping_address->id );\n\n $data->gateway = $this->gateway_library->get($ec->gateway->id);\n $data->gateway_id = $ec->gateway->id; //deprecated\n \n $data->billing_address = $ec->billing_address;\n $data->shipping_address = $ec->shipping_address;\n $data->shipments = $ec->shipments;\n\n $so = $this->set_shipment_method( $ec->shipments->id ); //this also does a calc\n $data->ship_cost = $so->cost;\n\n\n if( $input = $this->input->post() )\n {\n\n $this->load->model('nitrocart/orders_m');\n\n if($order_id = $this->place_order())\n {\n redirect( NC_ROUTE . '/payment/order/' . $order_id );\n }\n //else\n $this->session->set_flashdata( JSONStatus::Error ,\"Unable to place order.\");\n redirect( NC_ROUTE. '/cart' );\n }\n\n\n $this->template\n ->title(Settings::get('shop_name'), 'Account') \n ->set_breadcrumb('Express Checkout')\n ->build( 'checkout/express/confirm',$data);\n }", "public static function PRO_LOGIC_II()\n {\n return new DolbyDigitalPlusDownmixingPreferredMode(self::PRO_LOGIC_II);\n }", "public function payWayPurchase()\n\t{\n\t}", "function shipPriceAccepted($id,$logisticportalid,$prepriceid) {\n global $objGeneral;\n global $objCore;\n $arrColumnUpdate = array('pricestatus' => 1);\n $varUsersWhere = \" pkpriceid ='\" . $id . \"'\";\n $this->update(TABLE_ZONEPRICE, $arrColumnUpdate, $varUsersWhere);\n // pre($logisticportalid);\n $arrLogisticdetails = $objGeneral->GetCompleteDetailsofLogisticPortalbyid($logisticportalid);\n $logistictitle = $arrLogisticdetails[0]['logisticTitle'];\n $logisticmailid = $arrLogisticdetails[0]['logisticEmail'];\n if($prepriceid==0)\n {\n $editedmessage='';\n }\n else\n {\n $editedmessage='This value will be applied after 24 hours'; \n }\n \n if ($_SERVER[HTTP_HOST] != '192.168.100.97') {\n //Send Mail To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo.png' . '\"/>';\n $varToUser = $logisticmailid;\n $varFromUser = SITE_EMAIL_ADDRESS;\n $sitelink = SITE_ROOT_URL . 'logistic/';\n $varSubject = SITE_NAME . ':Price Apporval';\n $varBody = '\n \t\t<table width=\"700\" cellspacing=\"0\" cellpadding=\"5\" border=\"0\">\n\t\t\t\t\t\t\t <tbody>\n\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t <td width=\"600\" style=\"padding-left:10px;\">\n\t\t\t\t\t\t\t <p>\n\t\t\t\t\t\t\tWelcome! <br/><br/>\n\t\t\t\t\t\t\t<strong>Dear ' . $logistictitle . ',</strong>\n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\tWe are pleased to inform about your Zone Price Apporval. '.$editedmessage.' \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t <br /><br />\n\t\t\t\t\t\t\tIf there is anything that we can do to enhance your Tela Mela experience, please feel free to <a href=\"{CONTACT_US_LINK}\">contact us</a>.\n\t\t\t\t\t\t\t<br/><br/>\n\t\t\t\t\t\t\t </p>\n\t\t\t\t\t\t\t </td>\n\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t </tbody>\n\t\t\t\t\t\t\t </table>\n \t\t';\n// $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/admin_user_registration.html');\n// $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5($argArrPost['frmUserEmail']) . '\" target=\"_blank\">here</a> to unsubscribe.';\n// $varActivationLink = '';\n// $arrBodyKeywords = array('{USER}', '{USER_NAME}', '{PASSWORD}', '{EMAIL}', '{ROLE}', '{SITE_NAME}', '{ACTIVATION_LINK}', '{IMAGE_PATH}', '{UNSUBSCRIBE_LINK}');\n// $arrBodyKeywordsValues = array(trim(stripslashes($argArrPost['frmName'])), trim(stripslashes($argArrPost['frmName'])), trim($argArrPost['frmPassword']), trim(stripslashes($argArrPost['frmUserEmail'])), 'Country Portal', SITE_NAME, $varActivationLink, $varPath); //,$varUnsubscribeLink\n// $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $_SESSION['sessArrUsers'] = '';\n }\n //return all record\n return 1;\n }", "public function getProductOption();", "public function request_product(){\n $save_data['req_product_name'] = $_REQUEST['req_product_name'];\n $save_data['req_product_person'] = $_REQUEST['req_product_person'];\n $save_data['req_product_email'] = $_REQUEST['req_product_email'];\n $save_data['req_product_mobile'] = $_REQUEST['req_product_mobile'];\n $save_data['req_product_msg'] = $_REQUEST['req_product_msg'];\n $save_data['req_product_date'] = date('d-m-Y h:i:s A');\n $req_product_id = $this->User_Model->save_data('req_product', $save_data);\n if($req_product_id){\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Product Request Saved Successfully\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Product Request Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "function SAP_set_order($rec_id)\n{\n/*\n\tThis FUNCTION posts SD order \n\tINPUT: id of invoice\n\tOUTPUT:\n\t\t\t- \"ID\" of SD order\n\t\t\tOR \"0\" - if failed\n*/\n\tinclude(\"login_re.php\");\n\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\t\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t//$cond_value='10';\n\t$service_mode='SO_C';\t// CREATE\t\n\t$req = new Request();\n\t \n\t\t\t//Setting up the object\n\t\t\t$item= new Item();\n\t\t\n\t\t//Set up mySQL connection\n\t\t\t$db_server = mysqli_connect($db_hostname, $db_username,$db_password);\n\t\t\t$db_server->set_charset(\"utf8\");\n\t\t\tIf (!$db_server) die(\"Can not connect to a database!!\".mysqli_connect_error($db_server));\n\t\t\tmysqli_select_db($db_server,$db_database)or die(mysqli_error($db_server));\n\t//1.\t\n\t\t// LOCATE data for the invoice\n\t\t\t$invoice_sql=\"SELECT invoice.date,invoice.value,contract.id_SAP,currency.code,decade,month,year \n\t\t\t\t\t\t\tFROM invoice \n\t\t\t\t\t\t\tLEFT JOIN contract ON invoice.contract_id=contract.id \n LEFT JOIN currency ON invoice.currency=currency.id\n\t\t\t\t\t\t\tWHERE invoice.id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql=mysqli_query($db_server,$invoice_sql);\n\t\t\t\t\n\t\t\tif(!$answsql) die(\"Database SELECT TO invoice table failed: \".mysqli_error($db_server));\t\n\t\t\tif (!$answsql->num_rows)\n\t\t\t{\n\t\t\t\techo \"WARNING: No invoice found for a given ID in invoice TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t$i_data= mysqli_fetch_row($answsql);\n\t\t\t\t\n\t\t\t\n\t//2.\t\n\t\t\t// Prepare request for SAP ERPclass Item\n\t\n\t\t\t// Set up params\n\t\t\t\n\t\t\t$c_date=$i_data[0];\n\t\t\t$val=$i_data[1];\n\t\t\t$contract_id=$i_data[2];\n\t\t\t$curr=$i_data[3];\t// Currency in invoice\n\t\t\t$decade=$i_data[4];\n\t\t\t$month=$i_data[5];\n\t\t\t$year=$i_data[6];\n\t\t\t//SERVICE DATE\n\t\t\t$service_date='';\n\t\t\tswitch($month)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$service_date='-01-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$service_date='-02-';\n\t\t\t\t\tif((int)$year%4)\n\t\t\t\t\t\t$day='28';\n\t\t\t\t\telse\n\t\t\t\t\t\t$day='29';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$service_date='-03-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$service_date='-04-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$service_date='-05-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$service_date='-06-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\t$service_date='-07-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\t$service_date='-08-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\t$service_date='-09-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\t$service_date='-10-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\t$service_date='-11-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\t$service_date='-12-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG MONTH IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch($decade)\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t$day='01';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='10';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$day='20';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='28';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG DECADE IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$service_date='20'.$year.$service_date.$day;\n\t\t\t// Preparing Items for Invoice\n\t\t\t$count_in=1;// only one position by Invoice now\n\t\t\t$items=new ItemList();\n\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t{\t\n\t\t\t\t$item1 = new Item();\n\t\t\t\t// 1. Item number\n\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t// 2. Material code\n\t\t\t\t$item1->MATERIAL='901200000';//now it's fixed\n\t\t\t\n\t\t\t/*2.1 BLOCK LEFT FOR LOCATING SAP MATERIAL ID\n\t\t\t\n\t\t\t\t$servicesql='SELECT id_SAP,id FROM services WHERE id_NAV=\"'.$service_id.'\"';\t\n\t\t\t\t$answsql=mysqli_query($db_server,$servicesql);\t\n\t\t\t\tif(!$answsql) die(\"Database SELECT in services table failed: \".mysqli_error($db_server));\t\n\n\t\t\t\t$sap_service_id= mysqli_fetch_row($answsql);\n\t\t\t*/\n\t\t\t\t// 3. Currency\n\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t// 4. SD conditions\n\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t// 4. Quantity\n\t\t\t\t$item1->TARGET_QTY='1'; //FIXED!\n\t\t\t\t\n\t\t\t\n\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t$items->item[$it] = $item1;\n\t\t\t}\n\t\t\t\n\t\t// GENERAL SECTION (HEADER)\n\t\t\n\t\t\t$req->ID_SALESCONTRACT = $contract_id;\t\n\t\t\t$req->SERVICEMODE = $service_mode;\n\t\t\t$req->SERVICEDATE = $service_date;\t\t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->RETURN2 = '';\n\t\t\t\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order)\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}", "function SAP_set_order_multy($rec_id)\n{\n/*\n\tThis FUNCTION posts SD order \n\tINPUT: id of invoice\n\tOUTPUT:\n\t\t\t- \"ID\" of SD order\n\t\t\tOR \"0\" - if failed\n*/\n\tinclude(\"login_re.php\");\n\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t\n\t$service_mode='SO_C';\t// CREATE\t\n\t$req = new Request();\n\t \n\t\t\t//Setting up the object\n\t\t\t$item= new Item();\n\t\t\n\t\t//Set up mySQL connection\n\t\t\t$db_server = mysqli_connect($db_hostname, $db_username,$db_password);\n\t\t\t$db_server->set_charset(\"utf8\");\n\t\t\tIf (!$db_server) die(\"Can not connect to a database!!\".mysqli_connect_error($db_server));\n\t\t\tmysqli_select_db($db_server,$db_database)or die(mysqli_error($db_server));\n\t//1.\t\n\t\t// LOCATE data for the invoice\n\t\t\t$invoice_sql=\"SELECT invoice.date,invoice.value,contract.id_SAP,currency.code,invoice.month,invoice.year \n\t\t\t\t\t\t\tFROM invoice \n\t\t\t\t\t\t\tLEFT JOIN contract ON invoice.contract_id=contract.id \n LEFT JOIN currency ON invoice.currency=currency.id\n\t\t\t\t\t\t\tWHERE invoice.id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql=mysqli_query($db_server,$invoice_sql);\n\t\t\t\t\n\t\t\tif(!$answsql) die(\"Database SELECT TO invoice table failed: \".mysqli_error($db_server));\t\n\t\t\tif (!$answsql->num_rows)\n\t\t\t{\n\t\t\t\techo \"WARNING: No invoice found for a given ID in invoice TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t$i_data= mysqli_fetch_row($answsql);\n\t\t\t\t\n\t\t\t\n\t//2.\t\n\t\t\t// Prepare request for SAP ERPclass Item\n\t\n\t\t\t// Set up params\n\t\t\t\n\t\t\t$c_date=$i_data[0];\n\t\t\t$val=$i_data[1];\n\t\t\t$contract_id=$i_data[2];\n\t\t\t$curr=$i_data[3];\t// Currency in invoice\n\t\t\t$c_month=$i_data[4];\n\t\t\t$c_year=$i_data[5];\n\t\t\t$srv_date='';\n\t\t\t$m_date='';\n\t\t\t//SET UP SERVICE DATE - END OF THE BILLING PERIOD\n\t\t\tswitch($c_month)\n\t\t\t{\n\t\t\t\tcase '1':\n\t\t\t\t$m_date='-01-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t$m_date='-02-28';\n\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t$m_date='-03-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t$m_date='-04-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t$m_date='-05-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '6':\n\t\t\t\t$m_date='-06-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '7':\n\t\t\t\t$m_date='-07-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '8':\n\t\t\t\t$m_date='-08-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '9':\n\t\t\t\t$m_date='-09-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '10':\n\t\t\t\t$m_date='-10-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '11':\n\t\t\t\t$m_date='-11-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '12':\n\t\t\t\t$m_date='-12-31';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$srv_date='20'.$c_year.$m_date;\n\t\t\t\n\t\t\t// Preparing Items for Invoice\n\t\t\t\n\t\t\t// LOCATE POSITIONS for the invoice\n\t\t\t$positions_sql=\"SELECT service_id,quantity,service.id_SAP \n\t\t\t\t\t\t\tFROM invoice_reg \n\t\t\t\t\t\t\tLEFT JOIN service ON invoice_reg.service_id=service.id\n\t\t\t\t\t\t\tWHERE invoice_id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql1=mysqli_query($db_server,$positions_sql);\n\t\t\t\t\n\t\t\tif(!$answsql1) die(\"Database SELECT TO invoice_reg table failed: \".mysqli_error($db_server));\t\n\t\t\t$count_in=$answsql1->num_rows;\n\t\t\tif (!$count_in)\n\t\t\t{\n\t\t\t\techo \"WARNING: No POSITIONS found for a given ID in invoice_reg TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$items=new ItemList();\n\t\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t\t{\t\n\t\t\t\t\t$pos_data= mysqli_fetch_row($answsql1);\n\t\t\t\t\t$item1 = new Item();\n\t\t\t\t\t// 1. Item number\n\t\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t\t// 2. Material code\n\t\t\t\t\t$item1->MATERIAL=$pos_data[2];\n\t\t\t\n\t\t\t\t\n\t\t\t\t// 3. Currency ?? - need it?\n\t\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t\t// 4. SD conditions\n\t\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t\t// 4. Quantity\n\t\t\t\t\t$item1->TARGET_QTY=$pos_data[1];; \n\t\t\t\t\n\t\t\t\n\t\t\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t\t$items->item[$it] = $item1;\n\t\t\t\t}\n\t\t\t\n\t\t// GENERAL SECTION (HEADER)\n\t\t\n\t\t\t$req->ID_SALESCONTRACT = $contract_id;\t\n\t\t\t$req->SERVICEMODE = $service_mode; \t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->SERVICEDATE=$srv_date;\n\t\t\t$req->RETURN2 = '';\n\t\t\t//echo \"SENDING TO SAP\";\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order->RETURN2->item->MESSAGE==\"SUCCESS\")\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\t\t\telse\n\t\t\t\t$doc_id=0;\n\t\t\t\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}", "public function addProductCode($code)\n {\n //$pieces = preg_split(\"/-/\", $code);\n //$programId = preg_replace(\"/\\D/\", \"\", $pieces[0]);\n }", "function huiten_daifu_pay($parms){\n\n $huiten_config = $GLOBALS['huiten_config'];\n\n $url = 'http://121.42.248.56:8080/pay-platform-api/doQhyHtGateBusiness';//请求地址\n\n $merNo = $huiten_config['merchantNo'];//\n\n $signKey = $huiten_config['signKey'];//\n\n $resMap=array();\n\n $resMap['requestNo']=$parms['requestNo'];\n\n $resMap['version']='V1.0';\n\n $resMap['productId']='0203';\n\n $resMap['transId']='005';\n\n $resMap['merNo']=$merNo;\n\n $resMap['orderDate']=date('Ymd');\n\n $resMap['orderNo']=$parms['orderNo'];\n\n $resMap['notifyUrl']='http://www.euamote.me/index.php/Home/Deposit/huiten_notify.html';\n\n $resMap['dfType']='001';\n\n $resMap['transAmt']=$parms['transAmt'];\n\n $resMap['isCompay']='0';\n\n $resMap['phoneNo']=$parms['phoneNo'];\n\n $resMap['customerName']=$parms['customerName'];\n\n $resMap['accBankNo']=$parms['accBankNo'];\n\n $resMap['accBankName']=$parms['accBankName'];\n\n $resMap['acctNo']=$parms['acctNo'];\n\n $resMap['signature']=strtoupper(md5($resMap['requestNo'].$resMap['productId'].$resMap['merNo'].$signKey));\n\n\n\n $data=array();\n\n $data['reqJson']=json_encode($resMap,256);\n\n return json_decode(post($url,$data), true);\n}", "protected abstract function isSingleProduct();", "function trackingno($carrier, $trno, $shipmentMethod){\n\t$carrier1=$carrier;\t\n\t$carrier=strtolower($carrier);\n\t\n\t//$trno=strtolower($trno);\n\t$shipmentMethod1=$shipmentMethod; \n\t$shipmentMethod=strtolower($shipmentMethod);\n\t\n\t$carrierdata=\" (Not Specified)\";\n\t$carrierRG=\"Not Specified\";\n\t\n\t\tif($carrier !=\"\" ){$carrierdata=\" (\".$carrier1.\")\";}\n\tif($carrier=='ups (usa)' || $carrier=='ups' || $carrier=='ups (us)'){\n\t\t\n\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t}\n\t\telseif($carrier==\"\" && substr($shipmentMethod, 0, 3) === 'ups'){\n\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='fedex (usa)' || $carrier=='fedex' || $carrier=='fedex (us)'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t}\n\t\telseif($carrier=='' && substr($shipmentMethod, 0, 3) =='fedex'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='us postal service'){\n\t\t\t$clink=\"https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=\";\n\t\t}\n\t\t\n\t\telseif($carrier=='miscellaneous' || $carrier=='miscellaneous (us)'){$clink=\"\";}\n\t\telse{$clink=\"\";}\n\t\t\n\t\tif($clink == \"\"){\n\t\t\tif($carrier1!=\"\"){$carrierRG=$carrier1;}\n\t\t\tif (preg_match(\"/\\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\\dT]\\d\\d\\d ?\\d\\d\\d\\d ?\\d\\d\\d)\\b/\", $trno)) {\n\t\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\t\n\t\t\telseif (preg_match(\"/(\\b96\\d{20}\\b)|(\\b\\d{15}\\b)|(\\b\\d{12}\\b)/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/\\b((98\\d\\d\\d\\d\\d?\\d\\d\\d\\d|98\\d\\d) ?\\d\\d\\d\\d ?\\d\\d\\d\\d( ?\\d\\d\\d)?)\\b/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/^[0-9]{15}$/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($clink != \"\"){\n\t\t\t$trdata=\"<a href='\".$clink.\"\".$trno.\"' target='_blank'>\".$trno.\"</a>\".$carrierdata.\", \";\n\t\t}\n\t\telse{\n\t\t\t$trdata=$trno.\"\".$carrierdata.\", \";\n\t\t\t}\n\t\tif($trno==\"\"){$trdata=\"\";}\n\t\treturn $trdata;\n\t}", "function request_shipping_label($data)\n {\n // Note you may want to associate this in some other way, like with a database ID.\n $this->PartnerTransactionID = substr(uniqid(rand(), true), 0, 10);\n\n $xml = '<LabelRequest Test=\"NO\" LabelSize=\"4X6\" LabelType=\"Default\" LabelSubtype=\"None\" ImageFormat=\"GIF\">\n\t\t\t\t\t<RequesterID>' . $this->RequesterID . '</RequesterID>\n\t\t\t\t\t<AccountID>' . $this->AccountID . '</AccountID>\n\t\t\t\t\t<PassPhrase>' . $this->PassPhrase . '</PassPhrase>\n\t\t\t\t\t<PartnerTransactionID>' . $this->PartnerTransactionID . '</PartnerTransactionID>';\n\n $xml .= '<IntegratedFormType>Form2976</IntegratedFormType>';\n\n if (!empty($data)) {\n foreach ($data as $node_key => $node_value) {\n $xml .= '<' . $node_key . '>' . $node_value . '</' . $node_key . '>';\n }\n }\n\n $xml .= '<ResponseOptions PostagePrice=\"TRUE\"/>\n\t\t\t\t</LabelRequest>';\n\n $data = array(\"labelRequestXML\" => $xml);\n\n\n\n $request = $this->client->post('/LabelService/EwsLabelService.asmx/GetPostageLabelXML', array(), $data);\n return $this->send_request($request);\n }", "public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}", "public function prod($prod);", "public function getProductType()\n {\n }", "function before_process() {\n global $order, $db, $currencies, $messageStack;\n\n\t// if the card number has the blanked out middle number fields, it has been processed, the message that \n\t// the charges were not processed were set in pre_confirmation_check, just return to continue without processing.\n\tif (strpos($_POST['paymentech_field_1'], '*') !== false) {\n\t\treturn false;\n\t}\n\n $order->info['cc_expires'] = $_POST['paymentech_field_2'] . $_POST['paymentech_field_3'];\n $order->info['cc_owner'] = $_POST['paymentech_field_0'];\n\t$this->cc_card_owner = $_POST['paymentech_field_0'];\n $order->info['cc_cvv'] = $_POST['paymentech_field_4'];\n\n // Create a string that contains a listing of products ordered for the description field\n $description = $order->description;\n\n\t// Generate the XML file to be sent to Paymentech\n\tif (MODULE_PAYMENT_PAYMENTECH_TESTMODE == 'Test') {\n\t\t$MerchantID = MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_TEST;\n\t} else {\n\t\tswitch (DEFAULT_CURRENCY) {\n\t\t\tcase 'USD': $MerchantID = MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD; break;\n\t\t\tcase 'CAD': $MerchantID = MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD; break;\n\t\t}\n\t}\n\n\t$post_string = \"\n\t\t<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n\t\t<Request>\n\t\t\t<NewOrder>\n\t\t\t\t<IndustryType>EC</IndustryType>\n\t\t\t\t<MessageType>\" . (MODULE_PAYMENT_PAYMENTECH_AUTHORIZATION_TYPE == 'Authorize' ? 'A' : 'AC') . \"</MessageType>\n\t\t\t\t<BIN>\" . MODULE_PAYMENT_PAYMENTECH_BIN . \"</BIN>\n\t\t\t\t<MerchantID>\" . $MerchantID . \"</MerchantID>\n\t\t\t\t<TerminalID>\" . MODULE_PAYMENT_PAYMENTECH_TERMINAL_ID . \"</TerminalID>\n\t\t\t\t<AccountNum>\" . $_POST['paymentech_field_1'] . \"</AccountNum>\n\t\t\t\t<Exp>\" . $order->info['cc_expires'] . \"</Exp>\n\t\t\t\t<CurrencyCode>\" . (DEFAULT_CURRENCY == 'USD' ? '840' : '124') . \"</CurrencyCode>\n\t\t\t\t<CurrencyExponent>2</CurrencyExponent>\n\t\t\t\t<CardSecValInd>\" . ($this->cc_cvv2 ? 1 : 9 ) . \"</CardSecValInd>\n\t\t\t\t<CardSecVal>\" . ($this->cc_cvv2 ? $this->cc_cvv2 : '') . \"</CardSecVal>\n\t\t\t\t<AVSzip>\" . preg_replace(\"/[^A-Za-z0-9]/\", \"\", $order->bill_postal_code) . \"</AVSzip>\n\t\t\t\t<AVSaddress1>\" . substr($order->bill_address1, 0, 20) . \"</AVSaddress1>\"\n\t\t\t\t. ( $order->bill_address2 ? '\n\t\t\t\t<AVSaddress2>' . $order->bill_address2 . '</AVSaddress2>' : '' ) . \"\n\t\t\t\t<AVScity>\" . $order->bill_city_town . \"</AVScity>\n\t\t\t\t<AVSstate>\" . $order->bill_state_province . \"</AVSstate>\n\t\t\t\t<AVSphoneNum>\" . $order->bill_telephone . \"</AVSphoneNum>\n\t\t\t\t<AVSname>\" . $this->cc_card_owner . \"</AVSname>\n\t\t\t\t<AVScountryCode>\" . gen_get_country_iso_2_from_3($order->bill_country_code) . \"</AVScountryCode>\n\t\t\t\t<AVSDestzip>\" . preg_replace(\"/[^A-Za-z0-9]/\", \"\", $order->ship_postal_code) . \"</AVSDestzip>\n\t\t\t\t<AVSDestaddress1>\" . $order->ship_address1 . \"</AVSDestaddress1>\"\n\t\t\t\t . ( $order->ship_address2 ? '\n\t\t\t\t<AVSDestaddress2>' . $order->ship_address2 . '</AVSDestaddress2>' : '' ) . \"\n\t\t\t\t<AVSDestcity>\" . $order->ship_city_town . \"</AVSDestcity>\n\t\t\t\t<AVSDeststate>\" . $order->ship_state_province . \"</AVSDeststate>\n\t\t\t\t<AVSDestphoneNum>\" . $order->ship_telephone . \"</AVSDestphoneNum>\n\t\t\t\t<AVSDestname>\" . $order->ship_primary_name . \"</AVSDestname>\n\t\t\t\t<AVSDestcountryCode>\" . gen_get_country_iso_2_from_3($order->ship_country_code) . \"</AVSDestcountryCode>\n\t\t\t\t<OrderID>\" . $order->purchase_invoice_id . \"</OrderID>\n\t\t\t\t<Amount>\" . ($order->total_amount * pow(10, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places'])) . \"</Amount>\n\t\t\t</NewOrder>\n\t\t</Request>\n\t\";\n\n\t$header = \"POST /AUTHORIZE HTTP/1.0\\r\\n\"; //HTTP/1.1 should work fine also\n\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t$header .= \"Content-type: application/PTI41\\r\\n\";\n\t$header .= \"Content-length: \" . strlen($post_string) . \"\\r\\n\";\n\t$header .= \"Content-transfer-encoding: text\\r\\n\";\n\t$header .= \"Request-number: 1\\r\\n\";\n\t$header .= \"Document-type: Request\\r\\n\";\n\t$header .= \"Merchant-id: \" . $MerchantID . \"\\r\\n\\r\\n\";\n//\t$header .= \"Connection: close \\r\\n\\r\\n\"; //Must have two CR/LF's here\n\t$header .= $post_string;\n\n // SEND DATA BY CURL SECTION\n // Post order info data to Paymentech gateway, make sure you have cURL support installed\n\n if (MODULE_PAYMENT_PAYMENTECH_TESTMODE == 'Test') {\n\t\t$url = MODULE_PAYMENT_PAYMENTECH_TEST_URL_PRIMARY;\n\t} else {\n\t\t$url = MODULE_PAYMENT_PAYMENTECH_PRODUCTION_URL_PRIMARY;\n\t}\n\n//echo 'transmit xml = '; echo htmlspecialchars($header); echo '<br><br>';\n\n\t$GetPost = 'POST';\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\tcurl_setopt($ch, CURLOPT_HEADER, false); // You are providing a header manually so turn off auto header generation\n curl_setopt($ch, CURLOPT_VERBOSE, false);\n\n\n//*\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); // The following two options are necessary to properly set up SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);\n//*/\n\n/*\n\tcurl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\tif ($GetPost == 'POST') {\n\t curl_setopt($ch, CURLOPT_POST, 1);\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, $header);\n }\n*/\n\n if (CURL_PROXY_REQUIRED == 'True') {\n curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, true);\n curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);\n curl_setopt ($ch, CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS);\n }\n\n\t$authorize = curl_exec($ch); \n\t// Check for curl errors\n\t$curlerrornum = curl_errno($ch);\n\t$curlerror = curl_error($ch);\n\tcurl_close ($ch);\n\tif ($curlerrornum) { \n\t\t$messageStack->add('XML Read Error (cURL) #' . $curlerrornum . '. Description = ' . $curlerror,'error');\n\t\treturn true;\n\t}\n\n//echo 'response xml = ' . htmlspecialchars($authorize) . '<br><br>';\n\n\t// since the response is only one level deep, we can do a simple parse\n\t$authorize = trim($authorize);\n\t$authorize = substr($authorize, strpos($authorize, '<NewOrderResp>') + 14); // remove up to and including the container tag\n\t$authorize = substr($authorize, 0, strpos($authorize, '</NewOrderResp>')); // remove from end container tag on\n\t$results = array();\n\t$runaway_loop_counter = 0;\n\twhile ($authorize) {\n\t\t$key = substr($authorize, strpos($authorize, '<') + 1, strpos($authorize, '>') - 1);\n\t\t$authorize = substr($authorize, strpos($authorize, '>') + 1); // remove start tag\n\t\t$value = substr($authorize, 0, strpos($authorize, '<')); // until start of end tag\n\t\t$authorize = substr($authorize, strpos($authorize, '>') + 1); // remove end tag\n\t\t$results[$key] = $value;\n\t\tif ($runaway_loop_counter++ > 1000) break;\n\t}\n\n//echo 'RespCode = ' . $results['RespCode'] . '<br>';\n//echo 'AVSRespCode = ' . $results['AVSRespCode'] . '<br>';\n//echo 'CVV2RespCode = ' . $results['CVV2RespCode'] . '<br>';\n//echo 'TxRefNum = ' . $results['TxRefNum'] . '<br><br>';\n\n\tif ($results['ProcStatus'] == 0) { //initial gateway test passed\n\t\tif ($results['ApprovalStatus'] == 1) { //Gateway returned approved\n\t\t\t$this->auth_code = $results['AuthCode'];\n\t\t\t$this->transaction_id = $results['TxRefNum'];\n\t\t $messageStack->add($results['StatusMsg'] . ' - Approval code: ' . $this->auth_code . ' --> CVV2 results: ' . $this->CVV2RespCode[$results['CVV2RespCode']], 'success');\n\t\t $messageStack->add('Address verification results: ' . $this->AVSRespCode[$results['AVSRespCode']], 'success');\n/* DELETE ME */ return true; // force a fail to not post\n\t\t return false;\n\t\t} else {\n\t\t\t\n\t\t\t$messageStack->add(sprintf(MODULE_PAYMENT_PAYMENTECH_TEXT_DECLINED_MESSAGE, $results['StatusMsg']), 'error');\n\t\t\treturn true;\n\t\t}\n\t}\n\t//gateway test failed\n\t$messageStack->add(MODULE_PAYMENT_PAYMENTECH_TEXT_GATEWAY_ERROR, 'error');\n\treturn true;\n }", "public function get_Code_produit()\n\t\t{\n\t\t\treturn $this->Code_produit;\n\t\t}", "public function store()\n {\n $input = Request::onlyLegacy('category_id', 'name', 'unit', 'unit_cost', 'code', 'description', 'selling_price', 'supplier_id', 'abc_additional_data', 'styles', 'sizes', 'colors', 'sub_id', 'qbd_id', 'sync_on_qbd', 'trade_id');\n $validator = Validator::make($input, FinancialProduct::getRules());\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $companyId = $this->scope->has() ? $this->scope->id() : 0;\n\t\t$category = FinancialCategory::where('company_id', $companyId)\n\t\t\t->findOrFail($input['category_id']);\n\n $validator = Validator::make($input, FinancialProduct::getRulesByCategory($category));\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n if (ine($input, 'supplier_id')) {\n if (!$this->supplierRepo->isSupplierExist($input['supplier_id'])) {\n return ApiResponse::errorNotFound(trans('response.error.not_found', ['attribute' => 'Supplier']));\n }\n\n if ($this->supplierRepo->isSystemSupplier($input['supplier_id'])) {\n return ApiResponse::errorGeneral(\"You can't add supplier product from here.\");\n }\n }\n\n $message = trans('response.success.saved', ['attribute' => 'Product']);\n\n if (ine($input, 'sub_id')) {\n $subContractor = User::whereCompanyId($this->scope->id())\n ->whereGroupId(User::GROUP_SUB_CONTRACTOR)\n ->findOrFail($input['sub_id']);\n\n $category = FinancialCategory::whereName(FinancialCategory::LABOR)\n ->whereCompanyId($this->scope->id())\n ->firstOrFail();\n\n $input['category_id'] = $category->id;\n $message = trans('response.success.saved', ['attribute' => 'Rate sheet']);\n }\n\n $name = isSetNotEmpty($input, 'name') ?: null;\n\n try {\n $product = $this->repo->saveProduct(\n $input['category_id'],\n $name,\n $input['unit'],\n $input['unit_cost'],\n $input\n );\n\n return ApiResponse::success([\n 'message' => $message,\n 'data' => $this->response->item($product, new FinancialProductsTransformer)\n ]);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "abstract public function getPaymentMethod();", "public function actionrequestingEscrow(){\n \n \n \n \n $model = new Escrow;\n \n $member_id = Yii::app()->user->id;\n \n if(isset($_POST['quoted_id'])){\n $model->quote_id = $_POST['quote_id'];\n }else{\n $model->quote_id = 0;\n }\n \n $model->product_id = $_POST['product_id'];\n $model->escrow_number = $model->generateTheEscrowNumberForThisTransaction($model->quote_id,$model->product_id);\n if(isset($_POST['is_quotable'])){\n if($_POST['is_quotable'] == true){\n $model->is_quoted =1;\n }else{\n $model->is_quoted =0;\n }\n \n }else{\n $model->is_quoted = 0;\n }\n if(isset($_POST['future_trading'])){\n $model->is_futuristic = $_POST['future_trading'];\n }else{\n $model->is_futuristic = 0;\n \n }\n \n \n $model->minimum_number_of_product_to_buy = $_POST['minimum_number_of_product_to_buy_for_computation'];\n $model->whats_product_per_item = $_POST['whats_represents_an_item'];\n $model->status = strtolower('live');\n $model->escrow_operation_for = $_POST['escrow_request_from'];\n if($_POST['subscription_type'] == strtolower('post')){\n $model->quantity = $_POST['subscription_quantity'];\n }else{\n $model->quantity = $_POST['quantity_of_purchase'];\n }\n \n $model->price_per_item = $_POST['prevailing_retail_selling_price'];\n $model->total_amount_purchased=$_POST['amount_to_be_paid'];\n $model->escrow_initiation_date = new CDbExpression('NOW()');\n $model->escrow_initiated_by = Yii::app()->user->id;\n $model->direction = strtolower('initiation');\n \n $is_escrowed = 1;\n $is_escrow_accepted = 0;\n $start_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['start_price_validity_period'])); \n $end_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['end_price_validity_period'])); \n $cobuy_member_selling_price = 0;\n $amount_saved_on_purchase = 0;\n if($this->isMemberWithOpenOrder($member_id)){\n $order_id = $this->getTheOpenOrderInitiatedByMember($member_id);\n }else{\n $order_id = $this->createNewOrderForThisMember($member_id);\n }\n \n $escrow_file_error = 0;\n \n if($_FILES['escrow_agreement_file']['name'] != \"\"){\n if($_FILES['escrow_agreement_file']['type'] == 'application/pdf'){\n $escrow_filename = $_FILES['escrow_agreement_file']['name'];\n $escrow_filesize = $_FILES['escrow_agreement_file']['size'];\n }else{\n $escrow_file_error = $escrow_file_error + 1;\n \n }\n \n if($escrow_file_error == 0){\n if($model->validate()) {\n \n //move the escrow agreement file to the escrow directory \n $model->escrow_agreement_file = $model->moveTheEscrowAgreementToItsPathAndReturnItsFileName($escrow_filename);\n if($model->escrow_operation_for ==strtolower('noncart')){\n if($model->save()) {\n // if($this->isProductSubscriptionUpdatedSuccessfully($member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n /** }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section to consummate this transaction\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n } \n * \n */ \n \n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n if($model->hasTheEscrowOfThisSubscriptionAlreadyInitiated($member_id,$model->status,$model->product_id,$model->escrow_operation_for)==false){\n if($model->save()) {\n if($this->isProductSubscriptionUpdatedSuccessfully($model->id,$member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n \n }else{\n if($model->escrow_operation_for == 'pre'){\n $msg = \"This pre-subscribed product had been sent to the escrow administrator. If the escrow is accepted, the product will be added to your cart so as to effect payment. However, you may visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }\n \n \n } \n \n \n }else{\n \n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n $msg = \"You already have an escrow on this product subscription waiting for acceptance.You may need to wait for the escrow to be accepted before initiating a new one\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }\n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"Validaion Error: Check the forms fields for correctness\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg\n )\n );\n \n }\n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"File Format Error: There was an error in the uploaded escrow agreement document. Please check the uploaded file and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n }else{\n \n if($model->escrow_operation_for ==strtolower('noncart')){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n if($this->isProductEscrowable($model->product_id )){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n $msg = \"This product is not escrowable. Please choose another product and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n }\n \n } \n \n \n }", "function teligence_purchase_buypackage31_form_submit($form, &$form_state)\r\n{\r\n\tif($form_state['clicked_button']['#id'] == 'edit-submitpurchase')\r\n\t{\r\n\t\t// parse package elements; id, price, minutes\r\n\t\t$package = explode('|',$form_state['values']['packages']);\r\n\t\t\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc')\r\n\t\t{\r\n\t\t\t// ValidateAsuNotSignedIn\r\n\t\t\t$params = new stdClass ();\r\n\t\t $params->ivrBrandId = variable_get('teligence_purchase_brandid', 1);\r\n\t\t\t$params->email = $form_state['values']['email'];\r\n\t\t\t$params->password = $form_state['values']['password'];\r\n\t\t\t$params->marketId = $form_state['values']['city'];\r\n\t\t\t$params->packageId = $package[0];\r\n\t\t\t$params->creditCardNumber = $form_state['values']['cardnumber'];\r\n\t\t\t$params->expiryDateMmYy = str_pad($form_state['values']['cc_expiration']['month'].$form_state['values']['cc_expiration']['year'],4,\"0\",STR_PAD_LEFT);\r\n\t\t\t$params->cardholderName = $form_state['values']['cardholdername'];\r\n\t\t\t$params->zip = $form_state['values']['zippostal'];\r\n\t\t\t$result = teligence_purchase_soap_call($params, 'ValidateAsuNotSignedIn', variable_get('teligence_purchase_wsdl_ordermanagement',''),TRUE);\r\n\t\t\tswitch ($result->ValidateAsuNotSignedInResult->ResponseCode) \r\n\t\t\t{\r\n\t\t\t\tcase 'Success':\r\n\t\t\t\t\t$form_state['storage']['values']['ValidateResult'] = $result->ValidateAsuNotSignedInResult;\r\n\t\t\t\t\t$form_state['storage']['step'] = 'verifyorder';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'ExistingMembershipBrandHub': \r\n\t\t\t\t\t// signin as ivr_user, send validation email and redirect to 3.3\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// send validation email\r\n\t\t\t\t\t$tokens = teligence_purchase_tokens('emailValidateAccount');\r\n\t\t\t\t\t$tokens['[email]'] = $form_state['storage']['values']['email'];\r\n\t\t\t\t\t$tokens['[password]'] = $form_state['storage']['values']['password'];\r\n\t\t\t\t\t$tokens['[url]'] = url('cart/validate-web-account/' . \r\n\t\t\t\t\t\t$result->ValidateAsuNotSignedInResult->ValidationCode . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['email'] . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['password'], array('absolute' => TRUE)\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_mail('teligence_purchase', 'emailValidateAccount', $form_state['storage']['values']['email'], language_default(), $tokens);\r\n\t\t\t\t\tdrupal_set_message(t('We have sent you an email with a validation link. Please click it to validate your account.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// load user\r\n\t\t\t\t\tglobal $user;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// update drupal user\r\n\t\t\t\t\t$form_state['WebActiveMemberships'] = $result->ValidateAsuNotSignedInResult->WebActiveMemberships;\r\n\t\t\t\t\t$user = teligence_purchase_drupaluser($form_state);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// save values in the session\r\n\t\t\t\t\t$sessionValues = $result->ValidateAsuNotSignedInResult;\r\n\t\t\t\t\tteligence_purchase_setsessionvalues($sessionValues);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// message to user\r\n\t\t\t\t\tdrupal_set_message(t('We found you in our system. You can select from the packages below.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// redirect to success page\r\n\t\t\t\t\tdrupal_goto('cart/add-time');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InactivePaymethod':\r\n\t\t\t\tcase 'EmailLinkedToWebAccount':\r\n\t\t\t\tcase 'CreditCardBelongsToOtherMember':\r\n\t\t\t\tcase 'CreditCardLinkedToWebAccount':\r\n\t\t\t\t\tdrupal_set_message(t('We found you in our system already. Please !sign', array('!sign' => l(t('click here to sign-in'),'cart/login'))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'NegativeCreditStatus':\r\n\t\t\t\tcase 'NoSalesPaymentRestriction':\r\n\t\t\t\tcase 'DebtOrPaymentRestriction':\r\n\t\t\t\tcase 'OlderExpirationDate':\r\n\t\t\t\tcase 'DuplicateRequestGuid':\r\n\t\t\t\tcase 'FraudulentPaymethod':\r\n\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ValidateAsuNotSignedInResult->ErrMsg)),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// paypal\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'pp')\r\n\t\t{\r\n\t\t\t// send request to paypal.teligence.net\r\n\t\t\tmodule_load_include('inc', 'teligence_purchase', 'teligence_purchase-paypal');\r\n\t\t\t$urlquery = array(\r\n\t\t\t\t// 'areaCode' => '', // from previous implementation\r\n\t\t\t\t// 'Ani' => '', // from previous implementation\r\n\t\t\t\t'SequenceId' => teligence_cart_uuid(TRUE),\r\n\t\t\t\t'Password' => $form_state['storage']['values']['password'],\r\n\t\t\t\t'Email' => $form_state['storage']['values']['email'],\r\n\t\t\t\t'PackageId' => $package[0],\r\n\t\t\t\t'VendorPass' => md5(variable_get('teligence_cart_paypal_vendor_pass_asu', '')),\r\n\t\t\t\t'lang' => $GLOBALS['language']->language,\r\n\t\t\t\t'IvrBrandId' => variable_get('teligence_purchase_brandid', 1),\r\n\t\t\t);\r\n\t\t\tif(!teligence_purchase_paypalSetSessionData($urlquery, variable_get('teligence_cart_paypal_vendor_id_asu', '')))\r\n\t\t\t{\r\n\t\t\t\t// could not connect to paypal.teligence.net\r\n\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// place order\r\n\tif($form_state['clicked_button']['#id'] == 'edit-placeorder')\r\n\t{\r\n\t\t// drupal_set_message('<pre>'.check_plain(print_r($form_state['storage']['values'],1)).'</pre>');\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc')\r\n\t\t{\r\n\t\t\t// ProcessPayment\r\n\t\t\t$params = new stdClass ();\r\n\t\t\t$params->orderId = $form_state['storage']['values']['ValidateResult']->OrderId;\r\n\t\t\t$params->paymethodId = $form_state['storage']['values']['ValidateResult']->PaymethodId;\r\n\t\t\t$params->cvn = $form_state['storage']['values']['securitycode'];\r\n\t\t\t$params->email = $form_state['storage']['values']['email'];\r\n\t\t\t$params->password = $form_state['storage']['values']['password'];\r\n\t\t\t$result = teligence_purchase_soap_call($params, 'ProcessPayment', variable_get('teligence_purchase_wsdl_ordermanagement',''));\r\n\t\t\tswitch ($result->ProcessPaymentResult->ResponseCode) \r\n\t\t\t{\r\n\t\t\t\tcase 'Success':\r\n\t\t\t\t\t// send validation email\r\n\t\t\t\t\t$tokens = teligence_purchase_tokens('emailValidateAccount');\r\n\t\t\t\t\t$tokens['[email]'] = $form_state['storage']['values']['email'];\r\n\t\t\t\t\t$tokens['[password]'] = $form_state['storage']['values']['password'];\r\n\t\t\t\t\t$tokens['[url]'] = url('cart/validate-web-account/' . \r\n\t\t\t\t\t\t$result->ProcessPaymentResult->ValidationCode . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['email'] . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['password'], array('absolute' => TRUE)\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_mail('teligence_purchase', 'emailValidateAccount', $form_state['storage']['values']['email'], language_default(), $tokens);\r\n\t\t\t\t\tdrupal_set_message(t('We have sent you an email with a validation link. Please click it to validate your account.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// drupal_set_message('<pre>'.check_plain(print_r($result->ProcessPaymentResult->WebActiveMemberships,1)).'</pre>');\r\n\t\t\t\t\t// redirect to success page\r\n\t\t\t\t\t$querystring = array(\r\n\t\t\t\t\t\t'City' => trim(str_replace(\"2\", \"\",$result->ProcessPaymentResult->WebActiveMemberships->MarketName)),\r\n\t\t\t\t\t\t'Email' => $form_state['storage']['values']['email'],\r\n\t\t\t\t\t\t'TotalAmountCents' => $form_state['storage']['values']['ValidateResult']->TotalAmountCents,\r\n\t\t\t\t\t\t'PackageMinutes' => $form_state['storage']['values']['ValidateResult']->PackageMinutes,\r\n\t\t\t\t\t\t'IvrMembershipNumber' => $result->ProcessPaymentResult->IvrMembershipNumber,\r\n\t\t\t\t\t\t'IvrPasscode' => $result->ProcessPaymentResult->IvrPasscode,\r\n\t\t\t\t\t\t'LocalAccessNumber' => $result->ProcessPaymentResult->LocalAccessNumber,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_goto('cart/result/creditcardasu',$querystring);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'AuthorizationDeclined':\r\n\t\t\t\tcase 'RiskScoreReject':\r\n\t\t\t\tcase 'RiskScoreReview':\r\n\t\t\t\tcase 'AuthorizationTechnicalIssue':\r\n\t\t\t\tcase 'RtmFailure':\r\n\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ProcessPaymentResult->ErrMsg)),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\t// go back to modify a value\r\n\tif($form_state['clicked_button']['#id'] == 'edit-back')\r\n\t{\r\n\t\tunset($form_state['storage']['step']);\r\n\t\t$form_state['storage']['values']['packages'] = $form_state['values']['packages'];\r\n\t\t\r\n\t}\r\n}", "function respond()\r\n\t{\r\n\t\t$ROOT_PATH__= str_replace ( 'includes/modules/payment/alipayapp.php', '', str_replace ( '\\\\', '/', __FILE__ ) ) ;\r\n\t\tinclude_once ($ROOT_PATH__ . 'api/EBaoApp/eba_logManager.class.php');\r\n\t\tEba_LogManager::logPayResonse('postdata from alipay for alipay sdk ');\r\n\t\t//end\r\n\t\t//订单号\r\n\t\t$out_trade_no = $_REQUEST['out_trade_no'];\r\n\t\t//订单金额\r\n\t\t$total_fee = $_REQUEST['total_fee'];\r\n\t\t//订单状态\r\n\t\t$trade_status = $_REQUEST['trade_status'];\r\n\t\t\r\n\t\t//日志号\r\n\t\t$log_id = explode('-',$out_trade_no);\r\n\t\t$log_id = $log_id[1];\r\n// \t\t/* 检查支付的金额是否相符 */\r\n// \t\tif (!check_money($log_id, $total_fee))\r\n// \t\t{\r\n// \t\t\tEba_LogManager::log('postdata from alipaysdk for alipayapp total_fee is checked fail '.$total_fee .' order_sn'.$order_sn);\r\n// \t\t\treturn false;\r\n// \t\t}\r\n\t\r\n\t\tif ($trade_status == 'WAIT_SELLER_SEND_GOODS')\r\n\t\t{\r\n\t\t\tss_log(\"alipay into order_paid ,WAIT_SELLER_SEND_GOODS, order_sn: \".$out_trade_no);\r\n\t\t\t/* 改变订单状态 */\r\n\t\t\torder_paid($log_id, 2);\r\n\t\t\techo \"success\";\t\t//请不要修改或删除\r\n\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telseif ($trade_status == 'TRADE_FINISHED')\r\n\t\t{\r\n\t\t\tss_log(\"alipay into order_paid ,TRADE_FINISHED, order_sn: \".$out_trade_no);\r\n\t\t\t/* 改变订单状态 */\r\n\t\t\torder_paid($log_id);\r\n\t\t\techo \"success\";\t\t//请不要修改或删除\r\n\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telseif ($trade_status == 'TRADE_SUCCESS')\r\n\t\t{\r\n\t\t\tss_log(\"alipay into order_paid ,TRADE_SUCCESS, order_sn: \".$out_trade_no);\r\n\t\t\t \r\n\t\t\t/* 改变订单状态 */\r\n\t\t\torder_paid($log_id, 2);\r\n\t\t\techo \"success\";\t\t//请不要修改或删除\r\n\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }", "public function getPaymentRequest(): string;", "public function getProduct() {\n\t\t// if this is just a model made on our end, we might not the serialized product yet\n\t\t// alternatively: newer BillForward may omit serialized product and necessitate a fetch\n\t\tif (!$this->product) {\n\t\t\tif (!$this->productID) {\n\t\t\t\tthrow new Bf_PreconditionFailedException(\"This Bf_ProductRatePlan has neither a 'product' specified, nor a 'productID' by which to obtain said product.\");\n\t\t\t}\n\t\t\t$this->product = Bf_Product::getByID($this->productID);\n\t\t}\n\t\treturn $this->product;\n\t}", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "function teligence_purchase_buypackage32_form($form_state)\r\n{\r\n\tif($form_state['storage']['step'] == 'verifyorder')\r\n\t{\r\n\t\tdrupal_set_title(t('Review Purchase'));\r\n\t\t$form['verifyorder32'] = array(\r\n\t\t\t'#theme'=> 'teligence_purchase_verifyorder',\r\n\t\t\t'#value' => $form_state['storage']['values'],\r\n\t\t);\r\n\t\t$form['packages'] = array(\r\n\t\t\t'#type' => 'hidden',\r\n\t\t\t'#default_value' => $form_state['storage']['values']['packages'],\r\n\t\t);\r\n\t\t$form['back'] = array(\r\n\t\t\t'#type' => 'submit',\r\n\t\t\t'#value' => t('Go Back'),\r\n\t\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t\t);\r\n\t\t$form['placeorder'] = array(\r\n\t\t\t'#type' => 'submit',\r\n\t\t\t'#value' => t('Place Order'),\r\n\t\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t\t);\r\n\t\treturn $form;\r\n\t}\r\n\t\r\n\t$form['#pre_render'] = array('teligence_purchase_buypackage_form_prerender');\r\n\t$form['#after_build'] = array('teligence_purchase_buypackage_form_afterbuild');\r\n\t\r\n\t// get markets\r\n\t// find default region and market; localization\r\n\t$region = key((array)$_SESSION['stateprovincecity']['city']);\r\n\tif(key_exists(strtoupper(filter_var($_SESSION['localization']->Region,FILTER_SANITIZE_URL)), $_SESSION['stateprovincecity']['city']))\r\n\t\t$region = $_SESSION['localization']->Region;\r\n\t$sanitizedRegion = strtoupper(filter_var($region,FILTER_SANITIZE_URL));\r\n\t$form['location']['stateprovince'] = array(\r\n\t\t'#type' => 'select',\r\n\t\t'#title' => t('State/Province'),\r\n\t\t'#default_value' => isset($form_state['storage']['values']['stateprovince'])?$form_state['storage']['values']['stateprovince']:$sanitizedRegion,\r\n\t\t'#options' => (array)$_SESSION['stateprovincecity']['stateprovince'],\r\n\t);\r\n\t$marketId = key((array)$_SESSION['stateprovincecity']['city'][$sanitizedRegion]);\r\n\tif(key_exists($_SESSION['localization']->MarketId, (array)$_SESSION['stateprovincecity']['city'][$sanitizedRegion]))\r\n\t\t$marketId = $_SESSION['localization']->MarketId;\r\n\t$form['location']['city'] = array(\r\n\t\t'#type' => 'select',\r\n\t\t'#title' => t('City'),\r\n\t\t'#default_value' => isset($form_state['storage']['values']['city'])?$form_state['storage']['values']['city']:$marketId,\r\n\t);\r\n\t\r\n\t// get packages\r\n\t$form['packages'] = array(\r\n\t\t'#type' => 'radios',\r\n\t\t'#theme' => 'teligence_purchase_packagesradios',\r\n\t\t'#default_value' => $form_state['storage']['values']['packages'],\r\n\t);\r\n\t\r\n\t// payment information\r\n\t$form['payment']['paymethods'] = array(\r\n\t\t'#type' => 'radios',\r\n\t\t'#options' => array('pp'=>'PayPal', 'cc'=>t('Credit Card')),\r\n\t\t'#default_value' => $form_state['storage']['values']['paymethods'],\r\n\t);\r\n\t$form['payment']['cardholdername'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t(\"Cardholder's Name\"),\r\n\t\t'#default_value' => $form_state['storage']['values']['cardholdername'],\r\n\t);\r\n\t$form['payment']['cardnumber'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Card Number'),\r\n\t\t'#default_value' => $form_state['storage']['values']['cardnumber'],\r\n\t\t'#pre_render' => array('teligence_purchase_ccn_prerender'),\r\n\t);\r\n\t$form['payment']['securitycode'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Security Code'),\r\n\t\t'#default_value' => $form_state['storage']['values']['securitycode'],\r\n\t\t'#pre_render' => array('teligence_purchase_cvv_prerender'),\r\n\t);\r\n\t$form['payment']['zippostal'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Billing ').($_SESSION['localization']->Country == 'Canada' ? t('Postal Code') : t('Zip Code')),\r\n\t\t'#default_value' => $form_state['storage']['values']['zippostal'],\r\n\t);\r\n\t$form['payment']['cc_expiration'] = array (\r\n \t'#type'=>'date',\r\n \t'#title'=>t('Expiration Date'),\r\n \t'#theme' => 'teligence_purchase_ccexpirationdate',\r\n \t'#description'=>t('Enter expiration date on card'),\r\n \t'#default_value' => $form_state['storage']['values']['cc_expiration'],\r\n );\r\n\t\r\n\t$form['submitpurchase'] = array(\r\n\t\t'#type' => 'submit',\r\n\t\t'#value' => t('Complete My Purchase'),\r\n\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t);\r\n\t\r\n\treturn $form;\r\n}", "function validateEDPrice($field = Null){\n\t\tif(isset($this->data['ProductSeller']['express_delivery'])) {\n\t\t\tif(($this->data['ProductSeller']['express_delivery'] == '0') || ($this->data['ProductSeller']['express_delivery'] == '')){\n\t\t\t\treturn true;\n\t\t\t} else{\n\t\t\t\tif(!empty($this->data['ProductSeller']['express_delivery_price'])){\n\t\t\t\t\tif($this->data['ProductSeller']['express_delivery_price'] < 0){\n\t\t\t\t\t\treturn 'Express delivery price should be positive';\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn \"Enter express delivery price\";\n\t\t\t\t}\n\t\t\t}\n\t\t} else{\n\t\t\treturn true;\n\t\t}\n\t}", "public function hookactionUpdateQuantity($params)\n {\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n \n $context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n $product = new Product($id_product, false, $id_lang, $id_shop, $context);\n \n if (empty($product)) {\n return;\n }\n \n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $product_has_attributes = $product->hasAttributes();\n $productInfo = array(\n 'product_name' => $product_name,\n 'product_id' => $id_product\n );\n $check_oos = ($product_has_attributes && $id_product_attribute)\n || (!$product_has_attributes && !$id_product_attribute);\n $product_quantity = (int)$params['quantity'];\n if (Module::isInstalled('mailalerts')) {\n // For out of stock notification to admin\n $isActivate = $this->isRulesetActive('out_of_stock_alerts');\n if ($check_oos\n && $product->active == 1\n && $isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity <= $this->outStock) {\n $legendstemp = $this->replaceProductLegends(\n $isActivate[0]['template'],\n $productInfo\n );\n // Use send SMS API here\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $this->adminMobile\n );\n \n $this->sendSMSByAPI($postAPIdata);\n Onehopsmsservice::onehopSaveLog('OutStock', $legendstemp, $this->adminMobile);\n }\n \n // For back in stock\n $isActivate = $this->isRulesetActive('back_of_stock_alerts');\n if ($isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity > 0) {\n $bosSql = 'SELECT DISTINCT adr.phone_mobile, oos.id_customer';\n $bosSql .= ' FROM '._DB_PREFIX_. 'mailalert_customer_oos as oos';\n $bosSql .= ' INNER JOIN '._DB_PREFIX_. 'address as adr ON oos.id_customer = adr.id_customer';\n $bosSql .= ' WHERE oos.id_product = \"' . (int)$id_product . '\" AND deleted = 0';\n $bosResults = Db::getInstance()->ExecuteS($bosSql);\n \n if ($bosResults) {\n foreach ($bosResults as $customerVal) {\n $customerInfo = array(\n 'id_customer' => $customerVal['id_customer'],\n 'phone_mobile' => $customerVal['phone_mobile']\n );\n $legendstemp = $this->replaceProductCustomerLegends(\n $isActivate[0]['template'],\n $customerInfo,\n $productInfo\n );\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n // Use send SMS API here\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $customerVal['phone_mobile']\n );\n $this->sendSMSByAPI($postAPIdata);\n $delQuery = 'DELETE FROM ' . _DB_PREFIX_ . 'mailalert_customer_oos';\n $delQuery .= ' WHERE id_customer = \"' . (int)$customerVal['id_customer'] . '\"';\n Db::getInstance()->execute($delQuery);\n Onehopsmsservice::onehopSaveLog('BackStock', $legendstemp, $customerVal['phone_mobile']);\n }\n }\n }\n }\n }", "private function isFlow(){\r\n return $this->getPaymentMethod() == 9;\r\n }", "public function paypalRequest() {\r\n $this->dashboard_p_model->paypalConfig();\r\n if ($_POST) {\r\n $ItemName = $_POST[\"itemname\"]; //Item Name\r\n $ItemPrice = $_POST[\"itemprice\"]; //Item Price\r\n $ItemNumber = $_POST[\"itemnumber\"]; //Item Number\r\n $ItemDesc = $_POST[\"itemdesc\"]; //Item Number\r\n //$ItemQty = $_POST[\"itemQty\"]; // Item Quantity\r\n $ItemQty = 1;\r\n //$ItemTotalPrice = ($ItemPrice * $ItemQty); //(Item Price x Quantity = Total) Get total amount of product; \r\n $ItemTotalPrice = $ItemPrice;\r\n //call the paypal API \r\n\r\n $GrandTotal = $ItemTotalPrice;\r\n $TotalTaxAmount = 0;\r\n $ShippinCost = 0;\r\n $HandalingCost = 0;\r\n $ShippinDiscount = 0;\r\n $InsuranceCost = 0;\r\n\r\n //Parameters for SetExpressCheckout, which will be sent to PayPal\r\n $padata = '&METHOD=SetExpressCheckout' .\r\n '&RETURNURL=' . urlencode(PayPalReturnURL) .\r\n '&CANCELURL=' . urlencode(PayPalCancelURL) .\r\n '&PAYMENTREQUEST_0_PAYMENTACTION=' . urlencode(\"SALE\") .\r\n '&L_PAYMENTREQUEST_0_NAME0=' . urlencode($ItemName) .\r\n '&L_PAYMENTREQUEST_0_NUMBER0=' . urlencode($ItemNumber) .\r\n '&L_PAYMENTREQUEST_0_DESC0=' . urlencode($ItemDesc) .\r\n '&L_PAYMENTREQUEST_0_AMT0=' . urlencode($ItemPrice) .\r\n '&L_PAYMENTREQUEST_0_QTY0=' . urlencode($ItemQty) .\r\n '&NOSHIPPING=0' . //set 1 to hide buyer's shipping address, in-case products that does not require shipping\r\n\r\n '&PAYMENTREQUEST_0_ITEMAMT=' . urlencode($ItemTotalPrice) .\r\n '&PAYMENTREQUEST_0_TAXAMT=' . urlencode($TotalTaxAmount) .\r\n '&PAYMENTREQUEST_0_SHIPPINGAMT=' . urlencode($ShippinCost) .\r\n '&PAYMENTREQUEST_0_HANDLINGAMT=' . urlencode($HandalingCost) .\r\n '&PAYMENTREQUEST_0_SHIPDISCAMT=' . urlencode($ShippinDiscount) .\r\n '&PAYMENTREQUEST_0_INSURANCEAMT=' . urlencode($InsuranceCost) .\r\n '&PAYMENTREQUEST_0_AMT=' . urlencode($GrandTotal) .\r\n '&PAYMENTREQUEST_0_CURRENCYCODE=' . urlencode(PayPalCurrencyCode) .\r\n '&LOCALECODE=GB' . //PayPal pages to match the language on your website.\r\n '&LOGOIMG=http://www.sanwebe.com/wp-content/themes/sanwebe/img/logo.png' . //site logo\r\n '&CARTBORDERCOLOR=FFFFFF' . //border color of cart\r\n '&ALLOWNOTE=1';\r\n ############# set session variable we need later for \"DoExpressCheckoutPayment\" #######\r\n $_SESSION['ItemName'] = $ItemName; //Item Name\r\n $_SESSION['ItemPrice'] = $ItemPrice; //Item Price\r\n $_SESSION['ItemNumber'] = $ItemNumber; //Item Number\r\n $_SESSION['ItemDesc'] = $ItemDesc; //Item Number\r\n $_SESSION['ItemQty'] = $ItemQty; // Item Quantity\r\n $_SESSION['ItemTotalPrice'] = $ItemTotalPrice; //(Item Price x Quantity = Total) Get total amount of product; \r\n $_SESSION['TotalTaxAmount'] = $TotalTaxAmount; //Sum of tax for all items in this order. \r\n $_SESSION['HandalingCost'] = $HandalingCost; //Handling cost for this order.\r\n $_SESSION['InsuranceCost'] = $InsuranceCost; //shipping insurance cost for this order.\r\n $_SESSION['ShippinDiscount'] = $ShippinDiscount; //Shipping discount for this order. Specify this as negative number.\r\n $_SESSION['ShippinCost'] = $ShippinCost; //Although you may change the value later, try to pass in a shipping amount that is reasonably accurate.\r\n $_SESSION['GrandTotal'] = $GrandTotal;\r\n\r\n //We need to execute the \"SetExpressCheckOut\" method to obtain paypal token\r\n\r\n $httpParsedResponseAr = $this->dashboard_p_model->PPHttpPost('SetExpressCheckout', $padata, PayPalApiUsername, PayPalApiPassword, PayPalApiSignature, PayPalMode);\r\n /* echo '-------------------------';\r\n echo(\"<pre>\");\r\n print_r($httpParsedResponseAr);\r\n echo(\"</pre>\");*/\r\n //Respond according to message we receive from Paypal\r\n if (\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\r\n //Redirect user to PayPal store with Token received.\r\n $paypalurl = 'https://www.'.PayPalMode.'.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=' . $httpParsedResponseAr[\"TOKEN\"] . '';\r\n // echo $paypalurl;\r\n header('Location: ' . $paypalurl);\r\n return true;\r\n } else {\r\n //Show error message\r\n $this->session->userdata[\"paypal_msg\"] = ' <div style=\"color:red\"><b>Error : </b>' . urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]) . '</div>';\r\n redirect(base_url().'dasboardProfessional');\r\n\t\t\t /* echo '<pre>';\r\n print_r($httpParsedResponseAr);\r\n echo '</pre>';*/\r\n // return false;\r\n }\r\n }\r\n //***\r\n //Paypal redirects back to this page using ReturnURL, We should receive TOKEN and Payer ID\r\n if (isset($_GET[\"token\"]) && isset($_GET[\"PayerID\"])) {\r\n //we will be using these two variables to execute the \"DoExpressCheckoutPayment\"\r\n //Note: we haven't received any payment yet.\r\n $token = $_GET[\"token\"];\r\n $payer_id = $_GET[\"PayerID\"];\r\n //get session variables\r\n $ItemName = $_SESSION['ItemName']; //Item Name\r\n $ItemPrice = $_SESSION['ItemPrice']; //Item Price\r\n $ItemNumber = $_SESSION['ItemNumber']; //Item Number\r\n $ItemDesc = $_SESSION['ItemDesc']; //Item Number\r\n $ItemQty = $_SESSION['ItemQty']; // Item Quantity\r\n $ItemTotalPrice = $_SESSION['ItemTotalPrice']; //(Item Price x Quantity = Total) Get total amount of product; \r\n $TotalTaxAmount = $_SESSION['TotalTaxAmount']; //Sum of tax for all items in this order. \r\n $HandalingCost = $_SESSION['HandalingCost']; //Handling cost for this order.\r\n $InsuranceCost = $_SESSION['InsuranceCost']; //shipping insurance cost for this order.\r\n $ShippinDiscount = $_SESSION['ShippinDiscount']; //Shipping discount for this order. Specify this as negative number.\r\n $ShippinCost = $_SESSION['ShippinCost']; //Although you may change the value later, try to pass in a shipping amount that is reasonably accurate.\r\n $GrandTotal = $_SESSION['GrandTotal'];\r\n\r\n $padata = '&TOKEN=' . urlencode($token) .\r\n '&PAYERID=' . urlencode($payer_id) .\r\n '&PAYMENTREQUEST_0_PAYMENTACTION=' . urlencode(\"SALE\") .\r\n //set item info here, otherwise we won't see product details later\t\r\n '&L_PAYMENTREQUEST_0_NAME0=' . urlencode($ItemName) .\r\n '&L_PAYMENTREQUEST_0_NUMBER0=' . urlencode($ItemNumber) .\r\n '&L_PAYMENTREQUEST_0_DESC0=' . urlencode($ItemDesc) .\r\n '&L_PAYMENTREQUEST_0_AMT0=' . urlencode($ItemPrice) .\r\n '&L_PAYMENTREQUEST_0_QTY0=' . urlencode($ItemQty) .\r\n /*\r\n //Additional products (L_PAYMENTREQUEST_0_NAME0 becomes L_PAYMENTREQUEST_0_NAME1 and so on)\r\n '&L_PAYMENTREQUEST_0_NAME1='.urlencode($ItemName2).\r\n '&L_PAYMENTREQUEST_0_NUMBER1='.urlencode($ItemNumber2).\r\n '&L_PAYMENTREQUEST_0_DESC1=Description text'.\r\n '&L_PAYMENTREQUEST_0_AMT1='.urlencode($ItemPrice2).\r\n '&L_PAYMENTREQUEST_0_QTY1='. urlencode($ItemQty2).\r\n */\r\n\r\n '&PAYMENTREQUEST_0_ITEMAMT=' . urlencode($ItemTotalPrice) .\r\n '&PAYMENTREQUEST_0_TAXAMT=' . urlencode($TotalTaxAmount) .\r\n '&PAYMENTREQUEST_0_SHIPPINGAMT=' . urlencode($ShippinCost) .\r\n '&PAYMENTREQUEST_0_HANDLINGAMT=' . urlencode($HandalingCost) .\r\n '&PAYMENTREQUEST_0_SHIPDISCAMT=' . urlencode($ShippinDiscount) .\r\n '&PAYMENTREQUEST_0_INSURANCEAMT=' . urlencode($InsuranceCost) .\r\n '&PAYMENTREQUEST_0_AMT=' . urlencode($GrandTotal) .\r\n '&PAYMENTREQUEST_0_CURRENCYCODE=' . urlencode($PayPalCurrencyCode);\r\n\r\n //We need to execute the \"DoExpressCheckoutPayment\" at this point to Receive payment from user.\r\n $httpParsedResponseAr = $this->dashboard_p_model->PPHttpPost('DoExpressCheckoutPayment', $padata, PayPalApiUsername, PayPalApiPassword, PayPalApiSignature, PayPalMode);\r\n\r\n //Check if everything went ok..\r\n if (\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\r\n\r\n //echo '<h2>Success</h2>';\r\n // echo 'Your Transaction ID : ' . urldecode($httpParsedResponseAr[\"PAYMENTINFO_0_TRANSACTIONID\"]);\r\n\r\n /*\r\n //Sometimes Payment are kept pending even when transaction is complete.\r\n //hence we need to notify user about it and ask him manually approve the transiction\r\n */\r\n\r\n if ('Completed' == $httpParsedResponseAr[\"PAYMENTINFO_0_PAYMENTSTATUS\"]) {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:green\">Payment Received! Your product will be sent to you very soon!</div>';\r\n\t\t\t\t\t// do data insertions here\r\n } elseif ('Pending' == $httpParsedResponseAr[\"PAYMENTINFO_0_PAYMENTSTATUS\"]) {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:red\">Transaction Complete, but payment is still pending! ' .\r\n 'You need to manually authorize this payment in your <a target=\"_new\" href=\"http://www.paypal.com\">Paypal Account</a></div>';\r\n }\r\n\r\n // we can retrive transection details using either GetTransactionDetails or GetExpressCheckoutDetails\r\n // GetTransactionDetails requires a Transaction ID, and GetExpressCheckoutDetails requires Token returned by SetExpressCheckOut\r\n $padata = '&TOKEN=' . urlencode($token);\r\n\r\n $httpParsedResponseAr = $this->dashboard_p_model->PPHttpPost('GetExpressCheckoutDetails', $padata, $PayPalApiUsername, $PayPalApiPassword, $PayPalApiSignature, $PayPalMode);\r\n\r\n if (\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\r\n\r\n \t\t\t\t\t\r\n\t\t\t\t\t$buyerName = $httpParsedResponseAr[\"FIRSTNAME\"].' '.$httpParsedResponseAr[\"LASTNAME\"];\r\n\t\t\t\t\t$buyerEmail = urldecode($httpParsedResponseAr[\"EMAIL\"]);\r\n\t\t\t\t\t$transactionID =urldecode($httpParsedResponseAr[\"PAYMENTREQUEST_0_TRANSACTIONID\"]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$insert_row = $this->dashboard_p_model->savePaypalTransaction($buyerName,$buyerEmail,$transactionID,$ItemName,$ItemNumber, $ItemTotalPrice,$ItemQTY,$ItemDesc);\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($insert_row){\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \tredirect(base_url().'dasboardProfessional');\r\n\t\t\t\t\t}\r\n\r\n // return true;\r\n } else {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:red\"><b>GetTransactionDetails failed:</b>' . urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]) . '</div>';\r\n\t\t\t\t\tredirect(base_url().'dasboardProfessional');\r\n \r\n\t\t\t\t // echo '<pre>';\r\n // print_r($httpParsedResponseAr);\r\n // echo '</pre>';\r\n // return false;\r\n }\r\n \r\n } else {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:red\"><b>Error : </b>' . urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]) . '</div>';\r\n redirect(base_url().'dasboardProfessional');\r\n\t\t\t\t//echo '<pre>';\r\n //print_r($httpParsedResponseAr);\r\n //echo '</pre>';\r\n //return false;\r\n }\r\n\r\n //*** \r\n }\r\n }", "function teligence_purchase_buypackage31_form($form_state)\r\n{\r\n\tif($form_state['storage']['step'] == 'verifyorder')\r\n\t{\r\n\t\tdrupal_set_title(t('Review Purchase'));\r\n\t\t$form['verifyorder31'] = array(\r\n\t\t\t'#theme'=> 'teligence_purchase_verifyorder',\r\n\t\t\t'#value' => $form_state['storage']['values'],\r\n\t\t);\r\n\t\t$form['packages'] = array(\r\n\t\t\t'#type' => 'hidden',\r\n\t\t\t'#default_value' => $form_state['storage']['values']['packages'],\r\n\t\t);\r\n\t\t$form['back'] = array(\r\n\t\t\t'#type' => 'submit',\r\n\t\t\t'#value' => t('Go Back'),\r\n\t\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t\t);\r\n\t\t$form['placeorder'] = array(\r\n\t\t\t'#type' => 'submit',\r\n\t\t\t'#value' => t('Place Order'),\r\n\t\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t\t);\r\n\t\treturn $form;\r\n\t}\r\n\t\r\n\t$form['#pre_render'] = array('teligence_purchase_buypackage_form_prerender');\r\n\t$form['#after_build'] = array('teligence_purchase_buypackage_form_afterbuild');\r\n\t\r\n\t// debug logging\t\r\n\tif(variable_get('teligence_purchase_debug', 0))\r\n\t\twatchdog('debug',\"SESSION['localization']: @loc\",array('@loc'=>print_r($_SESSION['localization'],TRUE)));\r\n\t\r\n\t// get markets\r\n\t// find default region and market; localization\r\n\t$region = key((array)$_SESSION['stateprovincecity']['city']);\r\n\tif(key_exists(strtoupper(filter_var($_SESSION['localization']->Region,FILTER_SANITIZE_URL)), $_SESSION['stateprovincecity']['city']))\r\n\t\t$region = $_SESSION['localization']->Region;\r\n\t$sanitizedRegion = strtoupper(filter_var($region,FILTER_SANITIZE_URL));\r\n\t$form['location']['stateprovince'] = array(\r\n\t\t'#type' => 'select',\r\n\t\t'#title' => t('State/Province'),\r\n\t\t'#default_value' => isset($form_state['storage']['values']['stateprovince'])?$form_state['storage']['values']['stateprovince']:$sanitizedRegion,\r\n\t\t'#options' => (array)$_SESSION['stateprovincecity']['stateprovince'],\r\n\t);\r\n\t$marketId = key((array)$_SESSION['stateprovincecity']['city'][$sanitizedRegion]);\r\n\tif(key_exists($_SESSION['localization']->MarketId, (array)$_SESSION['stateprovincecity']['city'][$sanitizedRegion]))\r\n\t\t$marketId = $_SESSION['localization']->MarketId;\n\t$form['location']['city'] = array(\r\n\t\t'#type' => 'select',\r\n\t\t'#title' => t('City'),\r\n\t\t'#default_value' => isset($form_state['storage']['values']['city'])?$form_state['storage']['values']['city']:$marketId,\r\n\t);\r\n\t\r\n\t// get packages\r\n\t$form['packages'] = array(\r\n\t\t'#type' => 'radios',\r\n\t\t'#theme' => 'teligence_purchase_packagesradios',\r\n\t\t'#default_value' => $form_state['storage']['values']['packages'],\r\n\t);\r\n\t\r\n\t// account information\r\n\t$form['account']['email'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Email'),\r\n\t\t'#pre_render' => array('teligence_purchase_email_prerender'),\r\n\t\t'#default_value' => $form_state['storage']['values']['email'],\r\n\t);\r\n\t$form['account']['password'] = array(\r\n\t\t'#type' => 'password',\r\n\t\t'#title' => t('Password'),\r\n\t\t'#pre_render' => array('teligence_purchase_password_prerender'),\r\n\t\t'#description' => t('Password must be at least 6 characters long.'),\r\n\t\t'#default_value' => $form_state['storage']['values']['password'],\r\n\t);\r\n\t$form['account']['confirm'] = array(\r\n\t\t'#type' => 'password',\r\n\t\t'#title' => t('Confirm Password'),\r\n\t\t'#pre_render' => array('teligence_purchase_password_prerender'),\r\n\t\t'#description' => t('Password must be at least 6 characters long.'),\r\n\t\t'#default_value' => $form_state['storage']['values']['confirm'],\r\n\t);\r\n\t\r\n\t// payment information\r\n\t$form['payment']['paymethods'] = array(\r\n\t\t'#type' => 'radios',\r\n\t\t'#options' => array('pp'=>'PayPal', 'cc'=>t('Credit Card')),\r\n\t\t'#default_value' => $form_state['storage']['values']['paymethods'],\r\n\t);\r\n\t$form['payment']['cardholdername'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t(\"Cardholder's Name\"),\r\n\t\t'#default_value' => $form_state['storage']['values']['cardholdername'],\r\n\t);\r\n\t$form['payment']['cardnumber'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Card Number'),\r\n\t\t'#default_value' => $form_state['storage']['values']['cardnumber'],\r\n\t\t'#pre_render' => array('teligence_purchase_ccn_prerender'),\r\n\t);\r\n\t$form['payment']['securitycode'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Security Code'),\r\n\t\t'#default_value' => $form_state['storage']['values']['securitycode'],\r\n\t\t'#pre_render' => array('teligence_purchase_cvv_prerender'),\r\n\t);\r\n\t$form['payment']['zippostal'] = array(\r\n\t\t'#type' => 'textfield',\r\n\t\t'#title' => t('Billing ').($_SESSION['localization']->Country == 'Canada' ? t('Postal Code') : t('Zip Code')),\r\n\t\t'#default_value' => $form_state['storage']['values']['zippostal'],\r\n\t);\r\n\t$form['payment']['cc_expiration'] = array (\r\n \t'#type'=>'date',\r\n \t'#title'=>t('Expiration Date'),\r\n \t'#theme' => 'teligence_purchase_ccexpirationdate',\r\n \t'#description'=>t('Enter expiration date on card'),\r\n \t'#default_value' => $form_state['storage']['values']['cc_expiration'],\r\n );\r\n\t\r\n\t$form['submitpurchase'] = array(\r\n\t\t'#type' => 'submit',\r\n\t\t'#value' => t('Complete My Purchase'),\r\n\t\t'#pre_render' => array('teligence_purchase_button_prerender'),\r\n\t);\r\n\t\r\n\treturn $form;\r\n}", "function upgrade_400()\n {\n }", "function IndusIndPL($strnet_salary, $company, $category, $DOB, $clubbed_emi, $city, $reqtenure, $reqloanamount) {\n $net_salary = $strnet_salary;\n\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n\n if ($category == \"A+\" || $category == \"CAT A\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = \"12.99\";\n $intr = $interestrate;\n $proc_fee = \"0.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"13.75\";\n $intr = $interestrate ;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"14.75\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"13.50\";\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.25\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } elseif ($term == 60) {\n $getterm = 5;\n } else {\n $getterm = 5;\n }\n } else if ($category == \"CAT B\" || $category == \"CAT G\" || $category == \"C1000\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 14.00;\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 15.00;\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 16.00;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else if ($category == \"CAT C\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 17.50;\n $intr = $interestrate;\n $proc_fee = \"1.25%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 18;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 19;\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"18.50\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"19\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"20\";\n $intr = $interestrate;\n $proc_fee = \"2.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else {\n /* if ($net_salary >= 100000) {\n $interestrate = \"17\";\n $intr = 17;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 50000 && $net_salary < 100000) {\n $interestrate = \"17.5\";\n $intr = 17.5;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"18\";\n $intr = 18;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }*/\n }\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $princ = 100000;\n if ($intr > 0) {\n $perlacemi = round($princ * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($princ, $intr, $term);\n //Calculate Loan Amount\n if ($net_salary >= 50000) {\n $firstnet_salary = ($net_salary * (70 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else if ($net_salary >= 25000 && $net_salary < 50000) {\n $firstnet_salary = ($net_salary * (50 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else {\n $finalloanamount_dbr = 0;\n }\n } else {\n $finalloanamount_dbr = 0;\n }\n //other eiligibility\n if ($net_salary >= 50000) {\n $finalloanamount_other = $net_salary * 18;\n } else {\n $finalloanamount_other = $net_salary * 18;\n }\n $finalloanamount = 0;\n if ($finalloanamount_other < $finalloanamount_dbr) {\n $finalloanamount = $finalloanamount_other;\n } else {\n $finalloanamount = $finalloanamount_dbr;\n }\n if ($finalloanamount > 2500000) {\n if (strlen($category) > 1) {\n $getloanamout = 2500000;\n } else {\n $getloanamout = 700000;\n }\n } else {\n if (strlen($category) > 1) {\n $getloanamout = $finalloanamount;\n } else {\n if ($finalloanamount > 700000) {\n $getloanamout = 700000;\n } else {\n $getloanamout = $finalloanamount;\n }\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n if ($intr > 0) {\n if (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 700000 && $getloanamout < 1500000 && $net_salary >= 75000) {\n $interestrate = \"13.49\";\n $intr = 13.49;\n $proc_fee = \"0.49%\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 1500000 && $net_salary >= 100000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_fee = \"Rs. 4999\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n }\n } else {\n $getemicalc = 0;\n }\n\t\t\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $term))));\n $details['bank_code'] = \"Indus Ind Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $proc_fee;\n $details['category'] = $category;\n return($details);\n }", "public function createPurchaseOrder(Request $request)\n {\n $data = $request->input();\n\n $suppliers = array();\n\n foreach ($data as $key => $value) {\n $bestSupplier = ProductSuppliers::getBestSupplierForProduct($key);\n\n if(array_key_exists($bestSupplier['entity'], $suppliers))\n array_push($suppliers[$bestSupplier['entity']], $bestSupplier);\n else\n $suppliers[$bestSupplier['entity']] = [$bestSupplier];\n }\n\n foreach($suppliers as $supplier) {\n $documentLines = [];\n\n for($i = 0; $i < count($supplier); $i++) {\n $product = [\n 'description' => $supplier[$i]['description'],\n 'quantity' => $data[$supplier[$i]['product']],\n 'unitPrice' => number_format(floatval($supplier[$i]['price']), 2),\n 'deliveryDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\")+1, date(\"Y\"))),\n 'unit' => 'UN',\n 'itemTaxSchema' => 'ISENTO',\n 'purchasesItem' => $supplier[$i]['product'],\n 'documentLineStatus' => 'OPEN'\n ];\n\n array_push($documentLines, $product);\n }\n\n try {\n $result = JasminConnect::callJasmin('/purchases/orders', '', 'GET');\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n $seriesNumber = count(json_decode($result->getBody(), true)) + 1;\n\n try {\n $body = [\n 'documentType' => 'ECF',\n 'company' => 'TP-INDUSTRIES',\n 'serie' => '2019',\n 'seriesNumber' => $seriesNumber,\n 'documentDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'postingDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'SellerSupplierParty' => $supplier[0]['entity'],\n 'SellerSupplierPartyName' => $supplier[0]['name'],\n 'accountingParty' => $supplier[0]['entity'],\n 'exchangeRate' => 1,\n 'discount' => 0,\n 'loadingCountry' => $supplier[0]['country'],\n 'unloadingCountry' => 'PT',\n 'currency' => 'EUR',\n 'paymentMethod' => 'NUM',\n 'paymentTerm' => '01',\n 'documentLines' => $documentLines\n ];\n\n JasminConnect::callJasmin('/purchases/orders', '', 'POST', $body);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }\n\n return $data;\n }", "public function sendData($data)\n {\n return $this->response = new LegacyExpressPurchaseResponse($this, $data);\n }", "public function showServerResponse($product_data, $status, $display)\n {\n $successMessages = array(\n VALID => __('Your license key is activated('.$product_data['pluginName'].')', $this->pluginSlug),\n );\n\n $errorMessages = array(\n 'server_did_not_respond' => __('No response from server. Please try again later.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'license_activation_failed' => __('License Activation Failed. Please try again or contact support on [email protected]('.$product_data['pluginName'].')', $this->pluginSlug),\n 'no_license_key_entered' => __('Please enter license key.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'no_activations_left' => (!empty($display)) ? sprintf(__('Your License Key is already activated at : %s Please deactivate the license from one of the above site(s) to successfully activate it on your current site.('.$product_data['pluginName'].')', $this->pluginSlug), $display) : __('No Activations Left.('.$product_data['pluginName'].')', $this->pluginSlug),\n EXPIRED => __('Your license key has Expired. Please, Renew it.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'disabled' => __('Your License key is disabled('.$product_data['pluginName'].')', $this->pluginSlug),\n INVALID => __('Please enter valid license key('.$product_data['pluginName'].')', $this->pluginSlug),\n 'inactive' => __('Please try to activate license again. If it does not activate, contact support on [email protected]('.$product_data['pluginName'].')', $this->pluginSlug),\n 'site_inactive' => (!empty($display)) ? sprintf(__('Your License Key is already activated at : %s Please deactivate the license from one of the above site(s) to successfully activate it on your current site.('.$product_data['pluginName'].')', $this->pluginSlug), $display) : __('Site inactive (Press Activate license to activate plugin('.$product_data['pluginName'].'))', $this->pluginSlug),\n 'deactivated' => __('License Key is deactivated('.$product_data['pluginName'].')', $this->pluginSlug),\n 'default' => sprintf(__('Following Error Occurred: %s. Please contact support on [email protected] if you are not sure why this error is occurring('.$product_data['pluginName'].')', $this->pluginSlug), $status),\n 'server_curl_error' => __('There was an error while connecting to the server. please try again later.('.$product_data['pluginName'].')', $this->pluginSlug),\n );\n\n if ($status !== false) {\n if (array_key_exists($status, $successMessages)) {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $successMessages[$status],\n 'updated'\n );\n } else {\n if (array_key_exists($status, $errorMessages)) {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $errorMessages[$status],\n 'error'\n );\n } else {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $errorMessages['default'],\n 'error'\n );\n }\n }\n }\n }", "public function activate_license() {\n\n\t\t// listen for our activate button to be clicked\n\t\tif( isset( $_POST[ $this->product_slug . '_license_activate' ] ) ) {\n\n\t\t\t// run a quick security check\n\t\t \tif( ! check_admin_referer( $this->product_slug . '_license_nonce', $this->product_slug . '_license_nonce' ) )\n\t\t\t\treturn; // get out if we didn't click the Activate button\n\n\t\t\t// retrieve the license from the database\n\t\t\t$license = $_POST[ $this->product_slug . '-license-key' ];\n\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'activate_license',\n\t\t\t\t'license' => $license,\n\t\t\t\t'item_id' => urlencode( EAEL_SL_ITEM_ID ), // the ID of our product in EDD\n\t\t\t\t'url' => home_url()\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post( EAEL_STORE_URL,\n\t\t\t\tarray(\n\t\t\t\t\t'timeout' \t=> 15,\n\t\t\t\t\t'sslverify' => false,\n\t\t\t\t\t'body' \t\t=> $api_params\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\n\t\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t\t$message = $response->get_error_message();\n\t\t\t\t} else {\n\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t\tif ( false === $license_data->success ) {\n\n\t\t\t\t\tswitch( $license_data->error ) {\n\n\t\t\t\t\t\tcase 'expired' :\n\n\t\t\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\t\t__( 'Your license key expired on %s.' ),\n\t\t\t\t\t\t\t\tdate_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'revoked' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has been disabled.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'missing' :\n\n\t\t\t\t\t\t\t$message = __( 'Invalid license.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'invalid' :\n\t\t\t\t\t\tcase 'site_inactive' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license is not active for this URL.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'item_name_mismatch' :\n\n\t\t\t\t\t\t\t$message = sprintf( __( 'This appears to be an invalid license key for %s.' ), EAEL_SL_ITEM_NAME );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'no_activations_left':\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has reached its activation limit.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault :\n\n\t\t\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Check if anything passed on a message constituting a failure\n\t\t\tif ( ! empty( $message ) ) {\n\t\t\t\t$base_url = admin_url( 'admin.php?page=' . $this->get_settings_page_slug() );\n\t\t\t\t$redirect = add_query_arg( array( 'sl_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );\n\n\t\t\t\twp_redirect( $redirect );\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// $license_data->license will be either \"valid\" or \"invalid\"\n\n\t\t\t$this->set_license_key( $license );\n\t\t\t$this->set_license_status( $license_data->license );\n\n\t\t\twp_redirect( admin_url( 'admin.php?page=' . $this->get_settings_page_slug() ) );\n\t\t\texit();\n\t\t}\n\t}", "function _getIntlQuote($pkg, $method) {\r\n\t\tglobal $order;\r\n\t\tif (tep_not_null($method) && in_array($method, $this->intl_available)) {\r\n\t\t\t$request_types = array($method);\r\n\t\t} else {\r\n\t\t\t$request_types = $this->intl_available;\r\n\t\t}\r\n\t\t$this->intl_request_types = $request_types;\r\n\t\t$shipping_weight = ($pkg['item_weight'] < 0.0625 ? 0.0625 : $pkg['item_weight']);\r\n\t\t$shipping_pounds = floor($shipping_weight);\r\n\t\t$shipping_ounces = ceil((16 * ($shipping_weight - $shipping_pounds)) * 100) / 100; // rounded to two decimal digits\r\n\r\n\t\t// # if shipment is under one lb convert to ounces.\r\n\r\n\t\tif (SHIPPING_UNIT_WEIGHT == 'LBS' && $shipping_weight < 1.00) { \r\n\t\t\t$shipping_weight = ($shipping_weight / 16);\r\n\t\t}\r\n\r\n\t\t$nonuspsinsurancecost = 0;\r\n\t\tif (MODULE_SHIPPING_USPS_NON_USPS_INSURE == 'True') {\r\n\t\t\tif ($pkg['item_price'] <= 50) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS1;\r\n\t\t\t} else if ($pkg['item_price'] <= 100) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS2;\r\n\t\t\t}\telse if ($pkg['item_price'] <= 200) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS3;\r\n\t\t\t} else if ($pkg['item_price'] <= 300) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4;\r\n\t\t\t} else {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4 + ((ceil($pkg['item_price']/100) - 3) * MODULE_SHIPPING_USPS_INS5);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (empty($this->intl_maxinsure) || (MODULE_SHIPPING_USPS_INTL_INSURANCE_OPTION == 'False')) {\r\n\t\t\t$checkvalues = array($pkg['item_price']);\r\n\t\t} else {\r\n\t\t\t$checkvalues = array();\r\n\t\t\tforeach ($this->intl_maxinsure as $maxins) {\r\n\t\t\t\tif ($pkg['item_price'] <= $maxins) {\r\n\t\t\t\t\t$checkvalues[] = $pkg['item_price'];\r\n\t\t\t\t\tbreak; // stop once we find package value is less than allowed maximum\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$checkvalues[] = $maxins;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\trsort($checkvalues); // values must be checked in reverse order\r\n\t\t$request = \t'<IntlRateV2Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\">' .\r\n\t\t\t\t'<Revision>2</Revision>';\r\n\t\tforeach ($checkvalues as $pkgvalue) {\r\n\t\t\t$request .= '<Package ID=\"' . intval($pkgvalue) . '\">' .\r\n\t\t\t\t\t'<Pounds>' . $shipping_pounds . '</Pounds>' .\r\n\t\t\t\t\t'<Ounces>' . $shipping_ounces . '</Ounces>' .\r\n\t\t\t\t\t'<Machinable>True</Machinable>' .\r\n\t\t\t\t\t'<MailType>All</MailType>' .\r\n\t\t\t\t\t'<GXG>' .\r\n\t\t\t\t\t'<POBoxFlag>N</POBoxFlag>' .\r\n\t\t\t\t\t'<GiftFlag>N</GiftFlag>' .\r\n\t\t\t\t\t'</GXG>' .\r\n\t\t\t\t\t'<ValueOfContents>' . number_format($pkgvalue, 2, '.', '') . '</ValueOfContents>' .\r\n\t\t\t\t\t'<Country>' . $this->countries[$order->delivery['country']['iso_code_2']] . '</Country>' .\r\n\t\t\t\t\t'<Container>RECTANGULAR</Container>' .\r\n\t\t\t\t\t'<Size>' . ((max($pkg['item_length'], $pkg['item_width'], $pkg['item_height']) > 12) ? ' LARGE' : 'REGULAR') . '</Size>' .\r\n\t\t\t\t\t'<Width>' . $pkg['item_width'] . '</Width>' .\r\n\t\t\t\t\t'<Length>' . $pkg['item_length'] . '</Length>' .\r\n\t\t\t\t\t'<Height>' . $pkg['item_height'] . '</Height>' .\r\n\t\t\t\t\t'<Girth>' . ($pkg['item_height'] + $pkg['item_height'] + $pkg['item_width'] + $pkg['item_width']) . '</Girth>' .\r\n\t\t\t\t\t'<OriginZip>' . SHIPPING_ORIGIN_ZIP . '</OriginZip>' .\r\n\t\t\t\t\t\r\n\t\t\t\t\t'<CommercialFlag>Y</CommercialFlag>' .\r\n\t\t\t\t\t'<ExtraServices>' .\r\n\t\t\t\t\t'<ExtraService>1</ExtraService>' .\r\n\t\t\t\t\t'</ExtraServices>' .\r\n\t\t\t\t\t'</Package>';\r\n\t\t}\r\n\t\t$request .= '</IntlRateV2Request>';\r\n\t\t\r\n\t\t$request = \t'API=IntlRateV2&XML=' . urlencode($request);\r\n\t\t$usps_server = 'production.shippingapis.com';\r\n\t\t$api_dll = 'shippingAPI.dll';\r\n\t\t$body = '';\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES . 'http_client.php');\r\n\t\t}\r\n\t\t$http = new httpClient();\r\n\t\tif ($http->Connect($usps_server, 80)) {\r\n\t\t\t$http->addHeader('Host', $usps_server);\r\n\t\t\t$http->addHeader('User-Agent', 'IntenseCart eCommerce');\r\n\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\tif ($http->Get('/' . $api_dll . '?' . $request)) $body = $http->getBody();\r\n\t\t\t$http->Disconnect();\r\n\t\t} else {\r\n\t\t\t$body = '<Error><Number></Number><Description>' . MODULE_SHIPPING_USPS_TEXT_CONNECTION_ERROR . '</Description></Error>';\r\n\t\t}\r\n\t\t$doc = XML_unserialize($body);\r\n\t\t\r\n\t\t\r\n// \t\tprint_R( $doc );\r\n// \t\texit;\r\n\t\t\r\n\t\t\r\n\t\t$quotes = array();\r\n\t\tif (isset($doc['Error'])) return array('error' => $doc['Error']['Number'] . ' ' . $doc['Error']['Description']);\r\n\t\tif (isset($doc['IntlRateV2Response']['Package']['Error'])) return array('error' => $doc['IntlRateV2Response']['Package']['Error']['Number'] . ' ' . $doc['IntlRateV2Response']['Package']['Error']['Description']);\r\n\t\tif (isset($doc['IntlRateV2Response']['Package'][0]['Error'])) return array('error' => $doc['IntlRateV2Response']['Package']['Error'][0]['Number'] . ' ' . $doc['IntlRateV2Response']['Package'][0]['Error']['Description']);\r\n\t\tif (isset($doc['IntlRateV2Response']['Package']['Service']['SvcDescription'])) { // single mail service response\r\n\t\t\t$tmp = $this->_decode_intl_response($doc['RateV4Response']['Package']['Service'], $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t} elseif (isset($doc['IntlRateV2Response']['Package']['Service'][0])) { // multiple mailing services returned\r\n\t\t\tforeach ($doc['IntlRateV2Response']['Package']['Service'] as $mailsvc) {\r\n\t\t\t\tif (isset($mailsvc['SvcDescription'])) {\r\n\t\t\t\t\t$tmp = $this->_decode_intl_response($mailsvc, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} elseif (isset($doc['IntlRateV2Response']['Package'][0]['Service'])) { // multiple packages requested for insurance purposes\r\n\t\t\tforeach ($doc['IntlRateV2Response']['Package'] as $package) {\r\n\t\t\t\tif (isset($package['Service']['SvcDescription'])) { // single mail service response for package\r\n\t\t\t\t\t$tmp = $this->_decode_intl_response($package['Service'], $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\tif (!empty($tmp)) if (!isset($quotes[$tmp['id']])) $quotes[$tmp['id']] = $tmp; // save only first valid response\r\n\t\t\t\t} elseif (isset($package['Service'][0])) { // multiple mailing services returned for package\r\n\t\t\t\t\tforeach ($package['Service'] as $mailsvc) {\r\n\t\t\t\t\t\tif (isset($mailsvc['SvcDescription'])) {\r\n\t\t\t\t\t\t\t$tmp = $this->_decode_intl_response($mailsvc, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\t\t\tif (!empty($tmp)) if (!isset($quotes[$tmp['id']])) $quotes[$tmp['id']] = $tmp; // save only first valid response\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $quotes;\r\n\t}" ]
[ "0.5394845", "0.5349989", "0.53499657", "0.53370935", "0.5307311", "0.5170349", "0.5147347", "0.50740886", "0.5068462", "0.5063131", "0.5057364", "0.5043972", "0.5042954", "0.50401294", "0.5035706", "0.5033784", "0.50239867", "0.5014267", "0.5013367", "0.5010645", "0.5002312", "0.49875152", "0.49794927", "0.49470058", "0.4938668", "0.49365628", "0.49352548", "0.49344942", "0.4924996", "0.49244952", "0.4921056", "0.49171048", "0.49161083", "0.49118277", "0.49038216", "0.48980477", "0.4892289", "0.48919594", "0.4891013", "0.4885578", "0.4883056", "0.48793077", "0.4878502", "0.48735318", "0.4871321", "0.4854712", "0.4843775", "0.4817697", "0.4815689", "0.4813538", "0.481218", "0.48004043", "0.4799433", "0.4798092", "0.4789152", "0.47823626", "0.47722596", "0.4771673", "0.47698843", "0.47679487", "0.4767426", "0.47599152", "0.47480145", "0.47422665", "0.47367558", "0.47353554", "0.47313595", "0.47310886", "0.4727978", "0.47277564", "0.47198033", "0.4713604", "0.4711075", "0.47094655", "0.46902207", "0.4670474", "0.46633926", "0.4662386", "0.46545297", "0.46535978", "0.4653251", "0.46501932", "0.464632", "0.4642083", "0.46344766", "0.4634177", "0.46248433", "0.4621123", "0.4619274", "0.46191487", "0.4614726", "0.4614405", "0.46141854", "0.46129456", "0.46124506", "0.4607568", "0.46066967", "0.46058196", "0.46037844", "0.4602178", "0.46002847" ]
0.0
-1
This is the local DHL Express product code for which the delivery is feasible respecting the input data from the request.
public function getLocalProductCode(): ?string { return $this->localProductCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}", "private function determainclaimType()\r\n {\r\n // 9 digits\r\n if (preg_match($this->keycodeRegex, $this->keycode) == false)\r\n {\r\n $this->claimType = \"invaild-keycode\";\r\n }\r\n \r\n // if keycode is NOT null, then search in the database\r\n else if ($this->keycode != null)\r\n {\r\n $result = mysql_query(\"SELECT Keycode, Claimable, Repairable, WarrantyMonths\r\n FROM Product \r\n WHERE Product.Keycode = $this->keycode\");\r\n\r\n $array = mysql_fetch_array($result);\r\n\r\n // if keycode is null, item does not exist in the database\r\n //if ($array[\"Keycode\"] == false)\r\n if (empty($array))\r\n {\r\n $this->claimType = \"keycode-not-found\";\r\n }\r\n // if product is claimable and repairable\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 1)\r\n { \r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) \r\n {\r\n //// check warranty period\r\n $this->claimType = \"repair-warranty\";\r\n }\r\n else\r\n {\r\n // check warranty period\r\n $this->claimType = \"repair-no-warranty\";\r\n }\r\n }\r\n else // transactionResult number rows is zero, this means no transaction was founds\r\n { \r\n $this->claimType = \"repair-no-transaction\";\r\n }\r\n }\r\n // if product offers a finanical claim\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"finanical-warranty\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"finanical-outside-warranty\";\r\n }\r\n }\r\n else // transactionResult's rows was zero so no tranaction number was found\r\n {\r\n $this->claimType = \"finanical-no-transaction\";\r\n }\r\n }\r\n // if a product is NOT claimable with supplier\r\n else if ($array[\"Claimable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are above zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"not-claimable-refund\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"not-claimable-outside-warranty\";\r\n }\r\n }\r\n else // no vaild transaction number provided\r\n {\r\n $this->claimType = \"not-claimable-no-transaction\";\r\n }\r\n }\r\n }\r\n \r\n }", "public function getProdCode()\n {\n return $this->prod_code;\n }", "public function getProductCode(): ?string\n {\n return $this->productCode;\n }", "function getProductCode()\n {\n return $this->productCode;\n }", "public function productFlowProcess(){\r\n\t\t$query = $this->request->data ;\r\n\t\t$status = $query[\"status\"] ;\r\n\t\t$description = $query[\"description\"] ;\r\n\t\t$filterId = $query[\"filterId\"] ;\r\n\t\t$asin = $query[\"asin\"] ;\r\n\t\t$strategy = $query[\"strategy\"] ;\r\n\t\t/*print_r( $this->request ) ; \r\n\t\tprint_r($this->request->data) ;\r\n\t\techo \">>>>>>>>>>>>>>>>>\".$description ;*/\r\n\t\t\r\n\t\t\r\n\t\t//更新状态\r\n\t\t$this->Sale->updateProductFilterStatus($this->request->data) ;\r\n\t\t\r\n\t\t//添加备注\r\n\t\t//if( trim($description) != \"\" ){\r\n\t\t$this->Product->updateProductComment($asin,$description,$strategy) ;\r\n\t\t//}\r\n\t\t\r\n\t\t//加入黑名单\r\n\t\tif( $status == 3 ){\r\n\t\t\t$user = $this->getCookUser() ;\r\n\t\t\t$this->Sale->removeProduct($this->request->data,$user) ;\r\n\t\t}else{\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$this->response->type(\"json\") ;\r\n\t\t$this->response->body( \"success\") ;\r\n\r\n\t\treturn $this->response ;\r\n\t}", "function external_code($request)\n\t{\n\t\tlist($success, $return) = $this->system->is_valid_access4($request);\n\t\tif (!$success) return [FALSE, $return];\n\n\t\t//cek parameter: SecuritiesMarketCode\n\t\tif (!isset($request->params->SecuritiesMarketCode) || empty($request->params->SecuritiesMarketCode)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter SecuritiesMarketCode'])]];\n\t\t}\n\n\t\t//cek parameter: MarketID --> sumber external identification \n\t\tif (!isset($request->params->MarketID) || empty($request->params->MarketID)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter MarketID'])]];\n\t\t}\n\n\t\t$this->db->select('T2.SecuritiesCode');\n\t\t$this->db->from('market_instrument_id_market T1');\n\t\t$this->db->join('market_instrument T2', 'T1.SecuritiesID = T2.SecuritiesID'); \n\t\t$this->db->where('T1.MarketID', $request->params->MarketID);\n\t\t$this->db->where('T1.SecuritiesMarketCode', $request->params->SecuritiesMarketCode);\n\t\t$row = $this->db->get()->row();\n if (!$row) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-2', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-2'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'market company'])]];\n }\n\n\t\t$request->log_size = mb_strlen(serialize($row), '8bit');\n\t\t$request->log_type\t= 'data';\t\n\t\t$this->system->save_billing($request);\n\n\t\treturn [TRUE, ['result' => ['SecuritiesCode' => $row->SecuritiesCode]]];\n\t}", "function deliver($code)\n{ \n\n\techo \"// http://license.mxgraph.com/hosted \\n\";\n\techo $code;\n}", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function getProductCode()\n {\n if (array_key_exists(\"productCode\", $this->_propDict)) {\n return $this->_propDict[\"productCode\"];\n } else {\n return null;\n }\n }", "public function createFulfillmentRequestToDr($lineItems, $order) {\n $items = [];\n $request = [];\n $status = 'Completed';\n $responseCode = 'Success'; \n \n try {\n if ($order->getDrOrderId()) {\n $storeCode = $order->getStore()->getCode();\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n\n if(!$drModel->getId() || $drModel->getPostStatus() == 1) {\n return;\n } // end: if\n \n foreach ($lineItems as $itemId => $item) {\n $items['item'][] = [\n \"requisitionID\" => $item['requisitionID'],\n \"noticeExternalReferenceID\" => $item['noticeExternalReferenceID'],\n \"lineItemID\" => $itemId,\n\t\t\t\t\t\t\"magentoLineItemID\" => $item['magentoLineItemID'],\n \"fulfillmentCompanyID\" => $this->getCompanyId($storeCode),\n \"electronicFulfillmentNoticeItems\" => [\n \"item\" => [\n [\n \"status\" => $status,\n \"reasonCode\" => $responseCode,\n \"quantity\" => $item['quantity'],\n \"electronicContentType\" => \"EntitlementDetail\",\n \"electronicContent\" => \"magentoEventID\"\n ]\n ]\n ]\n ];\n } // end: foreach\n\n $request['ElectronicFulfillmentNoticeArray'] = $items;\n\n $this->curl->setOption(CURLOPT_RETURNTRANSFER, true);\n $this->curl->setOption(CURLOPT_TIMEOUT, 40);\n $this->curl->addHeader(\"Content-Type\", \"application/json\");\n $this->curl->post($this->getDrPostUrl($storeCode), $this->jsonHelper->jsonEncode($request));\n $result = $this->curl->getBody();\n $statusCode = $this->curl->getStatus();\n\n // Status Update: Exsisting code used according to review changes\n if ($statusCode == '200') {\n // Post Status updated only if entire order items are fulfilled\n if($this->getPendingFulfillment($order)) {\n // if all the quantites are satisfied then mark as 1\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n $drModel->setPostStatus(1);\n $drModel->save();\n } // end: if\n $comment = 'Magento & DR order status are matched';\n } else {\n $comment = 'Magento & DR order status are mis-matched';\n } // end: if\n\n $order->addStatusToHistory($order->getStatus(), __($comment));\n\n $this->_logger->info('createFulfillmentRequestToDr Request : '.json_encode($request));\n $this->_logger->info('createFulfillmentRequestToDr Response : '.json_encode($result)); \n } else {\n $this->_logger->error('Error createFulfillmentRequestToDr : Empty DR Order Id');\n } // end: if\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $le) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '.json_encode($le->getRawMessage()));\n } catch (\\Exception $ex) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '. $ex->getMessage());\n } // end: try \n \n return $result;\n }", "public static function postsubmit_derive_product($lead) {\n\t\t$wsProduct = '';\n\t\tif( empty($lead->wsMaxProductLine) || 'Unknown' == $lead->wsMaxProductLine ) { // no Product Line context on the form page\n\t\t\tif ( 'History-Culture Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\tif( !empty($lead->domesticOrInternational ) && 'us' == $lead->domesticOrInternational ) {\n\t\t\t\t\t$wsProduct = 'Middle School - History'; // default to History\n\t\t\t\t} else {\n\t\t\t\t\t$wsProduct = 'High School - International'; // abroad means Perspectives Division\n\t\t\t\t}\n\t\t\t} elseif ( 'Science Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Middle School - Science';\n\t\t\t} elseif ( 'Undergraduate Tours' == $lead->leadFormProduct || \n\t\t\t\t\t 'Graduate-Level Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'University'; // does not exist in Maximizer yet\n\t\t\t} elseif ( 'Music Festivals' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Concert and Performing Tours' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Marching Band Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Dance-Cheer Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Theatre Opportunities' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Performing';\n\t\t\t} elseif ( 'Sports Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Sports'; // does not exist in Maximizer yet\n\t\t\t} else {\n\t\t\t\t$wsProduct = 'Unknown';\n\t\t\t}\n\t\t} else {\n\t\t\t$wsProduct = $lead->wsMaxProductLine;\n\t\t}\n\t\treturn $wsProduct;\n\t}", "public function actionDeliveryCost($code){\n //check country\n $city= City::find()->where('Name=\"'.$code.'\"')->one();\n //var_dump($city);\n if($city->CountryCode == 'EGY'){\n //calculate weight\n $sum=0;\n foreach(Shopcart::goods() as $good) {\n $sum+= $good->item->product_weight ;\n\n }\n // return \"the new cost--\".$city->Name .$city->CountryCode;\n //$city->CountryCode;\n $cost= $this->GetCost($city->Name,$sum);\n if($cost =='' or $cost ==0){\n return Setting::get('deliver_cost');\n }else{return $cost ;}\n\n }else{\n return Setting::get('deliver_cost'); //.'-99'. $city->CountryCode;\n }\n\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "function get_item_code()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n\t\t\t$invoiceNumber = $_POST['inv'];\n\t\t\t$batch = $_POST['batch'];\n\t\t\t$tableName = \"london_stock\";\n\t\t\t$condition = array(\n\t\t\t\t'invoice_number' => $invoiceNumber,\n\t\t\t\t'invoice_date' => $batch\n\n\t\t\t);\n\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\tif ($result > 0) {\n\t\t\t\techo $response = json_encode($result, true);\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'No item', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "public function minAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function compliteAction()\n {\n\n $config = $this->get('plugins')->Frontend()->PilibabaPilipaySystem()->Config();\n $merchantNO = $this->Request()->getParam('merchantNO');\n $orderNo = $this->Request()->getParam('orderNo');\n $orderAmount = $this->Request()->getParam('orderAmount');\n $signType = $this->Request()->getParam('signType');\n $payResult = $this->Request()->getParam('payResult');\n $signMsg = $this->Request()->getParam('signMsg');\n $dealId = $this->Request()->getParam('dealId');\n $fee = $this->Request()->getParam('fee');\n $sendTime = $this->Request()->getParam('sendTime');\n\n\n if ($config->get('merchantNo') == $merchantNO\n && md5($merchantNO . $orderNo . $orderAmount . $sendTime . $config->get('appSecrect')) == $signMsg\n ) {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n $order = $builder->getQuery()->getOneOrNullResult();\n\n if ($payResult == 10) {\n\n $this->setPaymentStatus($order->getTransactionId(), 12);\n $url = $this->basePathUrl . '/paymentpilipay/finish?orderNo='.$orderNo;\n\n echo '<result>1</result><redirecturl>' . $url . '</redirecturl>';\n $this->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if ($order->getOrderStatus() && $order->getOrderStatus()->getId() == 0) {\n $this->setOrderStatus($order->getTransactionId(), 0); // in process\n }\n } elseif ($payResult == 11) {\n $this->setPaymentStatus($order->getTransactionId(), 21);\n\n }\n }\n\n }", "public function getOcentureProductCode($freedomProductCode) {\r\n $products = [\r\n 'YSDPROTECHM1MO' => 'YP8383',\r\n 'YSDPROTECHM1YR' => 'YP83811',\r\n 'YSDPROIDM1MO' => 'YP8381',\r\n 'YSDPROIDM1YR' => 'YP8389',\r\n 'YSDPROIDF1MO' => 'YP8382',\r\n 'YSDPROIDF1YR' => 'YP83810',\r\n 'YSDPROIDMP1MO' => 'YP8387',\r\n 'YSDPROIDMP1YR' => 'YP83815',\r\n 'YSDPROIDFP1MO' => 'YP8388',\r\n 'YSDPROIDFP1YR' => 'YP83816',\r\n 'YSDPROROADM1MO' => 'YP8384',\r\n 'YSDPROROADM1YR' => 'YP83812',\r\n 'YSDPROBUNDLM1MO' => 'YP8385',\r\n 'YSDPROBUNDLM1YR' => 'YP83813',\r\n 'YSDPROBUNDLF1MO' => 'YP8386',\r\n 'YSDPROBUNDLF1YR' => 'YP83814',\r\n 'testproduct' => 'IG7985'\r\n ];\r\n\r\n if (isset($products[$freedomProductCode])) {\r\n return $products[$freedomProductCode];\r\n } else {\r\n die(\"no product found matching with ocenture\");\r\n }\r\n }", "public function addProductCode($code)\n {\n //$pieces = preg_split(\"/-/\", $code);\n //$programId = preg_replace(\"/\\D/\", \"\", $pieces[0]);\n }", "function checkdelivery($package) {\n\n\t$item = $package['item'];\t\n\t$quantity = $package['quantity'];\t\n\t$to = $package['to'];\t\n\t$from = $package['from'];\t\n\n// Based on the location of the delivery address and \n// the warehouse the courier can decide if they can \n// make the delivery. If yes, they could then let the \n// warehouse know the cost and delivery date.\n\n\t$accepted = 1;\n\n\tif ( $accepted )\n\t{\n\t\t$cost = 10;\n\t\t$date = '12-05-2004';\n\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => $cost,\n\t\t\t\t\t'date' => $date\n\t\t\t\t\t);\n\t} else {\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => 0,\n\t\t\t\t\t'date' => 'null'\n\t\t\t\t\t);\n\t}\n\n return new soapval('return', 'DeliveryDetail', $output, false, 'urn:MyURN');\n}", "private function getProductInformation()\r\n {\r\n \r\n // if product is repairable get the repair agents details as well as products and suppliers\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" || \r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplierRepairAgent_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n // if the product is not repairable grab the product information and supplier information only\r\n else\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplier_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n }", "abstract protected function getPaymentMethodCode();", "function buildHostRequest() {\r\n\t\t$strRequest = \"\";\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->amt ) > 0) {\r\n\t\t\t\t$strRequest .= \"amt=\" . $this->amt . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->action ) > 0) {\r\n\t\t\t\t$strRequest .= \"action=\" . $this->action . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->responseURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"responseURL=\" . $this->responseURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->errorURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"errorURL=\" . $this->errorURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->trackId ) > 0) {\r\n\t\t\t\t$strRequest .= \"trackid=\" . $this->trackId . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf1 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf1=\" . $this->udf1 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf2 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf2=\" . $this->udf2 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf3 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf3=\" . $this->udf3 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf4 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf4=\" . $this->udf4 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf5 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf5=\" . $this->udf5 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf6 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf6=\" . $this->udf6 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf7 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf7=\" . $this->udf7 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf8 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf8=\" . $this->udf8 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf9 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf9=\" . $this->udf9 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf10 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf10=\" . $this->udf10 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf11 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf11=\" . $this->udf11 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf12 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf12=\" . $this->udf12 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf13 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf13=\" . $this->udf13 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf14 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf14=\" . $this->udf14 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf15 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf15=\" . $this->udf15 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf16 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf16=\" . $this->udf16 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf17 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf17=\" . $this->udf17 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf18 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf18=\" . $this->udf18 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf19 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf19=\" . $this->udf19 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf20 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf20=\" . $this->udf20 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf21 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf21=\" . $this->udf21 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf22 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf22=\" . $this->udf22 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf23 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf23=\" . $this->udf23 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf24 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf24=\" . $this->udf24 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf25 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf25=\" . $this->udf25 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf26 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf26=\" . $this->udf26 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf27 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf27=\" . $this->udf27 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf28 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf28=\" . $this->udf28 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf29 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf29=\" . $this->udf29 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf30 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf30=\" . $this->udf30 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf31 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf31=\" . $this->udf31 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf32 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf32=\" . $this->udf32 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->currency ) > 0) {\r\n\t\t\t\t$strRequest .= \"currencycode=\" . $this->currency . \"&\";\r\n\t\t\t}\r\n\t\t\tif ($this->language != null && strlen ( $this->language ) > 0) {\r\n\t\t\t\t$strRequest .= \"langid=\" . $this->language . \"&\";\r\n\t\t\t}\r\n\t\t\treturn $strRequest;\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * finally{\r\n\t\t * $strRequest = null;\r\n\t\t * }\r\n\t\t */\r\n\t}", "private function dataCodeAction()\n {\n $code_action = array(\n 'ABO' => array('Abonnement', '1'),\n 'PROSP' => array('Prospection', '2'),\n 'PROSP1' => array('Prospection tracer 1', '2'),\n 'PROSP11' => array('Prospection tracer 11', '2'),\n 'PROSP12' => array('Prospection tracer 12', '2'),\n 'PROSP13' => array('Prospection tracer 13', '2'),\n 'PROSP2' => array('Prospection tracer 2', '2'),\n 'PROSP21' => array('Prospection tracer 21', '2'),\n 'PROSP22' => array('Prospection tracer 22', '2'),\n 'PROSP23' => array('Prospection tracer 23', '2'),\n 'PROSP24' => array('Prospection tracer 24', '2'),\n 'PROSP3' => array('Prospection tracer 3', '2'),\n 'PROSP5' => array('Prospection tracer 5', '2'),\n 'PROSP51' => array('Prospection tracer 51', '2'),\n 'PROSP52' => array('Prospection tracer 52', '2'),\n 'PROSP53' => array('Prospection tracer 53', '2'),\n 'PROSP ENTR' => array('Contact entrant sans fiche client', '2'),\n 'PROSP REL' => array('Prospection REL', '2'),\n 'PROSPWEB' => array('Prospection Web', '2'),\n 'FID' => array('FID', '20'),\n 'FID PROMO' => array('FID suite promo', '20'),\n 'FID PROG F' => array('FID programme fidélité', '20'),\n 'FID WEB PRGF' => array('FID web PRGF', '20'),\n 'FID WEB PROMO' => array('FID web PROMO', '20'),\n 'FID WEB PROM' => array('FID web PROMO', '20'),\n 'FID WEB' => array('FID web', '20'),\n 'PAR' => array('Parrainage', '27'),\n 'REACT+4M' => array('Reactivation fichier clients +4mois', '28'),\n 'REACT+4MPROMO' => array('Reactivation fichier clients +4mois suite à promo', '28'),\n 'REACT SPONT' => array('Reactivation client spontanée', '28'),\n 'REACT SPONT PROMO' => array('Reactivation client spontanée suite à promo', '28'),\n 'REACTSPONT' => array('Reactivation client AC formulaire', '28'),\n 'REACT AC FORM' => array('Reactivation client AC formulaire', '28'),\n 'REACTIV' => array('Reactivation REACTIV', '28'),\n 'CONT ENTR' => array('CONT ENTR', '35')\n );\n $data = array();\n $c = 1;\n foreach ($code_action as $key => $value) {\n $data[] = array(\n 'id_code_action' => (int)$c,\n 'name' => pSQL($key),\n 'description' => pSQL($value[0]),\n 'groupe' => (int)$value[1]\n );\n $c++;\n }\n\n return $data;\n }", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "public function getPartnerCode()\n {\n // todo: implement partner code storage.\n return null;\n }", "public function get_Code_produit()\n\t\t{\n\t\t\treturn $this->Code_produit;\n\t\t}", "public function getLocalProductCountryCode(): ?string\n {\n return $this->localProductCountryCode;\n }", "public function deliveryPriceDhaka()\n {\n }", "function calc_required_en(){\r\n\tif(strpos($this->Tactics['spec'],'DoubleStrike') !== false) $this->Eq['A']['enc'] *= 2;\r\n\tif(strpos($this->Tactics['spec'],'TripleStrike') !== false) $this->Eq['A']['enc'] *= 3;\r\n\t$MSEnCpos = strpos($this->MS['spec'],'CostEN');\r\n\tif($MSEnCpos !== false) {\r\n\t\t$temp = array();\r\n\t\tpreg_match('/CostEN<([0-9.]+)>/',$this->MS['spec'],$temp,0,$MSEnCpos);\r\n\t\t$MSEnC = floatval($temp[1]);\r\n\t\tif($MSEnC < 1) $MSEnC = floor($this->Player['enmax'] * $MSEnC);\r\n\t\t$this->Eq['A']['enc'] += $MSEnC;\r\n\t}\r\n\t$this->RequireEN = ($this->Eq['A']['enc'] + $this->Eq['D']['enc'] + $this->Eq['E']['enc']);\r\n}", "private function validateAvailableProduct() {\n\n\t\t$studio_data = &$this->session->data['studio_data'][$this->request->post['price_studio_id']]; //make it short\n\n\t\t//if price_id_product is not empty\n\t\tif (!isset($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t///if product exists\n\t\t} elseif (!$this->model_opentshirts_product->getTotalProductsByID($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t//if product price is setted up\n\t\t}else if ($this->model_opentshirts_price_product->getMinQuantity($studio_data['id_product'])===false) {\n\t\t\t$this->error['warning'] = $this->language->get('error_not_available');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function fixAction()\n {\n $mMainReq = Qss_Model_Db::Table('OYeuCauMuaSam');\n $mMainReq->where(sprintf('IFID_M412 = %1$d', $this->_form->i_IFID));\n $oMainReq = $mMainReq->fetchOne();\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n\n $this->html->main = $oMainReq;\n $this->html->sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "function fn_warehouses_get_product_data_post(&$product_data, $auth, $preview, $lang_code)\n{\n if (empty($product_data['product_id'])) {\n return;\n }\n\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n /** @var Tygh\\Addons\\Warehouses\\ProductStock $product_stock */\n $product_stock = $manager->getProductWarehousesStock($product_data['product_id']);\n\n if (!$product_stock->hasStockSplitByWarehouses()) {\n return;\n }\n\n if (AREA == 'C') {\n /** @var \\Tygh\\Location\\Manager $manager */\n $manager = Tygh::$app['location'];\n $destination_id = $manager->getDestinationId();\n\n $product_data['amount'] = $product_stock->getAmountForDestination($destination_id);\n } else {\n $product_data['amount'] = $product_stock->getAmount();\n }\n}", "public function execute()\n {\n /** @var \\Magento\\Framework\\Controller\\Result\\Json $result */\n $result = $this->resultJsonFactory->create();\n\n $productId = $this->getRequest()->getParam('productId');\n $qty = $this->getRequest()->getParam('qty');\n\n\n if (!$productId) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product ID is required'),\n ]);\n }\n\n\n // check product is in stock\n /** @var \\Magento\\Catalog\\Model\\Product $product */\n $product = $this->productFactory->create();\n $product->load($productId);\n if (!$product->getId()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product not found'),\n ]);\n }\n if (!$product->isAvailable()) {\n // TODO: product placeholders\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n if ($product->isVirtual()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Virtual products cannot be shipped'),\n ]);\n }\n\n $messages = \"\";\n if ($this->getProductSalableQty && $this->isProductSalable) {\n if ($this->helper->getInventoryStock() != null) {\n if($product->getTypeId() == 'simple') {\n $qtyInStock = $this->getProductSalableQty->execute($product->getSku(), $this->helper->getInventoryStock());\n if ($qty > $qtyInStock) {\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n } else {\n $messages = \"stock = \" . $this->helper->getInventoryStock() . \" \" . $product->getSku() . \" \" . $qty . \" in stock \" . $qtyInStock . \" \" . $product->getTypeId();\n }\n }else{\n if($this->isProductSalable->execute($product->getSku(), $this->helper->getInventoryStock())){\n $messages = \"product is saleable\";\n }else{\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n }\n } else {\n $messages = \"inventory stock null\";\n }\n } else {\n $messages = __(\"MSI not supported: \") . $product->getSku() . \" \" . $product->getTypeId();\n //probably just means MSI not supported here.\n }\n\n\n $transport = new DataObject([\n 'available' => true,\n ]);\n $this->eventManager->dispatch('porterbuddy_availability', array(\n 'product' => $product,\n 'qty' => $qty,\n 'result' => $transport,\n ));\n\n if ($transport->getError()) {\n return $result->setData([\n 'error' => true,\n 'messages' => $transport->getMessage() ?: $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n\n return $result->setData([\n 'error' => false,\n 'available' => true,\n 'messages' => $messages\n ]);\n }", "function dsf_protx_release_order($order_number){\n\nglobal $ReleaseURL, $Verify, $ProtocolVersion;\n\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please release the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'Protx Item not Found';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please release the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'More than one protx item found';\n\tbreak;\n }\n \t\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n\n // we must have a valid transaction item if we are here, get the array of items.\n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$TargetURL = $ReleaseURL;\n$VerifyServer = $Verify;\n\n// echo 'URL = ' . $TargetURL;\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => 'RELEASE',\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response ='';\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been released witin protx.\n\t\t\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '13');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '13', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as released however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn $response;\n}", "public function make3DPayPayment()\n {\n $status = 'declined';\n $response = 'Declined';\n $proc_return_code = $this->request->get('procreturncode');\n\n $transaction_security = 'MPI fallback';\n if (in_array($this->request->get('mdstatus'), [1, 2, 3, 4])) {\n if ($this->request->get('mdstatus') == '1') {\n $transaction_security = 'Full 3D Secure';\n } elseif (in_array($this->request->get('mdstatus'), [2, 3, 4])) {\n $transaction_security = 'Half 3D Secure';\n }\n\n $status = 'approved';\n $response = 'Approved';\n }\n\n $this->response = (object) [\n 'id' => (string) $this->request->get('authcode'),\n 'order_id' => (string) $this->request->get('oid'),\n 'trans_id' => (string) $this->request->get('transid'),\n 'auth_code' => (string) $this->request->get('authcode'),\n 'host_ref_num' => (string) $this->request->get('hostrefnum'),\n 'response' => $response,\n 'transaction_type' => $this->type,\n 'transaction' => $this->order->transaction,\n 'transaction_security' => $transaction_security,\n 'proc_return_code' => $proc_return_code,\n 'code' => $proc_return_code,\n 'md_status' => $this->request->get('mdStatus'),\n 'status' => $status,\n 'status_detail' => isset($this->codes[$this->request->get('ProcReturnCode')]) ? (string) $this->request->get('ProcReturnCode') : null,\n 'hash' => (string) $this->request->get('secure3dhash'),\n 'rand' => (string) $this->request->get('rnd'),\n 'hash_params' => (string) $this->request->get('hashparams'),\n 'hash_params_val' => (string) $this->request->get('hashparamsval'),\n 'masked_number' => (string) $this->request->get('MaskedPan'),\n 'amount' => (string) $this->request->get('amount'),\n 'currency' => (string) $this->request->get('currency'),\n 'tx_status' => (string) $this->request->get('txstatus'),\n 'eci' => (string) $this->request->get('eci'),\n 'cavv' => (string) $this->request->get('cavv'),\n 'xid' => (string) $this->request->get('xid'),\n 'error_code' => (string) $this->request->get('errcode'),\n 'error_message' => (string) $this->request->get('errmsg'),\n 'md_error_message' => (string) $this->request->get('mderrormessage'),\n 'campaign_url' => null,\n 'name' => (string) $this->request->get('firmaadi'),\n 'email' => (string) $this->request->get('Email'),\n 'extra' => $this->request->get('Extra'),\n 'all' => $this->request->all(),\n ];\n\n return $this;\n }", "public function getPrepareOutgoingConsignmentRequest()\n {\n $request = new PrepareOutgoingConsignmentRequest();\n $request->localTransactionId = $this->localTransactionId;\n $request->initiator = $this->initiator;\n\n $enterprise = mercDicconst::getSetting('enterprise_guid');\n $hc = mercDicconst::getSetting('issuer_id');\n\n $delivery = new Delivery();\n $delivery->consignor = new BusinessMember();\n $delivery->consignor->enterprise = new Enterprise();\n $delivery->consignor->enterprise->guid = $enterprise;\n $delivery->consignor->businessEntity = new BusinessEntity();\n $delivery->consignor->businessEntity->guid = $hc;\n\n $delivery->consignee = new BusinessMember();\n $delivery->consignee->enterprise = new Enterprise();\n $delivery->consignee->enterprise->guid = $this->step3['recipient'];\n $delivery->consignee->businessEntity = new BusinessEntity();\n $delivery->consignee->businessEntity->guid = $this->step3['hc'];\n\n $consigments = [];\n $vetCertificates = [];\n\n if(isset($this->conditions)) {\n $this->conditions = json_decode($this->conditions, true);\n }\n\n foreach ($this->step1 as $id => $product) {\n $consigment = new Consignment();\n $consigment->id = 'con'.$id;\n $stock = MercStockEntry::findOne(['id' => $id]);\n $stock_raw = unserialize($stock->raw_data);\n if($stock->product_name != $product['product_name'])\n {\n\n }\n $consigment->volume = $product['select_amount'];\n $consigment->unit = new Unit();\n $consigment->unit = $stock_raw->batch->unit;\n\n $consigment->sourceStockEntry = new StockEntry();\n //$consigment->sourceStockEntry->uuid = $stock->uuid;\n $consigment->sourceStockEntry->guid = $stock->guid;\n\n $consigments[] = $consigment;\n\n $vetCertificate = new VetDocument();\n $vetCertificate->for = 'con'.$id;\n $authentication['purpose']['guid'] = $this->step2['purpose'];\n $authentication['cargoExpertized'] = $this->step2['cargoExpertized'];\n $authentication['locationProsperity'] = $this->step2['locationProsperity'];\n\n //Заполняем условия регионализации при необходимости\n //var_dump($this->conditions); die();\n if(isset($this->conditions[$product['product_name']])) {\n $conditions = null;\n $buff = $this->conditions[$product['product_name']];\n foreach ($buff as $key=>$item) {\n $r13nClause = new RegionalizationClause();\n $r13nClause->condition = new RegionalizationCondition();\n $r13nClause->condition->guid = $key;\n $conditions[] = $r13nClause;\n }\n $authentication['r13nClause'] = $conditions;\n }\n $vetCertificate->authentication = $authentication;\n $vetCertificates[] = $vetCertificate;\n }\n\n $delivery->consignment = $consigments;\n\n $delivery->transportInfo = new TransportInfo();\n $delivery->transportInfo->transportType = $this->step4['type'];\n $delivery->transportInfo->transportNumber = new TransportNumber();\n $delivery->transportInfo->transportNumber->vehicleNumber = $this->step4['car_number'];\n if (isset($this->step4['trailer_number'])) {\n $delivery->transportInfo->transportNumber->trailerNumber = $this->step4['trailer_number'];\n }\n if (isset($this->step4['container_number'])) {\n $delivery->transportInfo->transportNumber->containerNumber = $this->step4['container_number'];\n }\n $delivery->transportStorageType = $this->step4['storage_type'];\n\n $delivery->accompanyingForms = new ConsignmentDocumentList();\n if($this->step3['isTTN']) {\n $delivery->accompanyingForms->waybill = new Waybill();\n $delivery->accompanyingForms->waybill->issueSeries = $this->step3['seriesTTN'];\n $delivery->accompanyingForms->waybill->issueNumber = $this->step3['numberTTN'];\n $delivery->accompanyingForms->waybill->issueDate = date('Y-m-d', strtotime($this->step3['dateTTN']));\n $delivery->accompanyingForms->waybill->type = $this->step3['typeTTN'];\n }\n\n $delivery->accompanyingForms->vetCertificate = $vetCertificates;\n\n $request->delivery = $delivery;\n\n /* echo \"<pre>\";\n var_dump($request); die();*/\n return $request;\n }", "public function process ()\n {\n /**\n * Sets pricing for which offer is applicable.\n */\n $this->setOfferApplicablePricing();\n\n /**\n * Checks if offer is valid.\n */\n if ( $this->isOfferValid() ) {\n\n /**\n * Sets benefits gained from offer.\n */\n $this->setBenefit();\n }\n\n return $this->request;\n }", "protected function _drcRequest($service)\r\n\t{\r\t\t$db = Mage::getSingleton('core/resource')->getConnection('core_write');\r\t\t\r\n\t\t$origCountry = Mage::getStoreConfig('shipping/origin/country_id', $this->getStore());\r\n\t\tif ($origCountry != \"AU\") \r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\r\r\n\t\t// TODO: Add some more validations\r\t\t$path_smartsend = \"carriers/smartsend/\";\r\t\t\r\n\t\t//$frompcode = Mage::getStoreConfig('shipping/origin/postcode', $this->getStore());\r\n\t\t//$fromsuburb = Mage::getStoreConfig('shipping/origin/city', $this->getStore());\r\t\t\r\t\t$frompcode = Mage::getStoreConfig($path_smartsend.'post_code', $this->getStore());\r\t\t$fromsuburb = Mage::getStoreConfig($path_smartsend.'suburban', $this->getStore());\r\t\t\r\n\t\t$topcode = $service->getDestPostcode();\r\n\t\t$tosuburb = $service->getDestCity();\r\r\t\tMage::Log($frompcode);\r\t\tMage::Log($fromsuburb);\r\t\t\r\n\t\tif ($service->getDestCountryId()) {\r\n\t\t\t$destCountry = $service->getDestCountryId();\r\n\t\t} \r\r\n\t\telse{\r\n\t\t\t$destCountry = \"AU\";\r\n\t\t}\t\t\r\t\r\n\t\t// Here we get the weight (and convert it to grams) and set some\r\n\t\t// sensible defaults for other shipping parameters.\t\r\r\n\t\t$weight = (int)$service->getPackageWeight();\r\t\t\r\t\t$height = $width = $length = 100;\r\n\t\t$shipping_num_boxes = 1;\r\n\t\t$Description = \"CARTON\";\r\n\t\t$post_url = \"http://api.smartsend.com.au/\"; \r\r\t\r\n \r\t//$result = $db->query(\"SELECT depth,length,height,description,taillift FROM 'smartsend_products'\");\r\t\r\t\r\n $post_param_values[\"METHOD\"] = \"GetQuote\";\r\n $post_param_values[\"FROMCOUNTRYCODE\"] = $origCountry;\r\n $post_param_values[\"FROMPOSTCODE\"] = $frompcode; //\"2000\";\r\n $post_param_values[\"FROMSUBURB\"] = $fromsuburb; //\"SYDNEY\";\r\n $post_param_values[\"TOCOUNTRYCODE\"] = $destCountry;\r\n $post_param_values[\"TOPOSTCODE\"] = $topcode;\r\n $post_param_values[\"TOSUBURB\"] = $tosuburb;\r\r\n\r\t\r\n # tail lift - init \r\n $taillift = array();\r\n $key = 0;\r\r\n\t$freeBoxes = 0;\r\n if ($service->getAllItems()) {\r\n foreach ($service->getAllItems() as $item) {\r\r\n\t/* fetching the values of lenght,weight,height,description in smartsend_products table */\r\t\t\t\t$prod_id = $item->getProduct()->getId();\r\t\t\t\t\r\t\t\t\t\r\n if ($item->getProduct()->isVirtual() || $item->getParentItem()) {\r\r\n continue;\r\r\n }\r\r\n\r\r\n if ($item->getHasChildren() && $item->isShipSeparately()) {\r\r\n foreach ($item->getChildren() as $child) {\r\r\n if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {\r\r\n $freeBoxes += $item->getQty() * $child->getQty();\r\r\n }\r\r\n }\r\r\n } elseif ($item->getFreeShipping()) {\r\r\n $freeBoxes += $item->getQty();\r\r\n }\r\t\t\t\t\r\t\t\t\t$prod_id \t= $item->getProduct()->getId();\r\t\t\t\t$result \t= $db->query('Select * from `smartsend_products` where id='.\"'\".$prod_id.\"'\");\r\t\t\t\t$rows \t\t= $result->fetch(PDO::FETCH_ASSOC);\r\t\t\t\t\r\t\t\t\t\r\t\t\t\tif($rows){\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = $rows['height'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = $rows['length'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = $rows['depth'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $rows['description'];\r\t\t\t\t}else{\r\t\t\t\t\t/* default values */\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = 'none';\t\t\t\t\r\t\t\t\t}\r\r # tail lift - assigns value\r switch($rows['taillift']){\r case 'none':\r $taillift[] = \"none\";break;\r case 'atpickup':\r $taillift[] = \"atpickup\";break; \r case 'atdestination':\r $taillift[] = \"atdestination\";break; \r case 'both':\r $taillift[] = \"both\";break; \r }\r\t\t\t\t\t\r\t\t\t\t$key++;\r\n }\r\r\n }\r\t\t\r\t\t\r\r\n $this->setFreeBoxes($freeBoxes);\r\t\t\t\t\t\t\t\r/*\r\n $post_value_items[\"ITEM({$key})_HEIGHT\"] = $height;\r\n $post_value_items[\"ITEM({$key})_LENGTH\"] = $length;\r\n $post_value_items[\"ITEM({$key})_DEPTH\"] = $width;\r\n $post_value_items[\"ITEM({$key})_WEIGHT\"] = $width;\r\n $post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $Description;\r*/\r \r \t\t\r\r\n # tail lift - choose appropriate value\r\r\n $post_param_values[\"TAILLIFT\"] = \"none\"; \r\r\n if (in_array(\"none\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"none\"; \r\n if (in_array(\"atpickup\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atpickup\";\r\n if (in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atdestination\";\r\n if (in_array(\"atpickup\", $taillift) && in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\";\r\n if (in_array(\"both\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\"; \r\r\n \r\r\n $post_final_values = array_merge($post_param_values,$post_value_items);\r\r\n # POST PARAMETER AND ITEMS VALUE URLENCODE\r\r\n $post_string = \"\";\r\r\n foreach( $post_final_values as $key => $value )\r\n { $post_string .= \"$key=\" . urlencode( $value ) . \"&\"; }\r\n $post_string = rtrim( $post_string, \"& \" );\r\r\n\tif ($service->getFreeShipping() === true || $service->getPackageQty() == $this->getFreeBoxes()) {\r $shippingPrice = '0.00';\r\t\t\t\t\r\r\n $arr_resp['ACK'] = 'Success';\r $arr_resp['QUOTE(0)_TOTAL'] = $shippingPrice;\r $arr_resp['QUOTE(0)_ESTIMATEDTRANSITTIME'] = 'Fixed';\r $arr_resp['QUOTECOUNT'] = 1;\r\r\n }else{\r\r\n \r\r\n # START CURL PROCESS\r\r\n $request = curl_init($post_url); \r\tcurl_setopt($request, CURLOPT_HEADER, 0); \r\tcurl_setopt($request, CURLOPT_RETURNTRANSFER, 1); \r\n curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);\r\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n $post_response = curl_exec($request); \r\n curl_close ($request); // close curl object \r\r\n\t# parse output\r\n parse_str($post_response, $arr_resp);\r\r\n\t}\r\r\n\treturn $arr_resp;\r\r\n\t}", "abstract protected function getRequirement(): string;", "public function getPaymentRequest(): string;", "public function cs_proress_request($params = array()) {\n global $post, $cs_gateway_options, $cs_form_fields2;\n extract($params);\n\n $cs_current_date = date('Y-m-d H:i:s');\n $output = '';\n $rand_id = $this->cs_get_string(5);\n $business_email = $cs_gateway_options['cs_paypal_email'];\n\n\n $currency = isset($cs_gateway_options['cs_currency_type']) && $cs_gateway_options['cs_currency_type'] != '' ? $cs_gateway_options['cs_currency_type'] : 'USD';\n $cs_opt_hidden1_array = array(\n 'id' => '',\n 'std' => '_xclick',\n 'cust_id' => \"\",\n 'cust_name' => \"cmd\",\n 'return' => true,\n );\n $cs_opt_hidden2_array = array(\n 'id' => '',\n 'std' => sanitize_email($business_email),\n 'cust_id' => \"\",\n 'cust_name' => \"business\",\n 'return' => true,\n );\n $cs_opt_hidden3_array = array(\n 'id' => '',\n 'std' => $cs_trans_amount,\n 'cust_id' => \"\",\n 'cust_name' => \"amount\",\n 'return' => true,\n );\n $cs_opt_hidden4_array = array(\n 'id' => '',\n 'std' => $currency,\n 'cust_id' => \"\",\n 'cust_name' => \"currency_code\",\n 'return' => true,\n );\n $cs_opt_hidden5_array = array(\n 'id' => '',\n 'std' => $cs_package_title,\n 'cust_id' => \"\",\n 'cust_name' => \"item_name\",\n 'return' => true,\n );\n $cs_opt_hidden6_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_job_id),\n 'cust_id' => \"\",\n 'cust_name' => \"item_number\",\n 'return' => true,\n );\n $cs_opt_hidden7_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"cancel_return\",\n 'return' => true,\n );\n $cs_opt_hidden8_array = array(\n 'id' => '',\n 'std' => '1',\n 'cust_id' => \"\",\n 'cust_name' => \"no_note\",\n 'return' => true,\n );\n $cs_opt_hidden9_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"invoice\",\n 'return' => true,\n );\n $cs_opt_hidden10_array = array(\n 'id' => '',\n 'std' => esc_url($this->listner_url),\n 'cust_id' => \"\",\n 'cust_name' => \"notify_url\",\n 'return' => true,\n );\n $cs_opt_hidden11_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"lc\",\n 'return' => true,\n );\n $cs_opt_hidden12_array = array(\n 'id' => '',\n 'std' => '2',\n 'cust_id' => \"\",\n 'cust_name' => \"rm\",\n 'return' => true,\n );\n $cs_opt_hidden13_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"custom\",\n 'return' => true,\n );\n $cs_opt_hidden14_array = array(\n 'id' => '',\n 'std' => esc_url(home_url('/')),\n 'cust_id' => \"\",\n 'cust_name' => \"return\",\n 'return' => true,\n );\n\n $output .= '<form name=\"PayPalForm\" id=\"direcotry-paypal-form\" action=\"' . $this->gateway_url . '\" method=\"post\"> \n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden1_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden2_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden3_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden4_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden5_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden6_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden7_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden8_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden9_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden10_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden11_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden12_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden13_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden14_array) . '\n </form>';\n\n\n $data = CS_FUNCTIONS()->cs_special_chars($output);\n $data .= '<script>\n\t\t\t\t\t \t jQuery(\"#direcotry-paypal-form\").submit();\n\t\t\t\t\t </script>';\n echo CS_FUNCTIONS()->cs_special_chars($data);\n }", "public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n $this->load->model('esls_model');\n\n $formData = $this->input->post(NULL, TRUE);\n\n //DATA THAT COMES FROM PRODUCERS\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"delivery_ready\"){\n $this->process_delivery_ready_event($formData);\n }\n else if($name === \"bid_awarded\"){\n $this->process_bid_awarded_event($formData);\n }\n }", "public function setLocalProductCode(?string $localProductCode): self\n {\n $this->initialized['localProductCode'] = true;\n $this->localProductCode = $localProductCode;\n\n return $this;\n }", "public function process_request () {\n \n add_action( 'admin_notices', array( $this, 'admin_notices' ) );\n \n $supported_actions = array( 'activate-products', 'deactivate-product' );\n if ( !isset( $_REQUEST['action'] ) || !in_array( $_REQUEST['action'], $supported_actions ) || !check_admin_referer( 'bulk-' . 'licenses' ) ) {\n return null;\n }\n \n $response = false;\n $status = 'false';\n $type = $_REQUEST['action'];\n\n switch ( $type ) {\n case 'activate-products':\n $products = array();\n if ( isset( $_POST[ 'products' ] ) && 0 < count( $_POST[ 'products' ] ) ) {\n foreach ( $_POST[ 'products' ] as $k => $v ) {\n if ( !empty( $v[ 'license_key' ] ) ) {\n $products[$k] = $v;\n }\n }\n }\n if ( 0 < count( $products ) ) {\n //echo \"<pre>\"; print_r( $products ); echo \"</pre>\"; die();\n $response = $this->activate_products( $products );\n } else {\n $response = false;\n $type = 'no-license-keys';\n }\n break;\n\n case 'deactivate-product':\n if ( isset( $_GET['filepath'] ) && ( '' != $_GET['filepath'] ) ) {\n $response = $this->deactivate_product( $_GET['filepath'] );\n }\n break;\n\n default:\n break;\n }\n\n if ( $response == true ) {\n $status = 'true';\n }\n \n $redirect_url = \\UsabilityDynamics\\Utility::current_url( array( 'type' => urlencode( $type ), 'status' => urlencode( $status ) ), array( 'action', 'filepath', '_wpnonce' ) );\n wp_safe_redirect( $redirect_url );\n exit;\n }", "function trackingno($carrier, $trno, $shipmentMethod){\n\t$carrier1=$carrier;\t\n\t$carrier=strtolower($carrier);\n\t\n\t//$trno=strtolower($trno);\n\t$shipmentMethod1=$shipmentMethod; \n\t$shipmentMethod=strtolower($shipmentMethod);\n\t\n\t$carrierdata=\" (Not Specified)\";\n\t$carrierRG=\"Not Specified\";\n\t\n\t\tif($carrier !=\"\" ){$carrierdata=\" (\".$carrier1.\")\";}\n\tif($carrier=='ups (usa)' || $carrier=='ups' || $carrier=='ups (us)'){\n\t\t\n\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t}\n\t\telseif($carrier==\"\" && substr($shipmentMethod, 0, 3) === 'ups'){\n\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='fedex (usa)' || $carrier=='fedex' || $carrier=='fedex (us)'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t}\n\t\telseif($carrier=='' && substr($shipmentMethod, 0, 3) =='fedex'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='us postal service'){\n\t\t\t$clink=\"https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=\";\n\t\t}\n\t\t\n\t\telseif($carrier=='miscellaneous' || $carrier=='miscellaneous (us)'){$clink=\"\";}\n\t\telse{$clink=\"\";}\n\t\t\n\t\tif($clink == \"\"){\n\t\t\tif($carrier1!=\"\"){$carrierRG=$carrier1;}\n\t\t\tif (preg_match(\"/\\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\\dT]\\d\\d\\d ?\\d\\d\\d\\d ?\\d\\d\\d)\\b/\", $trno)) {\n\t\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\t\n\t\t\telseif (preg_match(\"/(\\b96\\d{20}\\b)|(\\b\\d{15}\\b)|(\\b\\d{12}\\b)/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/\\b((98\\d\\d\\d\\d\\d?\\d\\d\\d\\d|98\\d\\d) ?\\d\\d\\d\\d ?\\d\\d\\d\\d( ?\\d\\d\\d)?)\\b/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/^[0-9]{15}$/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($clink != \"\"){\n\t\t\t$trdata=\"<a href='\".$clink.\"\".$trno.\"' target='_blank'>\".$trno.\"</a>\".$carrierdata.\", \";\n\t\t}\n\t\telse{\n\t\t\t$trdata=$trno.\"\".$carrierdata.\", \";\n\t\t\t}\n\t\tif($trno==\"\"){$trdata=\"\";}\n\t\treturn $trdata;\n\t}", "protected function get_request(){\n\t\treturn \"value_cashflows\";\n\t}", "public function getDeliveryMode()\n {\n }", "abstract function can_use_premium_code();", "public function normalAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function getProduct() {\n\t\t// if this is just a model made on our end, we might not the serialized product yet\n\t\t// alternatively: newer BillForward may omit serialized product and necessitate a fetch\n\t\tif (!$this->product) {\n\t\t\tif (!$this->productID) {\n\t\t\t\tthrow new Bf_PreconditionFailedException(\"This Bf_ProductRatePlan has neither a 'product' specified, nor a 'productID' by which to obtain said product.\");\n\t\t\t}\n\t\t\t$this->product = Bf_Product::getByID($this->productID);\n\t\t}\n\t\treturn $this->product;\n\t}", "public function request(){\n return \\Gaia\\ShortCircuit::request();\n }", "function main( $isFuturePay ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : handling WorldPay payment response IPN\");\r\n\r\n $objects = $ids = $input = array( );\r\n\r\n $component = self::retrieve('MC_module','String','POST',true);\r\n $input[\"component\"] = $component;\r\n $contact = self::retrieve('MC_contact_id','Integer','POST',true);\r\n\r\n $this->getInput($input,$ids);\r\n\r\n if (!$isFuturePay) {\r\n // not a future payment notication but may be a future payment\r\n // agreement being made...\r\n\r\n // get ids\r\n $ids[\"contact\"] = self::retrieve('MC_contact_id','String','POST',true);\r\n $ids[\"contribution\"] = self::retrieve('MC_contribution_id','String','POST',true);\r\n $ids[\"thankyoupage\"] = self::retrieve('MC_civi_thankyou_url','String','POST',true);\r\n $ids[\"cancelpage\"] = self::retrieve('MC_civi_cancel_url','String','POST',true);\r\n if ($component=='event') {\r\n $ids[\"event\"] = self::retrieve('MC_event_id','String','POST',true);\r\n $ids[\"participant\"] = self::retrieve('MC_participant_id','String','POST',true);\r\n }\r\n else {\r\n // contribution optional id's\r\n $ids['membership'] = self::retrieve('MC_membership_id','String','POST',false);\r\n $ids['contributionRecur'] = self::retrieve( 'MC_contribution_recur_id', 'Integer', 'GET', false );\r\n $ids['contributionPage'] = self::retrieve( 'MC_contribution_page_id' , 'Integer', 'GET', false );\r\n }\r\n\r\n if (is_numeric($input[\"futurePayId\"])) {\r\n // this is a futurepay agreement being made \r\n // so store the ids and do nothing more here\r\n // since no money has actually been transferred yet\r\n // ...watch futurepay repsonse for such transfers\r\n self::storeFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n return;\r\n }\r\n }\r\n else {\r\n if (!is_numeric($input[\"futurePayId\"])) {\r\n CRM_Core_Error::debug_log_message(\"futurePayId is missing for recurring payment.\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : futurePayId is missing for recurring payment. input=\".print_r($input,true));\r\n exit();\r\n }\r\n self::retrieveFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n if (!$ids) {\r\n CRM_Core_Error::debug_log_message(\"Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n exit();\r\n }\r\n }\r\n\r\n $paymentProcessorID = self::retrieve('processor_id', 'Integer', 'POST', FALSE);\r\n if (empty($paymentProcessorID)) {\r\n $processorParams = array(\r\n 'user_name' => self::retrieve('installation', 'String', 'POST', FALSE),\r\n 'payment_processor_type_id' => CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', 'WorldPay', 'id', 'name'),\r\n 'is_test' => empty($input['is_test']) ? 0 : 1,\r\n );\r\n\r\n $processorInfo = array();\r\n if (!CRM_Financial_BAO_PaymentProcessor::retrieve($processorParams, $processorInfo)) {\r\n return FALSE;\r\n }\r\n $paymentProcessorID = $processorInfo['id'];\r\n }\r\n\r\n // validateData also loads the obects\r\n if (!$this->validateData($input,$ids,$objects,TRUE,$paymentProcessorID)) {\r\n error_log(__FILE__.\":\".__LINE__.\": validate data failed, input=\".print_r($input,true).\" ids=\".print_r($ids,true));\r\n return false;\r\n }\r\n\r\n self::$_paymentProcessor =& $objects['paymentProcessor'];\r\n if ($isFuturePay) {\r\n // future pay payment notification\r\n return $this->handleFuturepayPayment($input,$ids,$objects);\r\n }\r\n else if (is_numeric($input[\"futurePayId\"])) {\r\n // future pay payment initial agreement set up\r\n // appears like a single payment but no money changes hands\r\n return $this->handleFuturepayAgreement($input,$ids,$objects);\r\n }\r\n else {\r\n // single payment\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : now processing single payment\");\r\n return $this->handleSinglePayment($input,$ids,$objects);\r\n }\r\n }", "public function code() {\n Authentication::guard();\n\n $_POST = json_decode(file_get_contents('php://input'), true);\n\n if(!Csrf::check('global_token')) {\n die();\n }\n\n if(empty($_POST)) {\n die();\n }\n\n if(!settings()->payment->is_enabled || !settings()->payment->codes_is_enabled) {\n die();\n }\n\n /* Make sure the discount code exists */\n $code = db()->where('code', $_POST['code'])->where('type', 'redeemable')->where('redeemed < quantity')->getOne('codes');\n\n if(!$code) {\n Response::json(language()->account_plan->error_message->code_invalid, 'error');\n }\n\n /* Make sure the plan id exists and get details about it */\n $plan = (new Plan())->get_plan_by_id($code->plan_id);\n\n if(!$plan) {\n Response::json(language()->account_plan->error_message->code_invalid, 'error');\n }\n\n /* Make sure the code was not used previously */\n if(db()->where('user_id', $this->user->user_id)->where('code_id', $code->code_id)->getOne('redeemed_codes', ['id'])) {\n Response::json(language()->account_plan->error_message->code_used, 'error');\n }\n\n Response::json(sprintf(language()->account_plan->success_message->code, '<strong>' . $plan->name . '</strong>', '<strong>' . $code->days . '</strong>'), 'success', ['discount' => $code->discount]);\n }", "public function getDeliverySuggestionCode()\n {\n return $this->_deliverySuggestionCode;\n }", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "private function getCodigoPresupuestarioApuestaLicita()\r\n\t\t{\r\n\t\t\t$codigoPresupuesto['codigo'] = '301021100';\r\n\t\t\treturn $codigo = self::getCodigoPresupuestarioByCodigo($codigoPresupuesto['codigo']);\r\n\t\t}", "public function productScanning(){\n $user = $this->auth();\n if(empty($this->auth())){\n Utils::response(['status'=>false,'message'=>'Forbidden access.'],403);\n }\n $data = $this->getInput();\n if(($this->input->method() != 'post') || empty($data)){ \n Utils::response(['status'=>false,'message'=>'Bad request.'],400);\n }\n $validate = [\n ['field' =>'bar_code','label'=>'Barcode','rules' => 'required' ],\n\t\t\t['field' =>'scan_city','label'=>'Scan City','rules' => 'trim' ],\n\t\t\t['field' =>'pin_code','label'=>'Scan PIN Code','rules' => 'trim' ],\n ['field' =>'latitude','label'=>'Latitude','rules' => 'trim'],\n ['field' =>'longitude','label'=>'Longitude','rules' => 'trim' ],\n\t\t\t//['field' =>'registration_address','label'=>'Registration Address','rules' => 'trim|required' ],\n ];\n $errors = $this->ScannedproductsModel->validate($data,$validate);\n if(is_array($errors)){\n Utils::response(['status'=>false,'message'=>'Validation errorss.','errors'=>$errors]);\n }\n $result = $this->ScannedproductsModel->findProduct($data['bar_code']);\n $bar_code_data = $data['bar_code'];\n\t\t$bar_code2_data = $data['bar_code'];\n\t\t$product_id = $result->id;\n\t\t$consumerId = $user['id'];\n\t\t$data['ps_ip_address'] = $this->input->ip_address();\n\t\t\n\t\t// function to get product registration status\n $isRegistered = $this->ScannedproductsModel->isProductRegistered($bar_code_data, $bar_code2_data); \n\t\n $isLoyaltyForVideoFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForVideoFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForAudioFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForAudioFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForImageFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForImageFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForPDFFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForPDFFBQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdPDFFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdPDFFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdImageFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdImageFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$isLoyaltyForProductSurveyVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyPDFFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyPDFFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyImageFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyImageFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$isLoyaltyForProductDemoVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductDemoVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductDemoAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductDemoAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$mnv25_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 25)->get()->row();\n\t\t$mnvtext25 = $mnv25_result->message_notification_value;\n\t\t$mnv26_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 26)->get()->row();\n\t\t$mnvtext26 = $mnv26_result->message_notification_value;\n\t\t$mnv27_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 27)->get()->row();\n\t\t$mnvtext27 = $mnv27_result->message_notification_value;\n\t\t$mnv28_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 28)->get()->row();\n\t\t$mnvtext28 = $mnv28_result->message_notification_value;\n\t\t$mnv29_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 29)->get()->row();\n\t\t$mnvtext29 = $mnv29_result->message_notification_value;\n\t\t$mnv30_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 30)->get()->row();\n\t\t$mnvtext30 = $mnv30_result->message_notification_value;\n \n if(empty($result)){\n $data['user_id'] = $user['id'];\n $data['created'] = date('Y-m-d H:i:s');\n $this->db->insert('scanned_product_logs', $data);\n\t\t$mnv24_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 24)->get()->row();\n\t\t$mnvtext24 = $mnv24_result->message_notification_value;\n //$this->response(['status'=>false,'message'=>'This product and barcode is not supported by TRUSTAT.'],200);\n\t\t\t$this->response(['status'=>false,'message'=>$mnvtext24],200);\n }\n\t\tif(!empty($result->product_thumb_images)){\n $result->product_thumb_images = Utils::setFileUrl($result->product_thumb_images);\n }\n\t\t\n if(!empty($result->product_image)){\n $result->product_image = Utils::setFileUrl($result->product_image);\n }\n\t\tif(!empty($result->product_code_print_bg_images)){\n $result->product_code_print_bg_images = Utils::setFileUrl($result->product_code_print_bg_images);\n }\n if(!empty($result->product_video)){\n $result->product_video = Utils::setFileUrl($result->product_video);\n }\n if(!empty($result->product_audio)){\n $result->product_audio = Utils::setFileUrl($result->product_audio);\n }\n if(!empty($result->product_pdf)){\n $result->product_pdf = Utils::setFileUrl($result->product_pdf);\n }\n\t\tif(!empty($result->product_demo_video)){\n $result->product_demo_video = Utils::setFileUrl($result->product_demo_video);\n }\n\t\tif(!empty($result->product_demo_audio)){\n $result->product_demo_audio = Utils::setFileUrl($result->product_demo_audio);\n }\n\t\tif(!empty($result->product_user_manual)){\n $result->product_user_manual = Utils::setFileUrl($result->product_user_manual);\n }\n\t\t$result->product_registration_status = $isRegistered;\n\n\t\t$result->isLoyaltyForVideoFBQuesGiven = $isLoyaltyForVideoFBQuesGiven;\n\t\t$result->isLoyaltyForAudioFBQuesGiven = $isLoyaltyForAudioFBQuesGiven;\n\t\t$result->isLoyaltyForImageFBQuesGiven = $isLoyaltyForImageFBQuesGiven;\n\t\t$result->isLoyaltyForPDFFBQuesGiven = $isLoyaltyForPDFFBQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdVideoFeedbackQuesGiven = $isLoyaltyForProductPushedAdVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdAudioFeedbackQuesGiven = $isLoyaltyForProductPushedAdAudioFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdPDFFeedbackQuesGiven = $isLoyaltyForProductPushedAdPDFFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdImageFeedbackQuesGiven = $isLoyaltyForProductPushedAdImageFeedbackQuesGiven;\n\t\t\n\t\t$result->isLoyaltyForProductSurveyVideoFeedbackQuesGiven = $isLoyaltyForProductSurveyVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyAudioFeedbackQuesGiven = $isLoyaltyForProductSurveyAudioFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyPDFFeedbackQuesGiven = $isLoyaltyForProductSurveyPDFFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyImageFeedbackQuesGiven = $isLoyaltyForProductSurveyImageFeedbackQuesGiven;\n\t\t\n\t\t$result->isLoyaltyForProductDemoVideoFeedbackQuesGiven = $isLoyaltyForProductDemoVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductDemoAudioFeedbackQuesGiven = $isLoyaltyForProductDemoAudioFeedbackQuesGiven;\n\t\t\n\t\t\n\n\t\t$result->scanned_code = $data['bar_code']; \n\t\tif($data['bar_code'] == ($result->barcode_qr_code_no)) {\n\t\t\t\n\t\t$result->activation_level = $result->pack_level; \n\t\t\n\t\t$activation_packaging_level = $result->pack_level; \n\t\t\n\t\t\n\t\t} else {\n\t\t\t\n\t\t$result->activation_level = $result->pack_level2; \n\t\t$activation_packaging_level = $result->pack_level2;\n\t\t\t\n\t\t} \n $data['consumer_id'] = $user['id'];\n\t\t\n $data['product_id'] = $result->id;\n\t\t$data['customer_id'] = $result->created_by;\n $data['code_scan_date'] = date(\"Y-m-d H:i:s\");\n\t\t$data['del_by_cs'] = 0;\n //$result->pack_level = $result->pack_level; registration_status\n\t\t\n\t\t$consumer_id = $data['consumer_id'];\n\t\t$customer_id = $data['customer_id'];\n\t\t$product_id = $data['product_id'];\n\t\t\n\t\t$isConsAlreadyLinkedtoCust = $this->ScannedproductsModel->isConsAlreadyLinkedtoCust($consumer_id, $customer_id);\t\t\n\t\t\n\t\t$mnv1_result62 = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 62)->get()->row();\n\t\t$message_notification_value62 = $mnv1_result62->message_notification_value;\n\t\t\n if($this->db->insert($this->ScannedproductsModel->table, $data)){\t\n\t\t\n\t\tif($isConsAlreadyLinkedtoCust==false){\n\t\t$data['registration_status'] = \"Registered\";\n\t\t$this->db->insert('consumer_customer_link', $data);\n\t\t}\n\t\t\n\t\t\tif($activation_packaging_level==1){\n\t\t\t// Consumer Activity Log Data insert start\n\t\t\t$CALdata['date_time'] = date('Y-m-d H:i:s'); \n\t\t\t$CALdata['consumer_name'] = get_consumer_name_by_consumer_id($consumerId);\n\t\t\t$CALdata['consumer_id'] = $consumerId; \n\t\t\t$CALdata['consumer_mobile'] = getConsumerMobileNumberById($consumerId); \n\t\t\t$CALdata['customer_name'] = getUserNameById($customer_id); \n\t\t\t$CALdata['customer_id'] = $customer_id; \n\t\t\t$CALdata['unique_customer_code'] = getCustomerCodeById($customer_id); \n\t\t\t$CALdata['product_name'] = get_products_name_by_id($product_id); \n\t\t\t$CALdata['product_id'] = $product_id; \n\t\t\t$CALdata['product_sku'] = get_product_sku_by_id($product_id); \n\t\t\t$CALdata['product_code'] = $data['bar_code']; \n\t\t\t$CALdata['gloc_latitude'] = $data['latitude'];\n\t\t\t$CALdata['gloc_longitude'] = $data['longitude'];\n\t\t\t$CALdata['gloc_city'] = $data['scan_city'];\n\t\t\t$CALdata['gloc_pin_code'] = $data['pin_code'];\n\t\t\t$CALdata['consumer_activity_type'] = $message_notification_value62;\n\t\t\t$CALdata['loyalty_rewards_points'] = 0;\n\t\t\t$CALdata['loyalty_rewards_type'] = getCustomerLoyaltyTypeById($customer_id);\n\t\t\t\n\t\t\t$this->db->insert('consumer_activity_log_table', $CALdata);\n\t\t\t// Consumer Log Data insert end\n\t\t\t}\n\t\t\t$updateDataCityScan = array(\n\t\t\t\t\t 'city_last_scan' => $data['scan_city']\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('consumers', $updateDataCityScan, array('id' => $consumerId));\n\t\t\t\t\t\n\t\t\t//$this->db->insert('consumer_customer_link', $data);\n\t\t\t\n\t\t\t\n\t\t\t// Super Loyalty start\t\t\n\t\t\t// Insert number if Scans \n\t\t\t//check if the product code is already registerd\n\t\t\tif($activation_packaging_level==1){\n\t\t$ifSuperLoyaltyAlreadyGivenConsumerProduct = $this->ScannedproductsModel->ifSuperLoyaltyAlreadyGivenConsumerProduct($product_id, $consumerId); \n\t\t\t}else{\n\t\t$ifSuperLoyaltyAlreadyGivenConsumerProduct = \"NotGiven\";\n\t\t\t}\n\t\t$isSuperLoyaltyYes\t= SuperLoyaltyStatusonProductByProductID($product_id);\n\t\tif($isSuperLoyaltyYes==\"Yes\"){\n\t\t\tif($isRegistered==false){\n\t\t\t\tif($ifSuperLoyaltyAlreadyGivenConsumerProduct==\"NotGiven\"){\n\t\t$resultC = $this->db->select('number_of_scans')->from('consumers')->where('id', $consumerId)->get()->row();\n\t\t$number_of_scansBD = $resultC->number_of_scans;\n\t\t$number_of_scansAD = $number_of_scansBD + 1;\n\t\t$updateData = array(\n\t\t\t\t\t 'number_of_scans' => $number_of_scansAD\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('consumers', $updateData, array('id' => $consumerId));\n\t\t\t\t\t\n\t\t$resultP = $this->db->select('*')->from('products')->where('id', $product_id)->get()->row();\n\t\t$include_the_product_in_super_loyalty = $resultP->include_the_product_in_super_loyalty;\n\t\t$number_of_scans_for_super_loyalty = $resultP->number_of_scans_for_super_loyalty;\n\t\t$number_of_loyalty_points_for_super_loyalty = $resultP->number_of_loyalty_points_for_super_loyalty;\t\n\t\t$number_of_scans_for_productBD = $resultP->number_of_scans_for_product;\n\t\t\n\t\t$number_of_scans_for_productAD = $number_of_scans_for_productBD + 1;\n\t\t$updateDataP = array(\n\t\t\t\t\t 'number_of_scans_for_product' => $number_of_scans_for_productAD\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('products', $updateDataP, array('id' => $product_id));\n\t\t\n\t$remainder = $number_of_scans_for_productAD%$number_of_scans_for_super_loyalty;\n\t\tif(($remainder ==0)&&($number_of_loyalty_points_for_super_loyalty!=0)) {\t\t\n\t\t//$Product_id = getProductIDbyProductCode($data['bar_code']);\n\t\t\t$customerId = get_customer_id_by_product_id($product_id);\t\t\t\n\t\t\t\t$purchased_points = total_approved_points2($customerId);\n\t\t\t\t$consumed_points = get_total_consumed_points($customerId);\n\t\t\t\t$customer_loyalty_type = get_customer_loyalty_type_by_customer_id($customerId);\n\t\t\t\t$product_name = get_products_name_by_id($product_id);\n\t\t\t\t$consumer_name = getConsumerNameById($consumerId);\t\n\t\t\t\t$product_brand_name = get_products_brand_name_by_id($product_id);\n\t\t\t\t$customer_id = get_customer_id_by_product_id($product_id);\n\t\t\t\t\n\t\t\t\t$customer_name = getUserFullNameById($customerId);\t\t\n\t\t\t\t$product_name = get_products_name_by_id($product_id);\n\t\t\t\t$consumer_name = getConsumerNameById($consumerId);\n\t\t\n\t\t\t\t\n\t\t\t\t$LPconsumed_points = $consumed_points+$number_of_loyalty_points_for_super_loyalty;\n\t\t\t\t//echo \"<pre>\";print_r($LPconsumed_points); die;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($purchased_points > ($consumed_points+$number_of_loyalty_points_for_super_loyalty)){\n $message = 'Thank You for Product Registration. '. $number_of_loyalty_points_for_super_loyalty .' loyalty points will be added to your TRUSTAT loyalty account';\n\t\t\t\t//echo \"<pre>Jyada\";print_r($LPconsumed_points); die;\n\t\t\t\t}else{\n\t\t\t\t\t$message = 'Thank You for Scan!';\n\t\t\t\t\t//echo \"<pre>kam\";print_r($LPconsumed_points); die;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t // $transactionType = 'product-registration-without-warranty'; \n\t\t\t\t$transactionType = \"Super Loyalty\";\n\t\t\t\t//$mnv61_result = $this->db->select('message_notification_value,message_notification_value_part2')->from('message_notification_master')->where('id', 61)->get()->row();\n\t\t\t\t//$mnvtext61 = $mnv61_result->message_notification_value;\n\t\t\t\t$mnvtext61 = getAPPPassbookOnScreenDisplayMessageSLByProductId($product_id);\n\t\t\t\t//$mnvtext61_p2 = $mnv61_result->message_notification_value_part2;\n\t\t\t //$transactionTypeName = $mnvtext61 . $number_of_scans_for_productAD . $mnvtext52_p2;\n\t\t\t $transactionTypeName = $mnvtext61;\n\t\t\t\t//$userId = $user['id'];\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($purchased_points > ($consumed_points+$number_of_loyalty_points_for_super_loyalty)){\n\t\t\t\t$this->Productmodel->saveSuperLoylty($transactionType, $consumerId, $product_id, ['verification_date' => date(\"Y-m-d H:i:s\"), 'consumer_id' =>$consumerId, 'consumer_name' => $consumer_name, 'brand_name' => $product_brand_name, 'customer_name' => $customer_name, 'product_name' => $product_name, 'product_id' => $product_id, 'product_code' => $data['bar_code'],'customer_loyalty_type' => $customer_loyalty_type], $customer_id, $customer_loyalty_type, $number_of_loyalty_points_for_super_loyalty);\n\t\t\t\n\t\t\t\t$this->Productmodel->saveConsumerPassbookSuperLoyalty($transactionType, ['verification_date' => date(\"Y-m-d H:i:s\"), 'brand_name' => $product_brand_name, 'customer_name' => $customer_name, 'product_name' => $product_name, 'product_id' => $product_id, 'product_code' => $data['bar_code'],'customer_loyalty_type' => $customer_loyalty_type], $customer_id, $product_id, $consumerId, $transactionTypeName, 'Loyalty', $customer_loyalty_type, $number_of_loyalty_points_for_super_loyalty);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$fb_token = getConsumerFb_TokenById($consumerId);\n // $this->ConsumerModel->sendFCM('Thank you for Product Registration, Please check the details in \"my purchase list\" in TRUSTAT App.', $fb_token);\n\t\t\t //$mnv52_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 52)->get()->row();\n\t\t\t //$mnvtext52 = $mnv52_result->message_notification_value;\n\t\t\t $mnvtext52 = getAPPNotificationMessageforSuperLoyaltyByProductId($product_id);\n\t\t\t $this->ConsumerModel->sendFCM($mnvtext52, $fb_token);\n\t\t\t\t$NTFdata['consumer_id'] = $consumerId; \n\t\t\t\t$NTFdata['title'] = \"TRUSTAT Super Loyalty\";\n\t\t\t\t$NTFdata['body'] = $mnvtext52; \n\t\t\t\t$NTFdata['timestamp'] = date(\"Y-m-d H:i:s\",time()); \n\t\t\t\t$NTFdata['status'] = 0; \n\t\t\t\n\t\t\t$this->db->insert('list_notifications_table', $NTFdata);\n\t\t\t\n\t\t\t$TRNNC_result = $this->db->select('billin_particular_name, billin_particular_slug')->from('customer_billing_particular_master')->where('cbpm_id', 10)->get()->row();\n\t\t\t$TRNNC_billin_particular_name = $TRNNC_result->billin_particular_name;\n\t\t\t$TRNNC_billin_particular_slug = $TRNNC_result->billin_particular_slug;\n\t\t\t\n\t\t\t$TRNNCData['customer_id'] = $customer_id;\n\t\t\t$TRNNCData['consumer_id'] = $consumerId;\n\t\t\t$TRNNCData['billing_particular_name'] = $TRNNC_billin_particular_name.' TRUSTAT Super Loyalty';\t\t\n\t\t\t$TRNNCData['billing_particular_slug'] = $TRNNC_billin_particular_slug.'_TRUSTAT_Super_Loyalty';\n\t\t\t$TRNNCData['trans_quantity'] = 1; \n\t\t\t$TRNNCData['trans_date_time'] = date(\"Y-m-d H:i:s\",time()); \n\t\t\t$TRNNCData['trans_status'] = 1; \t\t\t\n\t\t\t$this->db->insert('tr_customer_bill_book', $TRNNCData);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Super Loyalty end\t\n\t\t\n\t\t\t\n\t\t\tif($result->barcode_qr_code_no == $data['bar_code']) {\n if( $result->pack_level == 0 ){\n if( $isRegistered ){\n\t\t\t\t\t\n\t\t\t\t\tif( $isRegistered == completed ){\n\t\t\t\t\t\n //$result->message1 = 'This product is already registered, please contact your retailer/manufacturer for further details.';\n\t\t\t\t\t$result->message1 = $mnvtext25;\n }else {\n\t\t\t\t\t//$result->message1 = 'This product registration is already under process. Outcome of product registration will be notified to TRUSTAT member, who had initiated the registration process.';\n\t\t\t\t\t$result->message1 = $mnvtext26;\n\t\t\t\t}\n\t\t\t\t}else{\n //$result->message1 = 'Thank You for initiating Product Registration, Click Ok to scan and upload valid invoice for this product purchase and activate the warranty.';\n\t\t\t\t\t$result->message1 = $mnvtext27;\n }\n }elseif( $result->pack_level == 1 ){\n //$result->message1 = 'Scanned product details for lavel '.$result->pack_level.'.';\n\t\t\t\t//$result->message1 = 'The barcode you have scanned is on the product packing, please scan the barcode on the product for registration.';\n\t\t\t\t$result->message1 = $mnvtext29;\n }elseif($result->pack_level > 1){\n //$result->message1 = 'This is not a product barcode for consumer, Please scan barcode placed on consumer pack';\n\t\t\t\t$result->message1 = $mnvtext30;\n }\n\t\t\t} else {\n\t\t\t\t\n\t\t\tif( $result->pack_level2 == 0 ){\n if( $isRegistered ){\n\t\t\t\t\t\n\t\t\t\t\tif( $isRegistered == completed ){\n\t\t\t\t\t\n //$result->message1 = 'This product is already registered, please contact your retailer/manufacturer for further details';\n\t\t\t\t\t$result->message1 = $mnvtext25;\n }else {\n\t\t\t\t\t//$result->message1 = 'This product registration is already under process. Outcome of product registration will be notified to TRUSTAT member, who had initiated the registration process';\n\t\t\t\t\t$result->message1 = $mnvtext26;\n\t\t\t\t}\n\t\t\t\t}else{\n // $result->message1 = 'Thank You for initiating Product Registration, Click Ok to scan and upload valid invoice for this product purchase and activate the warranty';\n\t\t\t\t\t $result->message1 = $mnvtext27;\n }\n }elseif( $result->pack_level2 == 1 ){\n //$result->message1 = 'Scanned product details for lavel '.$result->pack_level.'.';\n\t\t\t\t//$result->message1 = 'The barcode you have scanned is on the product packing, please scan the barcode on the product for registration.';\n\t\t\t\t$result->message1 = $mnvtext29;\n }elseif($result->pack_level2 > 1){\n //$result->message1 = 'This is not a product barcode for consumer, Please scan barcode placed on consumer pack';\n\t\t\t\t$result->message1 = $mnvtext30;\n }\t\n\t\t\t}\n\t\t\t\n //$this->response(['status'=>true,'message'=>'Scanned product details for lavel '.$result->pack_level.'.','data'=>$result]);\n\t\t$mnv31_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 31)->get()->row();\n\t\t$mnvtext31 = $mnv31_result->message_notification_value;\n\t\t\t//$this->response(['status'=>true,'message'=>'Thanks for scanning the product.','data'=>$result]);\n\t\t\t$this->response(['status'=>true,'message'=>$mnvtext31,'data'=>$result]);\n\t\t\t\n }else{\n\t\t$mnv32_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 32)->get()->row();\n\t\t$mnvtext32 = $mnv32_result->message_notification_value;\t\n // $this->response(['status'=>false,'message'=>'System failed to scan the record.'],200); \n\t\t\t$this->response(['status'=>false,'message'=>$mnvtext32],200); \n }\n }", "function _getDmstcQuote($pkg, $method = '') {\r\n\t\tglobal $order;\r\n\t\tif (tep_not_null($method) && in_array($method, $this->dmstc_available)) {\r\n\t\t\t$request_types = array($method);\r\n\t\t} else {\r\n\t\t\t$request_types = $this->dmstc_available;\r\n\t\t}\r\n\t\t$shipping_weight = ($pkg['item_weight'] < 0.0625 ? 0.0625 : $pkg['item_weight']);\r\n\t\t$shipping_pounds = floor($shipping_weight);\r\n\t\t$shipping_ounces = ceil((16 * ($shipping_weight - $shipping_pounds)) * 100) / 100; // rounded to two decimal digits\r\n\t\t$ounces = $shipping_weight * 16.0;\r\n\t\t$pkgvalue = $pkg['item_price'];\r\n\t\tif ($pkgvalue > MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX) $pkgvalue = MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX;\r\n\t\tif ($pkgvalue <= 0) $pkgvalue = 0.01;\r\n\t\t$nonuspsinsurancecost = 0;\r\n\t\tif (MODULE_SHIPPING_USPS_NON_USPS_INSURE == 'True') {\r\n\t\t\tif ($pkg['item_price'] <= 50) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS1;\r\n\t\t\t} else if ($pkg['item_price'] <= 100) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS2;\r\n\t\t\t}\telse if ($pkg['item_price'] <= 200) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS3;\r\n\t\t\t} else if ($pkg['item_price'] <= 300) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4;\r\n\t\t\t} else {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4 + ((ceil($pkg['item_price']/100) - 3) * MODULE_SHIPPING_USPS_INS5);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sservs = array(); // any special services to request\r\n\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $sservs = array(1, 11); //request insurance, both regular & express mail\r\n\t\tif ((MODULE_SHIPPING_USPS_DMST_SIG_CONF == 'True') && ($order->info['subtotal'] >= MODULE_SHIPPING_USPS_SIG_THRESH)) {\r\n\t\t\t$sservs[] = 15;\r\n\t\t} elseif (MODULE_SHIPPING_USPS_DMST_DEL_CONF == 'True') {\r\n\t\t\t$sservs[] = 13;\r\n\t\t}\r\n\t\t$sservice = '';\r\n\t\tif (!empty($sservs)) {\r\n\t\t\tforeach ($sservs as $id) $sservice .= '<SpecialService>' . $id . '</SpecialService>';\r\n\t\t\t$sservice = '<SpecialServices>' . $sservice . '</SpecialServices>';\r\n\t\t}\r\n\t\t$box = array($pkg['item_length'], $pkg['item_width'], $pkg['item_height']);\r\n\t\trsort($box); // put package size in large to small order for purposes of checking dimensions\r\n\t\tlist($length, $width, $height) = $box;\r\n\t\t$id = 0;\r\n\t\t$quotes = $request_group = array();\r\n\t\t$group_count = 1;\r\n\t\t$type_count = 0;\r\n\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\tforeach ($request_types as $service) { // break the requested shipping methods into groups\r\n\t\t\tif (strpos($service, 'First') !== false) { // if first class mail service check if will fit type\r\n\t\t\t\t$fcmt = $this->first_class_to_mail_type[$service];\r\n\t\t\t\tif (($fcmt == 'LETTER') && (($length > $this->first_class_letter['length']) || ($width > $this->first_class_letter['width']) || ($height > $this->first_class_letter['height']) || ($ounces > $this->first_class_letter['ounces']))) continue; // don't check letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'FLAT') && (($length > $this->first_class_large_letter['length']) || ($width > $this->first_class_large_letter['width']) || ($height > $this->first_class_large_letter['height']) || ($ounces > $this->first_class_large_letter['ounces']))) continue; // don't check large letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'POSTCARD') && (($length > 6) || ($width > 4.25) || ($height > 0.016) || ($ounces > 3.5))) continue; // don't check postcard type if package doesn't fit\r\n\t\t\t\tif ($ounces > $this->first_class_parcel_max_ounces) continue; // don't check First Class if too heavy\r\n\t\t\t}\r\n\t\t\t$cont = $this->type_to_container[$service]; // begin checking for packages larger than USPS containers\r\n\t\t\t// if this service type specifies a container and this package won't fit then skip this service\r\n\t\t\tif (strpos($cont, 'Envelope') !== false) { // if service container is envelope\r\n\t\t\t\tif ($height > 1) continue; // anything thicker than one inch won't fit an envelope\r\n\t\t\t\tif ((strpos($cont, 'SM') !== false) && (($length > 10) || ($width > 6))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Window') !== false) && (($length > 10) || ($width > 5))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Gift') !== false) && (($length > 10) || ($width > 7))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Legal') !== false) && (($length > 15) || ($width > 9.5))) continue;\r\n\t\t\t\tif (($length > 12.5) || ($width > 9.5)) continue; // other envelopes\r\n\t\t\t}\r\n\t\t\tif (($cont == 'SM Flat Rate Box') && (($length > 8.625) || ($width > 5.375) || ($height > 1.625))) continue;\r\n\t\t\tif (($cont == 'MD Flat Rate Box') || ($cont == 'Flat Rate Box')) {\r\n\t\t\t\tif ($length > 13.625) continue; // too big for longest medium box\r\n\t\t\t\tif ($length > 11) { // check medium type 2 box\r\n\t\t\t\t\tif (($length > 13.625) || ($width > 11.875) || ($height > 3.375)) continue; // won't fit medium type 2 box\r\n\t\t\t\t} elseif (($length > 11) || ($width > 8.5) || ($height > 5.5)) continue; // won't fit either type medium box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'LG Flat Rate Box') && (($length > 12) || ($width > 12) || ($height > 5.5))) continue;\r\n\t\t\tif ($cont == 'Regional Rate Box A') {\r\n\t\t\t\tif ($length > 12.8125) continue; // too big for longest A box\r\n\t\t\t\tif ($length > 10) { // check A2 box\r\n\t\t\t\t\tif (($length > 12.8125) || ($width > 10.9375) || ($height > 2.375)) continue; // won't fit A2 box\r\n\t\t\t\t} elseif (($length > 10) || ($width > 7) || ($height > 4.75)) continue; // won't fit either type A box\r\n\t\t\t}\r\n\t\t\tif ($cont == 'Regional Rate Box B') {\r\n\t\t\t\tif ($length > 15.875) continue; // too big for longest B box\r\n\t\t\t\tif ($length > 12) { // check B2 box\r\n\t\t\t\t\tif (($length > 15.875) || ($width > 14.375) || ($height > 2.875)) continue; // won't fit B2 box\r\n\t\t\t\t} elseif (($length > 12) || ($width > 10.25) || ($height > 5)) continue; // won't fit either type B box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'Regional Rate Box C') && (($length > 14.75) || ($width > 11.75) || ($height > 11.5))) continue;\r\n\t\t\t// passed all size checks so build request\r\n\t\t\t$request = '<Package ID=\"'. $id . '\"><Service>' . $this->type_to_request[$service] . '</Service>';\r\n\t\t\tif (strpos($service, 'First') !== false) $request .= '<FirstClassMailType>' . $fcmt . '</FirstClassMailType>';\r\n\t\t\t$request .= '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .\r\n\t\t\t\t\t'<ZipDestination>' . $this->dest_zip . '</ZipDestination>' .\r\n\t\t\t\t\t'<Pounds>' . $shipping_pounds . '</Pounds>' .\r\n\t \t\t'<Ounces>' . $shipping_ounces . '</Ounces>';\r\n\t\t\tif ((strpos($cont, 'Rate') === false) && (max($length, $width, $height) > 12)) {\r\n\t\t\t\t$request .= '<Container>RECTANGULAR</Container><Size>LARGE</Size>' .\r\n\t\t\t\t\t\t'<Width>' . $width . '</Width>' .\r\n\t\t\t\t\t\t'<Length>' . $length . '</Length>'.\r\n\t\t\t\t\t\t'<Height>' . $height . '</Height>';\r\n\t\t\t} else {\r\n\t\t\t\t$request .= '<Container>' . $cont . '</Container><Size>REGULAR</Size>';\r\n\t\t\t}\r\n\t\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $request .= '<Value>' . number_format($pkgvalue, 2, '.', '') . '</Value>';\r\n\t\t\t$request .= $sservice;\r\n\t\t\tif ((strpos($service, 'First') !== false) || (strpos($service, 'Post') !== false)) $request .= '<Machinable>true</Machinable>';\r\n\t\t\t$request .= '</Package>';\r\n\t\t\t$id++;\r\n\t\t\t$type_count++;\r\n\t\t\tif (($type_count > 25) || (($urllength + strlen(urlencode($request))) > 2000)) { // only 25 services allowed per request or 2000 characters per url\r\n\t\t\t\t$group_count++;\r\n\t\t\t\t$type_count = 1;\r\n\t\t\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\t\t}\r\n\t\t\t$urllength += strlen(urlencode($request));\r\n\t\t\t$request_group[$group_count][$type_count] = $request;\r\n\t\t} // end foreach request type as service\r\n\t\tif (empty($request_group)) return array('error' => MODULE_SHIPPING_USPS_ERROR_NO_SERVICES);\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES .'http_client.php');\r\n\t\t} //print_r($request_group);\r\n\t\tforeach ($request_group as $service_group) {\r\n\t\t\t$request = '<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision>';\r\n\t\t\tforeach ($service_group as $service_request) {\r\n\t\t\t\t$request .= $service_request;\r\n\t\t\t}\r\n\t\t\t$request .= '</RateV4Request>';\r\n\t\t\t$request = \t'API=RateV4&XML=' . urlencode($request);\r\n\t\t\t$body = '';\r\n\t\t\t$http = new httpClient();\r\n\t\t\tif ($http->Connect('production.shippingapis.com', 80)) {\r\n\t\t\t\t$http->addHeader('Host', 'production.shippingapis.com');\r\n\t\t\t\t$http->addHeader('User-Agent', 'IntenseCart');\r\n\t\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\t\tif ($http->Get('/shippingAPI.dll?' . $request)) $body = $http->getBody();\r\n\t\t\t\t$http->Disconnect();\r\n\t\t\t} else {\r\n\t\t\t\t$body = '<Error><Number></Number><Description>' . MODULE_SHIPPING_USPS_TEXT_CONNECTION_ERROR . '</Description></Error>';\r\n\t\t\t}\r\n\t\t\t$doc = XML_unserialize($body); //print_r($doc);\r\n\t\t\tif (isset($doc['Error'])) return array('error' => $doc['Error']['Number'] . ' ' . $doc['Error']['Description']);\r\n\t\t\tif (isset($doc['RateV4Response']['Package']['Postage'])) { // single mail service response\r\n\t\t\t\t$tmp = $this->_decode_domestic_response($doc['RateV4Response']['Package']['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t} elseif (isset($doc['RateV4Response']['Package'][0])) { // multiple mailing services returned\r\n\t\t\t\tforeach ($doc['RateV4Response']['Package'] as $mailsvc) {\r\n\t\t\t\t\tif (isset($mailsvc['Postage'])) {\r\n\t\t\t\t\t\t$tmp = $this->_decode_domestic_response($mailsvc['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end foreach $request_group\r\n\t\treturn $quotes;\r\n\t}", "public function designProfit(){\n\t\treturn $this->campaigns()\n\t\t\t->join('order_detail', 'product_campaign.id', 'order_detail.campaign_id')\n\t\t\t->join('order', 'order_detail.order_id', 'order.id')\n\t\t\t->join('order_status', 'order.id', 'order_status.order_id')\n\t\t\t->where('order_status.value', 4)\n\t\t\t->sum('product_quantity') * 25000;\n\t}", "function request_shipping_label($data)\n {\n // Note you may want to associate this in some other way, like with a database ID.\n $this->PartnerTransactionID = substr(uniqid(rand(), true), 0, 10);\n\n $xml = '<LabelRequest Test=\"NO\" LabelSize=\"4X6\" LabelType=\"Default\" LabelSubtype=\"None\" ImageFormat=\"GIF\">\n\t\t\t\t\t<RequesterID>' . $this->RequesterID . '</RequesterID>\n\t\t\t\t\t<AccountID>' . $this->AccountID . '</AccountID>\n\t\t\t\t\t<PassPhrase>' . $this->PassPhrase . '</PassPhrase>\n\t\t\t\t\t<PartnerTransactionID>' . $this->PartnerTransactionID . '</PartnerTransactionID>';\n\n $xml .= '<IntegratedFormType>Form2976</IntegratedFormType>';\n\n if (!empty($data)) {\n foreach ($data as $node_key => $node_value) {\n $xml .= '<' . $node_key . '>' . $node_value . '</' . $node_key . '>';\n }\n }\n\n $xml .= '<ResponseOptions PostagePrice=\"TRUE\"/>\n\t\t\t\t</LabelRequest>';\n\n $data = array(\"labelRequestXML\" => $xml);\n\n\n\n $request = $this->client->post('/LabelService/EwsLabelService.asmx/GetPostageLabelXML', array(), $data);\n return $this->send_request($request);\n }", "public function getDeliveryMode(): int\n {\n }", "function getCartArr ($cartStr)\n{\n\t// 1 -> OK\n\t// 2 -> invalid item\n\tglobal $currency,$currfactor,$cartArr,$isAllowExpressDlvry;\n\t$returnVal = 1;\n\tif ($invSrv == \"\") { $invSrv = new Inventory(); }\n\n\t$factory = new Product_service_factory();\n\t$prod_serv = $factory->get_instance('SE', $currency);\n\n\tif(strlen($cartStr)==0) return 0;\n\telse\n\t{\n\t\t$strArr = explode(',', $cartStr);\n\n\t\t//$addedfreexmas=\"N\";\n\n\t\tforeach ($strArr as $thisStr)\n\t\t{\n\t\t\t$pg_source = 0;\n\t\t\tif (strlen($thisStr)!=0)\n\t\t\t{\n\t\t\t\tlist($thisPid, $thisQty,$thisPrice) = explode('-',$thisStr);\n\t\t\t\tif ($currency == 'usd')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity, IF(ISNULL(sp.mainid), 1, 0) pg_source\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\tSELECT mainid\n\t\t\t\t\t\t\tFROM supplierprodstb\n\t\t\t\t\t\t\tWHERE iscurrentUS = '1'\n\t\t\t\t\t\t\t) sp\n\t\t\t\t\t\t\tON productstb.prodid = sp.mainid\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\n\t\t\t\t$thisPid = prevention_numeric($thisPid, 1, $cartStr);\n\t\t\t\t$sql .= \"\n\t\t\t\t\t\tWHERE prodid='\" . $thisPid . \"'\n\t\t\t\t\t\tAND site='SE'\n\t\t\t\t\t\tAND active='1'\n\t\t\t\t\t\t$additional_where\n\t\t\t\t\t\t\";\n\t\t\t\t$get_price = mysql_query_escape($sql) or die(\"Error @\".__LINE__);\n\t\t\t\t//echo $isAllowExpressDlvry;\n\t\t\t\tif ($isAllowExpressDlvry)\n\t\t\t\t{\n\t\t\t\t\tif (!$invSrv->isStockAvail($thisPid, \"IM\")) {\n\t\t\t\t\t\t$isAllowExpressDlvry = false;\n\t\t\t\t\t\t//echo \"falsenow(\".$thisPid.\")<br>\";\n\t\t\t\t\t\t//echo \"2\";\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"now(\".$thisPid.\")<br>\";\n\t\t\t\t}\n\t\t\t\t//Tommy check pg_source;\n\t\t\t\tif ($currency == 'usd' || $currency == 'aud')\n\t\t\t\t{\n\t\t\t\t\t//$pg_source = mysql_result($get_price,0,'pg_source');\n\t\t\t\t\t$prod_info = $prod_serv->get_product_info($thisid);\n\n\t\t\t\t\t$pg_source = $prod_serv->is_pg_sourcing($prod_info);\n\t\t\t\t}\n\t\t\t\t// End of modification for CR090319-001\n\t\t\t\tif(mysql_num_rows($get_price)!=1 || $thisQty<1 || $pg_source)\n\t\t\t\t{\n\t\t\t\t\t$returnVal = 2;\n\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Daniel - 20090409 - also check the advertised quantity with quantity in cart\n\t\t\t\t\t$listqty = mysql_result($get_price,0,'quantity');\n\t\t\t\t\tif($listqty==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$returnVal = 2;\n\t\t\t\t\t}\n\t\t\t\t\telseif($thisQty<=$listqty)\n\t\t\t\t\t{\n\t\t\t\t\t\t//end of 20090409\n\n\t\t\t\t\t\t// get listprice starts here\n\t\t\t\t\t\tinclude_once(COMMONPATH . 'srv_list.php');\n\t\t\t\t\t \t$dto = $srv->get_product_info($thisPid);\n\t\t\t\t\t\t$price = $dto->get_price();\n\n\t\t\t\t\t\t$thisListprice = $price;\n\n\t\t\t\t\t\tif($currency == 'hkd')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = number_format($thisListprice * $dto->get_rate_hkd(),2,'.','');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// get listprice ends here\n\n\t\t\t\t\t\t//added for xmas - start\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$mycarttotal = $mycarttotal-(-($thisQty*$thisListprice));\n\n\n\n\t\t\t\t\t\tif($mycarttotal>99 && $thisPid==\"1823\" && $addedfreexmas!=\"Y\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$addedfreexmas=\"Y\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//echo \"A added - $thisPid-$thisQty-$thisListprice <br><br>\";\n\t\t\t\t\t\t//added for xmas - end\n\t\t\t\t\t\tif($thisPid==\"1823\" && ($thisPrice=='0.00'||$thisPrice=='0'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t\t//do nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// added for xmas - start\n\t\t//check if there is already a 1823-1-0.00 in the cartarr\n\t\t/*\n\t\tforeach ($cartArr as $thisxmaspromo)\n\t\t{\n\t\t\t//echo \"A\".$thisxmaspromo[0].\"-\".$thisxmaspromo[2].\"<br>\";\n\n\n\t\t\tif(($thisxmaspromo[0]==\"1823\") && ($thisxmaspromo[2]==\"0.00\"||$thisxmaspromo[2]==\"0\"))\n\t\t\t{\n\t\t\t\t$addedfreexmas = \"Y\";\n\t\t\t}\n\t\t}\n\n\n\t\tif($mycarttotal>99 && $addedfreexmas!=\"Y\")\n\t\t{\n\t\t\t$cartArr[] = array(\"1823\",\"1\",\"0.00\");\n\t\t\t$addedfreexmas=\"Y\";\n\t\t\t//echo \"B added <br><br>\";\n\t\t}\n\t\t*/\n\t\t//added for xmas - end\n\t}\n\treturn $returnVal;\n}", "public function store()\n {\n $input = Request::onlyLegacy('category_id', 'name', 'unit', 'unit_cost', 'code', 'description', 'selling_price', 'supplier_id', 'abc_additional_data', 'styles', 'sizes', 'colors', 'sub_id', 'qbd_id', 'sync_on_qbd', 'trade_id');\n $validator = Validator::make($input, FinancialProduct::getRules());\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $companyId = $this->scope->has() ? $this->scope->id() : 0;\n\t\t$category = FinancialCategory::where('company_id', $companyId)\n\t\t\t->findOrFail($input['category_id']);\n\n $validator = Validator::make($input, FinancialProduct::getRulesByCategory($category));\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n if (ine($input, 'supplier_id')) {\n if (!$this->supplierRepo->isSupplierExist($input['supplier_id'])) {\n return ApiResponse::errorNotFound(trans('response.error.not_found', ['attribute' => 'Supplier']));\n }\n\n if ($this->supplierRepo->isSystemSupplier($input['supplier_id'])) {\n return ApiResponse::errorGeneral(\"You can't add supplier product from here.\");\n }\n }\n\n $message = trans('response.success.saved', ['attribute' => 'Product']);\n\n if (ine($input, 'sub_id')) {\n $subContractor = User::whereCompanyId($this->scope->id())\n ->whereGroupId(User::GROUP_SUB_CONTRACTOR)\n ->findOrFail($input['sub_id']);\n\n $category = FinancialCategory::whereName(FinancialCategory::LABOR)\n ->whereCompanyId($this->scope->id())\n ->firstOrFail();\n\n $input['category_id'] = $category->id;\n $message = trans('response.success.saved', ['attribute' => 'Rate sheet']);\n }\n\n $name = isSetNotEmpty($input, 'name') ?: null;\n\n try {\n $product = $this->repo->saveProduct(\n $input['category_id'],\n $name,\n $input['unit'],\n $input['unit_cost'],\n $input\n );\n\n return ApiResponse::success([\n 'message' => $message,\n 'data' => $this->response->item($product, new FinancialProductsTransformer)\n ]);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "public function toString()\n {\n return \"Order Detail - Shipping method are correct\";\n }", "protected function _getRequestSerial()\n {\n return Ark()->webService()->getRequestSerial();\n }", "function dsf_protx_decline_order($order_number){\n\nglobal $VoidURL, $AbortURL, $Verify, $ProtocolVersion;\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please decline the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'invalid protx item';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please decline the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'more than one protx item found';\n\tbreak;\n }\n \t\n\n // we must have a valid transaction item if we are here.\n \n // we therefore need to check our logs to see if the item has been previously charged.\n \n $check_history_query = dsf_db_query(\"select orders_id, orders_status_id from \" . DS_DB_SHOP . \".orders_status_history where orders_id='\" . $order_number . \"' and orders_status_id='90006'\");\n \n if (dsf_db_num_rows($check_history_query)==0){\n \t$TargetURL = $AbortURL; // never charged.\n\t$TxType = 'ABORT';\n }else{\n \t$TargetURL = $VoidURL; // has been charged\n\t$TxType = 'VOID';\n }\n \n \n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$VerifyServer = $Verify;\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => $TxType,\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been voided / aborted witin protx.\n\n\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '50005');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '50005', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t\t\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases except failed\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn 'error';\n}", "public function get_firmwareRelease(): string\n {\n // $res is a string;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::FIRMWARERELEASE_INVALID;\n }\n }\n $res = $this->_firmwareRelease;\n return $res;\n }", "public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}", "public function codeRechargement()\n {\n $code_secret = $this->utils->securite_xss($_POST['codesecret']);\n $fk_agence = $this->utils->securite_xss($_POST['fkagence']);\n $frais = $this->compteModel->verifCodeRechargement($fk_agence, $code_secret);\n if ($frais == 1) echo 1;\n elseif ($frais == 0) echo 0;\n else echo -2;\n }", "public function request_product(){\n $save_data['req_product_name'] = $_REQUEST['req_product_name'];\n $save_data['req_product_person'] = $_REQUEST['req_product_person'];\n $save_data['req_product_email'] = $_REQUEST['req_product_email'];\n $save_data['req_product_mobile'] = $_REQUEST['req_product_mobile'];\n $save_data['req_product_msg'] = $_REQUEST['req_product_msg'];\n $save_data['req_product_date'] = date('d-m-Y h:i:s A');\n $req_product_id = $this->User_Model->save_data('req_product', $save_data);\n if($req_product_id){\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Product Request Saved Successfully\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Product Request Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "public function quote_request_new() {\n\t /*\t$step_one_sidebar = '<div class=\"col-md-2\">\n\t <div class=\"sidebar\">\n\t <h3>Talk TO A REPRESENTATIVE</h3>\n\t <div class=\"selection-container\">\n\t <ul>\n\t <li>1 (877) 589-2214 (US/Canada)<br/><a href=\"mailto:[email protected]\">[email protected]</a></li>\n\t </ul>\n\t \n\t </div>\n\t </div>\n\t </div>'; */ \n\t\t$step_four = 'test';\n\t //return $this->new_product_finder('quote_request', NULL, $step_four);\n\t\t$path = \\Drupal::request()->getpathInfo();\n $arg = explode('/', $path);\t\t\n $cur_page = $arg[1];\n\t\t\n\t\t$pid = $_GET['pid'];\n\t\t\n\t\t$newrfq = $fpage;\n\t\t//$newrfq = $step_four;\n\t\t\n\t\treturn array(\n\t '#theme' => 'quote_request',\n\t\t '#cur_page' => $cur_page,\n\t\t '#pid' => $pid,\n\t '#quote_related_products' => $step_four,\n\t );\n \t}", "function dsf_process_sagepay($savedorder){\n\nglobal $protx_order,$GiftAidPayment, $ApplyAVSCV2, $CAVV, $XID, $ECI, $ClientNumber, $cc_issue_number, $cc_ccv_number, $cc_owner, $cc_number, $cc_start_month, $cc_start_year, $cc_expires_month, $cc_expires_year, $cc_ctype, $protx_attempts, $currencies, $ProtocolVersion, $DefaultCurrency,$PurchaseURL,$Verify, $VendorTxCode;\n\n \t\t\t\t\t$protx_ipn_currency = MODULE_PAYMENT_PROTXCC_DEFAULT_CURRENCY;\n\n\t\t\t\t\t\t // ORDER VALUE\n\t\t\t\t\t\t $strip_values_array = array(\"£\",\",\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['deposit_value']);\n\t\t\t\t\t\t }else{ // full order value\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['total_value']);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $protx_ipn_order_amount = number_format($protx_ipn_order_amount , 2,'.','');\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t// CREATE ALL values to be passed through to Protx.\n\t\t\t\t\t\t$VendorTxCode= SAP_ORDER_PREFIX . $savedorder->info['id'] . '--' . date('YmdHis');\n\t\t\t\t\t\t$Amount= $protx_ipn_order_amount;\n\t\t\t\t\t\t$Currency= $protx_ipn_currency;\n\t\t\t\t\t\t$Description= 'Basket ID ' . $savedorder->info['id'] . ' - ' . dsf_get_ip_address();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( strtoupper($savedorder->customer['email_address']) <> strtoupper(TELEPHONE_ORDER)){\n\t\t\t\t\t\t\t$CustomerEMail= $savedorder->customer['email_address'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$CustomerEMail='';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (($savedorder->customer['telephone']) && (strlen($savedorder->customer['telephone']) >5)){\n\t\t\t\t\t\t$ContactNumber= substr($savedorder->customer['telephone'],20);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$ContactNumber= substr(dsf_lookup_mobile($savedorder->customer['id']),20);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// BILLING INFORMATION\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingSurname= substr($savedorder->customer['lastname'],0,200);\n\t\t\t\t\t\t$BillingFirstnames= substr($savedorder->customer['firstname'],0,200);\n\n\t\t\t\t\t\t if (isset($savedorder->customer['house']) && strlen($savedorder->customer['house']) > 0){\n\t\t\t\t\t\t \t $BillingAddress1 = $savedorder->customer['house'] . ', ';\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$BillingAddress1 = '';\n\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingAddress1 .= $savedorder->customer['street'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['district']) && strlen($savedorder->customer['district']) > 1){\n\t\t\t\t\t\t\t$BillingAddress2 = $savedorder->customer['district'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingCity = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['town']) && strlen($savedorder->customer['town']) > 1){\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['town'];\n\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['county'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\tif (strlen($BillingCity) < 1){\n\t\t\t\t\t\t\t$BillingCity = 'Not Supplied';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingPostCode= $savedorder->customer['postcode'];\n\n\n\t\t\t\t\t\tif ($savedorder->customer['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// DELIVERY INFO - if no delivery address has been supplied, then we need to populate the variables\n\t\t\t\t\t\t// with the same values as billing.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->delivery['postcode']) && strlen($savedorder->delivery['postcode'])>4){ // delivery address exists\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// get customers name and split it into firstname, lastname\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (strpos($savedorder->delivery['name'],' ') > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t$splits = explode(' ', trim($savedorder->delivery['name']));\n\t\t\t\t\t\t\t\t\t\t\t\t// take into account that the customer could have put mr, mrs etc.. therefore use only the last two splits\n\t\t\t\t\t\t\t\t\t\t\t\t$total_splits = sizeof($splits);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($total_splits > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = $total_splits - 2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = $total_splits -1;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $splits[$first_split];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $splits[$second_split];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t// no breaks, ensure something is there\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t if (isset($savedorder->delivery['house']) && strlen($savedorder->delivery['house']) > 0){\n\t\t\t\t\t\t\t\t\t\t $DeliveryAddress1 = $savedorder->delivery['house'] . ', ';\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = '';\n\t\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryAddress1 .= $savedorder->delivery['street'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['district']) && strlen($savedorder->delivery['district']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $savedorder->delivery['district'];\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$DeliveryCity = '';\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\tif (isset($savedorder->delivery['town']) && strlen($savedorder->delivery['town']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['town'];\n\t\t\t\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['county'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\t\t\t\tif (strlen($DeliveryCity) < 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity = 'Not Supplied';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryPostCode= $savedorder->delivery['postcode'];\n\n\t\t\t\t\t\t\t\t\tif ($savedorder->delivery['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else { // we havent got a delivery address so we need to duplicate the billing information.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliverySurname = $BillingSurname;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryFirstnames = $BillingFirstnames;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = $BillingAddress1;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $BillingAddress2;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCity = $BillingCity;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryPostCode = $BillingPostCode;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = $BillingCountry;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\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 $pagerows = (sizeof($savedorder->products));\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $prod_basket = '';\n\t\t\t\t\t\t\t\t\t $tot_basket = '';\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=($pagerows+1); $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($savedorder->products[$i]['price']){ // there are records\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// products options code added 09-may-2006\n\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (sizeof($savedorder->products[$i]['attributes']) > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attributes_exist = '1';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \" (\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($j = 0, $k = sizeof($savedorder->products[$i]['attributes']); $j < $k; $j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $products_ordered_attributes .= ' '. $savedorder->products[$i]['attributes'][$j]['option'] . '-> ' . $savedorder->products[$i]['attributes'][$j]['value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes .= \" )\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// end of products options section.\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . str_replace(':', ' ', $savedorder->products[$i]['model'] . ' - ' . $savedorder->products[$i]['name'] . ' ' . $products_ordered_attributes); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $savedorder->products[$i]['qty']; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'] * $savedorder->products[$i]['qty'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\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\t\t\tfor ($i=0, $n=sizeof($savedorder->totals)+1; $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totalclass = $savedorder->totals[$i]['class'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($savedorder->totals[$i]['class']) > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$order_total[$totalclass] = array('title' => $savedorder->totals[$i]['title'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'text' => $savedorder->totals[$i]['text'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'value' => $savedorder->totals[$i]['value']\n\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\t\t\t\t\t\t}\n\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// discount if necessary\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_discount']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_discount']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':-' . $order_total['ot_discount']['value']; // line total\n\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\n\t\t\t\t\t\t\t\t\t // delivery charge (0.00 if necessary);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_shipping']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_shipping']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $order_total['ot_shipping']['value']; // line total\n\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 if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . 'Deposit Required'; // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $savedorder->info['deposit_value']; // line total\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\n\t\t\t\t\t\t\t\t// make new basket\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $basket = $pagerows . $prod_basket . $tot_basket;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// end of basket creation details.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t// register this order so we don't create an other one if this fails.\n\t\t\n\t\t\t$protx_order = $savedorder->info['id'];\n\t\t\tdsf_session_register('protx_order');\n \t\t\t\n\t\t\t// register the txCode created - we use this to allocate the payment to order\n\t\t\tdsf_session_register('VendorTxCode');\n\t\t\n\n\n// submit the information to SagePay\n\n\t\t\t\t\t// Set some variables\n\t\t\t\t\t$TargetURL = $PurchaseURL;\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t$VerifyServer = $Verify;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t\n\t\t\t\t\tif ($Description){\n\t\t\t\t\t\t$Description = substr($Description,0,100);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$Description = $DefaultDescription;\t\t\t\t\t\t\t\t// Specified in init-protx.php\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Create an array of values to send\n\t\t\t\t\t$required = array (\n\t\t\t\t\t\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t\t\t\t\t\t'TxType' => MODULE_PAYMENT_PROTXCC_TXTYPE,\t\t\t\t\t\t\t\t\t\t\t// Transaction type\n\t\t\t\t\t\t\t'Vendor' => MODULE_PAYMENT_PROTXCC_ID,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t\t\t\t\t\t'VendorTxCode' => $VendorTxCode,\t\t\t\t\t// Unique transaction code (generated by vendor)\n\t\t\t\t\t\t\t'Amount' => $Amount,\t\t\t\t\t\t\t\t\t\t\t// Value of order (supplied by vendor)\n\t\t\t\t\t\t\t'Currency' => $DefaultCurrency,\t\t\t\t\t\t\t\t\t// Currency of order (default specified in init-protx.php)\n\t\t\t\t\t\t\t'Description' => $Description,\t\t\t\t\t\t\t\t\t// Description of order \n\t\t\t\t\t\t\t 'BillingSurname' => $BillingSurname,\n\t\t\t\t\t\t\t 'BillingFirstnames' => $BillingFirstnames,\n\t\t\t\t\t\t\t 'BillingAddress1' => $BillingAddress1,\n\t\t\t\t\t\t\t 'BillingAddress2' => $BillingAddress2,\n\t\t\t\t\t\t\t 'BillingCity' => $BillingCity,\n\t\t\t\t\t\t\t 'BillingPostCode' => $BillingPostCode,\n\t\t\t\t\t\t\t 'BillingCountry' => $BillingCountry,\n\t\t\t\t\t\t\t 'DeliverySurname' => $DeliverySurname,\n\t\t\t\t\t\t\t 'DeliveryFirstnames' => $DeliveryFirstnames,\n\t\t\t\t\t\t\t 'DeliveryAddress1' => $DeliveryAddress1,\n\t\t\t\t\t\t\t 'DeliveryAddress2' => $DeliveryAddress2,\n\t\t\t\t\t\t\t 'DeliveryCity' => $DeliveryCity,\n\t\t\t\t\t\t\t 'DeliveryPostCode' => $DeliveryPostCode,\n\t\t\t\t\t\t\t 'DeliveryCountry' => $DeliveryCountry\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\n\t\t\t\t\t\n\t\t\t\t\t// add optional fields to the data array only if they've been set\n\t\t\t\t\t\n\t\t\t\t\t$optional_fields = array('ContactNumber' => $ContactNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'ContactFax' => $ContactFax,\n\t\t\t\t\t\t\t\t\t\t\t 'CustomerEMail' => $CustomerEMail,\n\t\t\t\t\t\t\t\t\t\t\t 'GiftAidPayment' => $GiftAidPayment,\n\t\t\t\t\t\t\t\t\t\t\t 'ApplyAVSCV2' => $ApplyAVSCV2,\n\t\t\t\t\t\t\t\t\t\t\t 'CAVV' => $CAVV,\n\t\t\t\t\t\t\t\t\t\t\t 'XID' => $XID,\n\t\t\t\t\t\t\t\t\t\t\t 'ECI' => $ECI,\n\t\t\t\t\t\t\t\t\t\t\t '3DSecureStatus' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'Basket' => $Basket,\n\t\t\t\t\t\t\t\t\t\t\t 'ClientNumber' => $ClientNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'IssueNumber' => $cc_issue_number,\n\t\t\t\t\t\t\t\t\t\t\t 'CV2' => $cc_ccv_number\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t// add the optional fields to the required array only if there are values set.\n\t\t\t\t\t$data = addOptionalFields( $optional_fields, $required, array ( \n\t\t\t\t\t 'ContactNumber',\n\t\t\t\t\t 'ContactFax',\n\t\t\t\t\t 'CustomerEMail',\n\t\t\t\t\t 'GiftAidPayment',\n\t\t\t\t\t 'ApplyAVSCV2',\n\t\t\t\t\t 'ClientIPAddress',\n\t\t\t\t\t 'CAVV',\n\t\t\t\t\t 'XID',\n\t\t\t\t\t 'ECI',\n\t\t\t\t\t '3DSecureStatus',\n\t\t\t\t\t 'Basket',\n\t\t\t\t\t 'ClientNumber', \n\t\t\t\t\t 'IssueNumber', \n\t\t\t\t\t 'CV2', \n\t\t\t\t\t) );\n\t\t\t\t\t\n\t\t\t\t\t$data['CardHolder'] =\t$cc_owner;\n\t\t\t\t\t$data['CardNumber'] = \t$cc_number;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Check if start date is supplied\n\t\t\t\t\tif($cc_start_month){\n\t\t\t\t\t\t// If so, add start date to data array to be appended to POST\n\t\t\t\t\t\t$data['StartDate'] = $cc_start_month . $cc_start_year;\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t// Add expiry date\n\t\t\t\t\t$data['ExpiryDate'] = $cc_expires_month . $cc_expires_year;\n\t\t\t\t\t\n\t\t\t\t\t// Add card type\n\t\t\t\t\t$data['CardType'] = $cc_ctype;\n\n\n\t\t\t\t\t$ipnum = dsf_get_ip_address();\n\n\t\t\t\t\t\t$data['Apply3DSecure'] = '0';\n\t\t\t\t\t\n\t\t\t\t\t$posted_data = $data;\n\t\t\t\t\t\n\t\t\t\t\t$data = formatData($data);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sage_response = requestPost($TargetURL, $data);\t\n\n\n\n\t\t\t\t\t// (1) add 1 to attempts counter\n\t\t\t\t\t\n\t\t\t\t\t\t$protx_attempts ++;\n\t\t\t\t\t\tdsf_session_unregister('protx_attempts');\n\t\t\t\t\t\tdsf_session_register('protx_attempts');\n\n\n\n\n\n\t// return the response back to the calling script.\n\t\treturn $sage_response;\n\t\t\n\n\n}", "public function getProductType()\n {\n }", "public function _getShipmentCode() {\n\t\treturn $this->_shipmentCode;\n\t}", "public function run()\n {\n $transport_data = [\n ['code' => '01', 'name' => '西濃運輸'],\n ['code' => '02', 'name' => '京成運輸'],\n ['code' => '03', 'name' => '佐川急便'],\n ['code' => '04', 'name' => '久留米運送'],\n ['code' => '05', 'name' => '福山通運'],\n ['code' => '06', 'name' => '岡山県貨物'],\n ['code' => '07', 'name' => '野々村運送'],\n ['code' => '08', 'name' => '西濃(名古屋西)'],\n ['code' => '09', 'name' => '中央便'],\n ['code' => '10', 'name' => 'トール'],\n ['code' => '11', 'name' => '西濃(園芸部)'],\n ['code' => '12', 'name' => '阪急国内空輸'],\n ['code' => '13', 'name' => '丸工運送'],\n ['code' => '14', 'name' => '使用禁止'],\n ['code' => '15', 'name' => 'エスラインギフ'],\n ['code' => '16', 'name' => '福山(宅配)'],\n ['code' => '17', 'name' => '使用禁止'],\n ['code' => '18', 'name' => '京都運輸'],\n ['code' => '19', 'name' => '日本通運'],\n ['code' => '20', 'name' => '西濃(直売部)'],\n ['code' => '21', 'name' => '大島運輸'],\n ['code' => '22', 'name' => '西濃(彦根)'],\n ['code' => '23', 'name' => '近鉄物流'],\n ['code' => '24', 'name' => 'ヤマト運輸'],\n ['code' => '25', 'name' => '丸三海運'],\n ['code' => '26', 'name' => '琉球通運'],\n ['code' => '27', 'name' => '大商海運'],\n ['code' => '28', 'name' => '【離島】'],\n ['code' => '29', 'name' => '使用禁止'],\n ['code' => '30', 'name' => '近鉄第一トラック'],\n ['code' => '31', 'name' => '信州名鉄'],\n ['code' => '32', 'name' => '使用禁止'],\n ['code' => '33', 'name' => '第一貨物'],\n ['code' => '34', 'name' => '日本新潟運輸'],\n ['code' => '35', 'name' => '福井配送'],\n ['code' => '36', 'name' => 'マルニ'],\n ['code' => '37', 'name' => 'ヨナイザワ'],\n ['code' => '38', 'name' => '札幌急配'],\n ['code' => '39', 'name' => '京都通運'],\n ['code' => '40', 'name' => 'シズナイロゴス'],\n ['code' => '41', 'name' => '八潮運輸'],\n ['code' => '42', 'name' => '松運'],\n ['code' => '43', 'name' => '曙商事'],\n ['code' => '44', 'name' => '東栄運送'],\n ['code' => '45', 'name' => '三八五流通'],\n ['code' => '46', 'name' => '博運社'],\n ['code' => '47', 'name' => '九州産交運輸'],\n ['code' => '48', 'name' => '千石西濃運輸'],\n ['code' => '49', 'name' => '宮崎運輸'],\n ['code' => '50', 'name' => '野母商船'],\n ['code' => '51', 'name' => '南国海運'],\n ['code' => '52', 'name' => '壱岐海運'],\n ['code' => '53', 'name' => '松岡満'],\n ['code' => '54', 'name' => '新潟運輸'],\n ['code' => '55', 'name' => 'トナミ運輸'],\n ['code' => '56', 'name' => '西武運輸'],\n ['code' => '57', 'name' => '山陽自動車'],\n ['code' => '58', 'name' => '名鉄運輸'],\n ['code' => '59', 'name' => '小林運輸'],\n ['code' => '60', 'name' => 'クロネコメール便'],\n ['code' => '61', 'name' => '北九州宮崎運送'],\n ['code' => '62', 'name' => 'ナビックス'],\n ['code' => '63', 'name' => '札樽自動車'],\n ['code' => '64', 'name' => '月寒運輸'],\n ['code' => '65', 'name' => 'ネコポス'],\n ['code' => '66', 'name' => '日硝ハイウエー'],\n ];\n\n $date_data = [\n 'created_at' => 20200101,\n 'created_by' => 1,\n 'updated_at' => 20200101,\n 'updated_by' => 1,\n 'deleted_at' => null,\n 'deleted_by' => null\n ];\n\n foreach ($transport_data as $value) {\n $transport_array[] = array_merge($value, $date_data);\n }\n\n // 扱便マスタテーブル\n DB::table('transport')->insert($transport_array);\n }", "public function fetchPrepInstructions()\n {\n if (! array_key_exists('SellerSKUList.Id.1', $this->options) &&\n ! array_key_exists('ASINList.Id.1', $this->options)) {\n $this->log('Product IDs must be set in order to get prep instructions!', 'Warning');\n\n return false;\n }\n\n if (! array_key_exists('ShipToCountryCode', $this->options)) {\n $this->log('Country Code must be set in order to get prep instructions!', 'Warning');\n\n return false;\n }\n\n $this->preparePrep();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n if ($this->mockMode) {\n $xml = $this->fetchMockFile();\n } else {\n $response = $this->sendRequest($url, ['Post'=>$query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body']);\n }\n\n $this->parseXml($xml->$path);\n }", "public function createPurchaseOrder(Request $request)\n {\n $data = $request->input();\n\n $suppliers = array();\n\n foreach ($data as $key => $value) {\n $bestSupplier = ProductSuppliers::getBestSupplierForProduct($key);\n\n if(array_key_exists($bestSupplier['entity'], $suppliers))\n array_push($suppliers[$bestSupplier['entity']], $bestSupplier);\n else\n $suppliers[$bestSupplier['entity']] = [$bestSupplier];\n }\n\n foreach($suppliers as $supplier) {\n $documentLines = [];\n\n for($i = 0; $i < count($supplier); $i++) {\n $product = [\n 'description' => $supplier[$i]['description'],\n 'quantity' => $data[$supplier[$i]['product']],\n 'unitPrice' => number_format(floatval($supplier[$i]['price']), 2),\n 'deliveryDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\")+1, date(\"Y\"))),\n 'unit' => 'UN',\n 'itemTaxSchema' => 'ISENTO',\n 'purchasesItem' => $supplier[$i]['product'],\n 'documentLineStatus' => 'OPEN'\n ];\n\n array_push($documentLines, $product);\n }\n\n try {\n $result = JasminConnect::callJasmin('/purchases/orders', '', 'GET');\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n $seriesNumber = count(json_decode($result->getBody(), true)) + 1;\n\n try {\n $body = [\n 'documentType' => 'ECF',\n 'company' => 'TP-INDUSTRIES',\n 'serie' => '2019',\n 'seriesNumber' => $seriesNumber,\n 'documentDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'postingDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'SellerSupplierParty' => $supplier[0]['entity'],\n 'SellerSupplierPartyName' => $supplier[0]['name'],\n 'accountingParty' => $supplier[0]['entity'],\n 'exchangeRate' => 1,\n 'discount' => 0,\n 'loadingCountry' => $supplier[0]['country'],\n 'unloadingCountry' => 'PT',\n 'currency' => 'EUR',\n 'paymentMethod' => 'NUM',\n 'paymentTerm' => '01',\n 'documentLines' => $documentLines\n ];\n\n JasminConnect::callJasmin('/purchases/orders', '', 'POST', $body);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }\n\n return $data;\n }", "public function fedexSmallPlanNotice()\n {\n $planMsg = $this->dataHelper->fedexSmallSetPlanNotice();\n return $planMsg;\n }", "function getResponseDescription($responseCode) {\n\n switch ($responseCode) {\n case \"0\" : $result = \"Transaction Successful\"; break;\n case \"?\" : $result = \"Transaction status is unknown\"; break;\n case \"1\" : $result = \"Unknown Error\"; break;\n case \"2\" : $result = \"Bank Declined Transaction\"; break;\n case \"3\" : $result = \"No Reply from Bank\"; break;\n case \"4\" : $result = \"Expired Card\"; break;\n case \"5\" : $result = \"Insufficient funds\"; break;\n case \"6\" : $result = \"Error Communicating with Bank\"; break;\n case \"7\" : $result = \"Payment Server System Error\"; break;\n case \"8\" : $result = \"Transaction Type Not Supported\"; break;\n case \"9\" : $result = \"Bank declined transaction (Do not contact Bank)\"; break;\n case \"A\" : $result = \"Transaction Aborted\"; break;\n case \"C\" : $result = \"Transaction Cancelled\"; break;\n case \"D\" : $result = \"Deferred transaction has been received and is awaiting processing\"; break;\n case \"F\" : $result = \"3D Secure Authentication failed\"; break;\n case \"I\" : $result = \"Card Security Code verification failed\"; break;\n case \"L\" : $result = \"Shopping Transaction Locked (Please try the transaction again later)\"; break;\n case \"N\" : $result = \"Cardholder is not enrolled in Authentication scheme\"; break;\n case \"P\" : $result = \"Transaction has been received by the Payment Adaptor and is being processed\"; break;\n case \"R\" : $result = \"Transaction was not processed - Reached limit of retry attempts allowed\"; break;\n case \"S\" : $result = \"Duplicate SessionID (OrderInfo)\"; break;\n case \"T\" : $result = \"Address Verification Failed\"; break;\n case \"U\" : $result = \"Card Security Code Failed\"; break;\n case \"V\" : $result = \"Address Verification and Card Security Code Failed\"; break;\n default : $result = \"Unable to be determined\";\n }\n return $result;\n }", "protected function _buildRequest()\n {\n // prepare API\n $this->setShippingMethod('Other');\n $this->setCustomerIP(Mage::helper('core/http')->getRemoteAddr());\n $version = Mage::helper('ewayrapid')->getExtensionVersion();\n $this->setDeviceID('Magento ' . Mage::getEdition() . ' ' . Mage::getVersion().' - eWAY '.$version);\n if (Mage::helper('ewayrapid')->isBackendOrder()) {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_MOTO);\n } else {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_PURCHASE);\n }\n $this->setCustomerReadOnly(true);\n\n // add Billing Address\n $billingAddress = $this->_quote->getBillingAddress();\n $customerParam = Mage::getModel('ewayrapid/field_customer');\n \n $title = $this->_fixTitle($billingAddress->getPrefix());\n \n $customerParam->setTitle($title)\n ->setFirstName($billingAddress->getFirstname())\n ->setLastName($billingAddress->getLastname())\n ->setCompanyName($billingAddress->getCompany())\n ->setJobDescription($billingAddress->getJobDescription())\n ->setStreet1($billingAddress->getStreet1())\n ->setStreet2($billingAddress->getStreet2())\n ->setCity($billingAddress->getCity())\n ->setState($billingAddress->getRegion())\n ->setPostalCode($billingAddress->getPostcode())\n ->setCountry(strtolower($billingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($billingAddress->getEmail())\n ->setPhone($billingAddress->getTelephone())\n ->setMobile($billingAddress->getMobile())\n ->setComments('')\n ->setFax($billingAddress->getFax())\n ->setUrl('');\n $this->setCustomer($customerParam);\n\n // add Shipping Address\n $shippingAddress = $this->_quote->getShippingAddress();\n\n // copy BillingAddress to ShippingAddress if checkout with guest or register\n $checkoutMethod = $this->_quote->getCheckoutMethod();\n if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST\n || $checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER\n ) {\n $shippingAddress = $billingAddress;\n }\n\n $shippingParam = Mage::getModel('ewayrapid/field_shippingAddress');\n $shippingParam->setFirstName($shippingAddress->getFirstname())\n ->setLastName($shippingAddress->getLastname())\n ->setStreet1($shippingAddress->getStreet1())\n ->setStreet2($shippingAddress->getStreet2())\n ->setCity($shippingAddress->getCity())\n ->setState($shippingAddress->getRegion())\n ->setPostalCode($shippingAddress->getPostcode())\n ->setCountry(strtolower($shippingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($shippingAddress->getEmail())\n ->setPhone($shippingAddress->getTelephone())\n ->setFax($shippingAddress->getFax());\n $this->setShippingAddress($shippingParam);\n\n return $this;\n }", "function IndusIndPL($strnet_salary, $company, $category, $DOB, $clubbed_emi, $city, $reqtenure, $reqloanamount) {\n $net_salary = $strnet_salary;\n\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n\n if ($category == \"A+\" || $category == \"CAT A\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = \"12.99\";\n $intr = $interestrate;\n $proc_fee = \"0.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"13.75\";\n $intr = $interestrate ;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"14.75\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"13.50\";\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.25\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } elseif ($term == 60) {\n $getterm = 5;\n } else {\n $getterm = 5;\n }\n } else if ($category == \"CAT B\" || $category == \"CAT G\" || $category == \"C1000\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 14.00;\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 15.00;\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 16.00;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else if ($category == \"CAT C\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 17.50;\n $intr = $interestrate;\n $proc_fee = \"1.25%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 18;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 19;\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"18.50\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"19\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"20\";\n $intr = $interestrate;\n $proc_fee = \"2.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else {\n /* if ($net_salary >= 100000) {\n $interestrate = \"17\";\n $intr = 17;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 50000 && $net_salary < 100000) {\n $interestrate = \"17.5\";\n $intr = 17.5;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"18\";\n $intr = 18;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }*/\n }\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $princ = 100000;\n if ($intr > 0) {\n $perlacemi = round($princ * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($princ, $intr, $term);\n //Calculate Loan Amount\n if ($net_salary >= 50000) {\n $firstnet_salary = ($net_salary * (70 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else if ($net_salary >= 25000 && $net_salary < 50000) {\n $firstnet_salary = ($net_salary * (50 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else {\n $finalloanamount_dbr = 0;\n }\n } else {\n $finalloanamount_dbr = 0;\n }\n //other eiligibility\n if ($net_salary >= 50000) {\n $finalloanamount_other = $net_salary * 18;\n } else {\n $finalloanamount_other = $net_salary * 18;\n }\n $finalloanamount = 0;\n if ($finalloanamount_other < $finalloanamount_dbr) {\n $finalloanamount = $finalloanamount_other;\n } else {\n $finalloanamount = $finalloanamount_dbr;\n }\n if ($finalloanamount > 2500000) {\n if (strlen($category) > 1) {\n $getloanamout = 2500000;\n } else {\n $getloanamout = 700000;\n }\n } else {\n if (strlen($category) > 1) {\n $getloanamout = $finalloanamount;\n } else {\n if ($finalloanamount > 700000) {\n $getloanamout = 700000;\n } else {\n $getloanamout = $finalloanamount;\n }\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n if ($intr > 0) {\n if (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 700000 && $getloanamout < 1500000 && $net_salary >= 75000) {\n $interestrate = \"13.49\";\n $intr = 13.49;\n $proc_fee = \"0.49%\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 1500000 && $net_salary >= 100000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_fee = \"Rs. 4999\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n }\n } else {\n $getemicalc = 0;\n }\n\t\t\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $term))));\n $details['bank_code'] = \"Indus Ind Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $proc_fee;\n $details['category'] = $category;\n return($details);\n }", "private function isFlow(){\r\n return $this->getPaymentMethod() == 9;\r\n }", "public function getProgramCode()\n {\n return $this->programCode;\n }", "public function _code()\n {\n if (!$this->validateCSRF()) {\n return response()->json($this->restrictionAccessMessage());\n }\n\n $item_category = ItemCategory::find(\\Input::get('item_category_id'));\n $item = Item::where('item_category_id', '=', $item_category->id)->orderBy('id', 'desc')->first();\n $number = 1;\n if ($item) {\n $array_number = explode('-', $item->code);\n $number = $array_number[count($array_number) - 1] + 1;\n }\n\n $response = array(\n 'code' => $item_category->code . '-' . $number\n );\n return response()->json($response);\n }", "public function evaluateRoad() {\n\t\t$code = $this->road['code'];\n\t\tif ($code === '0'){\n\t\t\treturn 'Closed';\n\t\t}else if($code === '1'){\n\t\t\treturn 'Chains on all vehicles';\n\t\t}else if($code === '2'){\n\t\t\treturn 'Chains or 4WD';\n\t\t}else if($code === '3'){ \n\t\t\treturn 'Chains carried'; \n\t\t}else if($code === '4'){ \n\t\t\treturn 'Open'; \n\t\t}else if($code === '5'){ \n\t\t\treturn 'Air Access Only'; \n\t\t}\n\t}", "public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }", "function SAP_set_order($rec_id)\n{\n/*\n\tThis FUNCTION posts SD order \n\tINPUT: id of invoice\n\tOUTPUT:\n\t\t\t- \"ID\" of SD order\n\t\t\tOR \"0\" - if failed\n*/\n\tinclude(\"login_re.php\");\n\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\t\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t//$cond_value='10';\n\t$service_mode='SO_C';\t// CREATE\t\n\t$req = new Request();\n\t \n\t\t\t//Setting up the object\n\t\t\t$item= new Item();\n\t\t\n\t\t//Set up mySQL connection\n\t\t\t$db_server = mysqli_connect($db_hostname, $db_username,$db_password);\n\t\t\t$db_server->set_charset(\"utf8\");\n\t\t\tIf (!$db_server) die(\"Can not connect to a database!!\".mysqli_connect_error($db_server));\n\t\t\tmysqli_select_db($db_server,$db_database)or die(mysqli_error($db_server));\n\t//1.\t\n\t\t// LOCATE data for the invoice\n\t\t\t$invoice_sql=\"SELECT invoice.date,invoice.value,contract.id_SAP,currency.code,decade,month,year \n\t\t\t\t\t\t\tFROM invoice \n\t\t\t\t\t\t\tLEFT JOIN contract ON invoice.contract_id=contract.id \n LEFT JOIN currency ON invoice.currency=currency.id\n\t\t\t\t\t\t\tWHERE invoice.id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql=mysqli_query($db_server,$invoice_sql);\n\t\t\t\t\n\t\t\tif(!$answsql) die(\"Database SELECT TO invoice table failed: \".mysqli_error($db_server));\t\n\t\t\tif (!$answsql->num_rows)\n\t\t\t{\n\t\t\t\techo \"WARNING: No invoice found for a given ID in invoice TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t$i_data= mysqli_fetch_row($answsql);\n\t\t\t\t\n\t\t\t\n\t//2.\t\n\t\t\t// Prepare request for SAP ERPclass Item\n\t\n\t\t\t// Set up params\n\t\t\t\n\t\t\t$c_date=$i_data[0];\n\t\t\t$val=$i_data[1];\n\t\t\t$contract_id=$i_data[2];\n\t\t\t$curr=$i_data[3];\t// Currency in invoice\n\t\t\t$decade=$i_data[4];\n\t\t\t$month=$i_data[5];\n\t\t\t$year=$i_data[6];\n\t\t\t//SERVICE DATE\n\t\t\t$service_date='';\n\t\t\tswitch($month)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$service_date='-01-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$service_date='-02-';\n\t\t\t\t\tif((int)$year%4)\n\t\t\t\t\t\t$day='28';\n\t\t\t\t\telse\n\t\t\t\t\t\t$day='29';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$service_date='-03-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$service_date='-04-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$service_date='-05-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$service_date='-06-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\t$service_date='-07-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\t$service_date='-08-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\t$service_date='-09-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\t$service_date='-10-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\t$service_date='-11-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\t$service_date='-12-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG MONTH IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch($decade)\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t$day='01';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='10';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$day='20';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='28';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG DECADE IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$service_date='20'.$year.$service_date.$day;\n\t\t\t// Preparing Items for Invoice\n\t\t\t$count_in=1;// only one position by Invoice now\n\t\t\t$items=new ItemList();\n\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t{\t\n\t\t\t\t$item1 = new Item();\n\t\t\t\t// 1. Item number\n\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t// 2. Material code\n\t\t\t\t$item1->MATERIAL='901200000';//now it's fixed\n\t\t\t\n\t\t\t/*2.1 BLOCK LEFT FOR LOCATING SAP MATERIAL ID\n\t\t\t\n\t\t\t\t$servicesql='SELECT id_SAP,id FROM services WHERE id_NAV=\"'.$service_id.'\"';\t\n\t\t\t\t$answsql=mysqli_query($db_server,$servicesql);\t\n\t\t\t\tif(!$answsql) die(\"Database SELECT in services table failed: \".mysqli_error($db_server));\t\n\n\t\t\t\t$sap_service_id= mysqli_fetch_row($answsql);\n\t\t\t*/\n\t\t\t\t// 3. Currency\n\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t// 4. SD conditions\n\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t// 4. Quantity\n\t\t\t\t$item1->TARGET_QTY='1'; //FIXED!\n\t\t\t\t\n\t\t\t\n\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t$items->item[$it] = $item1;\n\t\t\t}\n\t\t\t\n\t\t// GENERAL SECTION (HEADER)\n\t\t\n\t\t\t$req->ID_SALESCONTRACT = $contract_id;\t\n\t\t\t$req->SERVICEMODE = $service_mode;\n\t\t\t$req->SERVICEDATE = $service_date;\t\t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->RETURN2 = '';\n\t\t\t\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order)\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}", "public function getCode()\n {\n if($this->request->getQuery()->offsetExists($this->options->stage1->state->accessKey)) {\n $code = $this->getCodeFromRequest();\n if(is_string($code)) {\n return $code;\n }\n }\n return $this->getCodeFromVendor();\n }", "public function getShippingCode()\n {\n $result = parent::getShippingCode();\n return $result;\n }", "public function showServerResponse($product_data, $status, $display)\n {\n $successMessages = array(\n VALID => __('Your license key is activated('.$product_data['pluginName'].')', $this->pluginSlug),\n );\n\n $errorMessages = array(\n 'server_did_not_respond' => __('No response from server. Please try again later.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'license_activation_failed' => __('License Activation Failed. Please try again or contact support on [email protected]('.$product_data['pluginName'].')', $this->pluginSlug),\n 'no_license_key_entered' => __('Please enter license key.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'no_activations_left' => (!empty($display)) ? sprintf(__('Your License Key is already activated at : %s Please deactivate the license from one of the above site(s) to successfully activate it on your current site.('.$product_data['pluginName'].')', $this->pluginSlug), $display) : __('No Activations Left.('.$product_data['pluginName'].')', $this->pluginSlug),\n EXPIRED => __('Your license key has Expired. Please, Renew it.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'disabled' => __('Your License key is disabled('.$product_data['pluginName'].')', $this->pluginSlug),\n INVALID => __('Please enter valid license key('.$product_data['pluginName'].')', $this->pluginSlug),\n 'inactive' => __('Please try to activate license again. If it does not activate, contact support on [email protected]('.$product_data['pluginName'].')', $this->pluginSlug),\n 'site_inactive' => (!empty($display)) ? sprintf(__('Your License Key is already activated at : %s Please deactivate the license from one of the above site(s) to successfully activate it on your current site.('.$product_data['pluginName'].')', $this->pluginSlug), $display) : __('Site inactive (Press Activate license to activate plugin('.$product_data['pluginName'].'))', $this->pluginSlug),\n 'deactivated' => __('License Key is deactivated('.$product_data['pluginName'].')', $this->pluginSlug),\n 'default' => sprintf(__('Following Error Occurred: %s. Please contact support on [email protected] if you are not sure why this error is occurring('.$product_data['pluginName'].')', $this->pluginSlug), $status),\n 'server_curl_error' => __('There was an error while connecting to the server. please try again later.('.$product_data['pluginName'].')', $this->pluginSlug),\n );\n\n if ($status !== false) {\n if (array_key_exists($status, $successMessages)) {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $successMessages[$status],\n 'updated'\n );\n } else {\n if (array_key_exists($status, $errorMessages)) {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $errorMessages[$status],\n 'error'\n );\n } else {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $errorMessages['default'],\n 'error'\n );\n }\n }\n }\n }", "public function cerasisOriginAddress(\n $request,\n $_product,\n $receiverZipCode\n ) {\n //Todo: need to check which warehouse is selected and method params conflict also must be fixed. fetchWarehouseSecData()\n $this->request = $request;\n $whQuery = $this->dataHelper->fetchWarehouseSecData('warehouse');\n $enableDropship = $_product->getData('en_dropship');\n\n if ($enableDropship) {\n $dropShipID = $_product->getData('en_dropship_location');\n $originList = $this->dataHelper->fetchWarehouseWithID('dropship', $dropShipID);\n\n if (!$originList) {\n $product = $this->productLoader->create()->load($_product->getEntityId());\n $product->setData('en_dropship', 0)->getResource()->saveAttribute($product, 'en_dropship');\n $origin = $whQuery;\n } else {\n $origin = $originList;\n }\n } else {\n $origin = $whQuery;\n }\n if (!empty($origin)) {\n return $this->multiWarehouse($origin, $receiverZipCode);\n }\n }", "public function getDeliveryNumber() {\n return $this->params[\"original\"][\"delivery_number\"];\n }", "private function formVipCode() {\n\t\t\t\n\t\t\t//The vipcode is formed by y - Year 2 digits, z - day of the year, Hi - Hour and minutes, s - seconds\n\t\t\t$this->vipCodeUniqueId = date('yz-Hi-s');\n\t\t\t//$this->vipCodeUniqueId = explode('.', microtime(true))[0] . explode('.', microtime(true))[1];\n\t\t\t$this->vipCode = \"voltoAo\" . ucfirst($this->enterprise->getName()) . \"#\". $this->vipCodeUniqueId;\n\t\t\treturn $this->vipCode;\n\t\t\t\n\t\t}", "public function getProductOption();", "abstract public function getPaymentAuthorizationCode();", "public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }", "function getResponseMsg()\n {\n $msg = array('START' => 'Enter a product name:',\n 'NO_ITEMS' => 'There are no such items available.',\n 'INVALID_Q' => 'The query must contain only letters and digits (3 through 30).',\n 'DONE' => '{NUM} items from \"{NAME}\" fetched.');\n\n if (self::$current_state == 'DONE'){\n $msg[self::$current_state] = str_replace('{NAME}', self::$items_name, $msg[self::$current_state]);\n $msg[self::$current_state] = str_replace('{NUM}', self::$items_number, $msg[self::$current_state]);\n }\n return $msg[self::$current_state];\n }" ]
[ "0.55132407", "0.5250005", "0.52417946", "0.519151", "0.518918", "0.51860404", "0.5183702", "0.51620764", "0.5121596", "0.5102158", "0.5071421", "0.5064782", "0.50458515", "0.5026691", "0.50166225", "0.49991503", "0.499401", "0.49783915", "0.49728212", "0.48994455", "0.48845184", "0.48706278", "0.4869432", "0.486936", "0.48561537", "0.48466632", "0.48336586", "0.48297393", "0.48240584", "0.4819289", "0.48074627", "0.48006046", "0.47923937", "0.47847626", "0.47820553", "0.47814086", "0.47595617", "0.47539997", "0.4753727", "0.47493568", "0.47426748", "0.47423542", "0.47333437", "0.4726681", "0.47150606", "0.47132236", "0.47096825", "0.47072592", "0.47067836", "0.469928", "0.46914777", "0.46803072", "0.4678468", "0.466665", "0.46654955", "0.4657432", "0.4657432", "0.46532664", "0.46463433", "0.46412033", "0.46398225", "0.46369007", "0.46356055", "0.46338907", "0.46289647", "0.46274897", "0.46241072", "0.46166128", "0.46116674", "0.4608282", "0.46052602", "0.46042007", "0.45993462", "0.45922342", "0.45920718", "0.45908546", "0.45853516", "0.45787942", "0.45754555", "0.45736092", "0.45663333", "0.45622465", "0.45504326", "0.4546238", "0.45382652", "0.4535532", "0.45320705", "0.4529327", "0.4526444", "0.45234045", "0.45221037", "0.45217672", "0.4521237", "0.45183012", "0.45085132", "0.45074713", "0.45064425", "0.4503776", "0.4502515", "0.45022625" ]
0.5668688
0
This is the local DHL Express product code for which the delivery is feasible respecting the input data from the request.
public function setLocalProductCode(?string $localProductCode): self { $this->initialized['localProductCode'] = true; $this->localProductCode = $localProductCode; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLocalProductCode(): ?string\n {\n return $this->localProductCode;\n }", "public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}", "private function determainclaimType()\r\n {\r\n // 9 digits\r\n if (preg_match($this->keycodeRegex, $this->keycode) == false)\r\n {\r\n $this->claimType = \"invaild-keycode\";\r\n }\r\n \r\n // if keycode is NOT null, then search in the database\r\n else if ($this->keycode != null)\r\n {\r\n $result = mysql_query(\"SELECT Keycode, Claimable, Repairable, WarrantyMonths\r\n FROM Product \r\n WHERE Product.Keycode = $this->keycode\");\r\n\r\n $array = mysql_fetch_array($result);\r\n\r\n // if keycode is null, item does not exist in the database\r\n //if ($array[\"Keycode\"] == false)\r\n if (empty($array))\r\n {\r\n $this->claimType = \"keycode-not-found\";\r\n }\r\n // if product is claimable and repairable\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 1)\r\n { \r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) \r\n {\r\n //// check warranty period\r\n $this->claimType = \"repair-warranty\";\r\n }\r\n else\r\n {\r\n // check warranty period\r\n $this->claimType = \"repair-no-warranty\";\r\n }\r\n }\r\n else // transactionResult number rows is zero, this means no transaction was founds\r\n { \r\n $this->claimType = \"repair-no-transaction\";\r\n }\r\n }\r\n // if product offers a finanical claim\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"finanical-warranty\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"finanical-outside-warranty\";\r\n }\r\n }\r\n else // transactionResult's rows was zero so no tranaction number was found\r\n {\r\n $this->claimType = \"finanical-no-transaction\";\r\n }\r\n }\r\n // if a product is NOT claimable with supplier\r\n else if ($array[\"Claimable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are above zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"not-claimable-refund\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"not-claimable-outside-warranty\";\r\n }\r\n }\r\n else // no vaild transaction number provided\r\n {\r\n $this->claimType = \"not-claimable-no-transaction\";\r\n }\r\n }\r\n }\r\n \r\n }", "public function getProdCode()\n {\n return $this->prod_code;\n }", "public function getProductCode(): ?string\n {\n return $this->productCode;\n }", "function getProductCode()\n {\n return $this->productCode;\n }", "public function productFlowProcess(){\r\n\t\t$query = $this->request->data ;\r\n\t\t$status = $query[\"status\"] ;\r\n\t\t$description = $query[\"description\"] ;\r\n\t\t$filterId = $query[\"filterId\"] ;\r\n\t\t$asin = $query[\"asin\"] ;\r\n\t\t$strategy = $query[\"strategy\"] ;\r\n\t\t/*print_r( $this->request ) ; \r\n\t\tprint_r($this->request->data) ;\r\n\t\techo \">>>>>>>>>>>>>>>>>\".$description ;*/\r\n\t\t\r\n\t\t\r\n\t\t//更新状态\r\n\t\t$this->Sale->updateProductFilterStatus($this->request->data) ;\r\n\t\t\r\n\t\t//添加备注\r\n\t\t//if( trim($description) != \"\" ){\r\n\t\t$this->Product->updateProductComment($asin,$description,$strategy) ;\r\n\t\t//}\r\n\t\t\r\n\t\t//加入黑名单\r\n\t\tif( $status == 3 ){\r\n\t\t\t$user = $this->getCookUser() ;\r\n\t\t\t$this->Sale->removeProduct($this->request->data,$user) ;\r\n\t\t}else{\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$this->response->type(\"json\") ;\r\n\t\t$this->response->body( \"success\") ;\r\n\r\n\t\treturn $this->response ;\r\n\t}", "function external_code($request)\n\t{\n\t\tlist($success, $return) = $this->system->is_valid_access4($request);\n\t\tif (!$success) return [FALSE, $return];\n\n\t\t//cek parameter: SecuritiesMarketCode\n\t\tif (!isset($request->params->SecuritiesMarketCode) || empty($request->params->SecuritiesMarketCode)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter SecuritiesMarketCode'])]];\n\t\t}\n\n\t\t//cek parameter: MarketID --> sumber external identification \n\t\tif (!isset($request->params->MarketID) || empty($request->params->MarketID)) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-1', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-1'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'parameter MarketID'])]];\n\t\t}\n\n\t\t$this->db->select('T2.SecuritiesCode');\n\t\t$this->db->from('market_instrument_id_market T1');\n\t\t$this->db->join('market_instrument T2', 'T1.SecuritiesID = T2.SecuritiesID'); \n\t\t$this->db->where('T1.MarketID', $request->params->MarketID);\n\t\t$this->db->where('T1.SecuritiesMarketCode', $request->params->SecuritiesMarketCode);\n\t\t$row = $this->db->get()->row();\n if (!$row) {\n\t\t\tlist($success, $return) = $this->system->error_message('00-2', $request->LanguageID);\n\t\t\tif (!$success) return [FALSE, 'message' => '00-2'];\n\t\t\treturn [FALSE, ['message' => $this->system->refill_message($return['message'], ['data' => 'market company'])]];\n }\n\n\t\t$request->log_size = mb_strlen(serialize($row), '8bit');\n\t\t$request->log_type\t= 'data';\t\n\t\t$this->system->save_billing($request);\n\n\t\treturn [TRUE, ['result' => ['SecuritiesCode' => $row->SecuritiesCode]]];\n\t}", "function deliver($code)\n{ \n\n\techo \"// http://license.mxgraph.com/hosted \\n\";\n\techo $code;\n}", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function getProductCode()\n {\n if (array_key_exists(\"productCode\", $this->_propDict)) {\n return $this->_propDict[\"productCode\"];\n } else {\n return null;\n }\n }", "public function createFulfillmentRequestToDr($lineItems, $order) {\n $items = [];\n $request = [];\n $status = 'Completed';\n $responseCode = 'Success'; \n \n try {\n if ($order->getDrOrderId()) {\n $storeCode = $order->getStore()->getCode();\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n\n if(!$drModel->getId() || $drModel->getPostStatus() == 1) {\n return;\n } // end: if\n \n foreach ($lineItems as $itemId => $item) {\n $items['item'][] = [\n \"requisitionID\" => $item['requisitionID'],\n \"noticeExternalReferenceID\" => $item['noticeExternalReferenceID'],\n \"lineItemID\" => $itemId,\n\t\t\t\t\t\t\"magentoLineItemID\" => $item['magentoLineItemID'],\n \"fulfillmentCompanyID\" => $this->getCompanyId($storeCode),\n \"electronicFulfillmentNoticeItems\" => [\n \"item\" => [\n [\n \"status\" => $status,\n \"reasonCode\" => $responseCode,\n \"quantity\" => $item['quantity'],\n \"electronicContentType\" => \"EntitlementDetail\",\n \"electronicContent\" => \"magentoEventID\"\n ]\n ]\n ]\n ];\n } // end: foreach\n\n $request['ElectronicFulfillmentNoticeArray'] = $items;\n\n $this->curl->setOption(CURLOPT_RETURNTRANSFER, true);\n $this->curl->setOption(CURLOPT_TIMEOUT, 40);\n $this->curl->addHeader(\"Content-Type\", \"application/json\");\n $this->curl->post($this->getDrPostUrl($storeCode), $this->jsonHelper->jsonEncode($request));\n $result = $this->curl->getBody();\n $statusCode = $this->curl->getStatus();\n\n // Status Update: Exsisting code used according to review changes\n if ($statusCode == '200') {\n // Post Status updated only if entire order items are fulfilled\n if($this->getPendingFulfillment($order)) {\n // if all the quantites are satisfied then mark as 1\n $drModel = $this->drFactory->create()->load($order->getDrOrderId(), 'requisition_id');\n $drModel->setPostStatus(1);\n $drModel->save();\n } // end: if\n $comment = 'Magento & DR order status are matched';\n } else {\n $comment = 'Magento & DR order status are mis-matched';\n } // end: if\n\n $order->addStatusToHistory($order->getStatus(), __($comment));\n\n $this->_logger->info('createFulfillmentRequestToDr Request : '.json_encode($request));\n $this->_logger->info('createFulfillmentRequestToDr Response : '.json_encode($result)); \n } else {\n $this->_logger->error('Error createFulfillmentRequestToDr : Empty DR Order Id');\n } // end: if\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $le) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '.json_encode($le->getRawMessage()));\n } catch (\\Exception $ex) {\n $this->_logger->error('Error createFulfillmentRequestToDr : '. $ex->getMessage());\n } // end: try \n \n return $result;\n }", "public static function postsubmit_derive_product($lead) {\n\t\t$wsProduct = '';\n\t\tif( empty($lead->wsMaxProductLine) || 'Unknown' == $lead->wsMaxProductLine ) { // no Product Line context on the form page\n\t\t\tif ( 'History-Culture Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\tif( !empty($lead->domesticOrInternational ) && 'us' == $lead->domesticOrInternational ) {\n\t\t\t\t\t$wsProduct = 'Middle School - History'; // default to History\n\t\t\t\t} else {\n\t\t\t\t\t$wsProduct = 'High School - International'; // abroad means Perspectives Division\n\t\t\t\t}\n\t\t\t} elseif ( 'Science Themed Programs (K-12)' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Middle School - Science';\n\t\t\t} elseif ( 'Undergraduate Tours' == $lead->leadFormProduct || \n\t\t\t\t\t 'Graduate-Level Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'University'; // does not exist in Maximizer yet\n\t\t\t} elseif ( 'Music Festivals' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Concert and Performing Tours' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Marching Band Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Dance-Cheer Opportunities' == $lead->leadFormProduct ||\n\t\t\t\t\t 'Theatre Opportunities' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Performing';\n\t\t\t} elseif ( 'Sports Tours' == $lead->leadFormProduct ) {\n\t\t\t\t$wsProduct = 'Sports'; // does not exist in Maximizer yet\n\t\t\t} else {\n\t\t\t\t$wsProduct = 'Unknown';\n\t\t\t}\n\t\t} else {\n\t\t\t$wsProduct = $lead->wsMaxProductLine;\n\t\t}\n\t\treturn $wsProduct;\n\t}", "public function actionDeliveryCost($code){\n //check country\n $city= City::find()->where('Name=\"'.$code.'\"')->one();\n //var_dump($city);\n if($city->CountryCode == 'EGY'){\n //calculate weight\n $sum=0;\n foreach(Shopcart::goods() as $good) {\n $sum+= $good->item->product_weight ;\n\n }\n // return \"the new cost--\".$city->Name .$city->CountryCode;\n //$city->CountryCode;\n $cost= $this->GetCost($city->Name,$sum);\n if($cost =='' or $cost ==0){\n return Setting::get('deliver_cost');\n }else{return $cost ;}\n\n }else{\n return Setting::get('deliver_cost'); //.'-99'. $city->CountryCode;\n }\n\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "function get_item_code()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n\t\t\t$invoiceNumber = $_POST['inv'];\n\t\t\t$batch = $_POST['batch'];\n\t\t\t$tableName = \"london_stock\";\n\t\t\t$condition = array(\n\t\t\t\t'invoice_number' => $invoiceNumber,\n\t\t\t\t'invoice_date' => $batch\n\n\t\t\t);\n\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\tif ($result > 0) {\n\t\t\t\techo $response = json_encode($result, true);\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'No item', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "public function minAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function compliteAction()\n {\n\n $config = $this->get('plugins')->Frontend()->PilibabaPilipaySystem()->Config();\n $merchantNO = $this->Request()->getParam('merchantNO');\n $orderNo = $this->Request()->getParam('orderNo');\n $orderAmount = $this->Request()->getParam('orderAmount');\n $signType = $this->Request()->getParam('signType');\n $payResult = $this->Request()->getParam('payResult');\n $signMsg = $this->Request()->getParam('signMsg');\n $dealId = $this->Request()->getParam('dealId');\n $fee = $this->Request()->getParam('fee');\n $sendTime = $this->Request()->getParam('sendTime');\n\n\n if ($config->get('merchantNo') == $merchantNO\n && md5($merchantNO . $orderNo . $orderAmount . $sendTime . $config->get('appSecrect')) == $signMsg\n ) {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n $order = $builder->getQuery()->getOneOrNullResult();\n\n if ($payResult == 10) {\n\n $this->setPaymentStatus($order->getTransactionId(), 12);\n $url = $this->basePathUrl . '/paymentpilipay/finish?orderNo='.$orderNo;\n\n echo '<result>1</result><redirecturl>' . $url . '</redirecturl>';\n $this->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if ($order->getOrderStatus() && $order->getOrderStatus()->getId() == 0) {\n $this->setOrderStatus($order->getTransactionId(), 0); // in process\n }\n } elseif ($payResult == 11) {\n $this->setPaymentStatus($order->getTransactionId(), 21);\n\n }\n }\n\n }", "public function getOcentureProductCode($freedomProductCode) {\r\n $products = [\r\n 'YSDPROTECHM1MO' => 'YP8383',\r\n 'YSDPROTECHM1YR' => 'YP83811',\r\n 'YSDPROIDM1MO' => 'YP8381',\r\n 'YSDPROIDM1YR' => 'YP8389',\r\n 'YSDPROIDF1MO' => 'YP8382',\r\n 'YSDPROIDF1YR' => 'YP83810',\r\n 'YSDPROIDMP1MO' => 'YP8387',\r\n 'YSDPROIDMP1YR' => 'YP83815',\r\n 'YSDPROIDFP1MO' => 'YP8388',\r\n 'YSDPROIDFP1YR' => 'YP83816',\r\n 'YSDPROROADM1MO' => 'YP8384',\r\n 'YSDPROROADM1YR' => 'YP83812',\r\n 'YSDPROBUNDLM1MO' => 'YP8385',\r\n 'YSDPROBUNDLM1YR' => 'YP83813',\r\n 'YSDPROBUNDLF1MO' => 'YP8386',\r\n 'YSDPROBUNDLF1YR' => 'YP83814',\r\n 'testproduct' => 'IG7985'\r\n ];\r\n\r\n if (isset($products[$freedomProductCode])) {\r\n return $products[$freedomProductCode];\r\n } else {\r\n die(\"no product found matching with ocenture\");\r\n }\r\n }", "public function addProductCode($code)\n {\n //$pieces = preg_split(\"/-/\", $code);\n //$programId = preg_replace(\"/\\D/\", \"\", $pieces[0]);\n }", "function checkdelivery($package) {\n\n\t$item = $package['item'];\t\n\t$quantity = $package['quantity'];\t\n\t$to = $package['to'];\t\n\t$from = $package['from'];\t\n\n// Based on the location of the delivery address and \n// the warehouse the courier can decide if they can \n// make the delivery. If yes, they could then let the \n// warehouse know the cost and delivery date.\n\n\t$accepted = 1;\n\n\tif ( $accepted )\n\t{\n\t\t$cost = 10;\n\t\t$date = '12-05-2004';\n\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => $cost,\n\t\t\t\t\t'date' => $date\n\t\t\t\t\t);\n\t} else {\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => 0,\n\t\t\t\t\t'date' => 'null'\n\t\t\t\t\t);\n\t}\n\n return new soapval('return', 'DeliveryDetail', $output, false, 'urn:MyURN');\n}", "private function getProductInformation()\r\n {\r\n \r\n // if product is repairable get the repair agents details as well as products and suppliers\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" || \r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplierRepairAgent_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n // if the product is not repairable grab the product information and supplier information only\r\n else\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplier_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n }", "abstract protected function getPaymentMethodCode();", "function buildHostRequest() {\r\n\t\t$strRequest = \"\";\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->amt ) > 0) {\r\n\t\t\t\t$strRequest .= \"amt=\" . $this->amt . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->action ) > 0) {\r\n\t\t\t\t$strRequest .= \"action=\" . $this->action . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->responseURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"responseURL=\" . $this->responseURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->errorURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"errorURL=\" . $this->errorURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->trackId ) > 0) {\r\n\t\t\t\t$strRequest .= \"trackid=\" . $this->trackId . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf1 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf1=\" . $this->udf1 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf2 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf2=\" . $this->udf2 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf3 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf3=\" . $this->udf3 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf4 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf4=\" . $this->udf4 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf5 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf5=\" . $this->udf5 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf6 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf6=\" . $this->udf6 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf7 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf7=\" . $this->udf7 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf8 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf8=\" . $this->udf8 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf9 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf9=\" . $this->udf9 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf10 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf10=\" . $this->udf10 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf11 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf11=\" . $this->udf11 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf12 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf12=\" . $this->udf12 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf13 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf13=\" . $this->udf13 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf14 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf14=\" . $this->udf14 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf15 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf15=\" . $this->udf15 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf16 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf16=\" . $this->udf16 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf17 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf17=\" . $this->udf17 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf18 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf18=\" . $this->udf18 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf19 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf19=\" . $this->udf19 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf20 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf20=\" . $this->udf20 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf21 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf21=\" . $this->udf21 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf22 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf22=\" . $this->udf22 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf23 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf23=\" . $this->udf23 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf24 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf24=\" . $this->udf24 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf25 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf25=\" . $this->udf25 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf26 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf26=\" . $this->udf26 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf27 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf27=\" . $this->udf27 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf28 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf28=\" . $this->udf28 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf29 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf29=\" . $this->udf29 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf30 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf30=\" . $this->udf30 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf31 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf31=\" . $this->udf31 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf32 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf32=\" . $this->udf32 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->currency ) > 0) {\r\n\t\t\t\t$strRequest .= \"currencycode=\" . $this->currency . \"&\";\r\n\t\t\t}\r\n\t\t\tif ($this->language != null && strlen ( $this->language ) > 0) {\r\n\t\t\t\t$strRequest .= \"langid=\" . $this->language . \"&\";\r\n\t\t\t}\r\n\t\t\treturn $strRequest;\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * finally{\r\n\t\t * $strRequest = null;\r\n\t\t * }\r\n\t\t */\r\n\t}", "private function dataCodeAction()\n {\n $code_action = array(\n 'ABO' => array('Abonnement', '1'),\n 'PROSP' => array('Prospection', '2'),\n 'PROSP1' => array('Prospection tracer 1', '2'),\n 'PROSP11' => array('Prospection tracer 11', '2'),\n 'PROSP12' => array('Prospection tracer 12', '2'),\n 'PROSP13' => array('Prospection tracer 13', '2'),\n 'PROSP2' => array('Prospection tracer 2', '2'),\n 'PROSP21' => array('Prospection tracer 21', '2'),\n 'PROSP22' => array('Prospection tracer 22', '2'),\n 'PROSP23' => array('Prospection tracer 23', '2'),\n 'PROSP24' => array('Prospection tracer 24', '2'),\n 'PROSP3' => array('Prospection tracer 3', '2'),\n 'PROSP5' => array('Prospection tracer 5', '2'),\n 'PROSP51' => array('Prospection tracer 51', '2'),\n 'PROSP52' => array('Prospection tracer 52', '2'),\n 'PROSP53' => array('Prospection tracer 53', '2'),\n 'PROSP ENTR' => array('Contact entrant sans fiche client', '2'),\n 'PROSP REL' => array('Prospection REL', '2'),\n 'PROSPWEB' => array('Prospection Web', '2'),\n 'FID' => array('FID', '20'),\n 'FID PROMO' => array('FID suite promo', '20'),\n 'FID PROG F' => array('FID programme fidélité', '20'),\n 'FID WEB PRGF' => array('FID web PRGF', '20'),\n 'FID WEB PROMO' => array('FID web PROMO', '20'),\n 'FID WEB PROM' => array('FID web PROMO', '20'),\n 'FID WEB' => array('FID web', '20'),\n 'PAR' => array('Parrainage', '27'),\n 'REACT+4M' => array('Reactivation fichier clients +4mois', '28'),\n 'REACT+4MPROMO' => array('Reactivation fichier clients +4mois suite à promo', '28'),\n 'REACT SPONT' => array('Reactivation client spontanée', '28'),\n 'REACT SPONT PROMO' => array('Reactivation client spontanée suite à promo', '28'),\n 'REACTSPONT' => array('Reactivation client AC formulaire', '28'),\n 'REACT AC FORM' => array('Reactivation client AC formulaire', '28'),\n 'REACTIV' => array('Reactivation REACTIV', '28'),\n 'CONT ENTR' => array('CONT ENTR', '35')\n );\n $data = array();\n $c = 1;\n foreach ($code_action as $key => $value) {\n $data[] = array(\n 'id_code_action' => (int)$c,\n 'name' => pSQL($key),\n 'description' => pSQL($value[0]),\n 'groupe' => (int)$value[1]\n );\n $c++;\n }\n\n return $data;\n }", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "public function getPartnerCode()\n {\n // todo: implement partner code storage.\n return null;\n }", "public function get_Code_produit()\n\t\t{\n\t\t\treturn $this->Code_produit;\n\t\t}", "public function getLocalProductCountryCode(): ?string\n {\n return $this->localProductCountryCode;\n }", "public function deliveryPriceDhaka()\n {\n }", "function calc_required_en(){\r\n\tif(strpos($this->Tactics['spec'],'DoubleStrike') !== false) $this->Eq['A']['enc'] *= 2;\r\n\tif(strpos($this->Tactics['spec'],'TripleStrike') !== false) $this->Eq['A']['enc'] *= 3;\r\n\t$MSEnCpos = strpos($this->MS['spec'],'CostEN');\r\n\tif($MSEnCpos !== false) {\r\n\t\t$temp = array();\r\n\t\tpreg_match('/CostEN<([0-9.]+)>/',$this->MS['spec'],$temp,0,$MSEnCpos);\r\n\t\t$MSEnC = floatval($temp[1]);\r\n\t\tif($MSEnC < 1) $MSEnC = floor($this->Player['enmax'] * $MSEnC);\r\n\t\t$this->Eq['A']['enc'] += $MSEnC;\r\n\t}\r\n\t$this->RequireEN = ($this->Eq['A']['enc'] + $this->Eq['D']['enc'] + $this->Eq['E']['enc']);\r\n}", "private function validateAvailableProduct() {\n\n\t\t$studio_data = &$this->session->data['studio_data'][$this->request->post['price_studio_id']]; //make it short\n\n\t\t//if price_id_product is not empty\n\t\tif (!isset($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t///if product exists\n\t\t} elseif (!$this->model_opentshirts_product->getTotalProductsByID($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t//if product price is setted up\n\t\t}else if ($this->model_opentshirts_price_product->getMinQuantity($studio_data['id_product'])===false) {\n\t\t\t$this->error['warning'] = $this->language->get('error_not_available');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function fixAction()\n {\n $mMainReq = Qss_Model_Db::Table('OYeuCauMuaSam');\n $mMainReq->where(sprintf('IFID_M412 = %1$d', $this->_form->i_IFID));\n $oMainReq = $mMainReq->fetchOne();\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n\n $this->html->main = $oMainReq;\n $this->html->sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "function fn_warehouses_get_product_data_post(&$product_data, $auth, $preview, $lang_code)\n{\n if (empty($product_data['product_id'])) {\n return;\n }\n\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n /** @var Tygh\\Addons\\Warehouses\\ProductStock $product_stock */\n $product_stock = $manager->getProductWarehousesStock($product_data['product_id']);\n\n if (!$product_stock->hasStockSplitByWarehouses()) {\n return;\n }\n\n if (AREA == 'C') {\n /** @var \\Tygh\\Location\\Manager $manager */\n $manager = Tygh::$app['location'];\n $destination_id = $manager->getDestinationId();\n\n $product_data['amount'] = $product_stock->getAmountForDestination($destination_id);\n } else {\n $product_data['amount'] = $product_stock->getAmount();\n }\n}", "public function execute()\n {\n /** @var \\Magento\\Framework\\Controller\\Result\\Json $result */\n $result = $this->resultJsonFactory->create();\n\n $productId = $this->getRequest()->getParam('productId');\n $qty = $this->getRequest()->getParam('qty');\n\n\n if (!$productId) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product ID is required'),\n ]);\n }\n\n\n // check product is in stock\n /** @var \\Magento\\Catalog\\Model\\Product $product */\n $product = $this->productFactory->create();\n $product->load($productId);\n if (!$product->getId()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Product not found'),\n ]);\n }\n if (!$product->isAvailable()) {\n // TODO: product placeholders\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n if ($product->isVirtual()) {\n return $result->setData([\n 'error' => true,\n 'messages' => __('Virtual products cannot be shipped'),\n ]);\n }\n\n $messages = \"\";\n if ($this->getProductSalableQty && $this->isProductSalable) {\n if ($this->helper->getInventoryStock() != null) {\n if($product->getTypeId() == 'simple') {\n $qtyInStock = $this->getProductSalableQty->execute($product->getSku(), $this->helper->getInventoryStock());\n if ($qty > $qtyInStock) {\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n } else {\n $messages = \"stock = \" . $this->helper->getInventoryStock() . \" \" . $product->getSku() . \" \" . $qty . \" in stock \" . $qtyInStock . \" \" . $product->getTypeId();\n }\n }else{\n if($this->isProductSalable->execute($product->getSku(), $this->helper->getInventoryStock())){\n $messages = \"product is saleable\";\n }else{\n return $result->setData([\n 'error' => true,\n 'messages' => $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n }\n } else {\n $messages = \"inventory stock null\";\n }\n } else {\n $messages = __(\"MSI not supported: \") . $product->getSku() . \" \" . $product->getTypeId();\n //probably just means MSI not supported here.\n }\n\n\n $transport = new DataObject([\n 'available' => true,\n ]);\n $this->eventManager->dispatch('porterbuddy_availability', array(\n 'product' => $product,\n 'qty' => $qty,\n 'result' => $transport,\n ));\n\n if ($transport->getError()) {\n return $result->setData([\n 'error' => true,\n 'messages' => $transport->getMessage() ?: $this->helper->processPlaceholders(\n $this->helper->getAvailabilityTextOutOfStock()\n )\n ]);\n }\n\n return $result->setData([\n 'error' => false,\n 'available' => true,\n 'messages' => $messages\n ]);\n }", "function dsf_protx_release_order($order_number){\n\nglobal $ReleaseURL, $Verify, $ProtocolVersion;\n\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please release the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'Protx Item not Found';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please release the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'More than one protx item found';\n\tbreak;\n }\n \t\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n\n // we must have a valid transaction item if we are here, get the array of items.\n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$TargetURL = $ReleaseURL;\n$VerifyServer = $Verify;\n\n// echo 'URL = ' . $TargetURL;\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => 'RELEASE',\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response ='';\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been released witin protx.\n\t\t\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '13');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '13', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as released however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn $response;\n}", "public function make3DPayPayment()\n {\n $status = 'declined';\n $response = 'Declined';\n $proc_return_code = $this->request->get('procreturncode');\n\n $transaction_security = 'MPI fallback';\n if (in_array($this->request->get('mdstatus'), [1, 2, 3, 4])) {\n if ($this->request->get('mdstatus') == '1') {\n $transaction_security = 'Full 3D Secure';\n } elseif (in_array($this->request->get('mdstatus'), [2, 3, 4])) {\n $transaction_security = 'Half 3D Secure';\n }\n\n $status = 'approved';\n $response = 'Approved';\n }\n\n $this->response = (object) [\n 'id' => (string) $this->request->get('authcode'),\n 'order_id' => (string) $this->request->get('oid'),\n 'trans_id' => (string) $this->request->get('transid'),\n 'auth_code' => (string) $this->request->get('authcode'),\n 'host_ref_num' => (string) $this->request->get('hostrefnum'),\n 'response' => $response,\n 'transaction_type' => $this->type,\n 'transaction' => $this->order->transaction,\n 'transaction_security' => $transaction_security,\n 'proc_return_code' => $proc_return_code,\n 'code' => $proc_return_code,\n 'md_status' => $this->request->get('mdStatus'),\n 'status' => $status,\n 'status_detail' => isset($this->codes[$this->request->get('ProcReturnCode')]) ? (string) $this->request->get('ProcReturnCode') : null,\n 'hash' => (string) $this->request->get('secure3dhash'),\n 'rand' => (string) $this->request->get('rnd'),\n 'hash_params' => (string) $this->request->get('hashparams'),\n 'hash_params_val' => (string) $this->request->get('hashparamsval'),\n 'masked_number' => (string) $this->request->get('MaskedPan'),\n 'amount' => (string) $this->request->get('amount'),\n 'currency' => (string) $this->request->get('currency'),\n 'tx_status' => (string) $this->request->get('txstatus'),\n 'eci' => (string) $this->request->get('eci'),\n 'cavv' => (string) $this->request->get('cavv'),\n 'xid' => (string) $this->request->get('xid'),\n 'error_code' => (string) $this->request->get('errcode'),\n 'error_message' => (string) $this->request->get('errmsg'),\n 'md_error_message' => (string) $this->request->get('mderrormessage'),\n 'campaign_url' => null,\n 'name' => (string) $this->request->get('firmaadi'),\n 'email' => (string) $this->request->get('Email'),\n 'extra' => $this->request->get('Extra'),\n 'all' => $this->request->all(),\n ];\n\n return $this;\n }", "public function getPrepareOutgoingConsignmentRequest()\n {\n $request = new PrepareOutgoingConsignmentRequest();\n $request->localTransactionId = $this->localTransactionId;\n $request->initiator = $this->initiator;\n\n $enterprise = mercDicconst::getSetting('enterprise_guid');\n $hc = mercDicconst::getSetting('issuer_id');\n\n $delivery = new Delivery();\n $delivery->consignor = new BusinessMember();\n $delivery->consignor->enterprise = new Enterprise();\n $delivery->consignor->enterprise->guid = $enterprise;\n $delivery->consignor->businessEntity = new BusinessEntity();\n $delivery->consignor->businessEntity->guid = $hc;\n\n $delivery->consignee = new BusinessMember();\n $delivery->consignee->enterprise = new Enterprise();\n $delivery->consignee->enterprise->guid = $this->step3['recipient'];\n $delivery->consignee->businessEntity = new BusinessEntity();\n $delivery->consignee->businessEntity->guid = $this->step3['hc'];\n\n $consigments = [];\n $vetCertificates = [];\n\n if(isset($this->conditions)) {\n $this->conditions = json_decode($this->conditions, true);\n }\n\n foreach ($this->step1 as $id => $product) {\n $consigment = new Consignment();\n $consigment->id = 'con'.$id;\n $stock = MercStockEntry::findOne(['id' => $id]);\n $stock_raw = unserialize($stock->raw_data);\n if($stock->product_name != $product['product_name'])\n {\n\n }\n $consigment->volume = $product['select_amount'];\n $consigment->unit = new Unit();\n $consigment->unit = $stock_raw->batch->unit;\n\n $consigment->sourceStockEntry = new StockEntry();\n //$consigment->sourceStockEntry->uuid = $stock->uuid;\n $consigment->sourceStockEntry->guid = $stock->guid;\n\n $consigments[] = $consigment;\n\n $vetCertificate = new VetDocument();\n $vetCertificate->for = 'con'.$id;\n $authentication['purpose']['guid'] = $this->step2['purpose'];\n $authentication['cargoExpertized'] = $this->step2['cargoExpertized'];\n $authentication['locationProsperity'] = $this->step2['locationProsperity'];\n\n //Заполняем условия регионализации при необходимости\n //var_dump($this->conditions); die();\n if(isset($this->conditions[$product['product_name']])) {\n $conditions = null;\n $buff = $this->conditions[$product['product_name']];\n foreach ($buff as $key=>$item) {\n $r13nClause = new RegionalizationClause();\n $r13nClause->condition = new RegionalizationCondition();\n $r13nClause->condition->guid = $key;\n $conditions[] = $r13nClause;\n }\n $authentication['r13nClause'] = $conditions;\n }\n $vetCertificate->authentication = $authentication;\n $vetCertificates[] = $vetCertificate;\n }\n\n $delivery->consignment = $consigments;\n\n $delivery->transportInfo = new TransportInfo();\n $delivery->transportInfo->transportType = $this->step4['type'];\n $delivery->transportInfo->transportNumber = new TransportNumber();\n $delivery->transportInfo->transportNumber->vehicleNumber = $this->step4['car_number'];\n if (isset($this->step4['trailer_number'])) {\n $delivery->transportInfo->transportNumber->trailerNumber = $this->step4['trailer_number'];\n }\n if (isset($this->step4['container_number'])) {\n $delivery->transportInfo->transportNumber->containerNumber = $this->step4['container_number'];\n }\n $delivery->transportStorageType = $this->step4['storage_type'];\n\n $delivery->accompanyingForms = new ConsignmentDocumentList();\n if($this->step3['isTTN']) {\n $delivery->accompanyingForms->waybill = new Waybill();\n $delivery->accompanyingForms->waybill->issueSeries = $this->step3['seriesTTN'];\n $delivery->accompanyingForms->waybill->issueNumber = $this->step3['numberTTN'];\n $delivery->accompanyingForms->waybill->issueDate = date('Y-m-d', strtotime($this->step3['dateTTN']));\n $delivery->accompanyingForms->waybill->type = $this->step3['typeTTN'];\n }\n\n $delivery->accompanyingForms->vetCertificate = $vetCertificates;\n\n $request->delivery = $delivery;\n\n /* echo \"<pre>\";\n var_dump($request); die();*/\n return $request;\n }", "public function process ()\n {\n /**\n * Sets pricing for which offer is applicable.\n */\n $this->setOfferApplicablePricing();\n\n /**\n * Checks if offer is valid.\n */\n if ( $this->isOfferValid() ) {\n\n /**\n * Sets benefits gained from offer.\n */\n $this->setBenefit();\n }\n\n return $this->request;\n }", "protected function _drcRequest($service)\r\n\t{\r\t\t$db = Mage::getSingleton('core/resource')->getConnection('core_write');\r\t\t\r\n\t\t$origCountry = Mage::getStoreConfig('shipping/origin/country_id', $this->getStore());\r\n\t\tif ($origCountry != \"AU\") \r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\r\r\n\t\t// TODO: Add some more validations\r\t\t$path_smartsend = \"carriers/smartsend/\";\r\t\t\r\n\t\t//$frompcode = Mage::getStoreConfig('shipping/origin/postcode', $this->getStore());\r\n\t\t//$fromsuburb = Mage::getStoreConfig('shipping/origin/city', $this->getStore());\r\t\t\r\t\t$frompcode = Mage::getStoreConfig($path_smartsend.'post_code', $this->getStore());\r\t\t$fromsuburb = Mage::getStoreConfig($path_smartsend.'suburban', $this->getStore());\r\t\t\r\n\t\t$topcode = $service->getDestPostcode();\r\n\t\t$tosuburb = $service->getDestCity();\r\r\t\tMage::Log($frompcode);\r\t\tMage::Log($fromsuburb);\r\t\t\r\n\t\tif ($service->getDestCountryId()) {\r\n\t\t\t$destCountry = $service->getDestCountryId();\r\n\t\t} \r\r\n\t\telse{\r\n\t\t\t$destCountry = \"AU\";\r\n\t\t}\t\t\r\t\r\n\t\t// Here we get the weight (and convert it to grams) and set some\r\n\t\t// sensible defaults for other shipping parameters.\t\r\r\n\t\t$weight = (int)$service->getPackageWeight();\r\t\t\r\t\t$height = $width = $length = 100;\r\n\t\t$shipping_num_boxes = 1;\r\n\t\t$Description = \"CARTON\";\r\n\t\t$post_url = \"http://api.smartsend.com.au/\"; \r\r\t\r\n \r\t//$result = $db->query(\"SELECT depth,length,height,description,taillift FROM 'smartsend_products'\");\r\t\r\t\r\n $post_param_values[\"METHOD\"] = \"GetQuote\";\r\n $post_param_values[\"FROMCOUNTRYCODE\"] = $origCountry;\r\n $post_param_values[\"FROMPOSTCODE\"] = $frompcode; //\"2000\";\r\n $post_param_values[\"FROMSUBURB\"] = $fromsuburb; //\"SYDNEY\";\r\n $post_param_values[\"TOCOUNTRYCODE\"] = $destCountry;\r\n $post_param_values[\"TOPOSTCODE\"] = $topcode;\r\n $post_param_values[\"TOSUBURB\"] = $tosuburb;\r\r\n\r\t\r\n # tail lift - init \r\n $taillift = array();\r\n $key = 0;\r\r\n\t$freeBoxes = 0;\r\n if ($service->getAllItems()) {\r\n foreach ($service->getAllItems() as $item) {\r\r\n\t/* fetching the values of lenght,weight,height,description in smartsend_products table */\r\t\t\t\t$prod_id = $item->getProduct()->getId();\r\t\t\t\t\r\t\t\t\t\r\n if ($item->getProduct()->isVirtual() || $item->getParentItem()) {\r\r\n continue;\r\r\n }\r\r\n\r\r\n if ($item->getHasChildren() && $item->isShipSeparately()) {\r\r\n foreach ($item->getChildren() as $child) {\r\r\n if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {\r\r\n $freeBoxes += $item->getQty() * $child->getQty();\r\r\n }\r\r\n }\r\r\n } elseif ($item->getFreeShipping()) {\r\r\n $freeBoxes += $item->getQty();\r\r\n }\r\t\t\t\t\r\t\t\t\t$prod_id \t= $item->getProduct()->getId();\r\t\t\t\t$result \t= $db->query('Select * from `smartsend_products` where id='.\"'\".$prod_id.\"'\");\r\t\t\t\t$rows \t\t= $result->fetch(PDO::FETCH_ASSOC);\r\t\t\t\t\r\t\t\t\t\r\t\t\t\tif($rows){\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = $rows['height'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = $rows['length'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = $rows['depth'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $rows['description'];\r\t\t\t\t}else{\r\t\t\t\t\t/* default values */\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = 'none';\t\t\t\t\r\t\t\t\t}\r\r # tail lift - assigns value\r switch($rows['taillift']){\r case 'none':\r $taillift[] = \"none\";break;\r case 'atpickup':\r $taillift[] = \"atpickup\";break; \r case 'atdestination':\r $taillift[] = \"atdestination\";break; \r case 'both':\r $taillift[] = \"both\";break; \r }\r\t\t\t\t\t\r\t\t\t\t$key++;\r\n }\r\r\n }\r\t\t\r\t\t\r\r\n $this->setFreeBoxes($freeBoxes);\r\t\t\t\t\t\t\t\r/*\r\n $post_value_items[\"ITEM({$key})_HEIGHT\"] = $height;\r\n $post_value_items[\"ITEM({$key})_LENGTH\"] = $length;\r\n $post_value_items[\"ITEM({$key})_DEPTH\"] = $width;\r\n $post_value_items[\"ITEM({$key})_WEIGHT\"] = $width;\r\n $post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $Description;\r*/\r \r \t\t\r\r\n # tail lift - choose appropriate value\r\r\n $post_param_values[\"TAILLIFT\"] = \"none\"; \r\r\n if (in_array(\"none\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"none\"; \r\n if (in_array(\"atpickup\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atpickup\";\r\n if (in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atdestination\";\r\n if (in_array(\"atpickup\", $taillift) && in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\";\r\n if (in_array(\"both\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\"; \r\r\n \r\r\n $post_final_values = array_merge($post_param_values,$post_value_items);\r\r\n # POST PARAMETER AND ITEMS VALUE URLENCODE\r\r\n $post_string = \"\";\r\r\n foreach( $post_final_values as $key => $value )\r\n { $post_string .= \"$key=\" . urlencode( $value ) . \"&\"; }\r\n $post_string = rtrim( $post_string, \"& \" );\r\r\n\tif ($service->getFreeShipping() === true || $service->getPackageQty() == $this->getFreeBoxes()) {\r $shippingPrice = '0.00';\r\t\t\t\t\r\r\n $arr_resp['ACK'] = 'Success';\r $arr_resp['QUOTE(0)_TOTAL'] = $shippingPrice;\r $arr_resp['QUOTE(0)_ESTIMATEDTRANSITTIME'] = 'Fixed';\r $arr_resp['QUOTECOUNT'] = 1;\r\r\n }else{\r\r\n \r\r\n # START CURL PROCESS\r\r\n $request = curl_init($post_url); \r\tcurl_setopt($request, CURLOPT_HEADER, 0); \r\tcurl_setopt($request, CURLOPT_RETURNTRANSFER, 1); \r\n curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);\r\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n $post_response = curl_exec($request); \r\n curl_close ($request); // close curl object \r\r\n\t# parse output\r\n parse_str($post_response, $arr_resp);\r\r\n\t}\r\r\n\treturn $arr_resp;\r\r\n\t}", "abstract protected function getRequirement(): string;", "public function getPaymentRequest(): string;", "public function cs_proress_request($params = array()) {\n global $post, $cs_gateway_options, $cs_form_fields2;\n extract($params);\n\n $cs_current_date = date('Y-m-d H:i:s');\n $output = '';\n $rand_id = $this->cs_get_string(5);\n $business_email = $cs_gateway_options['cs_paypal_email'];\n\n\n $currency = isset($cs_gateway_options['cs_currency_type']) && $cs_gateway_options['cs_currency_type'] != '' ? $cs_gateway_options['cs_currency_type'] : 'USD';\n $cs_opt_hidden1_array = array(\n 'id' => '',\n 'std' => '_xclick',\n 'cust_id' => \"\",\n 'cust_name' => \"cmd\",\n 'return' => true,\n );\n $cs_opt_hidden2_array = array(\n 'id' => '',\n 'std' => sanitize_email($business_email),\n 'cust_id' => \"\",\n 'cust_name' => \"business\",\n 'return' => true,\n );\n $cs_opt_hidden3_array = array(\n 'id' => '',\n 'std' => $cs_trans_amount,\n 'cust_id' => \"\",\n 'cust_name' => \"amount\",\n 'return' => true,\n );\n $cs_opt_hidden4_array = array(\n 'id' => '',\n 'std' => $currency,\n 'cust_id' => \"\",\n 'cust_name' => \"currency_code\",\n 'return' => true,\n );\n $cs_opt_hidden5_array = array(\n 'id' => '',\n 'std' => $cs_package_title,\n 'cust_id' => \"\",\n 'cust_name' => \"item_name\",\n 'return' => true,\n );\n $cs_opt_hidden6_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_job_id),\n 'cust_id' => \"\",\n 'cust_name' => \"item_number\",\n 'return' => true,\n );\n $cs_opt_hidden7_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"cancel_return\",\n 'return' => true,\n );\n $cs_opt_hidden8_array = array(\n 'id' => '',\n 'std' => '1',\n 'cust_id' => \"\",\n 'cust_name' => \"no_note\",\n 'return' => true,\n );\n $cs_opt_hidden9_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"invoice\",\n 'return' => true,\n );\n $cs_opt_hidden10_array = array(\n 'id' => '',\n 'std' => esc_url($this->listner_url),\n 'cust_id' => \"\",\n 'cust_name' => \"notify_url\",\n 'return' => true,\n );\n $cs_opt_hidden11_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"lc\",\n 'return' => true,\n );\n $cs_opt_hidden12_array = array(\n 'id' => '',\n 'std' => '2',\n 'cust_id' => \"\",\n 'cust_name' => \"rm\",\n 'return' => true,\n );\n $cs_opt_hidden13_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"custom\",\n 'return' => true,\n );\n $cs_opt_hidden14_array = array(\n 'id' => '',\n 'std' => esc_url(home_url('/')),\n 'cust_id' => \"\",\n 'cust_name' => \"return\",\n 'return' => true,\n );\n\n $output .= '<form name=\"PayPalForm\" id=\"direcotry-paypal-form\" action=\"' . $this->gateway_url . '\" method=\"post\"> \n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden1_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden2_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden3_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden4_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden5_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden6_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden7_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden8_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden9_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden10_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden11_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden12_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden13_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden14_array) . '\n </form>';\n\n\n $data = CS_FUNCTIONS()->cs_special_chars($output);\n $data .= '<script>\n\t\t\t\t\t \t jQuery(\"#direcotry-paypal-form\").submit();\n\t\t\t\t\t </script>';\n echo CS_FUNCTIONS()->cs_special_chars($data);\n }", "public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n $this->load->model('esls_model');\n\n $formData = $this->input->post(NULL, TRUE);\n\n //DATA THAT COMES FROM PRODUCERS\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"delivery_ready\"){\n $this->process_delivery_ready_event($formData);\n }\n else if($name === \"bid_awarded\"){\n $this->process_bid_awarded_event($formData);\n }\n }", "public function process_request () {\n \n add_action( 'admin_notices', array( $this, 'admin_notices' ) );\n \n $supported_actions = array( 'activate-products', 'deactivate-product' );\n if ( !isset( $_REQUEST['action'] ) || !in_array( $_REQUEST['action'], $supported_actions ) || !check_admin_referer( 'bulk-' . 'licenses' ) ) {\n return null;\n }\n \n $response = false;\n $status = 'false';\n $type = $_REQUEST['action'];\n\n switch ( $type ) {\n case 'activate-products':\n $products = array();\n if ( isset( $_POST[ 'products' ] ) && 0 < count( $_POST[ 'products' ] ) ) {\n foreach ( $_POST[ 'products' ] as $k => $v ) {\n if ( !empty( $v[ 'license_key' ] ) ) {\n $products[$k] = $v;\n }\n }\n }\n if ( 0 < count( $products ) ) {\n //echo \"<pre>\"; print_r( $products ); echo \"</pre>\"; die();\n $response = $this->activate_products( $products );\n } else {\n $response = false;\n $type = 'no-license-keys';\n }\n break;\n\n case 'deactivate-product':\n if ( isset( $_GET['filepath'] ) && ( '' != $_GET['filepath'] ) ) {\n $response = $this->deactivate_product( $_GET['filepath'] );\n }\n break;\n\n default:\n break;\n }\n\n if ( $response == true ) {\n $status = 'true';\n }\n \n $redirect_url = \\UsabilityDynamics\\Utility::current_url( array( 'type' => urlencode( $type ), 'status' => urlencode( $status ) ), array( 'action', 'filepath', '_wpnonce' ) );\n wp_safe_redirect( $redirect_url );\n exit;\n }", "function trackingno($carrier, $trno, $shipmentMethod){\n\t$carrier1=$carrier;\t\n\t$carrier=strtolower($carrier);\n\t\n\t//$trno=strtolower($trno);\n\t$shipmentMethod1=$shipmentMethod; \n\t$shipmentMethod=strtolower($shipmentMethod);\n\t\n\t$carrierdata=\" (Not Specified)\";\n\t$carrierRG=\"Not Specified\";\n\t\n\t\tif($carrier !=\"\" ){$carrierdata=\" (\".$carrier1.\")\";}\n\tif($carrier=='ups (usa)' || $carrier=='ups' || $carrier=='ups (us)'){\n\t\t\n\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t}\n\t\telseif($carrier==\"\" && substr($shipmentMethod, 0, 3) === 'ups'){\n\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='fedex (usa)' || $carrier=='fedex' || $carrier=='fedex (us)'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t}\n\t\telseif($carrier=='' && substr($shipmentMethod, 0, 3) =='fedex'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='us postal service'){\n\t\t\t$clink=\"https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=\";\n\t\t}\n\t\t\n\t\telseif($carrier=='miscellaneous' || $carrier=='miscellaneous (us)'){$clink=\"\";}\n\t\telse{$clink=\"\";}\n\t\t\n\t\tif($clink == \"\"){\n\t\t\tif($carrier1!=\"\"){$carrierRG=$carrier1;}\n\t\t\tif (preg_match(\"/\\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\\dT]\\d\\d\\d ?\\d\\d\\d\\d ?\\d\\d\\d)\\b/\", $trno)) {\n\t\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\t\n\t\t\telseif (preg_match(\"/(\\b96\\d{20}\\b)|(\\b\\d{15}\\b)|(\\b\\d{12}\\b)/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/\\b((98\\d\\d\\d\\d\\d?\\d\\d\\d\\d|98\\d\\d) ?\\d\\d\\d\\d ?\\d\\d\\d\\d( ?\\d\\d\\d)?)\\b/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/^[0-9]{15}$/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($clink != \"\"){\n\t\t\t$trdata=\"<a href='\".$clink.\"\".$trno.\"' target='_blank'>\".$trno.\"</a>\".$carrierdata.\", \";\n\t\t}\n\t\telse{\n\t\t\t$trdata=$trno.\"\".$carrierdata.\", \";\n\t\t\t}\n\t\tif($trno==\"\"){$trdata=\"\";}\n\t\treturn $trdata;\n\t}", "protected function get_request(){\n\t\treturn \"value_cashflows\";\n\t}", "public function getDeliveryMode()\n {\n }", "abstract function can_use_premium_code();", "public function normalAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "public function getProduct() {\n\t\t// if this is just a model made on our end, we might not the serialized product yet\n\t\t// alternatively: newer BillForward may omit serialized product and necessitate a fetch\n\t\tif (!$this->product) {\n\t\t\tif (!$this->productID) {\n\t\t\t\tthrow new Bf_PreconditionFailedException(\"This Bf_ProductRatePlan has neither a 'product' specified, nor a 'productID' by which to obtain said product.\");\n\t\t\t}\n\t\t\t$this->product = Bf_Product::getByID($this->productID);\n\t\t}\n\t\treturn $this->product;\n\t}", "public function request(){\n return \\Gaia\\ShortCircuit::request();\n }", "function main( $isFuturePay ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : handling WorldPay payment response IPN\");\r\n\r\n $objects = $ids = $input = array( );\r\n\r\n $component = self::retrieve('MC_module','String','POST',true);\r\n $input[\"component\"] = $component;\r\n $contact = self::retrieve('MC_contact_id','Integer','POST',true);\r\n\r\n $this->getInput($input,$ids);\r\n\r\n if (!$isFuturePay) {\r\n // not a future payment notication but may be a future payment\r\n // agreement being made...\r\n\r\n // get ids\r\n $ids[\"contact\"] = self::retrieve('MC_contact_id','String','POST',true);\r\n $ids[\"contribution\"] = self::retrieve('MC_contribution_id','String','POST',true);\r\n $ids[\"thankyoupage\"] = self::retrieve('MC_civi_thankyou_url','String','POST',true);\r\n $ids[\"cancelpage\"] = self::retrieve('MC_civi_cancel_url','String','POST',true);\r\n if ($component=='event') {\r\n $ids[\"event\"] = self::retrieve('MC_event_id','String','POST',true);\r\n $ids[\"participant\"] = self::retrieve('MC_participant_id','String','POST',true);\r\n }\r\n else {\r\n // contribution optional id's\r\n $ids['membership'] = self::retrieve('MC_membership_id','String','POST',false);\r\n $ids['contributionRecur'] = self::retrieve( 'MC_contribution_recur_id', 'Integer', 'GET', false );\r\n $ids['contributionPage'] = self::retrieve( 'MC_contribution_page_id' , 'Integer', 'GET', false );\r\n }\r\n\r\n if (is_numeric($input[\"futurePayId\"])) {\r\n // this is a futurepay agreement being made \r\n // so store the ids and do nothing more here\r\n // since no money has actually been transferred yet\r\n // ...watch futurepay repsonse for such transfers\r\n self::storeFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n return;\r\n }\r\n }\r\n else {\r\n if (!is_numeric($input[\"futurePayId\"])) {\r\n CRM_Core_Error::debug_log_message(\"futurePayId is missing for recurring payment.\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : futurePayId is missing for recurring payment. input=\".print_r($input,true));\r\n exit();\r\n }\r\n self::retrieveFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n if (!$ids) {\r\n CRM_Core_Error::debug_log_message(\"Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n exit();\r\n }\r\n }\r\n\r\n $paymentProcessorID = self::retrieve('processor_id', 'Integer', 'POST', FALSE);\r\n if (empty($paymentProcessorID)) {\r\n $processorParams = array(\r\n 'user_name' => self::retrieve('installation', 'String', 'POST', FALSE),\r\n 'payment_processor_type_id' => CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', 'WorldPay', 'id', 'name'),\r\n 'is_test' => empty($input['is_test']) ? 0 : 1,\r\n );\r\n\r\n $processorInfo = array();\r\n if (!CRM_Financial_BAO_PaymentProcessor::retrieve($processorParams, $processorInfo)) {\r\n return FALSE;\r\n }\r\n $paymentProcessorID = $processorInfo['id'];\r\n }\r\n\r\n // validateData also loads the obects\r\n if (!$this->validateData($input,$ids,$objects,TRUE,$paymentProcessorID)) {\r\n error_log(__FILE__.\":\".__LINE__.\": validate data failed, input=\".print_r($input,true).\" ids=\".print_r($ids,true));\r\n return false;\r\n }\r\n\r\n self::$_paymentProcessor =& $objects['paymentProcessor'];\r\n if ($isFuturePay) {\r\n // future pay payment notification\r\n return $this->handleFuturepayPayment($input,$ids,$objects);\r\n }\r\n else if (is_numeric($input[\"futurePayId\"])) {\r\n // future pay payment initial agreement set up\r\n // appears like a single payment but no money changes hands\r\n return $this->handleFuturepayAgreement($input,$ids,$objects);\r\n }\r\n else {\r\n // single payment\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : now processing single payment\");\r\n return $this->handleSinglePayment($input,$ids,$objects);\r\n }\r\n }", "public function getDeliverySuggestionCode()\n {\n return $this->_deliverySuggestionCode;\n }", "public function code() {\n Authentication::guard();\n\n $_POST = json_decode(file_get_contents('php://input'), true);\n\n if(!Csrf::check('global_token')) {\n die();\n }\n\n if(empty($_POST)) {\n die();\n }\n\n if(!settings()->payment->is_enabled || !settings()->payment->codes_is_enabled) {\n die();\n }\n\n /* Make sure the discount code exists */\n $code = db()->where('code', $_POST['code'])->where('type', 'redeemable')->where('redeemed < quantity')->getOne('codes');\n\n if(!$code) {\n Response::json(language()->account_plan->error_message->code_invalid, 'error');\n }\n\n /* Make sure the plan id exists and get details about it */\n $plan = (new Plan())->get_plan_by_id($code->plan_id);\n\n if(!$plan) {\n Response::json(language()->account_plan->error_message->code_invalid, 'error');\n }\n\n /* Make sure the code was not used previously */\n if(db()->where('user_id', $this->user->user_id)->where('code_id', $code->code_id)->getOne('redeemed_codes', ['id'])) {\n Response::json(language()->account_plan->error_message->code_used, 'error');\n }\n\n Response::json(sprintf(language()->account_plan->success_message->code, '<strong>' . $plan->name . '</strong>', '<strong>' . $code->days . '</strong>'), 'success', ['discount' => $code->discount]);\n }", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "private function getCodigoPresupuestarioApuestaLicita()\r\n\t\t{\r\n\t\t\t$codigoPresupuesto['codigo'] = '301021100';\r\n\t\t\treturn $codigo = self::getCodigoPresupuestarioByCodigo($codigoPresupuesto['codigo']);\r\n\t\t}", "public function productScanning(){\n $user = $this->auth();\n if(empty($this->auth())){\n Utils::response(['status'=>false,'message'=>'Forbidden access.'],403);\n }\n $data = $this->getInput();\n if(($this->input->method() != 'post') || empty($data)){ \n Utils::response(['status'=>false,'message'=>'Bad request.'],400);\n }\n $validate = [\n ['field' =>'bar_code','label'=>'Barcode','rules' => 'required' ],\n\t\t\t['field' =>'scan_city','label'=>'Scan City','rules' => 'trim' ],\n\t\t\t['field' =>'pin_code','label'=>'Scan PIN Code','rules' => 'trim' ],\n ['field' =>'latitude','label'=>'Latitude','rules' => 'trim'],\n ['field' =>'longitude','label'=>'Longitude','rules' => 'trim' ],\n\t\t\t//['field' =>'registration_address','label'=>'Registration Address','rules' => 'trim|required' ],\n ];\n $errors = $this->ScannedproductsModel->validate($data,$validate);\n if(is_array($errors)){\n Utils::response(['status'=>false,'message'=>'Validation errorss.','errors'=>$errors]);\n }\n $result = $this->ScannedproductsModel->findProduct($data['bar_code']);\n $bar_code_data = $data['bar_code'];\n\t\t$bar_code2_data = $data['bar_code'];\n\t\t$product_id = $result->id;\n\t\t$consumerId = $user['id'];\n\t\t$data['ps_ip_address'] = $this->input->ip_address();\n\t\t\n\t\t// function to get product registration status\n $isRegistered = $this->ScannedproductsModel->isProductRegistered($bar_code_data, $bar_code2_data); \n\t\n $isLoyaltyForVideoFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForVideoFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForAudioFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForAudioFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForImageFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForImageFBQuesGiven($consumerId,$product_id);\n $isLoyaltyForPDFFBQuesGiven = $this->ScannedproductsModel->isLoyaltyForPDFFBQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdPDFFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdPDFFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductPushedAdImageFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductPushedAdImageFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$isLoyaltyForProductSurveyVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyPDFFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyPDFFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductSurveyImageFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductSurveyImageFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$isLoyaltyForProductDemoVideoFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductDemoVideoFeedbackQuesGiven($consumerId,$product_id);\n\t\t$isLoyaltyForProductDemoAudioFeedbackQuesGiven = $this->ScannedproductsModel->isLoyaltyForProductDemoAudioFeedbackQuesGiven($consumerId,$product_id);\n\t\t\n\t\t$mnv25_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 25)->get()->row();\n\t\t$mnvtext25 = $mnv25_result->message_notification_value;\n\t\t$mnv26_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 26)->get()->row();\n\t\t$mnvtext26 = $mnv26_result->message_notification_value;\n\t\t$mnv27_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 27)->get()->row();\n\t\t$mnvtext27 = $mnv27_result->message_notification_value;\n\t\t$mnv28_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 28)->get()->row();\n\t\t$mnvtext28 = $mnv28_result->message_notification_value;\n\t\t$mnv29_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 29)->get()->row();\n\t\t$mnvtext29 = $mnv29_result->message_notification_value;\n\t\t$mnv30_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 30)->get()->row();\n\t\t$mnvtext30 = $mnv30_result->message_notification_value;\n \n if(empty($result)){\n $data['user_id'] = $user['id'];\n $data['created'] = date('Y-m-d H:i:s');\n $this->db->insert('scanned_product_logs', $data);\n\t\t$mnv24_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 24)->get()->row();\n\t\t$mnvtext24 = $mnv24_result->message_notification_value;\n //$this->response(['status'=>false,'message'=>'This product and barcode is not supported by TRUSTAT.'],200);\n\t\t\t$this->response(['status'=>false,'message'=>$mnvtext24],200);\n }\n\t\tif(!empty($result->product_thumb_images)){\n $result->product_thumb_images = Utils::setFileUrl($result->product_thumb_images);\n }\n\t\t\n if(!empty($result->product_image)){\n $result->product_image = Utils::setFileUrl($result->product_image);\n }\n\t\tif(!empty($result->product_code_print_bg_images)){\n $result->product_code_print_bg_images = Utils::setFileUrl($result->product_code_print_bg_images);\n }\n if(!empty($result->product_video)){\n $result->product_video = Utils::setFileUrl($result->product_video);\n }\n if(!empty($result->product_audio)){\n $result->product_audio = Utils::setFileUrl($result->product_audio);\n }\n if(!empty($result->product_pdf)){\n $result->product_pdf = Utils::setFileUrl($result->product_pdf);\n }\n\t\tif(!empty($result->product_demo_video)){\n $result->product_demo_video = Utils::setFileUrl($result->product_demo_video);\n }\n\t\tif(!empty($result->product_demo_audio)){\n $result->product_demo_audio = Utils::setFileUrl($result->product_demo_audio);\n }\n\t\tif(!empty($result->product_user_manual)){\n $result->product_user_manual = Utils::setFileUrl($result->product_user_manual);\n }\n\t\t$result->product_registration_status = $isRegistered;\n\n\t\t$result->isLoyaltyForVideoFBQuesGiven = $isLoyaltyForVideoFBQuesGiven;\n\t\t$result->isLoyaltyForAudioFBQuesGiven = $isLoyaltyForAudioFBQuesGiven;\n\t\t$result->isLoyaltyForImageFBQuesGiven = $isLoyaltyForImageFBQuesGiven;\n\t\t$result->isLoyaltyForPDFFBQuesGiven = $isLoyaltyForPDFFBQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdVideoFeedbackQuesGiven = $isLoyaltyForProductPushedAdVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdAudioFeedbackQuesGiven = $isLoyaltyForProductPushedAdAudioFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdPDFFeedbackQuesGiven = $isLoyaltyForProductPushedAdPDFFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductPushedAdImageFeedbackQuesGiven = $isLoyaltyForProductPushedAdImageFeedbackQuesGiven;\n\t\t\n\t\t$result->isLoyaltyForProductSurveyVideoFeedbackQuesGiven = $isLoyaltyForProductSurveyVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyAudioFeedbackQuesGiven = $isLoyaltyForProductSurveyAudioFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyPDFFeedbackQuesGiven = $isLoyaltyForProductSurveyPDFFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductSurveyImageFeedbackQuesGiven = $isLoyaltyForProductSurveyImageFeedbackQuesGiven;\n\t\t\n\t\t$result->isLoyaltyForProductDemoVideoFeedbackQuesGiven = $isLoyaltyForProductDemoVideoFeedbackQuesGiven;\n\t\t$result->isLoyaltyForProductDemoAudioFeedbackQuesGiven = $isLoyaltyForProductDemoAudioFeedbackQuesGiven;\n\t\t\n\t\t\n\n\t\t$result->scanned_code = $data['bar_code']; \n\t\tif($data['bar_code'] == ($result->barcode_qr_code_no)) {\n\t\t\t\n\t\t$result->activation_level = $result->pack_level; \n\t\t\n\t\t$activation_packaging_level = $result->pack_level; \n\t\t\n\t\t\n\t\t} else {\n\t\t\t\n\t\t$result->activation_level = $result->pack_level2; \n\t\t$activation_packaging_level = $result->pack_level2;\n\t\t\t\n\t\t} \n $data['consumer_id'] = $user['id'];\n\t\t\n $data['product_id'] = $result->id;\n\t\t$data['customer_id'] = $result->created_by;\n $data['code_scan_date'] = date(\"Y-m-d H:i:s\");\n\t\t$data['del_by_cs'] = 0;\n //$result->pack_level = $result->pack_level; registration_status\n\t\t\n\t\t$consumer_id = $data['consumer_id'];\n\t\t$customer_id = $data['customer_id'];\n\t\t$product_id = $data['product_id'];\n\t\t\n\t\t$isConsAlreadyLinkedtoCust = $this->ScannedproductsModel->isConsAlreadyLinkedtoCust($consumer_id, $customer_id);\t\t\n\t\t\n\t\t$mnv1_result62 = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 62)->get()->row();\n\t\t$message_notification_value62 = $mnv1_result62->message_notification_value;\n\t\t\n if($this->db->insert($this->ScannedproductsModel->table, $data)){\t\n\t\t\n\t\tif($isConsAlreadyLinkedtoCust==false){\n\t\t$data['registration_status'] = \"Registered\";\n\t\t$this->db->insert('consumer_customer_link', $data);\n\t\t}\n\t\t\n\t\t\tif($activation_packaging_level==1){\n\t\t\t// Consumer Activity Log Data insert start\n\t\t\t$CALdata['date_time'] = date('Y-m-d H:i:s'); \n\t\t\t$CALdata['consumer_name'] = get_consumer_name_by_consumer_id($consumerId);\n\t\t\t$CALdata['consumer_id'] = $consumerId; \n\t\t\t$CALdata['consumer_mobile'] = getConsumerMobileNumberById($consumerId); \n\t\t\t$CALdata['customer_name'] = getUserNameById($customer_id); \n\t\t\t$CALdata['customer_id'] = $customer_id; \n\t\t\t$CALdata['unique_customer_code'] = getCustomerCodeById($customer_id); \n\t\t\t$CALdata['product_name'] = get_products_name_by_id($product_id); \n\t\t\t$CALdata['product_id'] = $product_id; \n\t\t\t$CALdata['product_sku'] = get_product_sku_by_id($product_id); \n\t\t\t$CALdata['product_code'] = $data['bar_code']; \n\t\t\t$CALdata['gloc_latitude'] = $data['latitude'];\n\t\t\t$CALdata['gloc_longitude'] = $data['longitude'];\n\t\t\t$CALdata['gloc_city'] = $data['scan_city'];\n\t\t\t$CALdata['gloc_pin_code'] = $data['pin_code'];\n\t\t\t$CALdata['consumer_activity_type'] = $message_notification_value62;\n\t\t\t$CALdata['loyalty_rewards_points'] = 0;\n\t\t\t$CALdata['loyalty_rewards_type'] = getCustomerLoyaltyTypeById($customer_id);\n\t\t\t\n\t\t\t$this->db->insert('consumer_activity_log_table', $CALdata);\n\t\t\t// Consumer Log Data insert end\n\t\t\t}\n\t\t\t$updateDataCityScan = array(\n\t\t\t\t\t 'city_last_scan' => $data['scan_city']\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('consumers', $updateDataCityScan, array('id' => $consumerId));\n\t\t\t\t\t\n\t\t\t//$this->db->insert('consumer_customer_link', $data);\n\t\t\t\n\t\t\t\n\t\t\t// Super Loyalty start\t\t\n\t\t\t// Insert number if Scans \n\t\t\t//check if the product code is already registerd\n\t\t\tif($activation_packaging_level==1){\n\t\t$ifSuperLoyaltyAlreadyGivenConsumerProduct = $this->ScannedproductsModel->ifSuperLoyaltyAlreadyGivenConsumerProduct($product_id, $consumerId); \n\t\t\t}else{\n\t\t$ifSuperLoyaltyAlreadyGivenConsumerProduct = \"NotGiven\";\n\t\t\t}\n\t\t$isSuperLoyaltyYes\t= SuperLoyaltyStatusonProductByProductID($product_id);\n\t\tif($isSuperLoyaltyYes==\"Yes\"){\n\t\t\tif($isRegistered==false){\n\t\t\t\tif($ifSuperLoyaltyAlreadyGivenConsumerProduct==\"NotGiven\"){\n\t\t$resultC = $this->db->select('number_of_scans')->from('consumers')->where('id', $consumerId)->get()->row();\n\t\t$number_of_scansBD = $resultC->number_of_scans;\n\t\t$number_of_scansAD = $number_of_scansBD + 1;\n\t\t$updateData = array(\n\t\t\t\t\t 'number_of_scans' => $number_of_scansAD\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('consumers', $updateData, array('id' => $consumerId));\n\t\t\t\t\t\n\t\t$resultP = $this->db->select('*')->from('products')->where('id', $product_id)->get()->row();\n\t\t$include_the_product_in_super_loyalty = $resultP->include_the_product_in_super_loyalty;\n\t\t$number_of_scans_for_super_loyalty = $resultP->number_of_scans_for_super_loyalty;\n\t\t$number_of_loyalty_points_for_super_loyalty = $resultP->number_of_loyalty_points_for_super_loyalty;\t\n\t\t$number_of_scans_for_productBD = $resultP->number_of_scans_for_product;\n\t\t\n\t\t$number_of_scans_for_productAD = $number_of_scans_for_productBD + 1;\n\t\t$updateDataP = array(\n\t\t\t\t\t 'number_of_scans_for_product' => $number_of_scans_for_productAD\n\t\t\t\t\t\t);\n\t\t\t\t\t$this->db->update('products', $updateDataP, array('id' => $product_id));\n\t\t\n\t$remainder = $number_of_scans_for_productAD%$number_of_scans_for_super_loyalty;\n\t\tif(($remainder ==0)&&($number_of_loyalty_points_for_super_loyalty!=0)) {\t\t\n\t\t//$Product_id = getProductIDbyProductCode($data['bar_code']);\n\t\t\t$customerId = get_customer_id_by_product_id($product_id);\t\t\t\n\t\t\t\t$purchased_points = total_approved_points2($customerId);\n\t\t\t\t$consumed_points = get_total_consumed_points($customerId);\n\t\t\t\t$customer_loyalty_type = get_customer_loyalty_type_by_customer_id($customerId);\n\t\t\t\t$product_name = get_products_name_by_id($product_id);\n\t\t\t\t$consumer_name = getConsumerNameById($consumerId);\t\n\t\t\t\t$product_brand_name = get_products_brand_name_by_id($product_id);\n\t\t\t\t$customer_id = get_customer_id_by_product_id($product_id);\n\t\t\t\t\n\t\t\t\t$customer_name = getUserFullNameById($customerId);\t\t\n\t\t\t\t$product_name = get_products_name_by_id($product_id);\n\t\t\t\t$consumer_name = getConsumerNameById($consumerId);\n\t\t\n\t\t\t\t\n\t\t\t\t$LPconsumed_points = $consumed_points+$number_of_loyalty_points_for_super_loyalty;\n\t\t\t\t//echo \"<pre>\";print_r($LPconsumed_points); die;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($purchased_points > ($consumed_points+$number_of_loyalty_points_for_super_loyalty)){\n $message = 'Thank You for Product Registration. '. $number_of_loyalty_points_for_super_loyalty .' loyalty points will be added to your TRUSTAT loyalty account';\n\t\t\t\t//echo \"<pre>Jyada\";print_r($LPconsumed_points); die;\n\t\t\t\t}else{\n\t\t\t\t\t$message = 'Thank You for Scan!';\n\t\t\t\t\t//echo \"<pre>kam\";print_r($LPconsumed_points); die;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t // $transactionType = 'product-registration-without-warranty'; \n\t\t\t\t$transactionType = \"Super Loyalty\";\n\t\t\t\t//$mnv61_result = $this->db->select('message_notification_value,message_notification_value_part2')->from('message_notification_master')->where('id', 61)->get()->row();\n\t\t\t\t//$mnvtext61 = $mnv61_result->message_notification_value;\n\t\t\t\t$mnvtext61 = getAPPPassbookOnScreenDisplayMessageSLByProductId($product_id);\n\t\t\t\t//$mnvtext61_p2 = $mnv61_result->message_notification_value_part2;\n\t\t\t //$transactionTypeName = $mnvtext61 . $number_of_scans_for_productAD . $mnvtext52_p2;\n\t\t\t $transactionTypeName = $mnvtext61;\n\t\t\t\t//$userId = $user['id'];\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($purchased_points > ($consumed_points+$number_of_loyalty_points_for_super_loyalty)){\n\t\t\t\t$this->Productmodel->saveSuperLoylty($transactionType, $consumerId, $product_id, ['verification_date' => date(\"Y-m-d H:i:s\"), 'consumer_id' =>$consumerId, 'consumer_name' => $consumer_name, 'brand_name' => $product_brand_name, 'customer_name' => $customer_name, 'product_name' => $product_name, 'product_id' => $product_id, 'product_code' => $data['bar_code'],'customer_loyalty_type' => $customer_loyalty_type], $customer_id, $customer_loyalty_type, $number_of_loyalty_points_for_super_loyalty);\n\t\t\t\n\t\t\t\t$this->Productmodel->saveConsumerPassbookSuperLoyalty($transactionType, ['verification_date' => date(\"Y-m-d H:i:s\"), 'brand_name' => $product_brand_name, 'customer_name' => $customer_name, 'product_name' => $product_name, 'product_id' => $product_id, 'product_code' => $data['bar_code'],'customer_loyalty_type' => $customer_loyalty_type], $customer_id, $product_id, $consumerId, $transactionTypeName, 'Loyalty', $customer_loyalty_type, $number_of_loyalty_points_for_super_loyalty);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$fb_token = getConsumerFb_TokenById($consumerId);\n // $this->ConsumerModel->sendFCM('Thank you for Product Registration, Please check the details in \"my purchase list\" in TRUSTAT App.', $fb_token);\n\t\t\t //$mnv52_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 52)->get()->row();\n\t\t\t //$mnvtext52 = $mnv52_result->message_notification_value;\n\t\t\t $mnvtext52 = getAPPNotificationMessageforSuperLoyaltyByProductId($product_id);\n\t\t\t $this->ConsumerModel->sendFCM($mnvtext52, $fb_token);\n\t\t\t\t$NTFdata['consumer_id'] = $consumerId; \n\t\t\t\t$NTFdata['title'] = \"TRUSTAT Super Loyalty\";\n\t\t\t\t$NTFdata['body'] = $mnvtext52; \n\t\t\t\t$NTFdata['timestamp'] = date(\"Y-m-d H:i:s\",time()); \n\t\t\t\t$NTFdata['status'] = 0; \n\t\t\t\n\t\t\t$this->db->insert('list_notifications_table', $NTFdata);\n\t\t\t\n\t\t\t$TRNNC_result = $this->db->select('billin_particular_name, billin_particular_slug')->from('customer_billing_particular_master')->where('cbpm_id', 10)->get()->row();\n\t\t\t$TRNNC_billin_particular_name = $TRNNC_result->billin_particular_name;\n\t\t\t$TRNNC_billin_particular_slug = $TRNNC_result->billin_particular_slug;\n\t\t\t\n\t\t\t$TRNNCData['customer_id'] = $customer_id;\n\t\t\t$TRNNCData['consumer_id'] = $consumerId;\n\t\t\t$TRNNCData['billing_particular_name'] = $TRNNC_billin_particular_name.' TRUSTAT Super Loyalty';\t\t\n\t\t\t$TRNNCData['billing_particular_slug'] = $TRNNC_billin_particular_slug.'_TRUSTAT_Super_Loyalty';\n\t\t\t$TRNNCData['trans_quantity'] = 1; \n\t\t\t$TRNNCData['trans_date_time'] = date(\"Y-m-d H:i:s\",time()); \n\t\t\t$TRNNCData['trans_status'] = 1; \t\t\t\n\t\t\t$this->db->insert('tr_customer_bill_book', $TRNNCData);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Super Loyalty end\t\n\t\t\n\t\t\t\n\t\t\tif($result->barcode_qr_code_no == $data['bar_code']) {\n if( $result->pack_level == 0 ){\n if( $isRegistered ){\n\t\t\t\t\t\n\t\t\t\t\tif( $isRegistered == completed ){\n\t\t\t\t\t\n //$result->message1 = 'This product is already registered, please contact your retailer/manufacturer for further details.';\n\t\t\t\t\t$result->message1 = $mnvtext25;\n }else {\n\t\t\t\t\t//$result->message1 = 'This product registration is already under process. Outcome of product registration will be notified to TRUSTAT member, who had initiated the registration process.';\n\t\t\t\t\t$result->message1 = $mnvtext26;\n\t\t\t\t}\n\t\t\t\t}else{\n //$result->message1 = 'Thank You for initiating Product Registration, Click Ok to scan and upload valid invoice for this product purchase and activate the warranty.';\n\t\t\t\t\t$result->message1 = $mnvtext27;\n }\n }elseif( $result->pack_level == 1 ){\n //$result->message1 = 'Scanned product details for lavel '.$result->pack_level.'.';\n\t\t\t\t//$result->message1 = 'The barcode you have scanned is on the product packing, please scan the barcode on the product for registration.';\n\t\t\t\t$result->message1 = $mnvtext29;\n }elseif($result->pack_level > 1){\n //$result->message1 = 'This is not a product barcode for consumer, Please scan barcode placed on consumer pack';\n\t\t\t\t$result->message1 = $mnvtext30;\n }\n\t\t\t} else {\n\t\t\t\t\n\t\t\tif( $result->pack_level2 == 0 ){\n if( $isRegistered ){\n\t\t\t\t\t\n\t\t\t\t\tif( $isRegistered == completed ){\n\t\t\t\t\t\n //$result->message1 = 'This product is already registered, please contact your retailer/manufacturer for further details';\n\t\t\t\t\t$result->message1 = $mnvtext25;\n }else {\n\t\t\t\t\t//$result->message1 = 'This product registration is already under process. Outcome of product registration will be notified to TRUSTAT member, who had initiated the registration process';\n\t\t\t\t\t$result->message1 = $mnvtext26;\n\t\t\t\t}\n\t\t\t\t}else{\n // $result->message1 = 'Thank You for initiating Product Registration, Click Ok to scan and upload valid invoice for this product purchase and activate the warranty';\n\t\t\t\t\t $result->message1 = $mnvtext27;\n }\n }elseif( $result->pack_level2 == 1 ){\n //$result->message1 = 'Scanned product details for lavel '.$result->pack_level.'.';\n\t\t\t\t//$result->message1 = 'The barcode you have scanned is on the product packing, please scan the barcode on the product for registration.';\n\t\t\t\t$result->message1 = $mnvtext29;\n }elseif($result->pack_level2 > 1){\n //$result->message1 = 'This is not a product barcode for consumer, Please scan barcode placed on consumer pack';\n\t\t\t\t$result->message1 = $mnvtext30;\n }\t\n\t\t\t}\n\t\t\t\n //$this->response(['status'=>true,'message'=>'Scanned product details for lavel '.$result->pack_level.'.','data'=>$result]);\n\t\t$mnv31_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 31)->get()->row();\n\t\t$mnvtext31 = $mnv31_result->message_notification_value;\n\t\t\t//$this->response(['status'=>true,'message'=>'Thanks for scanning the product.','data'=>$result]);\n\t\t\t$this->response(['status'=>true,'message'=>$mnvtext31,'data'=>$result]);\n\t\t\t\n }else{\n\t\t$mnv32_result = $this->db->select('message_notification_value')->from('message_notification_master')->where('id', 32)->get()->row();\n\t\t$mnvtext32 = $mnv32_result->message_notification_value;\t\n // $this->response(['status'=>false,'message'=>'System failed to scan the record.'],200); \n\t\t\t$this->response(['status'=>false,'message'=>$mnvtext32],200); \n }\n }", "function _getDmstcQuote($pkg, $method = '') {\r\n\t\tglobal $order;\r\n\t\tif (tep_not_null($method) && in_array($method, $this->dmstc_available)) {\r\n\t\t\t$request_types = array($method);\r\n\t\t} else {\r\n\t\t\t$request_types = $this->dmstc_available;\r\n\t\t}\r\n\t\t$shipping_weight = ($pkg['item_weight'] < 0.0625 ? 0.0625 : $pkg['item_weight']);\r\n\t\t$shipping_pounds = floor($shipping_weight);\r\n\t\t$shipping_ounces = ceil((16 * ($shipping_weight - $shipping_pounds)) * 100) / 100; // rounded to two decimal digits\r\n\t\t$ounces = $shipping_weight * 16.0;\r\n\t\t$pkgvalue = $pkg['item_price'];\r\n\t\tif ($pkgvalue > MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX) $pkgvalue = MODULE_SHIPPING_USPS_DMSTC_INSURANCE_MAX;\r\n\t\tif ($pkgvalue <= 0) $pkgvalue = 0.01;\r\n\t\t$nonuspsinsurancecost = 0;\r\n\t\tif (MODULE_SHIPPING_USPS_NON_USPS_INSURE == 'True') {\r\n\t\t\tif ($pkg['item_price'] <= 50) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS1;\r\n\t\t\t} else if ($pkg['item_price'] <= 100) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS2;\r\n\t\t\t}\telse if ($pkg['item_price'] <= 200) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS3;\r\n\t\t\t} else if ($pkg['item_price'] <= 300) {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4;\r\n\t\t\t} else {\r\n\t\t\t\t$nonuspsinsurancecost = MODULE_SHIPPING_USPS_INS4 + ((ceil($pkg['item_price']/100) - 3) * MODULE_SHIPPING_USPS_INS5);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sservs = array(); // any special services to request\r\n\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $sservs = array(1, 11); //request insurance, both regular & express mail\r\n\t\tif ((MODULE_SHIPPING_USPS_DMST_SIG_CONF == 'True') && ($order->info['subtotal'] >= MODULE_SHIPPING_USPS_SIG_THRESH)) {\r\n\t\t\t$sservs[] = 15;\r\n\t\t} elseif (MODULE_SHIPPING_USPS_DMST_DEL_CONF == 'True') {\r\n\t\t\t$sservs[] = 13;\r\n\t\t}\r\n\t\t$sservice = '';\r\n\t\tif (!empty($sservs)) {\r\n\t\t\tforeach ($sservs as $id) $sservice .= '<SpecialService>' . $id . '</SpecialService>';\r\n\t\t\t$sservice = '<SpecialServices>' . $sservice . '</SpecialServices>';\r\n\t\t}\r\n\t\t$box = array($pkg['item_length'], $pkg['item_width'], $pkg['item_height']);\r\n\t\trsort($box); // put package size in large to small order for purposes of checking dimensions\r\n\t\tlist($length, $width, $height) = $box;\r\n\t\t$id = 0;\r\n\t\t$quotes = $request_group = array();\r\n\t\t$group_count = 1;\r\n\t\t$type_count = 0;\r\n\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\tforeach ($request_types as $service) { // break the requested shipping methods into groups\r\n\t\t\tif (strpos($service, 'First') !== false) { // if first class mail service check if will fit type\r\n\t\t\t\t$fcmt = $this->first_class_to_mail_type[$service];\r\n\t\t\t\tif (($fcmt == 'LETTER') && (($length > $this->first_class_letter['length']) || ($width > $this->first_class_letter['width']) || ($height > $this->first_class_letter['height']) || ($ounces > $this->first_class_letter['ounces']))) continue; // don't check letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'FLAT') && (($length > $this->first_class_large_letter['length']) || ($width > $this->first_class_large_letter['width']) || ($height > $this->first_class_large_letter['height']) || ($ounces > $this->first_class_large_letter['ounces']))) continue; // don't check large letter type if package doesn't fit\r\n\t\t\t\tif (($fcmt == 'POSTCARD') && (($length > 6) || ($width > 4.25) || ($height > 0.016) || ($ounces > 3.5))) continue; // don't check postcard type if package doesn't fit\r\n\t\t\t\tif ($ounces > $this->first_class_parcel_max_ounces) continue; // don't check First Class if too heavy\r\n\t\t\t}\r\n\t\t\t$cont = $this->type_to_container[$service]; // begin checking for packages larger than USPS containers\r\n\t\t\t// if this service type specifies a container and this package won't fit then skip this service\r\n\t\t\tif (strpos($cont, 'Envelope') !== false) { // if service container is envelope\r\n\t\t\t\tif ($height > 1) continue; // anything thicker than one inch won't fit an envelope\r\n\t\t\t\tif ((strpos($cont, 'SM') !== false) && (($length > 10) || ($width > 6))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Window') !== false) && (($length > 10) || ($width > 5))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Gift') !== false) && (($length > 10) || ($width > 7))) continue;\r\n\t\t\t\tif ((strpos($cont, 'Legal') !== false) && (($length > 15) || ($width > 9.5))) continue;\r\n\t\t\t\tif (($length > 12.5) || ($width > 9.5)) continue; // other envelopes\r\n\t\t\t}\r\n\t\t\tif (($cont == 'SM Flat Rate Box') && (($length > 8.625) || ($width > 5.375) || ($height > 1.625))) continue;\r\n\t\t\tif (($cont == 'MD Flat Rate Box') || ($cont == 'Flat Rate Box')) {\r\n\t\t\t\tif ($length > 13.625) continue; // too big for longest medium box\r\n\t\t\t\tif ($length > 11) { // check medium type 2 box\r\n\t\t\t\t\tif (($length > 13.625) || ($width > 11.875) || ($height > 3.375)) continue; // won't fit medium type 2 box\r\n\t\t\t\t} elseif (($length > 11) || ($width > 8.5) || ($height > 5.5)) continue; // won't fit either type medium box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'LG Flat Rate Box') && (($length > 12) || ($width > 12) || ($height > 5.5))) continue;\r\n\t\t\tif ($cont == 'Regional Rate Box A') {\r\n\t\t\t\tif ($length > 12.8125) continue; // too big for longest A box\r\n\t\t\t\tif ($length > 10) { // check A2 box\r\n\t\t\t\t\tif (($length > 12.8125) || ($width > 10.9375) || ($height > 2.375)) continue; // won't fit A2 box\r\n\t\t\t\t} elseif (($length > 10) || ($width > 7) || ($height > 4.75)) continue; // won't fit either type A box\r\n\t\t\t}\r\n\t\t\tif ($cont == 'Regional Rate Box B') {\r\n\t\t\t\tif ($length > 15.875) continue; // too big for longest B box\r\n\t\t\t\tif ($length > 12) { // check B2 box\r\n\t\t\t\t\tif (($length > 15.875) || ($width > 14.375) || ($height > 2.875)) continue; // won't fit B2 box\r\n\t\t\t\t} elseif (($length > 12) || ($width > 10.25) || ($height > 5)) continue; // won't fit either type B box\r\n\t\t\t}\r\n\t\t\tif (($cont == 'Regional Rate Box C') && (($length > 14.75) || ($width > 11.75) || ($height > 11.5))) continue;\r\n\t\t\t// passed all size checks so build request\r\n\t\t\t$request = '<Package ID=\"'. $id . '\"><Service>' . $this->type_to_request[$service] . '</Service>';\r\n\t\t\tif (strpos($service, 'First') !== false) $request .= '<FirstClassMailType>' . $fcmt . '</FirstClassMailType>';\r\n\t\t\t$request .= '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .\r\n\t\t\t\t\t'<ZipDestination>' . $this->dest_zip . '</ZipDestination>' .\r\n\t\t\t\t\t'<Pounds>' . $shipping_pounds . '</Pounds>' .\r\n\t \t\t'<Ounces>' . $shipping_ounces . '</Ounces>';\r\n\t\t\tif ((strpos($cont, 'Rate') === false) && (max($length, $width, $height) > 12)) {\r\n\t\t\t\t$request .= '<Container>RECTANGULAR</Container><Size>LARGE</Size>' .\r\n\t\t\t\t\t\t'<Width>' . $width . '</Width>' .\r\n\t\t\t\t\t\t'<Length>' . $length . '</Length>'.\r\n\t\t\t\t\t\t'<Height>' . $height . '</Height>';\r\n\t\t\t} else {\r\n\t\t\t\t$request .= '<Container>' . $cont . '</Container><Size>REGULAR</Size>';\r\n\t\t\t}\r\n\t\t\tif (MODULE_SHIPPING_USPS_DMSTC_INSURANCE_OPTION == 'True') $request .= '<Value>' . number_format($pkgvalue, 2, '.', '') . '</Value>';\r\n\t\t\t$request .= $sservice;\r\n\t\t\tif ((strpos($service, 'First') !== false) || (strpos($service, 'Post') !== false)) $request .= '<Machinable>true</Machinable>';\r\n\t\t\t$request .= '</Package>';\r\n\t\t\t$id++;\r\n\t\t\t$type_count++;\r\n\t\t\tif (($type_count > 25) || (($urllength + strlen(urlencode($request))) > 2000)) { // only 25 services allowed per request or 2000 characters per url\r\n\t\t\t\t$group_count++;\r\n\t\t\t\t$type_count = 1;\r\n\t\t\t\t$urllength = strlen('production.shippingapis.com/shippingAPI.dll?<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision></RateV4Request>');\r\n\t\t\t}\r\n\t\t\t$urllength += strlen(urlencode($request));\r\n\t\t\t$request_group[$group_count][$type_count] = $request;\r\n\t\t} // end foreach request type as service\r\n\t\tif (empty($request_group)) return array('error' => MODULE_SHIPPING_USPS_ERROR_NO_SERVICES);\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES .'http_client.php');\r\n\t\t} //print_r($request_group);\r\n\t\tforeach ($request_group as $service_group) {\r\n\t\t\t$request = '<RateV4Request USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><Revision>2</Revision>';\r\n\t\t\tforeach ($service_group as $service_request) {\r\n\t\t\t\t$request .= $service_request;\r\n\t\t\t}\r\n\t\t\t$request .= '</RateV4Request>';\r\n\t\t\t$request = \t'API=RateV4&XML=' . urlencode($request);\r\n\t\t\t$body = '';\r\n\t\t\t$http = new httpClient();\r\n\t\t\tif ($http->Connect('production.shippingapis.com', 80)) {\r\n\t\t\t\t$http->addHeader('Host', 'production.shippingapis.com');\r\n\t\t\t\t$http->addHeader('User-Agent', 'IntenseCart');\r\n\t\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\t\tif ($http->Get('/shippingAPI.dll?' . $request)) $body = $http->getBody();\r\n\t\t\t\t$http->Disconnect();\r\n\t\t\t} else {\r\n\t\t\t\t$body = '<Error><Number></Number><Description>' . MODULE_SHIPPING_USPS_TEXT_CONNECTION_ERROR . '</Description></Error>';\r\n\t\t\t}\r\n\t\t\t$doc = XML_unserialize($body); //print_r($doc);\r\n\t\t\tif (isset($doc['Error'])) return array('error' => $doc['Error']['Number'] . ' ' . $doc['Error']['Description']);\r\n\t\t\tif (isset($doc['RateV4Response']['Package']['Postage'])) { // single mail service response\r\n\t\t\t\t$tmp = $this->_decode_domestic_response($doc['RateV4Response']['Package']['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t} elseif (isset($doc['RateV4Response']['Package'][0])) { // multiple mailing services returned\r\n\t\t\t\tforeach ($doc['RateV4Response']['Package'] as $mailsvc) {\r\n\t\t\t\t\tif (isset($mailsvc['Postage'])) {\r\n\t\t\t\t\t\t$tmp = $this->_decode_domestic_response($mailsvc['Postage'], $pkgvalue, $nonuspsinsurancecost, $pkg['item_price']);\r\n\t\t\t\t\t\tif (!empty($tmp)) $quotes[$tmp['id']] = $tmp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end foreach $request_group\r\n\t\treturn $quotes;\r\n\t}", "public function designProfit(){\n\t\treturn $this->campaigns()\n\t\t\t->join('order_detail', 'product_campaign.id', 'order_detail.campaign_id')\n\t\t\t->join('order', 'order_detail.order_id', 'order.id')\n\t\t\t->join('order_status', 'order.id', 'order_status.order_id')\n\t\t\t->where('order_status.value', 4)\n\t\t\t->sum('product_quantity') * 25000;\n\t}", "function request_shipping_label($data)\n {\n // Note you may want to associate this in some other way, like with a database ID.\n $this->PartnerTransactionID = substr(uniqid(rand(), true), 0, 10);\n\n $xml = '<LabelRequest Test=\"NO\" LabelSize=\"4X6\" LabelType=\"Default\" LabelSubtype=\"None\" ImageFormat=\"GIF\">\n\t\t\t\t\t<RequesterID>' . $this->RequesterID . '</RequesterID>\n\t\t\t\t\t<AccountID>' . $this->AccountID . '</AccountID>\n\t\t\t\t\t<PassPhrase>' . $this->PassPhrase . '</PassPhrase>\n\t\t\t\t\t<PartnerTransactionID>' . $this->PartnerTransactionID . '</PartnerTransactionID>';\n\n $xml .= '<IntegratedFormType>Form2976</IntegratedFormType>';\n\n if (!empty($data)) {\n foreach ($data as $node_key => $node_value) {\n $xml .= '<' . $node_key . '>' . $node_value . '</' . $node_key . '>';\n }\n }\n\n $xml .= '<ResponseOptions PostagePrice=\"TRUE\"/>\n\t\t\t\t</LabelRequest>';\n\n $data = array(\"labelRequestXML\" => $xml);\n\n\n\n $request = $this->client->post('/LabelService/EwsLabelService.asmx/GetPostageLabelXML', array(), $data);\n return $this->send_request($request);\n }", "public function getDeliveryMode(): int\n {\n }", "function getCartArr ($cartStr)\n{\n\t// 1 -> OK\n\t// 2 -> invalid item\n\tglobal $currency,$currfactor,$cartArr,$isAllowExpressDlvry;\n\t$returnVal = 1;\n\tif ($invSrv == \"\") { $invSrv = new Inventory(); }\n\n\t$factory = new Product_service_factory();\n\t$prod_serv = $factory->get_instance('SE', $currency);\n\n\tif(strlen($cartStr)==0) return 0;\n\telse\n\t{\n\t\t$strArr = explode(',', $cartStr);\n\n\t\t//$addedfreexmas=\"N\";\n\n\t\tforeach ($strArr as $thisStr)\n\t\t{\n\t\t\t$pg_source = 0;\n\t\t\tif (strlen($thisStr)!=0)\n\t\t\t{\n\t\t\t\tlist($thisPid, $thisQty,$thisPrice) = explode('-',$thisStr);\n\t\t\t\tif ($currency == 'usd')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity, IF(ISNULL(sp.mainid), 1, 0) pg_source\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\tSELECT mainid\n\t\t\t\t\t\t\tFROM supplierprodstb\n\t\t\t\t\t\t\tWHERE iscurrentUS = '1'\n\t\t\t\t\t\t\t) sp\n\t\t\t\t\t\t\tON productstb.prodid = sp.mainid\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\n\t\t\t\t$thisPid = prevention_numeric($thisPid, 1, $cartStr);\n\t\t\t\t$sql .= \"\n\t\t\t\t\t\tWHERE prodid='\" . $thisPid . \"'\n\t\t\t\t\t\tAND site='SE'\n\t\t\t\t\t\tAND active='1'\n\t\t\t\t\t\t$additional_where\n\t\t\t\t\t\t\";\n\t\t\t\t$get_price = mysql_query_escape($sql) or die(\"Error @\".__LINE__);\n\t\t\t\t//echo $isAllowExpressDlvry;\n\t\t\t\tif ($isAllowExpressDlvry)\n\t\t\t\t{\n\t\t\t\t\tif (!$invSrv->isStockAvail($thisPid, \"IM\")) {\n\t\t\t\t\t\t$isAllowExpressDlvry = false;\n\t\t\t\t\t\t//echo \"falsenow(\".$thisPid.\")<br>\";\n\t\t\t\t\t\t//echo \"2\";\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"now(\".$thisPid.\")<br>\";\n\t\t\t\t}\n\t\t\t\t//Tommy check pg_source;\n\t\t\t\tif ($currency == 'usd' || $currency == 'aud')\n\t\t\t\t{\n\t\t\t\t\t//$pg_source = mysql_result($get_price,0,'pg_source');\n\t\t\t\t\t$prod_info = $prod_serv->get_product_info($thisid);\n\n\t\t\t\t\t$pg_source = $prod_serv->is_pg_sourcing($prod_info);\n\t\t\t\t}\n\t\t\t\t// End of modification for CR090319-001\n\t\t\t\tif(mysql_num_rows($get_price)!=1 || $thisQty<1 || $pg_source)\n\t\t\t\t{\n\t\t\t\t\t$returnVal = 2;\n\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Daniel - 20090409 - also check the advertised quantity with quantity in cart\n\t\t\t\t\t$listqty = mysql_result($get_price,0,'quantity');\n\t\t\t\t\tif($listqty==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$returnVal = 2;\n\t\t\t\t\t}\n\t\t\t\t\telseif($thisQty<=$listqty)\n\t\t\t\t\t{\n\t\t\t\t\t\t//end of 20090409\n\n\t\t\t\t\t\t// get listprice starts here\n\t\t\t\t\t\tinclude_once(COMMONPATH . 'srv_list.php');\n\t\t\t\t\t \t$dto = $srv->get_product_info($thisPid);\n\t\t\t\t\t\t$price = $dto->get_price();\n\n\t\t\t\t\t\t$thisListprice = $price;\n\n\t\t\t\t\t\tif($currency == 'hkd')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = number_format($thisListprice * $dto->get_rate_hkd(),2,'.','');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// get listprice ends here\n\n\t\t\t\t\t\t//added for xmas - start\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$mycarttotal = $mycarttotal-(-($thisQty*$thisListprice));\n\n\n\n\t\t\t\t\t\tif($mycarttotal>99 && $thisPid==\"1823\" && $addedfreexmas!=\"Y\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$addedfreexmas=\"Y\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//echo \"A added - $thisPid-$thisQty-$thisListprice <br><br>\";\n\t\t\t\t\t\t//added for xmas - end\n\t\t\t\t\t\tif($thisPid==\"1823\" && ($thisPrice=='0.00'||$thisPrice=='0'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t\t//do nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// added for xmas - start\n\t\t//check if there is already a 1823-1-0.00 in the cartarr\n\t\t/*\n\t\tforeach ($cartArr as $thisxmaspromo)\n\t\t{\n\t\t\t//echo \"A\".$thisxmaspromo[0].\"-\".$thisxmaspromo[2].\"<br>\";\n\n\n\t\t\tif(($thisxmaspromo[0]==\"1823\") && ($thisxmaspromo[2]==\"0.00\"||$thisxmaspromo[2]==\"0\"))\n\t\t\t{\n\t\t\t\t$addedfreexmas = \"Y\";\n\t\t\t}\n\t\t}\n\n\n\t\tif($mycarttotal>99 && $addedfreexmas!=\"Y\")\n\t\t{\n\t\t\t$cartArr[] = array(\"1823\",\"1\",\"0.00\");\n\t\t\t$addedfreexmas=\"Y\";\n\t\t\t//echo \"B added <br><br>\";\n\t\t}\n\t\t*/\n\t\t//added for xmas - end\n\t}\n\treturn $returnVal;\n}", "public function store()\n {\n $input = Request::onlyLegacy('category_id', 'name', 'unit', 'unit_cost', 'code', 'description', 'selling_price', 'supplier_id', 'abc_additional_data', 'styles', 'sizes', 'colors', 'sub_id', 'qbd_id', 'sync_on_qbd', 'trade_id');\n $validator = Validator::make($input, FinancialProduct::getRules());\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $companyId = $this->scope->has() ? $this->scope->id() : 0;\n\t\t$category = FinancialCategory::where('company_id', $companyId)\n\t\t\t->findOrFail($input['category_id']);\n\n $validator = Validator::make($input, FinancialProduct::getRulesByCategory($category));\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n if (ine($input, 'supplier_id')) {\n if (!$this->supplierRepo->isSupplierExist($input['supplier_id'])) {\n return ApiResponse::errorNotFound(trans('response.error.not_found', ['attribute' => 'Supplier']));\n }\n\n if ($this->supplierRepo->isSystemSupplier($input['supplier_id'])) {\n return ApiResponse::errorGeneral(\"You can't add supplier product from here.\");\n }\n }\n\n $message = trans('response.success.saved', ['attribute' => 'Product']);\n\n if (ine($input, 'sub_id')) {\n $subContractor = User::whereCompanyId($this->scope->id())\n ->whereGroupId(User::GROUP_SUB_CONTRACTOR)\n ->findOrFail($input['sub_id']);\n\n $category = FinancialCategory::whereName(FinancialCategory::LABOR)\n ->whereCompanyId($this->scope->id())\n ->firstOrFail();\n\n $input['category_id'] = $category->id;\n $message = trans('response.success.saved', ['attribute' => 'Rate sheet']);\n }\n\n $name = isSetNotEmpty($input, 'name') ?: null;\n\n try {\n $product = $this->repo->saveProduct(\n $input['category_id'],\n $name,\n $input['unit'],\n $input['unit_cost'],\n $input\n );\n\n return ApiResponse::success([\n 'message' => $message,\n 'data' => $this->response->item($product, new FinancialProductsTransformer)\n ]);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "public function toString()\n {\n return \"Order Detail - Shipping method are correct\";\n }", "protected function _getRequestSerial()\n {\n return Ark()->webService()->getRequestSerial();\n }", "function dsf_protx_decline_order($order_number){\n\nglobal $VoidURL, $AbortURL, $Verify, $ProtocolVersion;\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please decline the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'invalid protx item';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please decline the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'more than one protx item found';\n\tbreak;\n }\n \t\n\n // we must have a valid transaction item if we are here.\n \n // we therefore need to check our logs to see if the item has been previously charged.\n \n $check_history_query = dsf_db_query(\"select orders_id, orders_status_id from \" . DS_DB_SHOP . \".orders_status_history where orders_id='\" . $order_number . \"' and orders_status_id='90006'\");\n \n if (dsf_db_num_rows($check_history_query)==0){\n \t$TargetURL = $AbortURL; // never charged.\n\t$TxType = 'ABORT';\n }else{\n \t$TargetURL = $VoidURL; // has been charged\n\t$TxType = 'VOID';\n }\n \n \n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$VerifyServer = $Verify;\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => $TxType,\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been voided / aborted witin protx.\n\n\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '50005');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '50005', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t\t\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases except failed\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn 'error';\n}", "public function get_firmwareRelease(): string\n {\n // $res is a string;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::FIRMWARERELEASE_INVALID;\n }\n }\n $res = $this->_firmwareRelease;\n return $res;\n }", "public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}", "public function codeRechargement()\n {\n $code_secret = $this->utils->securite_xss($_POST['codesecret']);\n $fk_agence = $this->utils->securite_xss($_POST['fkagence']);\n $frais = $this->compteModel->verifCodeRechargement($fk_agence, $code_secret);\n if ($frais == 1) echo 1;\n elseif ($frais == 0) echo 0;\n else echo -2;\n }", "public function request_product(){\n $save_data['req_product_name'] = $_REQUEST['req_product_name'];\n $save_data['req_product_person'] = $_REQUEST['req_product_person'];\n $save_data['req_product_email'] = $_REQUEST['req_product_email'];\n $save_data['req_product_mobile'] = $_REQUEST['req_product_mobile'];\n $save_data['req_product_msg'] = $_REQUEST['req_product_msg'];\n $save_data['req_product_date'] = date('d-m-Y h:i:s A');\n $req_product_id = $this->User_Model->save_data('req_product', $save_data);\n if($req_product_id){\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Product Request Saved Successfully\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Product Request Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "public function getProductType()\n {\n }", "public function quote_request_new() {\n\t /*\t$step_one_sidebar = '<div class=\"col-md-2\">\n\t <div class=\"sidebar\">\n\t <h3>Talk TO A REPRESENTATIVE</h3>\n\t <div class=\"selection-container\">\n\t <ul>\n\t <li>1 (877) 589-2214 (US/Canada)<br/><a href=\"mailto:[email protected]\">[email protected]</a></li>\n\t </ul>\n\t \n\t </div>\n\t </div>\n\t </div>'; */ \n\t\t$step_four = 'test';\n\t //return $this->new_product_finder('quote_request', NULL, $step_four);\n\t\t$path = \\Drupal::request()->getpathInfo();\n $arg = explode('/', $path);\t\t\n $cur_page = $arg[1];\n\t\t\n\t\t$pid = $_GET['pid'];\n\t\t\n\t\t$newrfq = $fpage;\n\t\t//$newrfq = $step_four;\n\t\t\n\t\treturn array(\n\t '#theme' => 'quote_request',\n\t\t '#cur_page' => $cur_page,\n\t\t '#pid' => $pid,\n\t '#quote_related_products' => $step_four,\n\t );\n \t}", "function dsf_process_sagepay($savedorder){\n\nglobal $protx_order,$GiftAidPayment, $ApplyAVSCV2, $CAVV, $XID, $ECI, $ClientNumber, $cc_issue_number, $cc_ccv_number, $cc_owner, $cc_number, $cc_start_month, $cc_start_year, $cc_expires_month, $cc_expires_year, $cc_ctype, $protx_attempts, $currencies, $ProtocolVersion, $DefaultCurrency,$PurchaseURL,$Verify, $VendorTxCode;\n\n \t\t\t\t\t$protx_ipn_currency = MODULE_PAYMENT_PROTXCC_DEFAULT_CURRENCY;\n\n\t\t\t\t\t\t // ORDER VALUE\n\t\t\t\t\t\t $strip_values_array = array(\"£\",\",\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['deposit_value']);\n\t\t\t\t\t\t }else{ // full order value\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['total_value']);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $protx_ipn_order_amount = number_format($protx_ipn_order_amount , 2,'.','');\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t// CREATE ALL values to be passed through to Protx.\n\t\t\t\t\t\t$VendorTxCode= SAP_ORDER_PREFIX . $savedorder->info['id'] . '--' . date('YmdHis');\n\t\t\t\t\t\t$Amount= $protx_ipn_order_amount;\n\t\t\t\t\t\t$Currency= $protx_ipn_currency;\n\t\t\t\t\t\t$Description= 'Basket ID ' . $savedorder->info['id'] . ' - ' . dsf_get_ip_address();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( strtoupper($savedorder->customer['email_address']) <> strtoupper(TELEPHONE_ORDER)){\n\t\t\t\t\t\t\t$CustomerEMail= $savedorder->customer['email_address'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$CustomerEMail='';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (($savedorder->customer['telephone']) && (strlen($savedorder->customer['telephone']) >5)){\n\t\t\t\t\t\t$ContactNumber= substr($savedorder->customer['telephone'],20);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$ContactNumber= substr(dsf_lookup_mobile($savedorder->customer['id']),20);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// BILLING INFORMATION\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingSurname= substr($savedorder->customer['lastname'],0,200);\n\t\t\t\t\t\t$BillingFirstnames= substr($savedorder->customer['firstname'],0,200);\n\n\t\t\t\t\t\t if (isset($savedorder->customer['house']) && strlen($savedorder->customer['house']) > 0){\n\t\t\t\t\t\t \t $BillingAddress1 = $savedorder->customer['house'] . ', ';\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$BillingAddress1 = '';\n\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingAddress1 .= $savedorder->customer['street'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['district']) && strlen($savedorder->customer['district']) > 1){\n\t\t\t\t\t\t\t$BillingAddress2 = $savedorder->customer['district'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingCity = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['town']) && strlen($savedorder->customer['town']) > 1){\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['town'];\n\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['county'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\tif (strlen($BillingCity) < 1){\n\t\t\t\t\t\t\t$BillingCity = 'Not Supplied';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingPostCode= $savedorder->customer['postcode'];\n\n\n\t\t\t\t\t\tif ($savedorder->customer['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// DELIVERY INFO - if no delivery address has been supplied, then we need to populate the variables\n\t\t\t\t\t\t// with the same values as billing.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->delivery['postcode']) && strlen($savedorder->delivery['postcode'])>4){ // delivery address exists\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// get customers name and split it into firstname, lastname\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (strpos($savedorder->delivery['name'],' ') > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t$splits = explode(' ', trim($savedorder->delivery['name']));\n\t\t\t\t\t\t\t\t\t\t\t\t// take into account that the customer could have put mr, mrs etc.. therefore use only the last two splits\n\t\t\t\t\t\t\t\t\t\t\t\t$total_splits = sizeof($splits);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($total_splits > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = $total_splits - 2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = $total_splits -1;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $splits[$first_split];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $splits[$second_split];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t// no breaks, ensure something is there\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t if (isset($savedorder->delivery['house']) && strlen($savedorder->delivery['house']) > 0){\n\t\t\t\t\t\t\t\t\t\t $DeliveryAddress1 = $savedorder->delivery['house'] . ', ';\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = '';\n\t\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryAddress1 .= $savedorder->delivery['street'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['district']) && strlen($savedorder->delivery['district']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $savedorder->delivery['district'];\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$DeliveryCity = '';\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\tif (isset($savedorder->delivery['town']) && strlen($savedorder->delivery['town']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['town'];\n\t\t\t\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['county'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\t\t\t\tif (strlen($DeliveryCity) < 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity = 'Not Supplied';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryPostCode= $savedorder->delivery['postcode'];\n\n\t\t\t\t\t\t\t\t\tif ($savedorder->delivery['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else { // we havent got a delivery address so we need to duplicate the billing information.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliverySurname = $BillingSurname;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryFirstnames = $BillingFirstnames;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = $BillingAddress1;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $BillingAddress2;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCity = $BillingCity;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryPostCode = $BillingPostCode;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = $BillingCountry;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\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 $pagerows = (sizeof($savedorder->products));\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $prod_basket = '';\n\t\t\t\t\t\t\t\t\t $tot_basket = '';\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=($pagerows+1); $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($savedorder->products[$i]['price']){ // there are records\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// products options code added 09-may-2006\n\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (sizeof($savedorder->products[$i]['attributes']) > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attributes_exist = '1';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \" (\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($j = 0, $k = sizeof($savedorder->products[$i]['attributes']); $j < $k; $j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $products_ordered_attributes .= ' '. $savedorder->products[$i]['attributes'][$j]['option'] . '-> ' . $savedorder->products[$i]['attributes'][$j]['value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes .= \" )\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// end of products options section.\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . str_replace(':', ' ', $savedorder->products[$i]['model'] . ' - ' . $savedorder->products[$i]['name'] . ' ' . $products_ordered_attributes); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $savedorder->products[$i]['qty']; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'] * $savedorder->products[$i]['qty'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\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\t\t\tfor ($i=0, $n=sizeof($savedorder->totals)+1; $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totalclass = $savedorder->totals[$i]['class'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($savedorder->totals[$i]['class']) > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$order_total[$totalclass] = array('title' => $savedorder->totals[$i]['title'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'text' => $savedorder->totals[$i]['text'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'value' => $savedorder->totals[$i]['value']\n\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\t\t\t\t\t\t}\n\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// discount if necessary\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_discount']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_discount']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':-' . $order_total['ot_discount']['value']; // line total\n\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\n\t\t\t\t\t\t\t\t\t // delivery charge (0.00 if necessary);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_shipping']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_shipping']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $order_total['ot_shipping']['value']; // line total\n\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 if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . 'Deposit Required'; // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $savedorder->info['deposit_value']; // line total\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\n\t\t\t\t\t\t\t\t// make new basket\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $basket = $pagerows . $prod_basket . $tot_basket;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// end of basket creation details.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t// register this order so we don't create an other one if this fails.\n\t\t\n\t\t\t$protx_order = $savedorder->info['id'];\n\t\t\tdsf_session_register('protx_order');\n \t\t\t\n\t\t\t// register the txCode created - we use this to allocate the payment to order\n\t\t\tdsf_session_register('VendorTxCode');\n\t\t\n\n\n// submit the information to SagePay\n\n\t\t\t\t\t// Set some variables\n\t\t\t\t\t$TargetURL = $PurchaseURL;\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t$VerifyServer = $Verify;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t\n\t\t\t\t\tif ($Description){\n\t\t\t\t\t\t$Description = substr($Description,0,100);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$Description = $DefaultDescription;\t\t\t\t\t\t\t\t// Specified in init-protx.php\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Create an array of values to send\n\t\t\t\t\t$required = array (\n\t\t\t\t\t\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t\t\t\t\t\t'TxType' => MODULE_PAYMENT_PROTXCC_TXTYPE,\t\t\t\t\t\t\t\t\t\t\t// Transaction type\n\t\t\t\t\t\t\t'Vendor' => MODULE_PAYMENT_PROTXCC_ID,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t\t\t\t\t\t'VendorTxCode' => $VendorTxCode,\t\t\t\t\t// Unique transaction code (generated by vendor)\n\t\t\t\t\t\t\t'Amount' => $Amount,\t\t\t\t\t\t\t\t\t\t\t// Value of order (supplied by vendor)\n\t\t\t\t\t\t\t'Currency' => $DefaultCurrency,\t\t\t\t\t\t\t\t\t// Currency of order (default specified in init-protx.php)\n\t\t\t\t\t\t\t'Description' => $Description,\t\t\t\t\t\t\t\t\t// Description of order \n\t\t\t\t\t\t\t 'BillingSurname' => $BillingSurname,\n\t\t\t\t\t\t\t 'BillingFirstnames' => $BillingFirstnames,\n\t\t\t\t\t\t\t 'BillingAddress1' => $BillingAddress1,\n\t\t\t\t\t\t\t 'BillingAddress2' => $BillingAddress2,\n\t\t\t\t\t\t\t 'BillingCity' => $BillingCity,\n\t\t\t\t\t\t\t 'BillingPostCode' => $BillingPostCode,\n\t\t\t\t\t\t\t 'BillingCountry' => $BillingCountry,\n\t\t\t\t\t\t\t 'DeliverySurname' => $DeliverySurname,\n\t\t\t\t\t\t\t 'DeliveryFirstnames' => $DeliveryFirstnames,\n\t\t\t\t\t\t\t 'DeliveryAddress1' => $DeliveryAddress1,\n\t\t\t\t\t\t\t 'DeliveryAddress2' => $DeliveryAddress2,\n\t\t\t\t\t\t\t 'DeliveryCity' => $DeliveryCity,\n\t\t\t\t\t\t\t 'DeliveryPostCode' => $DeliveryPostCode,\n\t\t\t\t\t\t\t 'DeliveryCountry' => $DeliveryCountry\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\n\t\t\t\t\t\n\t\t\t\t\t// add optional fields to the data array only if they've been set\n\t\t\t\t\t\n\t\t\t\t\t$optional_fields = array('ContactNumber' => $ContactNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'ContactFax' => $ContactFax,\n\t\t\t\t\t\t\t\t\t\t\t 'CustomerEMail' => $CustomerEMail,\n\t\t\t\t\t\t\t\t\t\t\t 'GiftAidPayment' => $GiftAidPayment,\n\t\t\t\t\t\t\t\t\t\t\t 'ApplyAVSCV2' => $ApplyAVSCV2,\n\t\t\t\t\t\t\t\t\t\t\t 'CAVV' => $CAVV,\n\t\t\t\t\t\t\t\t\t\t\t 'XID' => $XID,\n\t\t\t\t\t\t\t\t\t\t\t 'ECI' => $ECI,\n\t\t\t\t\t\t\t\t\t\t\t '3DSecureStatus' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'Basket' => $Basket,\n\t\t\t\t\t\t\t\t\t\t\t 'ClientNumber' => $ClientNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'IssueNumber' => $cc_issue_number,\n\t\t\t\t\t\t\t\t\t\t\t 'CV2' => $cc_ccv_number\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t// add the optional fields to the required array only if there are values set.\n\t\t\t\t\t$data = addOptionalFields( $optional_fields, $required, array ( \n\t\t\t\t\t 'ContactNumber',\n\t\t\t\t\t 'ContactFax',\n\t\t\t\t\t 'CustomerEMail',\n\t\t\t\t\t 'GiftAidPayment',\n\t\t\t\t\t 'ApplyAVSCV2',\n\t\t\t\t\t 'ClientIPAddress',\n\t\t\t\t\t 'CAVV',\n\t\t\t\t\t 'XID',\n\t\t\t\t\t 'ECI',\n\t\t\t\t\t '3DSecureStatus',\n\t\t\t\t\t 'Basket',\n\t\t\t\t\t 'ClientNumber', \n\t\t\t\t\t 'IssueNumber', \n\t\t\t\t\t 'CV2', \n\t\t\t\t\t) );\n\t\t\t\t\t\n\t\t\t\t\t$data['CardHolder'] =\t$cc_owner;\n\t\t\t\t\t$data['CardNumber'] = \t$cc_number;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Check if start date is supplied\n\t\t\t\t\tif($cc_start_month){\n\t\t\t\t\t\t// If so, add start date to data array to be appended to POST\n\t\t\t\t\t\t$data['StartDate'] = $cc_start_month . $cc_start_year;\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t// Add expiry date\n\t\t\t\t\t$data['ExpiryDate'] = $cc_expires_month . $cc_expires_year;\n\t\t\t\t\t\n\t\t\t\t\t// Add card type\n\t\t\t\t\t$data['CardType'] = $cc_ctype;\n\n\n\t\t\t\t\t$ipnum = dsf_get_ip_address();\n\n\t\t\t\t\t\t$data['Apply3DSecure'] = '0';\n\t\t\t\t\t\n\t\t\t\t\t$posted_data = $data;\n\t\t\t\t\t\n\t\t\t\t\t$data = formatData($data);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sage_response = requestPost($TargetURL, $data);\t\n\n\n\n\t\t\t\t\t// (1) add 1 to attempts counter\n\t\t\t\t\t\n\t\t\t\t\t\t$protx_attempts ++;\n\t\t\t\t\t\tdsf_session_unregister('protx_attempts');\n\t\t\t\t\t\tdsf_session_register('protx_attempts');\n\n\n\n\n\n\t// return the response back to the calling script.\n\t\treturn $sage_response;\n\t\t\n\n\n}", "public function _getShipmentCode() {\n\t\treturn $this->_shipmentCode;\n\t}", "public function run()\n {\n $transport_data = [\n ['code' => '01', 'name' => '西濃運輸'],\n ['code' => '02', 'name' => '京成運輸'],\n ['code' => '03', 'name' => '佐川急便'],\n ['code' => '04', 'name' => '久留米運送'],\n ['code' => '05', 'name' => '福山通運'],\n ['code' => '06', 'name' => '岡山県貨物'],\n ['code' => '07', 'name' => '野々村運送'],\n ['code' => '08', 'name' => '西濃(名古屋西)'],\n ['code' => '09', 'name' => '中央便'],\n ['code' => '10', 'name' => 'トール'],\n ['code' => '11', 'name' => '西濃(園芸部)'],\n ['code' => '12', 'name' => '阪急国内空輸'],\n ['code' => '13', 'name' => '丸工運送'],\n ['code' => '14', 'name' => '使用禁止'],\n ['code' => '15', 'name' => 'エスラインギフ'],\n ['code' => '16', 'name' => '福山(宅配)'],\n ['code' => '17', 'name' => '使用禁止'],\n ['code' => '18', 'name' => '京都運輸'],\n ['code' => '19', 'name' => '日本通運'],\n ['code' => '20', 'name' => '西濃(直売部)'],\n ['code' => '21', 'name' => '大島運輸'],\n ['code' => '22', 'name' => '西濃(彦根)'],\n ['code' => '23', 'name' => '近鉄物流'],\n ['code' => '24', 'name' => 'ヤマト運輸'],\n ['code' => '25', 'name' => '丸三海運'],\n ['code' => '26', 'name' => '琉球通運'],\n ['code' => '27', 'name' => '大商海運'],\n ['code' => '28', 'name' => '【離島】'],\n ['code' => '29', 'name' => '使用禁止'],\n ['code' => '30', 'name' => '近鉄第一トラック'],\n ['code' => '31', 'name' => '信州名鉄'],\n ['code' => '32', 'name' => '使用禁止'],\n ['code' => '33', 'name' => '第一貨物'],\n ['code' => '34', 'name' => '日本新潟運輸'],\n ['code' => '35', 'name' => '福井配送'],\n ['code' => '36', 'name' => 'マルニ'],\n ['code' => '37', 'name' => 'ヨナイザワ'],\n ['code' => '38', 'name' => '札幌急配'],\n ['code' => '39', 'name' => '京都通運'],\n ['code' => '40', 'name' => 'シズナイロゴス'],\n ['code' => '41', 'name' => '八潮運輸'],\n ['code' => '42', 'name' => '松運'],\n ['code' => '43', 'name' => '曙商事'],\n ['code' => '44', 'name' => '東栄運送'],\n ['code' => '45', 'name' => '三八五流通'],\n ['code' => '46', 'name' => '博運社'],\n ['code' => '47', 'name' => '九州産交運輸'],\n ['code' => '48', 'name' => '千石西濃運輸'],\n ['code' => '49', 'name' => '宮崎運輸'],\n ['code' => '50', 'name' => '野母商船'],\n ['code' => '51', 'name' => '南国海運'],\n ['code' => '52', 'name' => '壱岐海運'],\n ['code' => '53', 'name' => '松岡満'],\n ['code' => '54', 'name' => '新潟運輸'],\n ['code' => '55', 'name' => 'トナミ運輸'],\n ['code' => '56', 'name' => '西武運輸'],\n ['code' => '57', 'name' => '山陽自動車'],\n ['code' => '58', 'name' => '名鉄運輸'],\n ['code' => '59', 'name' => '小林運輸'],\n ['code' => '60', 'name' => 'クロネコメール便'],\n ['code' => '61', 'name' => '北九州宮崎運送'],\n ['code' => '62', 'name' => 'ナビックス'],\n ['code' => '63', 'name' => '札樽自動車'],\n ['code' => '64', 'name' => '月寒運輸'],\n ['code' => '65', 'name' => 'ネコポス'],\n ['code' => '66', 'name' => '日硝ハイウエー'],\n ];\n\n $date_data = [\n 'created_at' => 20200101,\n 'created_by' => 1,\n 'updated_at' => 20200101,\n 'updated_by' => 1,\n 'deleted_at' => null,\n 'deleted_by' => null\n ];\n\n foreach ($transport_data as $value) {\n $transport_array[] = array_merge($value, $date_data);\n }\n\n // 扱便マスタテーブル\n DB::table('transport')->insert($transport_array);\n }", "public function fetchPrepInstructions()\n {\n if (! array_key_exists('SellerSKUList.Id.1', $this->options) &&\n ! array_key_exists('ASINList.Id.1', $this->options)) {\n $this->log('Product IDs must be set in order to get prep instructions!', 'Warning');\n\n return false;\n }\n\n if (! array_key_exists('ShipToCountryCode', $this->options)) {\n $this->log('Country Code must be set in order to get prep instructions!', 'Warning');\n\n return false;\n }\n\n $this->preparePrep();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n if ($this->mockMode) {\n $xml = $this->fetchMockFile();\n } else {\n $response = $this->sendRequest($url, ['Post'=>$query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body']);\n }\n\n $this->parseXml($xml->$path);\n }", "public function createPurchaseOrder(Request $request)\n {\n $data = $request->input();\n\n $suppliers = array();\n\n foreach ($data as $key => $value) {\n $bestSupplier = ProductSuppliers::getBestSupplierForProduct($key);\n\n if(array_key_exists($bestSupplier['entity'], $suppliers))\n array_push($suppliers[$bestSupplier['entity']], $bestSupplier);\n else\n $suppliers[$bestSupplier['entity']] = [$bestSupplier];\n }\n\n foreach($suppliers as $supplier) {\n $documentLines = [];\n\n for($i = 0; $i < count($supplier); $i++) {\n $product = [\n 'description' => $supplier[$i]['description'],\n 'quantity' => $data[$supplier[$i]['product']],\n 'unitPrice' => number_format(floatval($supplier[$i]['price']), 2),\n 'deliveryDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\")+1, date(\"Y\"))),\n 'unit' => 'UN',\n 'itemTaxSchema' => 'ISENTO',\n 'purchasesItem' => $supplier[$i]['product'],\n 'documentLineStatus' => 'OPEN'\n ];\n\n array_push($documentLines, $product);\n }\n\n try {\n $result = JasminConnect::callJasmin('/purchases/orders', '', 'GET');\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n $seriesNumber = count(json_decode($result->getBody(), true)) + 1;\n\n try {\n $body = [\n 'documentType' => 'ECF',\n 'company' => 'TP-INDUSTRIES',\n 'serie' => '2019',\n 'seriesNumber' => $seriesNumber,\n 'documentDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'postingDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'SellerSupplierParty' => $supplier[0]['entity'],\n 'SellerSupplierPartyName' => $supplier[0]['name'],\n 'accountingParty' => $supplier[0]['entity'],\n 'exchangeRate' => 1,\n 'discount' => 0,\n 'loadingCountry' => $supplier[0]['country'],\n 'unloadingCountry' => 'PT',\n 'currency' => 'EUR',\n 'paymentMethod' => 'NUM',\n 'paymentTerm' => '01',\n 'documentLines' => $documentLines\n ];\n\n JasminConnect::callJasmin('/purchases/orders', '', 'POST', $body);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }\n\n return $data;\n }", "public function fedexSmallPlanNotice()\n {\n $planMsg = $this->dataHelper->fedexSmallSetPlanNotice();\n return $planMsg;\n }", "function getResponseDescription($responseCode) {\n\n switch ($responseCode) {\n case \"0\" : $result = \"Transaction Successful\"; break;\n case \"?\" : $result = \"Transaction status is unknown\"; break;\n case \"1\" : $result = \"Unknown Error\"; break;\n case \"2\" : $result = \"Bank Declined Transaction\"; break;\n case \"3\" : $result = \"No Reply from Bank\"; break;\n case \"4\" : $result = \"Expired Card\"; break;\n case \"5\" : $result = \"Insufficient funds\"; break;\n case \"6\" : $result = \"Error Communicating with Bank\"; break;\n case \"7\" : $result = \"Payment Server System Error\"; break;\n case \"8\" : $result = \"Transaction Type Not Supported\"; break;\n case \"9\" : $result = \"Bank declined transaction (Do not contact Bank)\"; break;\n case \"A\" : $result = \"Transaction Aborted\"; break;\n case \"C\" : $result = \"Transaction Cancelled\"; break;\n case \"D\" : $result = \"Deferred transaction has been received and is awaiting processing\"; break;\n case \"F\" : $result = \"3D Secure Authentication failed\"; break;\n case \"I\" : $result = \"Card Security Code verification failed\"; break;\n case \"L\" : $result = \"Shopping Transaction Locked (Please try the transaction again later)\"; break;\n case \"N\" : $result = \"Cardholder is not enrolled in Authentication scheme\"; break;\n case \"P\" : $result = \"Transaction has been received by the Payment Adaptor and is being processed\"; break;\n case \"R\" : $result = \"Transaction was not processed - Reached limit of retry attempts allowed\"; break;\n case \"S\" : $result = \"Duplicate SessionID (OrderInfo)\"; break;\n case \"T\" : $result = \"Address Verification Failed\"; break;\n case \"U\" : $result = \"Card Security Code Failed\"; break;\n case \"V\" : $result = \"Address Verification and Card Security Code Failed\"; break;\n default : $result = \"Unable to be determined\";\n }\n return $result;\n }", "protected function _buildRequest()\n {\n // prepare API\n $this->setShippingMethod('Other');\n $this->setCustomerIP(Mage::helper('core/http')->getRemoteAddr());\n $version = Mage::helper('ewayrapid')->getExtensionVersion();\n $this->setDeviceID('Magento ' . Mage::getEdition() . ' ' . Mage::getVersion().' - eWAY '.$version);\n if (Mage::helper('ewayrapid')->isBackendOrder()) {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_MOTO);\n } else {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_PURCHASE);\n }\n $this->setCustomerReadOnly(true);\n\n // add Billing Address\n $billingAddress = $this->_quote->getBillingAddress();\n $customerParam = Mage::getModel('ewayrapid/field_customer');\n \n $title = $this->_fixTitle($billingAddress->getPrefix());\n \n $customerParam->setTitle($title)\n ->setFirstName($billingAddress->getFirstname())\n ->setLastName($billingAddress->getLastname())\n ->setCompanyName($billingAddress->getCompany())\n ->setJobDescription($billingAddress->getJobDescription())\n ->setStreet1($billingAddress->getStreet1())\n ->setStreet2($billingAddress->getStreet2())\n ->setCity($billingAddress->getCity())\n ->setState($billingAddress->getRegion())\n ->setPostalCode($billingAddress->getPostcode())\n ->setCountry(strtolower($billingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($billingAddress->getEmail())\n ->setPhone($billingAddress->getTelephone())\n ->setMobile($billingAddress->getMobile())\n ->setComments('')\n ->setFax($billingAddress->getFax())\n ->setUrl('');\n $this->setCustomer($customerParam);\n\n // add Shipping Address\n $shippingAddress = $this->_quote->getShippingAddress();\n\n // copy BillingAddress to ShippingAddress if checkout with guest or register\n $checkoutMethod = $this->_quote->getCheckoutMethod();\n if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST\n || $checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER\n ) {\n $shippingAddress = $billingAddress;\n }\n\n $shippingParam = Mage::getModel('ewayrapid/field_shippingAddress');\n $shippingParam->setFirstName($shippingAddress->getFirstname())\n ->setLastName($shippingAddress->getLastname())\n ->setStreet1($shippingAddress->getStreet1())\n ->setStreet2($shippingAddress->getStreet2())\n ->setCity($shippingAddress->getCity())\n ->setState($shippingAddress->getRegion())\n ->setPostalCode($shippingAddress->getPostcode())\n ->setCountry(strtolower($shippingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($shippingAddress->getEmail())\n ->setPhone($shippingAddress->getTelephone())\n ->setFax($shippingAddress->getFax());\n $this->setShippingAddress($shippingParam);\n\n return $this;\n }", "function IndusIndPL($strnet_salary, $company, $category, $DOB, $clubbed_emi, $city, $reqtenure, $reqloanamount) {\n $net_salary = $strnet_salary;\n\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n\n if ($category == \"A+\" || $category == \"CAT A\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = \"12.99\";\n $intr = $interestrate;\n $proc_fee = \"0.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"13.75\";\n $intr = $interestrate ;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"14.75\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"13.50\";\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.25\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } elseif ($term == 60) {\n $getterm = 5;\n } else {\n $getterm = 5;\n }\n } else if ($category == \"CAT B\" || $category == \"CAT G\" || $category == \"C1000\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 14.00;\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 15.00;\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 16.00;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else if ($category == \"CAT C\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 17.50;\n $intr = $interestrate;\n $proc_fee = \"1.25%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 18;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 19;\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"18.50\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"19\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"20\";\n $intr = $interestrate;\n $proc_fee = \"2.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else {\n /* if ($net_salary >= 100000) {\n $interestrate = \"17\";\n $intr = 17;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 50000 && $net_salary < 100000) {\n $interestrate = \"17.5\";\n $intr = 17.5;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"18\";\n $intr = 18;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }*/\n }\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $princ = 100000;\n if ($intr > 0) {\n $perlacemi = round($princ * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($princ, $intr, $term);\n //Calculate Loan Amount\n if ($net_salary >= 50000) {\n $firstnet_salary = ($net_salary * (70 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else if ($net_salary >= 25000 && $net_salary < 50000) {\n $firstnet_salary = ($net_salary * (50 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else {\n $finalloanamount_dbr = 0;\n }\n } else {\n $finalloanamount_dbr = 0;\n }\n //other eiligibility\n if ($net_salary >= 50000) {\n $finalloanamount_other = $net_salary * 18;\n } else {\n $finalloanamount_other = $net_salary * 18;\n }\n $finalloanamount = 0;\n if ($finalloanamount_other < $finalloanamount_dbr) {\n $finalloanamount = $finalloanamount_other;\n } else {\n $finalloanamount = $finalloanamount_dbr;\n }\n if ($finalloanamount > 2500000) {\n if (strlen($category) > 1) {\n $getloanamout = 2500000;\n } else {\n $getloanamout = 700000;\n }\n } else {\n if (strlen($category) > 1) {\n $getloanamout = $finalloanamount;\n } else {\n if ($finalloanamount > 700000) {\n $getloanamout = 700000;\n } else {\n $getloanamout = $finalloanamount;\n }\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n if ($intr > 0) {\n if (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 700000 && $getloanamout < 1500000 && $net_salary >= 75000) {\n $interestrate = \"13.49\";\n $intr = 13.49;\n $proc_fee = \"0.49%\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 1500000 && $net_salary >= 100000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_fee = \"Rs. 4999\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n }\n } else {\n $getemicalc = 0;\n }\n\t\t\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $term))));\n $details['bank_code'] = \"Indus Ind Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $proc_fee;\n $details['category'] = $category;\n return($details);\n }", "private function isFlow(){\r\n return $this->getPaymentMethod() == 9;\r\n }", "public function getProgramCode()\n {\n return $this->programCode;\n }", "public function _code()\n {\n if (!$this->validateCSRF()) {\n return response()->json($this->restrictionAccessMessage());\n }\n\n $item_category = ItemCategory::find(\\Input::get('item_category_id'));\n $item = Item::where('item_category_id', '=', $item_category->id)->orderBy('id', 'desc')->first();\n $number = 1;\n if ($item) {\n $array_number = explode('-', $item->code);\n $number = $array_number[count($array_number) - 1] + 1;\n }\n\n $response = array(\n 'code' => $item_category->code . '-' . $number\n );\n return response()->json($response);\n }", "public function evaluateRoad() {\n\t\t$code = $this->road['code'];\n\t\tif ($code === '0'){\n\t\t\treturn 'Closed';\n\t\t}else if($code === '1'){\n\t\t\treturn 'Chains on all vehicles';\n\t\t}else if($code === '2'){\n\t\t\treturn 'Chains or 4WD';\n\t\t}else if($code === '3'){ \n\t\t\treturn 'Chains carried'; \n\t\t}else if($code === '4'){ \n\t\t\treturn 'Open'; \n\t\t}else if($code === '5'){ \n\t\t\treturn 'Air Access Only'; \n\t\t}\n\t}", "public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }", "public function getShippingCode()\n {\n $result = parent::getShippingCode();\n return $result;\n }", "public function getCode()\n {\n if($this->request->getQuery()->offsetExists($this->options->stage1->state->accessKey)) {\n $code = $this->getCodeFromRequest();\n if(is_string($code)) {\n return $code;\n }\n }\n return $this->getCodeFromVendor();\n }", "function SAP_set_order($rec_id)\n{\n/*\n\tThis FUNCTION posts SD order \n\tINPUT: id of invoice\n\tOUTPUT:\n\t\t\t- \"ID\" of SD order\n\t\t\tOR \"0\" - if failed\n*/\n\tinclude(\"login_re.php\");\n\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\t\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t//$cond_value='10';\n\t$service_mode='SO_C';\t// CREATE\t\n\t$req = new Request();\n\t \n\t\t\t//Setting up the object\n\t\t\t$item= new Item();\n\t\t\n\t\t//Set up mySQL connection\n\t\t\t$db_server = mysqli_connect($db_hostname, $db_username,$db_password);\n\t\t\t$db_server->set_charset(\"utf8\");\n\t\t\tIf (!$db_server) die(\"Can not connect to a database!!\".mysqli_connect_error($db_server));\n\t\t\tmysqli_select_db($db_server,$db_database)or die(mysqli_error($db_server));\n\t//1.\t\n\t\t// LOCATE data for the invoice\n\t\t\t$invoice_sql=\"SELECT invoice.date,invoice.value,contract.id_SAP,currency.code,decade,month,year \n\t\t\t\t\t\t\tFROM invoice \n\t\t\t\t\t\t\tLEFT JOIN contract ON invoice.contract_id=contract.id \n LEFT JOIN currency ON invoice.currency=currency.id\n\t\t\t\t\t\t\tWHERE invoice.id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql=mysqli_query($db_server,$invoice_sql);\n\t\t\t\t\n\t\t\tif(!$answsql) die(\"Database SELECT TO invoice table failed: \".mysqli_error($db_server));\t\n\t\t\tif (!$answsql->num_rows)\n\t\t\t{\n\t\t\t\techo \"WARNING: No invoice found for a given ID in invoice TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t$i_data= mysqli_fetch_row($answsql);\n\t\t\t\t\n\t\t\t\n\t//2.\t\n\t\t\t// Prepare request for SAP ERPclass Item\n\t\n\t\t\t// Set up params\n\t\t\t\n\t\t\t$c_date=$i_data[0];\n\t\t\t$val=$i_data[1];\n\t\t\t$contract_id=$i_data[2];\n\t\t\t$curr=$i_data[3];\t// Currency in invoice\n\t\t\t$decade=$i_data[4];\n\t\t\t$month=$i_data[5];\n\t\t\t$year=$i_data[6];\n\t\t\t//SERVICE DATE\n\t\t\t$service_date='';\n\t\t\tswitch($month)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$service_date='-01-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$service_date='-02-';\n\t\t\t\t\tif((int)$year%4)\n\t\t\t\t\t\t$day='28';\n\t\t\t\t\telse\n\t\t\t\t\t\t$day='29';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$service_date='-03-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$service_date='-04-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$service_date='-05-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$service_date='-06-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\t$service_date='-07-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\t$service_date='-08-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\t$service_date='-09-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\t$service_date='-10-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\t$service_date='-11-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\t$service_date='-12-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG MONTH IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch($decade)\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t$day='01';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='10';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$day='20';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='28';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG DECADE IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$service_date='20'.$year.$service_date.$day;\n\t\t\t// Preparing Items for Invoice\n\t\t\t$count_in=1;// only one position by Invoice now\n\t\t\t$items=new ItemList();\n\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t{\t\n\t\t\t\t$item1 = new Item();\n\t\t\t\t// 1. Item number\n\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t// 2. Material code\n\t\t\t\t$item1->MATERIAL='901200000';//now it's fixed\n\t\t\t\n\t\t\t/*2.1 BLOCK LEFT FOR LOCATING SAP MATERIAL ID\n\t\t\t\n\t\t\t\t$servicesql='SELECT id_SAP,id FROM services WHERE id_NAV=\"'.$service_id.'\"';\t\n\t\t\t\t$answsql=mysqli_query($db_server,$servicesql);\t\n\t\t\t\tif(!$answsql) die(\"Database SELECT in services table failed: \".mysqli_error($db_server));\t\n\n\t\t\t\t$sap_service_id= mysqli_fetch_row($answsql);\n\t\t\t*/\n\t\t\t\t// 3. Currency\n\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t// 4. SD conditions\n\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t// 4. Quantity\n\t\t\t\t$item1->TARGET_QTY='1'; //FIXED!\n\t\t\t\t\n\t\t\t\n\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t$items->item[$it] = $item1;\n\t\t\t}\n\t\t\t\n\t\t// GENERAL SECTION (HEADER)\n\t\t\n\t\t\t$req->ID_SALESCONTRACT = $contract_id;\t\n\t\t\t$req->SERVICEMODE = $service_mode;\n\t\t\t$req->SERVICEDATE = $service_date;\t\t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->RETURN2 = '';\n\t\t\t\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order)\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}", "public function showServerResponse($product_data, $status, $display)\n {\n $successMessages = array(\n VALID => __('Your license key is activated('.$product_data['pluginName'].')', $this->pluginSlug),\n );\n\n $errorMessages = array(\n 'server_did_not_respond' => __('No response from server. Please try again later.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'license_activation_failed' => __('License Activation Failed. Please try again or contact support on [email protected]('.$product_data['pluginName'].')', $this->pluginSlug),\n 'no_license_key_entered' => __('Please enter license key.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'no_activations_left' => (!empty($display)) ? sprintf(__('Your License Key is already activated at : %s Please deactivate the license from one of the above site(s) to successfully activate it on your current site.('.$product_data['pluginName'].')', $this->pluginSlug), $display) : __('No Activations Left.('.$product_data['pluginName'].')', $this->pluginSlug),\n EXPIRED => __('Your license key has Expired. Please, Renew it.('.$product_data['pluginName'].')', $this->pluginSlug),\n 'disabled' => __('Your License key is disabled('.$product_data['pluginName'].')', $this->pluginSlug),\n INVALID => __('Please enter valid license key('.$product_data['pluginName'].')', $this->pluginSlug),\n 'inactive' => __('Please try to activate license again. If it does not activate, contact support on [email protected]('.$product_data['pluginName'].')', $this->pluginSlug),\n 'site_inactive' => (!empty($display)) ? sprintf(__('Your License Key is already activated at : %s Please deactivate the license from one of the above site(s) to successfully activate it on your current site.('.$product_data['pluginName'].')', $this->pluginSlug), $display) : __('Site inactive (Press Activate license to activate plugin('.$product_data['pluginName'].'))', $this->pluginSlug),\n 'deactivated' => __('License Key is deactivated('.$product_data['pluginName'].')', $this->pluginSlug),\n 'default' => sprintf(__('Following Error Occurred: %s. Please contact support on [email protected] if you are not sure why this error is occurring('.$product_data['pluginName'].')', $this->pluginSlug), $status),\n 'server_curl_error' => __('There was an error while connecting to the server. please try again later.('.$product_data['pluginName'].')', $this->pluginSlug),\n );\n\n if ($status !== false) {\n if (array_key_exists($status, $successMessages)) {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $successMessages[$status],\n 'updated'\n );\n } else {\n if (array_key_exists($status, $errorMessages)) {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $errorMessages[$status],\n 'error'\n );\n } else {\n add_settings_error(\n 'epi_'.$this->pluginSlug.'_errors',\n esc_attr('settings_updated'),\n $errorMessages['default'],\n 'error'\n );\n }\n }\n }\n }", "public function cerasisOriginAddress(\n $request,\n $_product,\n $receiverZipCode\n ) {\n //Todo: need to check which warehouse is selected and method params conflict also must be fixed. fetchWarehouseSecData()\n $this->request = $request;\n $whQuery = $this->dataHelper->fetchWarehouseSecData('warehouse');\n $enableDropship = $_product->getData('en_dropship');\n\n if ($enableDropship) {\n $dropShipID = $_product->getData('en_dropship_location');\n $originList = $this->dataHelper->fetchWarehouseWithID('dropship', $dropShipID);\n\n if (!$originList) {\n $product = $this->productLoader->create()->load($_product->getEntityId());\n $product->setData('en_dropship', 0)->getResource()->saveAttribute($product, 'en_dropship');\n $origin = $whQuery;\n } else {\n $origin = $originList;\n }\n } else {\n $origin = $whQuery;\n }\n if (!empty($origin)) {\n return $this->multiWarehouse($origin, $receiverZipCode);\n }\n }", "public function getDeliveryNumber() {\n return $this->params[\"original\"][\"delivery_number\"];\n }", "public function getProductOption();", "private function formVipCode() {\n\t\t\t\n\t\t\t//The vipcode is formed by y - Year 2 digits, z - day of the year, Hi - Hour and minutes, s - seconds\n\t\t\t$this->vipCodeUniqueId = date('yz-Hi-s');\n\t\t\t//$this->vipCodeUniqueId = explode('.', microtime(true))[0] . explode('.', microtime(true))[1];\n\t\t\t$this->vipCode = \"voltoAo\" . ucfirst($this->enterprise->getName()) . \"#\". $this->vipCodeUniqueId;\n\t\t\treturn $this->vipCode;\n\t\t\t\n\t\t}", "abstract public function getPaymentAuthorizationCode();", "function getResponseMsg()\n {\n $msg = array('START' => 'Enter a product name:',\n 'NO_ITEMS' => 'There are no such items available.',\n 'INVALID_Q' => 'The query must contain only letters and digits (3 through 30).',\n 'DONE' => '{NUM} items from \"{NAME}\" fetched.');\n\n if (self::$current_state == 'DONE'){\n $msg[self::$current_state] = str_replace('{NAME}', self::$items_name, $msg[self::$current_state]);\n $msg[self::$current_state] = str_replace('{NUM}', self::$items_number, $msg[self::$current_state]);\n }\n return $msg[self::$current_state];\n }", "public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }" ]
[ "0.5670038", "0.55147827", "0.5249802", "0.5243149", "0.51940495", "0.5190678", "0.5186055", "0.5182411", "0.51613486", "0.5120875", "0.51044416", "0.50716776", "0.50647014", "0.50469846", "0.5027506", "0.50167537", "0.49985266", "0.49944723", "0.49802482", "0.4972659", "0.48998973", "0.48842055", "0.48720115", "0.48683548", "0.48682073", "0.48567474", "0.48485", "0.48355353", "0.4830866", "0.4825393", "0.48194376", "0.4808635", "0.4799566", "0.4791494", "0.4786335", "0.47825858", "0.47813818", "0.47595233", "0.4754855", "0.47539005", "0.4751373", "0.47428933", "0.4742725", "0.47325638", "0.47149575", "0.47132218", "0.47095904", "0.47087824", "0.4707068", "0.46982777", "0.46934932", "0.4680204", "0.46775016", "0.4668554", "0.46674034", "0.46592334", "0.46592334", "0.46543336", "0.46464545", "0.4641121", "0.4640159", "0.46379176", "0.46377942", "0.46336713", "0.4628974", "0.46278948", "0.46251485", "0.46176085", "0.46131387", "0.4607904", "0.4606664", "0.4604463", "0.45992365", "0.45918444", "0.45916227", "0.4591023", "0.45867938", "0.45792502", "0.4576288", "0.45736817", "0.45657605", "0.4564131", "0.4549732", "0.45455438", "0.45394188", "0.453716", "0.45332038", "0.45305547", "0.45278603", "0.4523366", "0.45233133", "0.45228544", "0.4520355", "0.45187455", "0.4510982", "0.45089227", "0.45080575", "0.45047805", "0.4502612", "0.4502353" ]
0.472589
44
The country code for the local service used.
public function getLocalProductCountryCode(): ?string { return $this->localProductCountryCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function countryCode();", "public function getCountryCode()\n {\n return $this->country_code;\n }", "public function getCountryCode()\n {\n return $this->country_code;\n }", "public function getCountryCode()\n {\n return $this->country_code;\n }", "public function getCountryCode() : string\n {\n return $this->countryCode;\n }", "public function countryCode(): string\n {\n return $this->getData('CountryCodeISO3166A2');\n }", "public function country(): string\n {\n return $this->country;\n }", "protected function getCountry()\n {\n return strtoupper($this->checkoutSession->getLastRealOrder()->getBillingAddress()->getCountryId());\n }", "public static function country()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn request()->header('CF_IPCOUNTRY');\n\t\t}) ?: '';\n\t}", "protected static function country_code(): mixed\n\t{\n\t\treturn self::$query->country_code;\n\t}", "public function country()\r\n\t{\r\n\t\t$country = \\Shop\\Models\\Countries::fromCode( $this->country_isocode_2 );\r\n\r\n\t\treturn $country;\r\n\t}", "public function getCountryCode()\n {\n return $this->countryCode;\n }", "public function getCountryCode()\n {\n return $this->countryCode;\n }", "public function getCountryCode()\n {\n return $this->countryCode;\n }", "public static function visitor_country()\n {\n $code = null;\n if (Director::isDev()) {\n if (isset($_GET['countryfortestingonly'])) {\n $code = $_GET['countryfortestingonly'];\n Controller::curr()->getRequest()->getSession()->set('countryfortestingonly', $code);\n }\n if ($code = Controller::curr()->getRequest()->getSession()->get('countryfortestingonly')) {\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n if (! $code) {\n if (isset($_SERVER['HTTP_CF_IPCOUNTRY']) && $_SERVER['HTTP_CF_IPCOUNTRY']) {\n return $_SERVER['HTTP_CF_IPCOUNTRY'];\n }\n $code = Controller::curr()->getRequest()->getSession()->get('MyCloudFlareCountry');\n if (! $code) {\n $address = self::get_remote_address();\n if (strlen($address) > 3) {\n $code = CloudFlareGeoIP::ip2country($address, true);\n }\n if (! $code) {\n $code = self::get_default_country_code();\n }\n if ('' === $code) {\n $code = Config::inst()->get('CloudFlareGeoip', 'default_country_code');\n }\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n\n return $code;\n }", "public function getCountryCode(): string\n {\n return !is_null($this->Countrycode)\n ? $this->Countrycode\n : self::DEFAULT_COUNTRY;\n }", "public function getCountry() : string\n {\n return $this->country;\n }", "public function getCountry() :string\n {\n return $this->country;\n }", "public function getCountryCode()\n\t{\n\t\tif ($this->countryCode === null)\n\t\t{\n\t\t\t$binInfo = $this->getBinInfo();\n\t\t\tif ($binInfo)\n\t\t\t\t$this->countryCode = strtoupper($binInfo->countryCode);\n\t\t}\n\t\treturn $this->countryCode;\n\t}", "public function getCountry(): string\n {\n return $this->result->country_name;\n }", "public function getCountryCode();", "public function getCountryCode()\n {\n return $this->code;\n }", "public function getCountryCode()\n {\n return substr($this->_code, -2);\n }", "public function getCode()\r\r\n\t{\r\r\n\t\treturn \"\";#getCountryFromIP($this->ip,\"code\");\r\r\n\t}", "public function getCountry()\n {\n return parent::getValue('country');\n }", "public function getCountryCode(): string;", "public function getCountry() : string {\n\t\t\treturn substr($this->value, 4, 2);\n\t\t}", "public function getCountryCode(): string\n {\n return 'SK';\n }", "public function getCountry()\n {\n return $this->getParameter('country');\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n if (!array_key_exists('country', $this->userInfo)) {\n $this->getLocation();\n }\n\n return $this->getInfoVar('country');\n }", "public function getCountry()\n {\n return $this->getValueObject('country');\n }", "public function getNativeCountry()\n {\n return Wrapper\\World::country($this->getNativeLeagueId());\n }", "public function getCountry()\n\t{\n\t\treturn $this->country;\n\t}", "public function getCountry()\n\t{\n\t\treturn $this->country;\n\t}", "public function getCountry()\n {\n return $this->getParameter('billingCountry');\n }", "public function get_country_id() {\n\t\treturn $this->_country_id;\n\t}", "function getCountry() {\r\r\n\t\treturn $this->country;\r\r\n\t}", "public function getCountry() {}", "public function getCountry() {}", "public function getCountry() {\n\t\treturn self::$_country;\n\t}", "public function getCountry()\n {\n return isset($this->address_data['country']) ? $this->address_data['country'] : null;\n }", "public function getCountry() \n {\n return $this->country;\n }", "public function getCountryCode(): ?string\n {\n return $this->countryCode;\n }", "public function get_visitor_country() {\n\t\treturn $this->get_country_code($this->get_visitor_ip_address());\n\t}", "abstract public function countryISOCode();", "protected function LiveDefaultCountry()\n {\n return self::get_default_country_code_combined();\n }", "public function getCountryName()\n {\n return $this->getValue('nb_icontact_prospect_country_name');\n }", "public function getCountryName()\n {\n return $this->getCountry()->getName();\n }", "public function getMerchantCountry()\n {\n return $this->_pro->getConfig()->getMerchantCountry();\n }", "public static function getCountry(){\n $country = '';\n $ip = self::getClientIP();\n if ($ip != '') {\n $data = file_get_contents('http://freegeoip.net/json/' . $ip);\n $response = json_decode($data);\n $country = $response->country_code;\n }\n \n return $country;\n }", "public function getPhoneCountryCode()\n {\n return $this->phoneCountryCode;\n }", "public function country(): ?string\n {\n return $this->country;\n }", "public function getCountryName() {\n //check if we have a country code\n if ($this->country) {\n //return the country name\n return Locale::getDisplayRegion('en_' . $this->country);\n }\n return NULL;\n }", "public function getCountryId()\n {\n return $this->getShippingAddress()->getCountryId();\n }", "public function getCountry_id()\n {\n return $this->country_id;\n }", "public function getCountry();", "public function getCountry();", "public function getCountryName();", "public function getUserCountry()\n {\n $fileName = $this->getDatabaseFile();\n\n $reader = new MaxMindReader($fileName);\n\n $ipAddress = $this->getUserIp();\n //$ipAddress = \"82.65.140.34\";\n\n $country = $reader->get($ipAddress);\n $reader->close();\n\n return $country ? $country['country']['iso_code'] : null;\n }", "public function getCountryCode()\n {\n $node = $this->response->getFirst('contact:addr/contact:cc', $this->node);\n\n return $node->nodeValue;\n }", "public function getReqCountry()\n\t{\n\t\treturn $this->req_country;\n\t}", "public function getCompanyCountry() {\n\n return $this->company_country;\n\n }", "public function getPhoneCountryCode()\n\t{\n\t\treturn $this->getIfSet('countryCode', $this->data->phone);\n\t}", "public function getCountryCode() {\n\t\tif (!$this->_countryCode) {\n\t\t\tthrow new System_Exception('User countryCode is not set');\n\t\t}\n\t\treturn $this->_countryCode;\n\t}", "function countryId( )\n {\n return $this->CountryID;\n }", "public function getCountry(): ?string\n {\n return $this->country;\n }", "public function getCountry(): ?string\n {\n return $this->country;\n }", "public function getCountry(): ?string\n {\n return $this->country;\n }", "public function getISOCountry()\n {\n return $this->iSOCountry;\n }", "public function getBillingCountry()\n {\n return $this->getParameter('billingCountry');\n }", "public function getCountryName()\n {\n return $this->getShippingAddress()->getCountryModel()->getName($this->localeResolver->getLocale());\n }", "public function getCountry(): ?string\n {\n return $this->_country;\n }", "public function getSubscriberCountry()\n {\n $country = parent::getSubscriberCountry(); \n return $country;\n }", "protected function LiveCountry()\n {\n return EcommerceCountry::get_country();\n }", "function getCountryID() {\n\t\treturn $this->_CountryID;\n\t}", "public function getDefaultCountry() {\n return (int) CRM_Core_Config::singleton()->defaultContactCountry;\n }", "public static function get_ip_country() {\n\t\tif ( false === self::$ip_country ) {\n\t\t\t$geoip = WC_Geolocation::geolocate_ip();\n\t\t\tself::$ip_country = $geoip['country'];\n\t\t}\n\t\treturn self::$ip_country;\n\t}", "function jr_get_server_country() {\r\n\r\n\t// Get user country\r\n\tif(isset($_SERVER['HTTP_X_FORWARD_FOR'])) $ip = $_SERVER['HTTP_X_FORWARD_FOR']; else $ip = $_SERVER['REMOTE_ADDR'];\r\n\r\n\t$ip = strip_tags($ip);\r\n\t$country = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\r\n\r\n\t$result = wp_remote_get('http://api.hostip.info/country.php?ip='.$ip);\r\n\tif (!is_wp_error($result) && strtolower($result['body']) != 'xx') $country = $result['body'];\r\n\r\n\treturn strtolower($country);\r\n}", "public function getCountry()\n {\n $arr_countries = array(\n 'F' =>\t_('Austria'),\n 'T' =>\t_('Belgium'),\n 'D' =>\t_('Finland'),\n 'E' =>\t_('France'),\n 'L' =>\t_('France'),\n 'P' =>\t_('Germany'),\n 'R' =>\t_('Germany'),\n 'N' =>\t_('Greece'),\n 'K' =>\t_('Ireland'),\n 'J' =>\t_('Italy'),\n 'G' =>\t_('Netherlands'),\n 'H' =>\t_('United Kingdom'),\n 'U' =>\t_('Portugal'),\n 'M' =>\t_('Spain'),\n );\n\n return $arr_countries[$this->str_value[0]];\n }", "public function getPayerAddressCountry() {\n\t\treturn $this->_getField(self::$PAYER_ADDRESS_COUNTRY);\n\t}", "public function getCountryCode(): ?string;", "public function getHotelCountry()\n {\n return $this->hotel_country;\n }", "public function requestCountryCode();", "public function getShippingCountry()\n {\n return $this->getParameter('shippingCountry');\n }", "public function getSessionCountry()\n {\n return Mage::getSingleton('core/session')->getData($this->_sessionRequestCountryKey);\n }", "public function getNativeCountryId()\n {\n return $this->getXml()->getElementsByTagName('NativeCountryID')->item(0)->nodeValue;\n }" ]
[ "0.8142543", "0.8101725", "0.8101725", "0.8101725", "0.80856514", "0.80809814", "0.8072471", "0.80634975", "0.80614734", "0.8054734", "0.8044396", "0.7995372", "0.7995372", "0.7995372", "0.79879904", "0.793553", "0.7920998", "0.7907546", "0.7907271", "0.79009086", "0.7836446", "0.7822051", "0.7802518", "0.77937853", "0.7786099", "0.7761642", "0.7711422", "0.7690968", "0.76659924", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.7639357", "0.7616228", "0.76056355", "0.7562078", "0.7562078", "0.7529475", "0.7490564", "0.74803746", "0.74431163", "0.74431163", "0.74345416", "0.7433641", "0.74039584", "0.7396513", "0.73809475", "0.73785347", "0.7374407", "0.73431045", "0.73322964", "0.72981924", "0.7294447", "0.7289047", "0.72576565", "0.7251431", "0.723983", "0.72323877", "0.72269577", "0.72269577", "0.72236663", "0.7222225", "0.7193348", "0.7147017", "0.7133595", "0.71255755", "0.71230537", "0.7108468", "0.71021485", "0.71021485", "0.71021485", "0.70907664", "0.70811045", "0.70643115", "0.70094305", "0.70048714", "0.69865423", "0.69860554", "0.69547284", "0.6942527", "0.6941761", "0.69357485", "0.691765", "0.6908758", "0.6870573", "0.6849327", "0.6828283", "0.68217224", "0.6818917" ]
0.732138
62
The country code for the local service used.
public function setLocalProductCountryCode(?string $localProductCountryCode): self { $this->initialized['localProductCountryCode'] = true; $this->localProductCountryCode = $localProductCountryCode; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function countryCode();", "public function getCountryCode()\n {\n return $this->country_code;\n }", "public function getCountryCode()\n {\n return $this->country_code;\n }", "public function getCountryCode()\n {\n return $this->country_code;\n }", "public function getCountryCode() : string\n {\n return $this->countryCode;\n }", "public function countryCode(): string\n {\n return $this->getData('CountryCodeISO3166A2');\n }", "public function country(): string\n {\n return $this->country;\n }", "protected function getCountry()\n {\n return strtoupper($this->checkoutSession->getLastRealOrder()->getBillingAddress()->getCountryId());\n }", "public static function country()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn request()->header('CF_IPCOUNTRY');\n\t\t}) ?: '';\n\t}", "protected static function country_code(): mixed\n\t{\n\t\treturn self::$query->country_code;\n\t}", "public function country()\r\n\t{\r\n\t\t$country = \\Shop\\Models\\Countries::fromCode( $this->country_isocode_2 );\r\n\r\n\t\treturn $country;\r\n\t}", "public function getCountryCode()\n {\n return $this->countryCode;\n }", "public function getCountryCode()\n {\n return $this->countryCode;\n }", "public function getCountryCode()\n {\n return $this->countryCode;\n }", "public static function visitor_country()\n {\n $code = null;\n if (Director::isDev()) {\n if (isset($_GET['countryfortestingonly'])) {\n $code = $_GET['countryfortestingonly'];\n Controller::curr()->getRequest()->getSession()->set('countryfortestingonly', $code);\n }\n if ($code = Controller::curr()->getRequest()->getSession()->get('countryfortestingonly')) {\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n if (! $code) {\n if (isset($_SERVER['HTTP_CF_IPCOUNTRY']) && $_SERVER['HTTP_CF_IPCOUNTRY']) {\n return $_SERVER['HTTP_CF_IPCOUNTRY'];\n }\n $code = Controller::curr()->getRequest()->getSession()->get('MyCloudFlareCountry');\n if (! $code) {\n $address = self::get_remote_address();\n if (strlen($address) > 3) {\n $code = CloudFlareGeoIP::ip2country($address, true);\n }\n if (! $code) {\n $code = self::get_default_country_code();\n }\n if ('' === $code) {\n $code = Config::inst()->get('CloudFlareGeoip', 'default_country_code');\n }\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n\n return $code;\n }", "public function getCountryCode(): string\n {\n return !is_null($this->Countrycode)\n ? $this->Countrycode\n : self::DEFAULT_COUNTRY;\n }", "public function getCountry() : string\n {\n return $this->country;\n }", "public function getCountry() :string\n {\n return $this->country;\n }", "public function getCountryCode()\n\t{\n\t\tif ($this->countryCode === null)\n\t\t{\n\t\t\t$binInfo = $this->getBinInfo();\n\t\t\tif ($binInfo)\n\t\t\t\t$this->countryCode = strtoupper($binInfo->countryCode);\n\t\t}\n\t\treturn $this->countryCode;\n\t}", "public function getCountry(): string\n {\n return $this->result->country_name;\n }", "public function getCountryCode();", "public function getCountryCode()\n {\n return $this->code;\n }", "public function getCountryCode()\n {\n return substr($this->_code, -2);\n }", "public function getCode()\r\r\n\t{\r\r\n\t\treturn \"\";#getCountryFromIP($this->ip,\"code\");\r\r\n\t}", "public function getCountry()\n {\n return parent::getValue('country');\n }", "public function getCountryCode(): string;", "public function getCountry() : string {\n\t\t\treturn substr($this->value, 4, 2);\n\t\t}", "public function getCountryCode(): string\n {\n return 'SK';\n }", "public function getCountry()\n {\n return $this->getParameter('country');\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n return $this->country;\n }", "public function getCountry()\n {\n if (!array_key_exists('country', $this->userInfo)) {\n $this->getLocation();\n }\n\n return $this->getInfoVar('country');\n }", "public function getCountry()\n {\n return $this->getValueObject('country');\n }", "public function getNativeCountry()\n {\n return Wrapper\\World::country($this->getNativeLeagueId());\n }", "public function getCountry()\n\t{\n\t\treturn $this->country;\n\t}", "public function getCountry()\n\t{\n\t\treturn $this->country;\n\t}", "public function getCountry()\n {\n return $this->getParameter('billingCountry');\n }", "public function get_country_id() {\n\t\treturn $this->_country_id;\n\t}", "function getCountry() {\r\r\n\t\treturn $this->country;\r\r\n\t}", "public function getCountry() {}", "public function getCountry() {}", "public function getCountry() {\n\t\treturn self::$_country;\n\t}", "public function getCountry()\n {\n return isset($this->address_data['country']) ? $this->address_data['country'] : null;\n }", "public function getCountry() \n {\n return $this->country;\n }", "public function getCountryCode(): ?string\n {\n return $this->countryCode;\n }", "public function get_visitor_country() {\n\t\treturn $this->get_country_code($this->get_visitor_ip_address());\n\t}", "abstract public function countryISOCode();", "protected function LiveDefaultCountry()\n {\n return self::get_default_country_code_combined();\n }", "public function getCountryName()\n {\n return $this->getValue('nb_icontact_prospect_country_name');\n }", "public function getCountryName()\n {\n return $this->getCountry()->getName();\n }", "public function getLocalProductCountryCode(): ?string\n {\n return $this->localProductCountryCode;\n }", "public function getMerchantCountry()\n {\n return $this->_pro->getConfig()->getMerchantCountry();\n }", "public static function getCountry(){\n $country = '';\n $ip = self::getClientIP();\n if ($ip != '') {\n $data = file_get_contents('http://freegeoip.net/json/' . $ip);\n $response = json_decode($data);\n $country = $response->country_code;\n }\n \n return $country;\n }", "public function getPhoneCountryCode()\n {\n return $this->phoneCountryCode;\n }", "public function country(): ?string\n {\n return $this->country;\n }", "public function getCountryName() {\n //check if we have a country code\n if ($this->country) {\n //return the country name\n return Locale::getDisplayRegion('en_' . $this->country);\n }\n return NULL;\n }", "public function getCountryId()\n {\n return $this->getShippingAddress()->getCountryId();\n }", "public function getCountry_id()\n {\n return $this->country_id;\n }", "public function getCountry();", "public function getCountry();", "public function getCountryName();", "public function getUserCountry()\n {\n $fileName = $this->getDatabaseFile();\n\n $reader = new MaxMindReader($fileName);\n\n $ipAddress = $this->getUserIp();\n //$ipAddress = \"82.65.140.34\";\n\n $country = $reader->get($ipAddress);\n $reader->close();\n\n return $country ? $country['country']['iso_code'] : null;\n }", "public function getCountryCode()\n {\n $node = $this->response->getFirst('contact:addr/contact:cc', $this->node);\n\n return $node->nodeValue;\n }", "public function getReqCountry()\n\t{\n\t\treturn $this->req_country;\n\t}", "public function getCompanyCountry() {\n\n return $this->company_country;\n\n }", "public function getPhoneCountryCode()\n\t{\n\t\treturn $this->getIfSet('countryCode', $this->data->phone);\n\t}", "public function getCountryCode() {\n\t\tif (!$this->_countryCode) {\n\t\t\tthrow new System_Exception('User countryCode is not set');\n\t\t}\n\t\treturn $this->_countryCode;\n\t}", "function countryId( )\n {\n return $this->CountryID;\n }", "public function getCountry(): ?string\n {\n return $this->country;\n }", "public function getCountry(): ?string\n {\n return $this->country;\n }", "public function getCountry(): ?string\n {\n return $this->country;\n }", "public function getISOCountry()\n {\n return $this->iSOCountry;\n }", "public function getBillingCountry()\n {\n return $this->getParameter('billingCountry');\n }", "public function getCountryName()\n {\n return $this->getShippingAddress()->getCountryModel()->getName($this->localeResolver->getLocale());\n }", "public function getCountry(): ?string\n {\n return $this->_country;\n }", "public function getSubscriberCountry()\n {\n $country = parent::getSubscriberCountry(); \n return $country;\n }", "protected function LiveCountry()\n {\n return EcommerceCountry::get_country();\n }", "function getCountryID() {\n\t\treturn $this->_CountryID;\n\t}", "public function getDefaultCountry() {\n return (int) CRM_Core_Config::singleton()->defaultContactCountry;\n }", "public static function get_ip_country() {\n\t\tif ( false === self::$ip_country ) {\n\t\t\t$geoip = WC_Geolocation::geolocate_ip();\n\t\t\tself::$ip_country = $geoip['country'];\n\t\t}\n\t\treturn self::$ip_country;\n\t}", "function jr_get_server_country() {\r\n\r\n\t// Get user country\r\n\tif(isset($_SERVER['HTTP_X_FORWARD_FOR'])) $ip = $_SERVER['HTTP_X_FORWARD_FOR']; else $ip = $_SERVER['REMOTE_ADDR'];\r\n\r\n\t$ip = strip_tags($ip);\r\n\t$country = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\r\n\r\n\t$result = wp_remote_get('http://api.hostip.info/country.php?ip='.$ip);\r\n\tif (!is_wp_error($result) && strtolower($result['body']) != 'xx') $country = $result['body'];\r\n\r\n\treturn strtolower($country);\r\n}", "public function getCountry()\n {\n $arr_countries = array(\n 'F' =>\t_('Austria'),\n 'T' =>\t_('Belgium'),\n 'D' =>\t_('Finland'),\n 'E' =>\t_('France'),\n 'L' =>\t_('France'),\n 'P' =>\t_('Germany'),\n 'R' =>\t_('Germany'),\n 'N' =>\t_('Greece'),\n 'K' =>\t_('Ireland'),\n 'J' =>\t_('Italy'),\n 'G' =>\t_('Netherlands'),\n 'H' =>\t_('United Kingdom'),\n 'U' =>\t_('Portugal'),\n 'M' =>\t_('Spain'),\n );\n\n return $arr_countries[$this->str_value[0]];\n }", "public function getPayerAddressCountry() {\n\t\treturn $this->_getField(self::$PAYER_ADDRESS_COUNTRY);\n\t}", "public function getCountryCode(): ?string;", "public function getHotelCountry()\n {\n return $this->hotel_country;\n }", "public function requestCountryCode();", "public function getShippingCountry()\n {\n return $this->getParameter('shippingCountry');\n }", "public function getSessionCountry()\n {\n return Mage::getSingleton('core/session')->getData($this->_sessionRequestCountryKey);\n }", "public function getNativeCountryId()\n {\n return $this->getXml()->getElementsByTagName('NativeCountryID')->item(0)->nodeValue;\n }" ]
[ "0.8142543", "0.8101725", "0.8101725", "0.8101725", "0.80856514", "0.80809814", "0.8072471", "0.80634975", "0.80614734", "0.8054734", "0.8044396", "0.7995372", "0.7995372", "0.7995372", "0.79879904", "0.793553", "0.7920998", "0.7907546", "0.7907271", "0.79009086", "0.7836446", "0.7822051", "0.7802518", "0.77937853", "0.7786099", "0.7761642", "0.7711422", "0.7690968", "0.76659924", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.76543206", "0.7639357", "0.7616228", "0.76056355", "0.7562078", "0.7562078", "0.7529475", "0.7490564", "0.74803746", "0.74431163", "0.74431163", "0.74345416", "0.7433641", "0.74039584", "0.7396513", "0.73809475", "0.73785347", "0.7374407", "0.73431045", "0.73322964", "0.732138", "0.72981924", "0.7294447", "0.7289047", "0.72576565", "0.7251431", "0.723983", "0.72323877", "0.72269577", "0.72269577", "0.72236663", "0.7222225", "0.7193348", "0.7147017", "0.7133595", "0.71255755", "0.71230537", "0.7108468", "0.71021485", "0.71021485", "0.71021485", "0.70907664", "0.70811045", "0.70643115", "0.70094305", "0.70048714", "0.69865423", "0.69860554", "0.69547284", "0.6942527", "0.6941761", "0.69357485", "0.691765", "0.6908758", "0.6870573", "0.6849327", "0.6828283", "0.68217224", "0.6818917" ]
0.0
-1
The NetworkTypeCode element indicates the product belongs to the Day Definite (DD) or Time Definite (TD) network. Possible Values; DD: Day Definite product TD: Time Definite product.
public function getNetworkTypeCode(): ?string { return $this->networkTypeCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setNetworkTypeCode(?string $networkTypeCode): self\n {\n $this->initialized['networkTypeCode'] = true;\n $this->networkTypeCode = $networkTypeCode;\n\n return $this;\n }", "public function getAdNetworkType()\n {\n return $this->ad_network_type;\n }", "function network_code( $network ){\n $network = trim(strtolower( $network ) );\n switch ($network) {\n case 'mtn':\n case 'dstv':\n return '01';\n break;\n case 'glo':\n case 'gotv':\n return '02';\n break;\n case '9mobile':\n case 'etisalat':\n case 'startimes':\n return '03';\n break;\n default :\n // airtel\n return '04';\n }\n}", "public function getNetworkType() {\n return $this->signal;\n }", "function fann_get_network_type($ann)\n{\n}", "public function getDeliveryTypeCode()\n {\n return $this->deliveryTypeCode;\n }", "public function getTypeNationalite() {\n return $this->typeNationalite;\n }", "public function getDOWTypeCode()\n {\n return $this->dOWTypeCode;\n }", "public function setNmfcCode($nmfcCode)\n {\n $this->values['NmfcCode'] = $nmfcCode;\n return $this;\n }", "public function setNetworkType($network) {\n if ($network != self::NETWORK_TYPE_1xRTT && $network != self::NETWORK_TYPE_CDMA &&\n $network != self::NETWORK_TYPE_EDGE && $network != self::NETWORK_TYPE_EHRPD &&\n $network != self::NETWORK_TYPE_EVDO_0 && $network != self::NETWORK_TYPE_EVDO_A &&\n $network != self::NETWORK_TYPE_EVDO_B && $network != self::NETWORK_TYPE_GPRS &&\n $network != self::NETWORK_TYPE_HSDPA && $network != self::NETWORK_TYPE_HSPA &&\n $network != self::NETWORK_TYPE_HSPAP && $network != self::NETWORK_TYPE_HSUPA &&\n $network != self::NETWORK_TYPE_IDEN && $network != self::NETWORK_TYPE_LTE &&\n $network != self::NETWORK_TYPE_UMTS && $network != self::NETWORK_TYPE_UNKNOWN) {\n throw new InvalidArgumentException(\"\\\"network\\\" is no valid character\");\n }\n $this->network = $network;\n }", "public function setAdNetworkType($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V0\\Enums\\AdNetworkTypeEnum_AdNetworkType::class);\n $this->ad_network_type = $var;\n\n return $this;\n }", "public function getCodeType()\n {\n return $this->codeType;\n }", "public function setTypeCode($typeCode)\n {\n $this->typeCode = $typeCode;\n return $this;\n }", "public function setNetwork($var)\n {\n GPBUtil::checkString($var, True);\n $this->network = $var;\n\n return $this;\n }", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "public function getPayMethodByCcType($ccTypeCode)\n {\n $returnValue = '';\n switch ($ccTypeCode) {\n case 'VI':\n case 'MC':\n $returnValue = self::PAYU_METHOD_CCVISAMC;\n break;\n case 'JCB':\n $returnValue = self::PAYU_METHOD_CCJCB;\n break;\n case 'DINCLB':\n $returnValue = self::PAYU_METHOD_CCDINERS;\n break;\n default:\n Mage::throwException(Mage::helper('innobyte_payu_lite')->__('CC type not supported by PayU.'));\n }\n return $returnValue;\n }", "public function getNetworkId(){\n\t\treturn self::NETWORK_ID;\n\t}", "public function getSocialNetwork($type_network) {\n if (isset($this->rSocialNetwork)) {\n foreach ($this->rSocialNetwork as $value) {\n if ($value->type_network == $type_network) {\n return $value->value;\n }\n }\n }\n return '';\n }", "public function getForecastTypeCode()\n {\n return $this->forecastTypeCode;\n }", "public function getCdNfservico()\n {\n return $this->cd_nfservico;\n }", "public function setTypeCode(?string $typeCode): self\n {\n $this->initialized['typeCode'] = true;\n $this->typeCode = $typeCode;\n\n return $this;\n }", "public function setTypeCode(?string $typeCode): self\n {\n $this->initialized['typeCode'] = true;\n $this->typeCode = $typeCode;\n\n return $this;\n }", "public function getNetworkMode()\n {\n return $this->_networkMode;\n }", "public function getReferenceType($code = null)\n {\n $types = array(\n 'TXN' => Mage::helper('paypal')->__('Transaction ID'),\n 'ODR' => Mage::helper('paypal')->__('Order ID'),\n 'SUB' => Mage::helper('paypal')->__('Subscription ID'),\n 'PAP' => Mage::helper('paypal')->__('Preapproved Payment ID')\n );\n if($code === null) {\n asort($types);\n return $types;\n }\n if (isset($types[$code])) {\n return $types[$code];\n }\n return $code;\n }", "public function getReferenceType($code = null)\n {\n $types = array(\n 'TXN' => Mage::helper('paypalmx')->__('Transaction ID'),\n 'ODR' => Mage::helper('paypalmx')->__('Order ID'),\n 'SUB' => Mage::helper('paypalmx')->__('Subscription ID'),\n 'PAP' => Mage::helper('paypalmx')->__('Preapproved Payment ID')\n );\n if($code === null) {\n asort($types);\n return $types;\n }\n if (isset($types[$code])) {\n return $types[$code];\n }\n return $code;\n }", "public function getDeliveryConfirmationTypeByCode($code)\n {\n $storeId = $this->getRma()->getStoreId();\n $countryId = $this->_rmaData->getReturnAddressModel($storeId)->getCountryId();\n $carrierCode = $this->getShipment()->getCarrierCode();\n $carrier = $this->_rmaData->getCarrier($carrierCode, $this->getRma()->getStoreId());\n if ($carrier) {\n $params = new \\Magento\\Framework\\DataObject(['country_recipient' => $countryId]);\n $confirmationTypes = $carrier->getDeliveryConfirmationTypes($params);\n $containerType = !empty($confirmationTypes[$code]) ? $confirmationTypes[$code] : '';\n return $containerType;\n }\n return '';\n }", "public function setDOWTypeCode($dOWTypeCode)\n {\n $this->dOWTypeCode = $dOWTypeCode;\n return $this;\n }", "public function getNationality()\n {\n return $this->nationality;\n }", "public function getNationality()\n {\n return $this->nationality;\n }", "public function getNationality()\n {\n return $this->nationality;\n }", "public function __construct(NcType $ncType)\n {\n $this->model = $ncType;\n }", "public function getTypeCode () {\n if (2 == $this->status) {\n return \"meanless\";\n }\n\n return $this->objtype;\n }", "public function getNetValue()\n {\n return $this->netValue;\n }", "public function getCdNppTypes()\n {\n return $this->hasMany(CdNppType::className(), ['capture_id' => 'capture_id']);\n }", "public function getTypeCode(): int\n {\n return $this->typeCode;\n }", "public function code( $typedescription ) {\n\t\treturn 1;\n\t}", "public function getDistributorTypeCode()\n {\n return $this->distributorTypeCode;\n }", "public function getDiscountCode()\n {\n if (is_null($this->discountCode)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DISCOUNT_CODE);\n if (is_null($data)) {\n return null;\n }\n\n $this->discountCode = DiscountCodeKeyReferenceModel::of($data);\n }\n\n return $this->discountCode;\n }", "public final function getTypeCode(): int\n {\n return self::TYPE_CODE;\n }", "public function setLaborTypeCode(?string $laborTypeCode): self\n {\n $this->laborTypeCode = $laborTypeCode;\n\n return $this;\n }", "public function setNetwork($value)\n {\n return $this->set('Network', $value);\n }", "public function setNetwork($value)\n {\n return $this->set('Network', $value);\n }", "public function setNetwork($value)\n {\n return $this->set('Network', $value);\n }", "function getNumericCountryCode($iso2Code){\r\n\t\t$resource = \"countries\";\r\n\t\t$countriesArray = $this->getResource($resource, null, 'All');\r\n\t\tif($countriesArray){\r\n\t\t\tforeach ($countriesArray as $country) {\r\n\t\t\t\tif($country->Alpha2Code == $iso2Code){\r\n\t\t\t\t\treturn $country->NumericCode;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function getNationalityID()\n {\n return $this->nationalityID;\n }", "public function getNetwork() {\n return $this->getValue('network');\n }", "public function getTypeLabel()\n {\n if ( $this->isCotis() ) {\n return _T(\"Membership\");\n } else {\n return _T(\"Donation\");\n }\n }", "public function getEntityTypeCode()\n {\n return 'catalog_rule';\n }", "public function setOrderCurrencyCode($code);", "public function getCurrencyCode()\n {\n return $this->_fields['CurrencyCode']['FieldValue'];\n }", "public function getCurrencyCode() \n {\n return $this->_fields['CurrencyCode']['FieldValue'];\n }", "public function getCargoTypeCode()\n {\n return $this->cargoTypeCode;\n }", "public function getCompareTypeLabel()\n {\n $compareType = $this->checkCompareType();\n if ($compareType === false)\n throw new Exception(\"Compare type is not set\");\n \n if ($compareType == self::COMPARE_TYPE_BY_BOX)\n return \"Box\";\n \n if ($compareType == self::COMPARE_TYPE_BY_TIMECODE)\n return \"Timecode\";\n \n return '';\n }", "public function setDeliveryTypeCode($deliveryTypeCode)\n {\n $this->deliveryTypeCode = $deliveryTypeCode;\n return $this;\n }", "public function setDeliveryTypeCode($deliveryTypeCode)\n {\n $this->deliveryTypeCode = $deliveryTypeCode;\n return $this;\n }", "public function setCdNfservico($cd_nfservico)\n {\n $this->cd_nfservico = $cd_nfservico;\n\n return $this;\n }", "public function setCodeType($codeType)\n {\n $this->codeType = $codeType;\n\n return $this;\n }", "public function getLaborTypeCode(): ?string\n {\n return $this->laborTypeCode;\n }", "protected function getNetsPaymentTypes() {\n return unserialize(NETS_PAYMENT_TYPES);\n }", "public function currencyCode()\n {\n return $this->_storeManager->getStore()->getCurrentCurrency()->getCurrencyCode();\n }", "public function getCodiNoti($value) {\n\t\treturn $this->codi_noti;\n\t}", "public function getRawType()\n {\n if ( $this->isCotis() ) {\n return 'membership';\n } else {\n return 'donation';\n }\n }", "public function getIdFactorNetwork()\n {\n return $this->id_factor_network;\n }", "public function getNiche_code () {\n\t$preValue = $this->preGetValue(\"niche_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->niche_code;\n\treturn $data;\n}", "final public function getNetworkId(): int\n {\n return static::NETWORK_ID;\n }", "public function getNatureCode()\n {\n return $this->natureCode;\n }", "function isInISO($code) {\n $xml = simplexml_load_file('http://www.currency-iso.org/dam/downloads/lists/list_one.xml');\n $result = $xml -> xpath(\"//CcyNtry[Ccy='{$code}']\");\n if($result != null) {\n return true;\n } else {\n return false;\n }\n }", "protected function __construct(int $typeCode)\n {\n $this->typeCode = $typeCode;\n }", "public function getCcTypeName()\n {\n $types = $this->_paymentConfig->getCcTypes();\n $ccType = $this->getInfo()->getCcType();\n if (isset($types[$ccType])) {\n return $types[$ccType];\n }\n return empty($ccType) ? __('N/A') : $ccType;\n }", "public function getNetworkTier()\n {\n return isset($this->network_tier) ? $this->network_tier : 0;\n }", "Public Function NetworkId() {\n\t\treturn $this->networkId;\n\t\n\t}", "public function setCurrencyCode($var)\n {\n GPBUtil::checkString($var, True);\n $this->currency_code = $var;\n\n return $this;\n }", "public function getDeliveryNetAmount()\r\n {\r\n return $this->_deliveryNetAmount;\r\n }", "public static function IdentifyCardType($ccNum)\n\t{\n\t\t$ccNum = preg_replace('/[^0-9]+/', '', $ccNum);\n\t\t//Visa 4 13, 16\n\t\tif (preg_match('/^4(.{12}|.{15})$/', $ccNum))\n\t\t\treturn 'VISA';\n\t\t//Master Card 51 to 55 16\n\t\telseif (preg_match('/^5[1-5].{14}$/', $ccNum))\n\t\t\treturn 'MASTERCARD';\n\t\t//American Express 34, 37 15\n\t\telseif (preg_match('/^3[47].{13}$/', $ccNum))\n\t\t\treturn 'AMEX';\n\t\t//Diners Club 300 to 305, 36 14\n\t\t//Carte Blanche 38 14\n\t\telseif (preg_match('/^3(0[0-5].{11}|[68].{12})$/', $ccNum))\n\t\t\treturn 'DINERS';\n\t\t//Discover 6011 16\n\t\telseif (preg_match('/^6011.{12}$/', $ccNum))\n\t\t\treturn 'DISCOVER';\n\t\t//JCB 3 16\n\t\t//JCB 2131, 1800 15\n\t\telseif (preg_match('/^3.{15}|(2131|1800).{11}$/', $ccNum))\n\t\t\treturn 'JCB';\n\t\t//EnRoute 2014, 2149 15\n\t\telseif (preg_match('/^2(014|149).{11}$/', $ccNum))\n\t\t\treturn 'ENROUTE';\n\t\telse\n\t\t\treturn \"N\";\n\t}", "protected function getEntityTypeId($entityTypeCode = null)\n {\n return $this->getSubject()->getEntityTypeId($entityTypeCode);\n }", "public function getTypeCode(): ?string\n {\n return $this->typeCode;\n }", "public function getTypeCode(): ?string\n {\n return $this->typeCode;\n }", "public function getCode()\r\r\n\t{\r\r\n\t\treturn \"\";#getCountryFromIP($this->ip,\"code\");\r\r\n\t}", "public function getServiceTypeCode()\n {\n return $this->serviceTypeCode;\n }", "public function getCurrencyISOCode()\n {\n $numberFormatter = new \\NumberFormatter($this->_currentLocale, \\NumberFormatter::CURRENCY);\n return $numberFormatter->getSymbol(\\NumberFormatter::INTL_CURRENCY_SYMBOL);\n }", "public function categoriaOcupacional()\n {\n if ($this->PP05A==1 && $this->PP05D==1){\n return 1;\n }\n if ($this->PP05A==1 && ($this->PP05D==2 || $this->PP05D==3)){\n return 2;\n }\n if ($this->PP05A==3){\n return 3;\n }\n if ($this->PP05A==2 && $this->PP05B==2 && $this->PP05B1==3){\n return 4;\n }\n // #Ns./Nr.\n // (me parece que es si no se completa: pp05a=null)\n }", "public static function getCodeTypes() {\n return array('B', 'P', 'PU', 'PR', 'CS', 'SA', 'SR', 'PG');\n }", "protected function get_currency_iso_code( $currency_code, $default_code = '826' ) {\r\n\t\t$result = $default_code;\r\n\t\t$iso_codes = array(\r\n\t\t\t'GBP' => '826',\r\n\t\t\t'USD' => '840',\r\n\t\t\t'EUR' => '978',\r\n\t\t);\r\n\t\tif ( array_key_exists( $currency_code, $iso_codes ) ) {\r\n\t\t\t$result = $iso_codes[ $currency_code ];\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function mapNetworkStatus($status) {\n\n\t\tswitch (strtolower($status)) {\n\n\t\t\tcase 'cleared':\n\t\t\tcase 'paid':\n\t\t\t\treturn MerchantTransaction::STATUS_CONFIRMED;\n\t\t\tcase 'cancelled':\n\t\t\t\treturn MerchantTransaction::STATUS_CANCELED;\n\t\t\tcase 'notcleared':\n\t\t\t\treturn MerchantTransaction::STATUS_OPEN;\n\t\t}\n\n\t\treturn MerchantTransaction::STATUS_NONE;\n\t}", "public function get_net_types($p_id = null)\n {\n $l_sql = 'SELECT * FROM isys_net_type ';\n\n if (is_numeric($p_id))\n {\n $l_sql .= 'WHERE isys_net_type__id = ' . $this->convert_sql_id($p_id);\n }\n else if (is_string($p_id))\n {\n $l_sql .= 'WHERE isys_net_type__const = ' . $this->convert_sql_text($p_id);\n } // if\n\n return $this->retrieve($l_sql);\n }", "public function getOrderCurrencyCode();", "Public Function setNetworkId($NetworkId) {\n\t\t$this->networkId = $NetworkId;\n\t\n\t}", "public static function getSymbolOfCurrencyCode($currencyCode) {\n $currencyCode = strtoupper($currencyCode);\n $currencies = [\n \t'AED' => '&#1583;.&#1573;', // ?\n 'AFN' => '&#65;&#102;',\n 'ALL' => '&#76;&#101;&#107;',\n 'AMD' => '',\n 'ANG' => '&#402;',\n 'AOA' => '&#75;&#122;', // ?\n 'ARS' => '&#36;',\n 'AUD' => '&#36;',\n 'AWG' => '&#402;',\n 'AZN' => '&#1084;&#1072;&#1085;',\n 'BAM' => '&#75;&#77;',\n 'BBD' => '&#36;',\n 'BDT' => '&#2547;', // ?\n 'BGN' => '&#1083;&#1074;',\n 'BHD' => '.&#1583;.&#1576;', // ?\n 'BIF' => '&#70;&#66;&#117;', // ?\n 'BMD' => '&#36;',\n 'BND' => '&#36;',\n 'BOB' => '&#36;&#98;',\n 'BRL' => '&#82;&#36;',\n 'BSD' => '&#36;',\n 'BTN' => '&#78;&#117;&#46;', // ?\n 'BWP' => '&#80;',\n 'BYR' => '&#112;&#46;',\n 'BZD' => '&#66;&#90;&#36;',\n 'CAD' => '&#36;',\n 'CDF' => '&#70;&#67;',\n 'CHF' => '&#67;&#72;&#70;',\n 'CLF' => '', // ?\n 'CLP' => '&#36;',\n 'CNY' => '&#165;',\n 'COP' => '&#36;',\n 'CRC' => '&#8353;',\n 'CUP' => '&#8396;',\n 'CVE' => '&#36;', // ?\n 'CZK' => '&#75;&#269;',\n 'DJF' => '&#70;&#100;&#106;', // ?\n 'DKK' => '&#107;&#114;',\n 'DOP' => '&#82;&#68;&#36;',\n 'DZD' => '&#1583;&#1580;', // ?\n 'EGP' => '&#163;',\n 'ETB' => '&#66;&#114;',\n 'EUR' => '&#8364;',\n 'FJD' => '&#36;',\n 'FKP' => '&#163;',\n 'GBP' => '&#163;',\n 'GEL' => '&#4314;', // ?\n 'GHS' => '&#162;',\n 'GIP' => '&#163;',\n 'GMD' => '&#68;', // ?\n 'GNF' => '&#70;&#71;', // ?\n 'GTQ' => '&#81;',\n 'GYD' => '&#36;',\n 'HKD' => '&#36;',\n 'HNL' => '&#76;',\n 'HRK' => '&#107;&#110;',\n 'HTG' => '&#71;', // ?\n 'HUF' => '&#70;&#116;',\n 'IDR' => '&#82;&#112;',\n 'ILS' => '&#8362;',\n 'INR' => '&#8377;',\n 'IQD' => '&#1593;.&#1583;', // ?\n 'IRR' => '&#65020;',\n 'ISK' => '&#107;&#114;',\n 'JEP' => '&#163;',\n 'JMD' => '&#74;&#36;',\n 'JOD' => '&#74;&#68;', // ?\n 'JPY' => '&#165;',\n 'KES' => '&#75;&#83;&#104;', // ?\n 'KGS' => '&#1083;&#1074;',\n 'KHR' => '&#6107;',\n 'KMF' => '&#67;&#70;', // ?\n 'KPW' => '&#8361;',\n 'KRW' => '&#8361;',\n 'KWD' => '&#1583;.&#1603;', // ?\n 'KYD' => '&#36;',\n 'KZT' => '&#1083;&#1074;',\n 'LAK' => '&#8365;',\n 'LBP' => '&#163;',\n 'LKR' => '&#8360;',\n 'LRD' => '&#36;',\n 'LSL' => '&#76;', // ?\n 'LTL' => '&#76;&#116;',\n 'LVL' => '&#76;&#115;',\n 'LYD' => '&#1604;.&#1583;', // ?\n 'MAD' => '&#1583;.&#1605;.', //?\n 'MDL' => '&#76;',\n 'MGA' => '&#65;&#114;', // ?\n 'MKD' => '&#1076;&#1077;&#1085;',\n 'MMK' => '&#75;',\n 'MNT' => '&#8366;',\n 'MOP' => '&#77;&#79;&#80;&#36;', // ?\n 'MRO' => '&#85;&#77;', // ?\n 'MUR' => '&#8360;', // ?\n 'MVR' => '.&#1923;', // ?\n 'MWK' => '&#77;&#75;',\n 'MXN' => '&#36;',\n 'MYR' => '&#82;&#77;',\n 'MZN' => '&#77;&#84;',\n 'NAD' => '&#36;',\n 'NGN' => '&#8358;',\n 'NIO' => '&#67;&#36;',\n 'NOK' => '&#107;&#114;',\n 'NPR' => '&#8360;',\n 'NZD' => '&#36;',\n 'OMR' => '&#65020;',\n 'PAB' => '&#66;&#47;&#46;',\n 'PEN' => '&#83;&#47;&#46;',\n 'PGK' => '&#75;', // ?\n 'PHP' => '&#8369;',\n 'PKR' => '&#8360;',\n 'PLN' => '&#122;&#322;',\n 'PYG' => '&#71;&#115;',\n 'QAR' => '&#65020;',\n 'RON' => '&#108;&#101;&#105;',\n 'RSD' => '&#1044;&#1080;&#1085;&#46;',\n 'RUB' => '&#1088;&#1091;&#1073;',\n 'RWF' => '&#1585;.&#1587;',\n 'SAR' => '&#65020;',\n 'SBD' => '&#36;',\n 'SCR' => '&#8360;',\n 'SDG' => '&#163;', // ?\n 'SEK' => '&#107;&#114;',\n 'SGD' => '&#36;',\n 'SHP' => '&#163;',\n 'SLL' => '&#76;&#101;', // ?\n 'SOS' => '&#83;',\n 'SRD' => '&#36;',\n 'STD' => '&#68;&#98;', // ?\n 'SVC' => '&#36;',\n 'SYP' => '&#163;',\n 'SZL' => '&#76;', // ?\n 'THB' => '&#3647;',\n 'TJS' => '&#84;&#74;&#83;', // ? TJS (guess)\n 'TMT' => '&#109;',\n 'TND' => '&#1583;.&#1578;',\n 'TOP' => '&#84;&#36;',\n 'TRY' => '&#8356;', // New Turkey Lira (old symbol used)\n 'TTD' => '&#36;',\n 'TWD' => '&#78;&#84;&#36;',\n 'TZS' => '',\n 'UAH' => '&#8372;',\n 'UGX' => '&#85;&#83;&#104;',\n 'USD' => '&#36;',\n 'UYU' => '&#36;&#85;',\n 'UZS' => '&#1083;&#1074;',\n 'VEF' => '&#66;&#115;',\n 'VND' => '&#8363;',\n 'VUV' => '&#86;&#84;',\n 'WST' => '&#87;&#83;&#36;',\n 'XAF' => '&#70;&#67;&#70;&#65;',\n 'XCD' => '&#36;',\n 'XDR' => '',\n 'XOF' => '',\n 'XPF' => '&#70;',\n 'YER' => '&#65020;',\n 'ZAR' => '&#82;',\n 'ZMK' => '&#90;&#75;', // ?\n 'ZWL' => '&#90;&#36;'\n ];\n return $currencies[$currencyCode];\n }", "public function network($networkId)\n {\n return $this->request('get', '/api/networks/'.$networkId);\n }", "public function GetTypeDesc(): string {\n\t\tswitch($this->debugType) {\n\t\t\tcase self::NONE: \treturn \"NONE\";\n\t\t\tcase self::LOG: \treturn \"LOG\";\n\t\t\tcase self::DEBUG:\treturn \"DEBUG\";\n\t\t\tcase self::DEV:\t\treturn \"DEV\";\n\t\t\tdefault: \t\t\t\t\treturn \"unknown\";\n\t\t}\n\t}", "public function getCommunityNetwork()\n {\n return $this->communityNetwork;\n }", "public function setDistributorTypeCode($distributorTypeCode)\n {\n $this->distributorTypeCode = $distributorTypeCode;\n return $this;\n }", "public function getDiscountCode()\n {\n return $this->discountCode;\n }", "public function getDiscountCode()\n {\n return $this->discountCode;\n }", "public function setForecastTypeCode(\\horstoeko\\ubl\\entities\\cbc\\ForecastTypeCode $forecastTypeCode)\n {\n $this->forecastTypeCode = $forecastTypeCode;\n return $this;\n }", "function _NDL()\r\n\t{\r\n\r\n\t}", "public function getDiscountType()\n {\n return $this->discountType;\n }", "public function getNetwork()\n {\n return $this->network;\n }", "public function getNetwork()\n {\n return $this->network;\n }" ]
[ "0.5964149", "0.5531543", "0.5402334", "0.5320659", "0.50460637", "0.5028686", "0.5000282", "0.49938503", "0.49405426", "0.47683275", "0.47538877", "0.47342655", "0.46673933", "0.4646093", "0.46384332", "0.46384332", "0.45928445", "0.45781636", "0.45749137", "0.4515465", "0.45059803", "0.44913024", "0.44913024", "0.4476967", "0.44459164", "0.44427395", "0.44355598", "0.44311416", "0.4408672", "0.4408672", "0.4408672", "0.4385488", "0.43825564", "0.43795022", "0.43779105", "0.43750578", "0.43631414", "0.4354316", "0.4352674", "0.43396556", "0.4313275", "0.43070123", "0.43055457", "0.43055457", "0.4300198", "0.4292553", "0.42867318", "0.42727137", "0.4270653", "0.42507154", "0.42480367", "0.4241275", "0.42298856", "0.4229821", "0.422472", "0.422472", "0.42186052", "0.42166916", "0.421601", "0.4212599", "0.42033875", "0.41869593", "0.4181587", "0.41774896", "0.41730368", "0.41681305", "0.416493", "0.4164223", "0.41602546", "0.41594738", "0.41479334", "0.41464007", "0.41341352", "0.4129618", "0.41291493", "0.41243804", "0.41188717", "0.41188717", "0.41103116", "0.410789", "0.40974256", "0.40856576", "0.40853825", "0.40838492", "0.40699422", "0.40682805", "0.40537578", "0.40535334", "0.4049731", "0.404506", "0.40407148", "0.40318123", "0.40245798", "0.40236732", "0.40236732", "0.40233788", "0.40233278", "0.40197238", "0.40028283", "0.40028283" ]
0.6282591
0
The NetworkTypeCode element indicates the product belongs to the Day Definite (DD) or Time Definite (TD) network. Possible Values; DD: Day Definite product TD: Time Definite product.
public function setNetworkTypeCode(?string $networkTypeCode): self { $this->initialized['networkTypeCode'] = true; $this->networkTypeCode = $networkTypeCode; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNetworkTypeCode(): ?string\n {\n return $this->networkTypeCode;\n }", "public function getAdNetworkType()\n {\n return $this->ad_network_type;\n }", "function network_code( $network ){\n $network = trim(strtolower( $network ) );\n switch ($network) {\n case 'mtn':\n case 'dstv':\n return '01';\n break;\n case 'glo':\n case 'gotv':\n return '02';\n break;\n case '9mobile':\n case 'etisalat':\n case 'startimes':\n return '03';\n break;\n default :\n // airtel\n return '04';\n }\n}", "public function getNetworkType() {\n return $this->signal;\n }", "function fann_get_network_type($ann)\n{\n}", "public function getDeliveryTypeCode()\n {\n return $this->deliveryTypeCode;\n }", "public function getTypeNationalite() {\n return $this->typeNationalite;\n }", "public function getDOWTypeCode()\n {\n return $this->dOWTypeCode;\n }", "public function setNmfcCode($nmfcCode)\n {\n $this->values['NmfcCode'] = $nmfcCode;\n return $this;\n }", "public function setNetworkType($network) {\n if ($network != self::NETWORK_TYPE_1xRTT && $network != self::NETWORK_TYPE_CDMA &&\n $network != self::NETWORK_TYPE_EDGE && $network != self::NETWORK_TYPE_EHRPD &&\n $network != self::NETWORK_TYPE_EVDO_0 && $network != self::NETWORK_TYPE_EVDO_A &&\n $network != self::NETWORK_TYPE_EVDO_B && $network != self::NETWORK_TYPE_GPRS &&\n $network != self::NETWORK_TYPE_HSDPA && $network != self::NETWORK_TYPE_HSPA &&\n $network != self::NETWORK_TYPE_HSPAP && $network != self::NETWORK_TYPE_HSUPA &&\n $network != self::NETWORK_TYPE_IDEN && $network != self::NETWORK_TYPE_LTE &&\n $network != self::NETWORK_TYPE_UMTS && $network != self::NETWORK_TYPE_UNKNOWN) {\n throw new InvalidArgumentException(\"\\\"network\\\" is no valid character\");\n }\n $this->network = $network;\n }", "public function setAdNetworkType($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V0\\Enums\\AdNetworkTypeEnum_AdNetworkType::class);\n $this->ad_network_type = $var;\n\n return $this;\n }", "public function getCodeType()\n {\n return $this->codeType;\n }", "public function setTypeCode($typeCode)\n {\n $this->typeCode = $typeCode;\n return $this;\n }", "public function setNetwork($var)\n {\n GPBUtil::checkString($var, True);\n $this->network = $var;\n\n return $this;\n }", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "public function getPayMethodByCcType($ccTypeCode)\n {\n $returnValue = '';\n switch ($ccTypeCode) {\n case 'VI':\n case 'MC':\n $returnValue = self::PAYU_METHOD_CCVISAMC;\n break;\n case 'JCB':\n $returnValue = self::PAYU_METHOD_CCJCB;\n break;\n case 'DINCLB':\n $returnValue = self::PAYU_METHOD_CCDINERS;\n break;\n default:\n Mage::throwException(Mage::helper('innobyte_payu_lite')->__('CC type not supported by PayU.'));\n }\n return $returnValue;\n }", "public function getNetworkId(){\n\t\treturn self::NETWORK_ID;\n\t}", "public function getSocialNetwork($type_network) {\n if (isset($this->rSocialNetwork)) {\n foreach ($this->rSocialNetwork as $value) {\n if ($value->type_network == $type_network) {\n return $value->value;\n }\n }\n }\n return '';\n }", "public function getForecastTypeCode()\n {\n return $this->forecastTypeCode;\n }", "public function getCdNfservico()\n {\n return $this->cd_nfservico;\n }", "public function setTypeCode(?string $typeCode): self\n {\n $this->initialized['typeCode'] = true;\n $this->typeCode = $typeCode;\n\n return $this;\n }", "public function setTypeCode(?string $typeCode): self\n {\n $this->initialized['typeCode'] = true;\n $this->typeCode = $typeCode;\n\n return $this;\n }", "public function getNetworkMode()\n {\n return $this->_networkMode;\n }", "public function getReferenceType($code = null)\n {\n $types = array(\n 'TXN' => Mage::helper('paypal')->__('Transaction ID'),\n 'ODR' => Mage::helper('paypal')->__('Order ID'),\n 'SUB' => Mage::helper('paypal')->__('Subscription ID'),\n 'PAP' => Mage::helper('paypal')->__('Preapproved Payment ID')\n );\n if($code === null) {\n asort($types);\n return $types;\n }\n if (isset($types[$code])) {\n return $types[$code];\n }\n return $code;\n }", "public function getReferenceType($code = null)\n {\n $types = array(\n 'TXN' => Mage::helper('paypalmx')->__('Transaction ID'),\n 'ODR' => Mage::helper('paypalmx')->__('Order ID'),\n 'SUB' => Mage::helper('paypalmx')->__('Subscription ID'),\n 'PAP' => Mage::helper('paypalmx')->__('Preapproved Payment ID')\n );\n if($code === null) {\n asort($types);\n return $types;\n }\n if (isset($types[$code])) {\n return $types[$code];\n }\n return $code;\n }", "public function getDeliveryConfirmationTypeByCode($code)\n {\n $storeId = $this->getRma()->getStoreId();\n $countryId = $this->_rmaData->getReturnAddressModel($storeId)->getCountryId();\n $carrierCode = $this->getShipment()->getCarrierCode();\n $carrier = $this->_rmaData->getCarrier($carrierCode, $this->getRma()->getStoreId());\n if ($carrier) {\n $params = new \\Magento\\Framework\\DataObject(['country_recipient' => $countryId]);\n $confirmationTypes = $carrier->getDeliveryConfirmationTypes($params);\n $containerType = !empty($confirmationTypes[$code]) ? $confirmationTypes[$code] : '';\n return $containerType;\n }\n return '';\n }", "public function setDOWTypeCode($dOWTypeCode)\n {\n $this->dOWTypeCode = $dOWTypeCode;\n return $this;\n }", "public function getNationality()\n {\n return $this->nationality;\n }", "public function getNationality()\n {\n return $this->nationality;\n }", "public function getNationality()\n {\n return $this->nationality;\n }", "public function __construct(NcType $ncType)\n {\n $this->model = $ncType;\n }", "public function getTypeCode () {\n if (2 == $this->status) {\n return \"meanless\";\n }\n\n return $this->objtype;\n }", "public function getTypeCode(): int\n {\n return $this->typeCode;\n }", "public function getNetValue()\n {\n return $this->netValue;\n }", "public function getCdNppTypes()\n {\n return $this->hasMany(CdNppType::className(), ['capture_id' => 'capture_id']);\n }", "public function code( $typedescription ) {\n\t\treturn 1;\n\t}", "public function getDistributorTypeCode()\n {\n return $this->distributorTypeCode;\n }", "public function getDiscountCode()\n {\n if (is_null($this->discountCode)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DISCOUNT_CODE);\n if (is_null($data)) {\n return null;\n }\n\n $this->discountCode = DiscountCodeKeyReferenceModel::of($data);\n }\n\n return $this->discountCode;\n }", "public final function getTypeCode(): int\n {\n return self::TYPE_CODE;\n }", "public function setLaborTypeCode(?string $laborTypeCode): self\n {\n $this->laborTypeCode = $laborTypeCode;\n\n return $this;\n }", "public function setNetwork($value)\n {\n return $this->set('Network', $value);\n }", "public function setNetwork($value)\n {\n return $this->set('Network', $value);\n }", "public function setNetwork($value)\n {\n return $this->set('Network', $value);\n }", "function getNumericCountryCode($iso2Code){\r\n\t\t$resource = \"countries\";\r\n\t\t$countriesArray = $this->getResource($resource, null, 'All');\r\n\t\tif($countriesArray){\r\n\t\t\tforeach ($countriesArray as $country) {\r\n\t\t\t\tif($country->Alpha2Code == $iso2Code){\r\n\t\t\t\t\treturn $country->NumericCode;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function getNationalityID()\n {\n return $this->nationalityID;\n }", "public function getNetwork() {\n return $this->getValue('network');\n }", "public function getTypeLabel()\n {\n if ( $this->isCotis() ) {\n return _T(\"Membership\");\n } else {\n return _T(\"Donation\");\n }\n }", "public function getEntityTypeCode()\n {\n return 'catalog_rule';\n }", "public function setOrderCurrencyCode($code);", "public function getCurrencyCode()\n {\n return $this->_fields['CurrencyCode']['FieldValue'];\n }", "public function getCurrencyCode() \n {\n return $this->_fields['CurrencyCode']['FieldValue'];\n }", "public function getCargoTypeCode()\n {\n return $this->cargoTypeCode;\n }", "public function getCompareTypeLabel()\n {\n $compareType = $this->checkCompareType();\n if ($compareType === false)\n throw new Exception(\"Compare type is not set\");\n \n if ($compareType == self::COMPARE_TYPE_BY_BOX)\n return \"Box\";\n \n if ($compareType == self::COMPARE_TYPE_BY_TIMECODE)\n return \"Timecode\";\n \n return '';\n }", "public function setDeliveryTypeCode($deliveryTypeCode)\n {\n $this->deliveryTypeCode = $deliveryTypeCode;\n return $this;\n }", "public function setDeliveryTypeCode($deliveryTypeCode)\n {\n $this->deliveryTypeCode = $deliveryTypeCode;\n return $this;\n }", "public function setCodeType($codeType)\n {\n $this->codeType = $codeType;\n\n return $this;\n }", "public function getLaborTypeCode(): ?string\n {\n return $this->laborTypeCode;\n }", "public function setCdNfservico($cd_nfservico)\n {\n $this->cd_nfservico = $cd_nfservico;\n\n return $this;\n }", "protected function getNetsPaymentTypes() {\n return unserialize(NETS_PAYMENT_TYPES);\n }", "public function currencyCode()\n {\n return $this->_storeManager->getStore()->getCurrentCurrency()->getCurrencyCode();\n }", "public function getCodiNoti($value) {\n\t\treturn $this->codi_noti;\n\t}", "public function getRawType()\n {\n if ( $this->isCotis() ) {\n return 'membership';\n } else {\n return 'donation';\n }\n }", "public function getIdFactorNetwork()\n {\n return $this->id_factor_network;\n }", "public function getNiche_code () {\n\t$preValue = $this->preGetValue(\"niche_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->niche_code;\n\treturn $data;\n}", "final public function getNetworkId(): int\n {\n return static::NETWORK_ID;\n }", "function isInISO($code) {\n $xml = simplexml_load_file('http://www.currency-iso.org/dam/downloads/lists/list_one.xml');\n $result = $xml -> xpath(\"//CcyNtry[Ccy='{$code}']\");\n if($result != null) {\n return true;\n } else {\n return false;\n }\n }", "public function getNatureCode()\n {\n return $this->natureCode;\n }", "protected function __construct(int $typeCode)\n {\n $this->typeCode = $typeCode;\n }", "public function getCcTypeName()\n {\n $types = $this->_paymentConfig->getCcTypes();\n $ccType = $this->getInfo()->getCcType();\n if (isset($types[$ccType])) {\n return $types[$ccType];\n }\n return empty($ccType) ? __('N/A') : $ccType;\n }", "public function getNetworkTier()\n {\n return isset($this->network_tier) ? $this->network_tier : 0;\n }", "Public Function NetworkId() {\n\t\treturn $this->networkId;\n\t\n\t}", "public function setCurrencyCode($var)\n {\n GPBUtil::checkString($var, True);\n $this->currency_code = $var;\n\n return $this;\n }", "public static function IdentifyCardType($ccNum)\n\t{\n\t\t$ccNum = preg_replace('/[^0-9]+/', '', $ccNum);\n\t\t//Visa 4 13, 16\n\t\tif (preg_match('/^4(.{12}|.{15})$/', $ccNum))\n\t\t\treturn 'VISA';\n\t\t//Master Card 51 to 55 16\n\t\telseif (preg_match('/^5[1-5].{14}$/', $ccNum))\n\t\t\treturn 'MASTERCARD';\n\t\t//American Express 34, 37 15\n\t\telseif (preg_match('/^3[47].{13}$/', $ccNum))\n\t\t\treturn 'AMEX';\n\t\t//Diners Club 300 to 305, 36 14\n\t\t//Carte Blanche 38 14\n\t\telseif (preg_match('/^3(0[0-5].{11}|[68].{12})$/', $ccNum))\n\t\t\treturn 'DINERS';\n\t\t//Discover 6011 16\n\t\telseif (preg_match('/^6011.{12}$/', $ccNum))\n\t\t\treturn 'DISCOVER';\n\t\t//JCB 3 16\n\t\t//JCB 2131, 1800 15\n\t\telseif (preg_match('/^3.{15}|(2131|1800).{11}$/', $ccNum))\n\t\t\treturn 'JCB';\n\t\t//EnRoute 2014, 2149 15\n\t\telseif (preg_match('/^2(014|149).{11}$/', $ccNum))\n\t\t\treturn 'ENROUTE';\n\t\telse\n\t\t\treturn \"N\";\n\t}", "public function getDeliveryNetAmount()\r\n {\r\n return $this->_deliveryNetAmount;\r\n }", "protected function getEntityTypeId($entityTypeCode = null)\n {\n return $this->getSubject()->getEntityTypeId($entityTypeCode);\n }", "public function getTypeCode(): ?string\n {\n return $this->typeCode;\n }", "public function getTypeCode(): ?string\n {\n return $this->typeCode;\n }", "public function getCode()\r\r\n\t{\r\r\n\t\treturn \"\";#getCountryFromIP($this->ip,\"code\");\r\r\n\t}", "public function getServiceTypeCode()\n {\n return $this->serviceTypeCode;\n }", "public function getCurrencyISOCode()\n {\n $numberFormatter = new \\NumberFormatter($this->_currentLocale, \\NumberFormatter::CURRENCY);\n return $numberFormatter->getSymbol(\\NumberFormatter::INTL_CURRENCY_SYMBOL);\n }", "public static function getCodeTypes() {\n return array('B', 'P', 'PU', 'PR', 'CS', 'SA', 'SR', 'PG');\n }", "protected function get_currency_iso_code( $currency_code, $default_code = '826' ) {\r\n\t\t$result = $default_code;\r\n\t\t$iso_codes = array(\r\n\t\t\t'GBP' => '826',\r\n\t\t\t'USD' => '840',\r\n\t\t\t'EUR' => '978',\r\n\t\t);\r\n\t\tif ( array_key_exists( $currency_code, $iso_codes ) ) {\r\n\t\t\t$result = $iso_codes[ $currency_code ];\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function categoriaOcupacional()\n {\n if ($this->PP05A==1 && $this->PP05D==1){\n return 1;\n }\n if ($this->PP05A==1 && ($this->PP05D==2 || $this->PP05D==3)){\n return 2;\n }\n if ($this->PP05A==3){\n return 3;\n }\n if ($this->PP05A==2 && $this->PP05B==2 && $this->PP05B1==3){\n return 4;\n }\n // #Ns./Nr.\n // (me parece que es si no se completa: pp05a=null)\n }", "public function mapNetworkStatus($status) {\n\n\t\tswitch (strtolower($status)) {\n\n\t\t\tcase 'cleared':\n\t\t\tcase 'paid':\n\t\t\t\treturn MerchantTransaction::STATUS_CONFIRMED;\n\t\t\tcase 'cancelled':\n\t\t\t\treturn MerchantTransaction::STATUS_CANCELED;\n\t\t\tcase 'notcleared':\n\t\t\t\treturn MerchantTransaction::STATUS_OPEN;\n\t\t}\n\n\t\treturn MerchantTransaction::STATUS_NONE;\n\t}", "public function get_net_types($p_id = null)\n {\n $l_sql = 'SELECT * FROM isys_net_type ';\n\n if (is_numeric($p_id))\n {\n $l_sql .= 'WHERE isys_net_type__id = ' . $this->convert_sql_id($p_id);\n }\n else if (is_string($p_id))\n {\n $l_sql .= 'WHERE isys_net_type__const = ' . $this->convert_sql_text($p_id);\n } // if\n\n return $this->retrieve($l_sql);\n }", "Public Function setNetworkId($NetworkId) {\n\t\t$this->networkId = $NetworkId;\n\t\n\t}", "public function getOrderCurrencyCode();", "public static function getSymbolOfCurrencyCode($currencyCode) {\n $currencyCode = strtoupper($currencyCode);\n $currencies = [\n \t'AED' => '&#1583;.&#1573;', // ?\n 'AFN' => '&#65;&#102;',\n 'ALL' => '&#76;&#101;&#107;',\n 'AMD' => '',\n 'ANG' => '&#402;',\n 'AOA' => '&#75;&#122;', // ?\n 'ARS' => '&#36;',\n 'AUD' => '&#36;',\n 'AWG' => '&#402;',\n 'AZN' => '&#1084;&#1072;&#1085;',\n 'BAM' => '&#75;&#77;',\n 'BBD' => '&#36;',\n 'BDT' => '&#2547;', // ?\n 'BGN' => '&#1083;&#1074;',\n 'BHD' => '.&#1583;.&#1576;', // ?\n 'BIF' => '&#70;&#66;&#117;', // ?\n 'BMD' => '&#36;',\n 'BND' => '&#36;',\n 'BOB' => '&#36;&#98;',\n 'BRL' => '&#82;&#36;',\n 'BSD' => '&#36;',\n 'BTN' => '&#78;&#117;&#46;', // ?\n 'BWP' => '&#80;',\n 'BYR' => '&#112;&#46;',\n 'BZD' => '&#66;&#90;&#36;',\n 'CAD' => '&#36;',\n 'CDF' => '&#70;&#67;',\n 'CHF' => '&#67;&#72;&#70;',\n 'CLF' => '', // ?\n 'CLP' => '&#36;',\n 'CNY' => '&#165;',\n 'COP' => '&#36;',\n 'CRC' => '&#8353;',\n 'CUP' => '&#8396;',\n 'CVE' => '&#36;', // ?\n 'CZK' => '&#75;&#269;',\n 'DJF' => '&#70;&#100;&#106;', // ?\n 'DKK' => '&#107;&#114;',\n 'DOP' => '&#82;&#68;&#36;',\n 'DZD' => '&#1583;&#1580;', // ?\n 'EGP' => '&#163;',\n 'ETB' => '&#66;&#114;',\n 'EUR' => '&#8364;',\n 'FJD' => '&#36;',\n 'FKP' => '&#163;',\n 'GBP' => '&#163;',\n 'GEL' => '&#4314;', // ?\n 'GHS' => '&#162;',\n 'GIP' => '&#163;',\n 'GMD' => '&#68;', // ?\n 'GNF' => '&#70;&#71;', // ?\n 'GTQ' => '&#81;',\n 'GYD' => '&#36;',\n 'HKD' => '&#36;',\n 'HNL' => '&#76;',\n 'HRK' => '&#107;&#110;',\n 'HTG' => '&#71;', // ?\n 'HUF' => '&#70;&#116;',\n 'IDR' => '&#82;&#112;',\n 'ILS' => '&#8362;',\n 'INR' => '&#8377;',\n 'IQD' => '&#1593;.&#1583;', // ?\n 'IRR' => '&#65020;',\n 'ISK' => '&#107;&#114;',\n 'JEP' => '&#163;',\n 'JMD' => '&#74;&#36;',\n 'JOD' => '&#74;&#68;', // ?\n 'JPY' => '&#165;',\n 'KES' => '&#75;&#83;&#104;', // ?\n 'KGS' => '&#1083;&#1074;',\n 'KHR' => '&#6107;',\n 'KMF' => '&#67;&#70;', // ?\n 'KPW' => '&#8361;',\n 'KRW' => '&#8361;',\n 'KWD' => '&#1583;.&#1603;', // ?\n 'KYD' => '&#36;',\n 'KZT' => '&#1083;&#1074;',\n 'LAK' => '&#8365;',\n 'LBP' => '&#163;',\n 'LKR' => '&#8360;',\n 'LRD' => '&#36;',\n 'LSL' => '&#76;', // ?\n 'LTL' => '&#76;&#116;',\n 'LVL' => '&#76;&#115;',\n 'LYD' => '&#1604;.&#1583;', // ?\n 'MAD' => '&#1583;.&#1605;.', //?\n 'MDL' => '&#76;',\n 'MGA' => '&#65;&#114;', // ?\n 'MKD' => '&#1076;&#1077;&#1085;',\n 'MMK' => '&#75;',\n 'MNT' => '&#8366;',\n 'MOP' => '&#77;&#79;&#80;&#36;', // ?\n 'MRO' => '&#85;&#77;', // ?\n 'MUR' => '&#8360;', // ?\n 'MVR' => '.&#1923;', // ?\n 'MWK' => '&#77;&#75;',\n 'MXN' => '&#36;',\n 'MYR' => '&#82;&#77;',\n 'MZN' => '&#77;&#84;',\n 'NAD' => '&#36;',\n 'NGN' => '&#8358;',\n 'NIO' => '&#67;&#36;',\n 'NOK' => '&#107;&#114;',\n 'NPR' => '&#8360;',\n 'NZD' => '&#36;',\n 'OMR' => '&#65020;',\n 'PAB' => '&#66;&#47;&#46;',\n 'PEN' => '&#83;&#47;&#46;',\n 'PGK' => '&#75;', // ?\n 'PHP' => '&#8369;',\n 'PKR' => '&#8360;',\n 'PLN' => '&#122;&#322;',\n 'PYG' => '&#71;&#115;',\n 'QAR' => '&#65020;',\n 'RON' => '&#108;&#101;&#105;',\n 'RSD' => '&#1044;&#1080;&#1085;&#46;',\n 'RUB' => '&#1088;&#1091;&#1073;',\n 'RWF' => '&#1585;.&#1587;',\n 'SAR' => '&#65020;',\n 'SBD' => '&#36;',\n 'SCR' => '&#8360;',\n 'SDG' => '&#163;', // ?\n 'SEK' => '&#107;&#114;',\n 'SGD' => '&#36;',\n 'SHP' => '&#163;',\n 'SLL' => '&#76;&#101;', // ?\n 'SOS' => '&#83;',\n 'SRD' => '&#36;',\n 'STD' => '&#68;&#98;', // ?\n 'SVC' => '&#36;',\n 'SYP' => '&#163;',\n 'SZL' => '&#76;', // ?\n 'THB' => '&#3647;',\n 'TJS' => '&#84;&#74;&#83;', // ? TJS (guess)\n 'TMT' => '&#109;',\n 'TND' => '&#1583;.&#1578;',\n 'TOP' => '&#84;&#36;',\n 'TRY' => '&#8356;', // New Turkey Lira (old symbol used)\n 'TTD' => '&#36;',\n 'TWD' => '&#78;&#84;&#36;',\n 'TZS' => '',\n 'UAH' => '&#8372;',\n 'UGX' => '&#85;&#83;&#104;',\n 'USD' => '&#36;',\n 'UYU' => '&#36;&#85;',\n 'UZS' => '&#1083;&#1074;',\n 'VEF' => '&#66;&#115;',\n 'VND' => '&#8363;',\n 'VUV' => '&#86;&#84;',\n 'WST' => '&#87;&#83;&#36;',\n 'XAF' => '&#70;&#67;&#70;&#65;',\n 'XCD' => '&#36;',\n 'XDR' => '',\n 'XOF' => '',\n 'XPF' => '&#70;',\n 'YER' => '&#65020;',\n 'ZAR' => '&#82;',\n 'ZMK' => '&#90;&#75;', // ?\n 'ZWL' => '&#90;&#36;'\n ];\n return $currencies[$currencyCode];\n }", "public function network($networkId)\n {\n return $this->request('get', '/api/networks/'.$networkId);\n }", "public function GetTypeDesc(): string {\n\t\tswitch($this->debugType) {\n\t\t\tcase self::NONE: \treturn \"NONE\";\n\t\t\tcase self::LOG: \treturn \"LOG\";\n\t\t\tcase self::DEBUG:\treturn \"DEBUG\";\n\t\t\tcase self::DEV:\t\treturn \"DEV\";\n\t\t\tdefault: \t\t\t\t\treturn \"unknown\";\n\t\t}\n\t}", "public function getCommunityNetwork()\n {\n return $this->communityNetwork;\n }", "public function setDistributorTypeCode($distributorTypeCode)\n {\n $this->distributorTypeCode = $distributorTypeCode;\n return $this;\n }", "public function setForecastTypeCode(\\horstoeko\\ubl\\entities\\cbc\\ForecastTypeCode $forecastTypeCode)\n {\n $this->forecastTypeCode = $forecastTypeCode;\n return $this;\n }", "public function getDiscountCode()\n {\n return $this->discountCode;\n }", "public function getDiscountCode()\n {\n return $this->discountCode;\n }", "function _NDL()\r\n\t{\r\n\r\n\t}", "public function getDiscountType()\n {\n return $this->discountType;\n }", "public function getNetwork()\n {\n return $this->network;\n }", "public function getNetwork()\n {\n return $this->network;\n }" ]
[ "0.6283847", "0.55310315", "0.5403923", "0.53193134", "0.50447154", "0.5030371", "0.49977976", "0.49954498", "0.49425521", "0.47692546", "0.47555423", "0.47384894", "0.46731952", "0.46456292", "0.46392566", "0.46392566", "0.45956838", "0.45785922", "0.4575585", "0.45174977", "0.45035005", "0.44971082", "0.44971082", "0.44756803", "0.44491765", "0.44461396", "0.44389042", "0.44328326", "0.44067317", "0.44067317", "0.44067317", "0.4386079", "0.4383753", "0.43785572", "0.43781427", "0.43771875", "0.4365698", "0.43560264", "0.43546432", "0.4343533", "0.4316902", "0.4306153", "0.43046847", "0.43046847", "0.4301988", "0.42911994", "0.42850584", "0.42713153", "0.42711613", "0.42542425", "0.42508724", "0.42441055", "0.42332867", "0.423169", "0.4228074", "0.4228074", "0.42222098", "0.42178732", "0.42173055", "0.42104375", "0.4205106", "0.41870338", "0.41801655", "0.41772035", "0.4175487", "0.41690397", "0.41660604", "0.41652504", "0.41646984", "0.41592994", "0.41474593", "0.4146558", "0.41381517", "0.41300723", "0.41280082", "0.41264203", "0.41211167", "0.41211167", "0.41132706", "0.41098595", "0.40982404", "0.4087753", "0.4087037", "0.40854383", "0.4071305", "0.4067143", "0.4054833", "0.405477", "0.40515235", "0.40453032", "0.40395483", "0.4030291", "0.40279886", "0.40272036", "0.40255985", "0.40255985", "0.40218496", "0.40192363", "0.40014344", "0.40014344" ]
0.5967874
1
Indicator that the product only can be offered to customers with prior agreement.
public function getIsCustomerAgreement(): ?bool { return $this->isCustomerAgreement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function form_is_available_to_create_a_customer()\n {\n\n }", "abstract function has_purchased_before();", "public function shouldAcceptLicense()\n {\n return !Config::get('licenseAccepted');\n }", "abstract function is_only_premium();", "public function isIndependentCreditSupported();", "public function maybe_print_subscription_limit_notice()\n {\n\n global $product;\n\n // Product limits are applied\n if (!$this->maybe_make_product_not_purchasable(true, $product)) {\n\n // One non-terminated subscription per customer per site\n if (RP_SUB_Settings::is('subscription_limit', 'one_per_customer')) {\n wc_print_notice(__('Sorry, you are not allowed to purchase this product as you already have a subscription on this site.', 'subscriptio'), 'notice');\n }\n // One non-terminated subscription per product per customer per site\n else if (RP_SUB_Settings::is('subscription_limit', 'one_per_product')) {\n wc_print_notice(__('Sorry, you are not allowed to purchase this product as you already have it in one of your subscriptions.', 'subscriptio'), 'notice');\n }\n }\n }", "public function form_is_available_to_update_customers()\n {\n\n }", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}", "private function COIRequiresApproval()\r\n {\r\n global $db;\r\n\r\n // if there is more than one COI form in the db then approvals are required\r\n $sql = \"SELECT * FROM `forms_coi`\r\n WHERE `form_tracking_id` = \" . $this->trackingFormId . \"\r\n and `coi_none` = '0'\";\r\n $result = $db->getAll($sql);\r\n\r\n if (count($result) <= 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "protected function isOfferValid ()\n {\n return $this->offerApplicableAmount >= $this->offer->minimum_order_amount;\n }", "function mc_do_not_allow_3_month_renewals( $subscription_can_be_renewed, $subscription, $subscription_key, $user_id ) {\n if( $subscription['product_id'] == 3622 ) {\n return false;\n }\n else {\n return $subscription_can_be_renewed;\n }\n}", "public function canClaim() {\r\n return $this->getSparePower() >= $this->factionsLevel->getSettings()->powerPerPlot;\r\n }", "public function isAllowOrder() {\n $qtyAllow = false;\n \n // check qty\n if ($this->quantity >= $this->minimum_quantity) {\n $qtyAllow = true;\n }\n else {\n if ($this->when_out_of_stock == 1) {\n $qtyAllow = true;\n }\n }\n \n // check all\n if (($qtyAllow) & ($this->active) & ($this->available_for_order)) {\n return true;\n }\n \n return false;\n }", "public function canPayment()\n {\n return true;\n }", "public function isAllowedToApplyLoan()\n {\n return $this->getAge() >= 18;\n }", "public function forceCheckoutOnContribute(){\n\t\tif(!$this->canContribute()){\n\t\t\t$_SESSION['flashMessage'] = \"Sorry, you will need complete this purchase before you can send another gift.\";\n\t\t\tview::Redirect('cart', 'index');\n\t\t}\n\t}", "public function isValid()\n {\n return $this->getStatus() != 'unlicensed';\n }", "public function getIsCustomerAccessLimited(): bool;", "private function validateAvailableProduct() {\n\n\t\t$studio_data = &$this->session->data['studio_data'][$this->request->post['price_studio_id']]; //make it short\n\n\t\t//if price_id_product is not empty\n\t\tif (!isset($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t///if product exists\n\t\t} elseif (!$this->model_opentshirts_product->getTotalProductsByID($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t//if product price is setted up\n\t\t}else if ($this->model_opentshirts_price_product->getMinQuantity($studio_data['id_product'])===false) {\n\t\t\t$this->error['warning'] = $this->language->get('error_not_available');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function validateMinimumAmount()\n {\n return !(Mage::getStoreConfigFlag('sales/minimum_order/active')\n && Mage::getStoreConfigFlag('sales/minimum_order/multi_address')\n && !$this->getQuote()->validateMinimumAmount());\n }", "function is_paying_or_trial__premium_only() {\n\t\t\treturn $this->is_premium() && $this->is_paying_or_trial();\n\t\t}", "public function authorize()\n {\n return Cart::load()->getTotalQuantity() > 1;\n }", "public function isApproved()\n {\n\n return false;\n }", "private function unbalancedSupply() {\n $rapporto = $_POST['quantitaCercata'] / $_POST['quantitaOfferta'];\n if ($rapporto >= 0.5 && $rapporto <= 2)\n return false;\n return true;\n }", "private function purchaseRestrictionsApproval($ins) {\n if($ins['liter'] > 100) {\n\t $response = [\n\t \"status\" => \"error\", \n\t \"message\" => \"Customer tidak diizinkan mengisi lebih dari 100 lt ({$ins['liter']} lt).\\n\\nSilakan ubah volume!\", \n\t ];\n\t echo json_encode($response);\t \n } else {\n\t $response = [\n\t \"status\" => \"ok\", \n\t \"message\" => \"Customer ingin mengisi biosolar dengan volume {$ins['liter']} liter pada pembelian ke - {$ins['numOfBuy']}\"\n\t ];\n\t echo json_encode($response);\t \n } \n }", "public function declined()\n\t{\n\t\treturn !$this->approved();\n\t}", "public function isOrderEditable()\n {\n return !\\XLite::isFreeLicense();\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function canSkipOrderReviewStep()\n {\n return !$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON);\n }", "public function canBeFree()\n {\n return count($this->getCurrentStudentCareerSchoolYear()) > 0;\n\n }", "abstract function is_premium();", "function is_paying__premium_only() {\n\t\t\treturn ( $this->is__premium_only() && $this->is_paying() );\n\t\t}", "function is_not_paying() {\n\t\t\treturn ( $this->is_trial() || $this->is_free_plan() );\n\t\t}", "public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "function check_requirements()\n\t{\n\t\tif (!$this->obj_customer->verify_id())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested customer (\". $this->obj_customer->id .\") does not exist - possibly the customer has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\n\t\treturn 1;\n\t}", "public function isAllowed()\n {\n return in_array(\n $this->vippsQuote->getStatus(),\n [\n QuoteStatusInterface::STATUS_NEW,\n QuoteStatusInterface::STATUS_PENDING,\n QuoteStatusInterface::STATUS_RESERVE_FAILED,\n QuoteStatusInterface::STATUS_REVERT_FAILED\n ],\n true\n );\n }", "public function applyNewLicenseRange()\n {\n $paypal = new paypalLicense;\n $lastPayInfo = $this->getPaidInfo();\n\n if (false === isset($lastPayInfo->items)) {\n return true;\n }\n\n $newRangeDate = DateTime::createFromFormat('m/d/Y H:i:s', paypalLicense::NEW_RANGE_DATE_APPLY);\n $payDate = new DateTime($lastPayInfo->date);\n\n return $newRangeDate < $payDate;\n }", "public function maybe_make_product_not_purchasable($is_purchasable, $product)\n {\n\n global $wp;\n\n // TODO: Problem - when subscriptions are limited but product can be purchased, warning is being displayed when navigating to product page from the thank you page (something goes wrong at the very moment of checkout)\n\n // Result not yet in cache\n if (!isset($this->product_is_purchasable[$product->get_id()])) {\n\n // Make sure this is a subscription product and we are not on the \"Thank You\" page\n if ($is_purchasable && subscriptio_is_subscription_product($product) && !is_order_received_page()) {\n\n // Get product id to check\n $product_id = $product->is_type('variation') ? $product->get_parent_id() : $product->get_id();\n\n // Subscription limits are enabled\n if (!RP_SUB_Settings::is('subscription_limit', 'no_limit')) {\n\n // Iterate over non-terminated customer subscriptions\n foreach (subscriptio_get_customer_subscriptions() as $subscription) {\n\n // One non-terminated subscription per customer per site\n if (RP_SUB_Settings::is('subscription_limit', 'one_per_customer')) {\n\n // Customer already has a non-terminated subscription on this site\n $is_purchasable = false;\n } // One non-terminated subscription per product per customer per site\n else if (RP_SUB_Settings::is('subscription_limit', 'one_per_product')) {\n\n // Iterate over subscription items\n foreach ($subscription->get_items() as $item) {\n\n // Compare product ids\n if ($item->get_product_id() === $product_id) {\n\n // Customer already has a non-terminated subscription for this product on this site\n $is_purchasable = false;\n }\n }\n }\n }\n }\n }\n\n // Add result to cache\n $this->product_is_purchasable[$product->get_id()] = $is_purchasable;\n }\n\n // Return result from cache\n return $this->product_is_purchasable[$product->get_id()];\n }", "public function canDecline()\n {\n $user = $this->getUser();\n\n if (\n $this->getData('status') == Service\\BalanceWithdrawals::STATUS_PENDING &&\n $user->getData('role') == 'Admin'\n ) {\n return true;\n }\n\n return false;\n }", "function edd_pup_eligible_updates( $payment_id, $updated_products, $object = true, $licenseditems = null, $email_id = 0 ){\r\n\r\n\tif ( empty( $payment_id) || empty( $updated_products ) || $email_id = 0 ) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif ( is_null( $licenseditems ) ) {\r\n\t\tglobal $wpdb;\r\n\t\t$licenseditems = $wpdb->get_results( \"SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_edd_sl_enabled' AND meta_value = 1\", OBJECT_K );\r\n\t}\r\n\r\n\t$customer_updates = '';\r\n\t$licensing = edd_get_option( 'edd_pup_license' );\r\n\t$payment_meta = get_post_meta( $payment_id, '_edd_payment_meta', true );\r\n\r\n\tif ( ( $licensing != false ) && is_plugin_active('edd-software-licensing/edd-software-licenses.php' ) ) {\r\n\t\t$licenses = edd_pup_get_license_keys( $payment_id );\r\n\t}\r\n\r\n\tforeach ( maybe_unserialize( $payment_meta['cart_details'] ) as $item ){\r\n\t\t$item['name'] = addslashes( $item['name'] );\r\n\r\n\t\t// Skip $item if it is not a product being updated\r\n\t\tif ( !isset( $updated_products[ $item['id'] ] ) ){\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// If Software Licensing integration is active and the $item has software licensing enabled\r\n\t\tif ( ( $licensing != false ) && isset( $licenseditems[ $item['id'] ] ) ) {\r\n\r\n\t\t\t// If the customer has licenses and the license for this $item is enabled and active\r\n\t\t\t$enabled = get_post_status( $licenses[$item['id']]['license_id'] ) == 'publish' ? true : false;\r\n\r\n\t\t\tif ( !empty( $licenses ) && $enabled && in_array( edd_software_licensing()->get_license_status( $licenses[$item['id']]['license_id'] ), apply_filters( 'edd_pup_valid_license_statuses', array( 'active', 'inactive' ) ) ) ) {\r\n\t\t\t\t// Add the $item as an eligible updates\r\n\t\t\t\t$customer_updates[ $item['id'] ] = $object ? $item : $item['name'];\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t\t// Add the $item as an eligible updates\r\n\t\t\t\t$customer_updates[ $item['id'] ] = $object ? $item : $item['name'];\r\n\t\t}\r\n\t}\r\n\r\n\treturn $customer_updates;\r\n}", "function checkLicence() {\n\n $isValid = true;\n \n return $isValid;\n}", "protected function _maybe_show_notice() {\n\t\tif ( false === $this->is_valid && ! SermonManager::getOption( 'license_key' ) ) {\n\t\t\tPlugin::instance()->notice_manager->add_info( 'licensing_activate', 'Please <a href=\"' . admin_url( 'edit.php?post_type=wpfc_sermon&page=sm-settings&tab=licensing' ) . '\" target=\"_self\">enter and activate</a> your license key to enable automatic updates.', 10, 'licensing', true );\n\t\t} else {\n\t\t\tPlugin::instance()->notice_manager->set_seen( 'licensing_activate', true );\n\t\t}\n\t}", "public function is_purchased( TPM_Product $product ) {\n\n\t\t//check old licenses\n\t\t$thrive_license = get_option( 'thrive_license', array() );\n\t\tif ( in_array( 'all', $thrive_license, false ) || in_array( $product->get_tag(), $thrive_license, false ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/** @var $license TPM_License */\n\t\tforeach ( $this->get_ttw_license_instances() as $id => $license ) {\n\t\t\tif ( $license->has_tag( $product->get_tag() ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}", "public function isStatusNotPaid()\n {\n return $this->status == self::_ORDER_STATUS_NEW || $this->status == self::_ORDER_STATUS_REJECTED;\n }", "public function canBeAccepted()\n {\n return $this->isReadyForIssuing();\n }", "public function isVersionActivelyMaintained() {}", "public function tellNotEnoughMoneyInAccount()\n {\n }", "public function form_is_available_to_create_a_note()\n {\n\n }", "public function isUnderpaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_UNDERPAID;\n }", "public function canAddToCart($product)\n {\n return (!$product->getData('personalization_allowed') || !$product->getData('personalization_required'));\n }", "protected function shouldAddPayment(): bool\r\n {\r\n return DocumentTypes::hasPayments($this->documentType);\r\n }", "public function isApplicable();", "public function isVatRateCurrentlyApplicable($vat_rate_commencement_date,$order_id,$product_id){\n //get the date when this order was done\n $order_date = getdate(strtotime($this->getTheDateOfThisOrder($order_id,$product_id)));\n $date_vat_commenced = getdate(strtotime($vat_rate_commencement_date));\n \n if(($order_date['year'] - $date_vat_commenced['year'])>0){\n return true;\n }else if(($order_date['year'] - $date_vat_commenced['year'])<0){\n return false;\n }else{\n if(($order_date['mon'] - $date_vat_commenced['mon'])>0){\n return true;\n }else if(($order_date['mon'] - $date_vat_commenced['mon'])<0){\n return false;\n }else{\n if(($order_date['mday'] - $date_vat_commenced['mday'])>0){\n return true;\n }else if(($order_date['mday'] - $date_vat_commenced['mday'])==0){\n return true;\n }else{\n return false;\n }\n }\n }\n \n \n }", "public function use_for_claims() {\n\t\treturn $this->get_product_meta( 'use_for_claims' ) === 'yes';\n\t}", "function can_use_premium_code__premium_only() {\n\t\t\treturn $this->is_premium() && $this->can_use_premium_code();\n\t\t}", "function needs_payment() {\n\t\t\tif ( $this->total > 0 ) return true; else return false;\n\t\t}", "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }", "public static function is_eligible_to_bid( $user_id = null , $product_id = null ) {\n\n if( !$user_id ) return false;\n if( !$product_id ) return false;\n if( WAUC_Functions::is_user_forbidden( $user_id ) ) return false;\n\n if( strtotime( WAUC_Functions::get_auction_start_time( $product_id ) ) < time() && time() < strtotime( WAUC_Functions::get_auction_end_time( $product_id ) ) ) {\n return true;\n } ;\n\n return false;\n\n }", "protected function restrict() {\n $this->restrict_to_permission('manage_products');\n }", "abstract function has_paid_plan();", "public function isAccountEligibleForChargeGeneration()\n\t{\n\t\t$objAccount = Account::getForId($this->account);\n\t\tif ($objAccount == null)\n\t\t{\n\t\t\tthrow new Exception(\"Associated Account (Id: {$this->account}) could not be found\");\n\t\t}\n\t\t\n\t\t// RecurringCharges only get generated if their associated account is active\n\t\tif ($objAccount->archived == ACCOUNT_STATUS_ACTIVE)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function unpaid(): bool\n {\n return in_array($this->status, [self::PENDING]);\n }", "function is_purchasable() {\n\t\t$purchasable = WCS_Limiter::is_purchasable( parent::is_purchasable(), $this );\n\n\t\treturn apply_filters( 'woocommerce_subscription_is_purchasable', $purchasable, $this );\n\t}", "function dispatch_licenses(){\n\t\n//1get all unfinished orders which are paid\n//2fetch all available licences\n\n//if 1 > 0 \n\t//loop for (unfinished orders)\n \t\t//compare ordered product id with available licences\n\t\t//if available\n\t\t\t//fetch email of buyer + send email + add buyer to database\n\t\t//else \n\t\t\t//mail not available to admin\n\t//loop end\n\t\n}", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('catalog/productsupdater');\r\n }", "public function testDeclined(){ \n\n $unBuyableProduct = Product::where('price', '>', 75)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($unBuyableProduct, $this->testVisaPan);\n $response->assertSee(\"Declined\");\n\n\n //test card 2\n $response = $this->checkoutAction($unBuyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Declined\"); \n \n }", "public function canBeDeclined()\n {\n return $this->isAwaitingFee();\n }", "public function testIsApplicableWithNonAuthorizedUser()\n {\n $paymentMethod = $this->createMock(\\Magento\\Payment\\Model\\MethodInterface::class);\n $quote = $this->createPartialMock(\\Magento\\Quote\\Model\\Quote::class, ['getCustomerId']);\n $quote->expects($this->once())->method('getCustomerId')->willReturn(null);\n $this->assertTrue($this->hasCompanyPermission->isApplicable($paymentMethod, $quote));\n }", "public function isCreditCardPurchase()\n {\n return $this->payment_method->id != 1;\n }", "public function testReactTakesPrecedenceOverDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountPaid' => 1,\n\t\t\t'getCountDisagreed' => 2,\n\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_REACT,\n\t\t\t$result\n\t\t);\n\t}", "public function ensure_keys_are_actually_active () {\n $already_active = (array)$this->get_activated_products();\n $products = $this->get_detected_products();\n if ( 0 < count( $already_active ) ) {\n foreach ( $already_active as $k => $v ) {\n //** Only look through activated plugins */\n if( !array_key_exists( $k, $products ) ) {\n continue;\n }\n $deactivate = true;\n \n if ( !empty( $already_active[ $k ][2] ) ) {\n //** Get license and activation email */\n $data = base64_decode( $already_active[ $k ][2] );\n $data = explode( '::', $data );\n $license_key = isset( $data[0] ) ? trim( $data[0] ) : '';\n $activation_email = isset( $data[1] ) ? trim( $data[1] ) : '';\n\n //** Do request */\n $response = $this->api->status( array(\n 'product_id' \t=> $already_active[ $k ][0],\n 'instance' \t\t=> $already_active[ $k ][1],\n 'email' => trim($activation_email),\n 'licence_key' => trim($license_key),\n ), false, false );\n \n //** Do not deactivate if cannot reach UD */\n if ( $response === false ) {\n continue;\n }\n if( is_array( $response ) && !empty( $response[ 'status_check' ] ) && $response[ 'status_check' ] == 'active' ) {\n $deactivate = false;\n }\n }\n if( $deactivate ) {\n $this->deactivate_product( $k, true );\n }\n }\n }\n }", "public function canWithdraw()\n {\n return true;\n }", "public function canBeReincorporated()\n {\n return count(StudentFreePeer::retrieveCurrentAndIsFree(null, $this->getId())) > 0;\n\n }", "public function updateLicenseStatus()\n {\n $transient = get_transient($this->slug);\n\n // If set and valid, return.\n if (VALID === $transient) {\n error_log('Active...');\n return;\n }\n // If expired, do something to never req again.\n\n // If not then, perform a check\n // error_log('Checking ...');\n // $response = $this->checkLicenseKey();\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_Vendors::vendors_sellers');\n }", "public function testOneDisagreedNoCancelIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "public function needs_payment() {\n\t\treturn apply_filters( 'woocommerce_cart_needs_payment', 0 < $this->get_total( 'edit' ), $this );\n\t}", "public function chekcingForMarketplaceSellerOrNot() {\n /**\n * Initilize customer and seller group id\n */\n $customerGroupIdVal = $sellerGroupIdVal = $customerStatusValue = '';\n /**\n * Get customer group id\n * @var int\n */\n $customerGroupIdVal = Mage::getSingleton ( 'customer/session' )->getCustomerGroupId ();\n $sellerGroupIdVal = Mage::helper ( 'marketplace' )->getGroupId ();\n /**\n * Get customer status\n * @var int\n */\n $customerStatusValue = Mage::getSingleton ( 'customer/session' )->getCustomer ()->getCustomerstatus ();\n /**\n * Checking for customer group id and seller group id\n */\n if (! Mage::getSingleton ( 'customer/session' )->isLoggedIn () && $customerGroupIdVal != $sellerGroupIdVal) {\n /**\n * add error message\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You must have a Seller Account to access this page' ) );\n $this->_redirect ( 'marketplace/seller/login' );\n return false;\n }\n /**\n * Checking whether customer approved or not\n */\n if ($customerStatusValue != 1) {\n /**\n * add error message\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'Admin Approval is required. Please wait until admin confirms your Seller Account' ) );\n $this->_redirect ( 'marketplace/seller/login' );\n return false;\n }\n }", "protected function checkProductRequirements()\n {\n $activeProductIds = $expiredProductIds = array();\n if ($this->_user) {\n $activeProductIds = $this->_user->getActiveProductIds();\n $expiredProductIds = $this->_user->getExpiredProductIds();\n }\n $error = $this->getDi()->productTable->checkRequirements($this->getProducts(), $activeProductIds, $expiredProductIds);\n return $error ? $error : null;\n }", "abstract function can_use_premium_code();", "public function canBeManagedForCareerSubjectAllowed()\n {\n return $this->countCareerStudents() > 0;\n\n }", "public function permittedFor(UserLicense $account, $method);", "public function testIsAvailableWithCanceledGuarantee()\n {\n $orderId = 123;\n\n /** @var CaseInterface|\\PHPUnit_Framework_MockObject_MockObject $case */\n $case = $this->getMockBuilder(CaseInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $case->expects($this->once())\n ->method('getGuaranteeDisposition')\n ->willReturn(CaseEntity::GUARANTEE_CANCELED);\n\n $this->caseManagement->expects($this->once())\n ->method('getByOrderId')\n ->with($orderId)\n ->willReturn($case);\n\n $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId));\n }", "function is_valid_for_use() {\n\t\t\tif ( ! in_array( get_woocommerce_currency(), apply_filters( 'woocommerce_esewa_supported_currencies', array( 'NPR' ) ) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "private function getAlreadyPurchasedProduct()\n {\n // If is Guest then hide the review form\n if (!$this->getCustomerId()) {\n return false;\n }\n try {\n $product = $this->getProductInfo();\n $orders = $this->getCustomerOrders();\n foreach ($orders as $order) {\n // Get all visible items in the order\n /** @var $items \\Magento\\Sales\\Api\\Data\\OrderItemInterface[] **/\n $items = $order->getAllVisibleItems();\n // Loop all items\n foreach ($items as $item) {\n // Check whether the current product exist in the order.\n if ($item->getProductId() == $product->getId()) {\n return true;\n }\n }\n }\n return false;\n } catch (\\Exception $e) {\n return false;\n }\n }", "function approve(){\n\t\t$points= $this->ref('currently_requested_to_id')->get('points_available');\n\t\tif($points < 3000)\n\t\t\t$this->api->js()->univ()->errorMessage(\"Not suficcient points available, [ $points ]\")->execute();\n\t\t// Send point to the requester and less from your self ... \n\n\t\t$purchaser= $this->add('Model_MemberAll')->addCondition(\"id\",$this['request_from_id'])->tryLoadAny();\n\t\t$purchaser['points_available'] = $purchaser['points_available'] + 3000;\n\t\t$purchaser->save();\n\n\t\t$seller=$this->add('Model_MemberAll')->addCondition(\"id\",$this['currently_requested_to_id'])->tryLoadAny();\n\t\t$seller['points_available'] = $seller['points_available'] - 3000;\n\t\t$seller->save();\n\n\t\tif($this->api->auth->model->id == 1)\n\t\t\t$this['status']='Approved By Admin';\n\t\telse\n\t\t\t$this['status']='Approved';\n\n\t\t$this->save();\n\n\n\t}", "public function showing_restricted_products() {\n\t\treturn ! $this->hiding_restricted_products();\n\t}", "public function user_has_access_to_product( $user_id, $product_id ) {\n\n if ( $user_id == get_current_user_id() && current_user_can( 'edit_users' ) )\n return true;\n\n $user_has_access = apply_filters( 'yith_wcmbs_user_has_access_to_product', false, $user_id, $product_id );\n if ( $user_has_access )\n return true;\n\n $product_plans = $this->product_is_in_plans( $product_id );\n\n $delay = get_post_meta( $product_id, '_yith_wcmbs_plan_delay', true );\n $member = YITH_WCMBS_Members()->get_member( $user_id );\n\n $user_plans = $member->get_membership_plans( array( 'return' => 'complete' ) );\n\n foreach ( $user_plans as $membership ) {\n $plan_ids = array_intersect( array_merge( array( $membership->plan_id ), $membership->get_linked_plans() ), $product_plans );\n if ( !empty( $plan_ids ) ) {\n\n $start_date = $membership->start_date + ( $membership->paused_days * 60 * 60 * 24 );\n if ( !empty( $delay ) ) {\n if ( !isset( $delay[ $membership->plan_id ] ) ) {\n $linked = $membership->get_linked_plans();\n $min_delay_time = 0;\n $first = true;\n foreach ( $linked as $plan_id ) {\n if ( isset( $delay[ $plan_id ] ) ) {\n if ( $first ) {\n $min_delay_time = $delay[ $plan_id ];\n $first = false;\n } else {\n if ( $delay[ $plan_id ] < $min_delay_time ) {\n $min_delay_time = $delay[ $plan_id ];\n }\n }\n }\n }\n\n if ( $min_delay_time > 0 ) {\n if ( strtotime( '+' . $min_delay_time . ' days midnight', $start_date ) <= strtotime( 'midnight' ) ) {\n return true;\n }\n } else {\n return true;\n }\n } else {\n if ( $delay[ $membership->plan_id ] < 1 || strtotime( '+' . $delay[ $membership->plan_id ] . ' days midnight', $start_date ) <= strtotime( 'midnight' ) ) {\n return true;\n }\n }\n } else {\n return true;\n }\n }\n }\n\n return false;\n // VECCHIO codice -------------------------------------------------\n $user_plans = $member->get_membership_plans( array( 'return' => 'id_date', 'include_linked' => true ) );\n\n if ( !empty( $user_plans ) ) {\n foreach ( $user_plans as $plan ) {\n if ( in_array( $plan[ 'id' ], $product_plans ) ) {\n if ( isset( $delay[ $plan[ 'id' ] ] ) ) {\n $delay_days = $delay[ $plan[ 'id' ] ];\n\n if ( strtotime( '+' . $delay_days . ' days midnight', $plan[ 'date' ] ) <= strtotime( 'midnight' ) )\n return true;\n } else {\n return true;\n }\n }\n }\n }\n\n return false;\n }", "public function isReadyForIssuing()\n {\n return $this->isFeePaid();\n }", "function disable_repeat_purchase_for_tamboo( $purchasable, $product ) {\n $product_id = $product->get_id();\n \n // Bailout if not a product with Attribute \"Purchase\"\n $string_values = $product->get_attribute('Purchase');\n if (( empty($string_values) )) { \n return $purchasable;\n }\n\n // return false if the customer has bought the product\n if ( wc_customer_bought_product( wp_get_current_user()->user_email, get_current_user_id(), $product_id ) ) {\n $purchasable = false;\n }\n \n // Double-check for variations: if parent is not purchasable, then variation is not\n if ( $purchasable && $product->is_type( 'variation' ) ) {\n $parent = wc_get_product( $product->get_parent_id() );\n $purchasable = $parent->is_purchasable();\n }\n return $purchasable;\n}", "function isEligibleToSubscribe($mid, $isVerified){\n\t\t// If free user restrict after 100 subscription form submission\n\t\t// Restrict per minute 5 submission\n\t\t// Restrict per day 100 submission\n\n\t\t$retVal = false;\n\t\tif(!$isVerified){\n\t\t\t$rsCountSignupContact = $this->db->query(\"Select count(subscriber_id) as totSubscribed from red_email_subscribers where subscriber_created_by='$mid' and is_signup=1 and date_format(subscriber_date_added,'%Y-%m-%d') = curdate()\");\n\t\t\t$intTotalSubscribed = $rsCountSignupContact->row()->totSubscribed;\n\t\t\t$rsCountSignupContact->free_result();\n\t\t\t//if($intTotalSubscribed < 26){\n\t\t\tif($intTotalSubscribed < 6){\n\t\t\t\t$retVal = true;\n\t\t\t}\n\t\t}else{\n\t\t\t$retVal = true;\n\n\t\t\t/* $user_packages_array=$this->UserModel->get_user_packages(array('member_id'=>$mid,'is_deleted'=>0));\n\t\t\t$package_id=$user_packages_array[0]['package_id'];\n\t\t\tif($package_id > 0){\n\t\t\t\t$retVal = true;\n\t\t\t}else{\n\t\t\t\t$rsCountSignupContact = $this->db->query(\"Select count(subscriber_id) as totSubscribed from red_email_subscribers where subscriber_created_by='$mid' and is_signup=1 and is_deleted=1\");\n\t\t\t\t$intTotalSubscribed = $rsCountSignupContact->row()->totSubscribed;\n\t\t\t\t$rsCountSignupContact->free_result();\n\t\t\t\tif($intTotalSubscribed < 3){\n\t\t\t\t\t$retVal = true;\n\t\t\t\t}\n\t\t\t} */\n\n\n\t\t}\n\t\treturn $retVal ;\n\t}", "public function isRejected() {\n\t\treturn $this->approved == -1;\n\t}", "public function no_items() {\r\n\t\t_e( 'No customers avaliable.', 'ac' );\r\n\t}", "public function askForFeeConfirmation()\n {\n }", "public function getCanMakePurchaseOrdersAttribute()\n {\n \treturn true;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magestore_InventorySuccess::adjuststock');\n }", "public function approveAndEarmark() {\n // Check if user has enough money available on card to pay for amount on authorization request.\n // Assumption: it's enough to check if the available balance is no greater than the amount that has been authorized.\n if ($this->card->availableBalance() > $this->authorizationRequest->getAuthorizedAmount()) {\n // Approve request.\n $this->authorizationRequest->approve();\n // Earmark the amount in the authorization request on the card.\n $this->card->earmark($this->authorizationRequest);\n } else {\n throw new Exception(\"User does not have enough money available on their card.\");\n }\n }", "public function is_needed() {\n\t\treturn $this->context->site_represents === 'company';\n\t}", "public function authorize()\n {\n return $this->user()->hasPermission('subscription-service-create-plan');\n }" ]
[ "0.6664504", "0.6564951", "0.6555718", "0.6475293", "0.64315957", "0.633081", "0.6239179", "0.62027127", "0.61860466", "0.60351485", "0.6010945", "0.60030466", "0.59828126", "0.59474903", "0.59460324", "0.5935436", "0.5933044", "0.5899337", "0.5897854", "0.58636314", "0.5861657", "0.5856804", "0.58562374", "0.5849919", "0.58283716", "0.58267", "0.5822009", "0.58111167", "0.58054197", "0.57934046", "0.57861143", "0.5781772", "0.57780904", "0.5772057", "0.57643867", "0.5756182", "0.57499856", "0.57460606", "0.57352674", "0.5724676", "0.57130545", "0.57097787", "0.570572", "0.5697097", "0.5692635", "0.5692522", "0.5686051", "0.5675524", "0.56722325", "0.56654954", "0.56601816", "0.56586426", "0.5652059", "0.56446064", "0.5632062", "0.5622338", "0.5617318", "0.56125575", "0.5608288", "0.5606003", "0.559378", "0.5592376", "0.5588677", "0.558527", "0.55823267", "0.5576804", "0.5573361", "0.5551388", "0.55507606", "0.5546418", "0.5544439", "0.5540279", "0.55389595", "0.55313075", "0.55300653", "0.55271685", "0.5525619", "0.55213743", "0.5521117", "0.55178463", "0.55169916", "0.5514193", "0.5510826", "0.55088145", "0.5507602", "0.5506638", "0.549749", "0.54964817", "0.5490897", "0.5483692", "0.5481858", "0.54809016", "0.5475681", "0.5473478", "0.5464515", "0.5462735", "0.5462605", "0.5462166", "0.5452462", "0.5448152", "0.5447291" ]
0.0
-1
Indicator that the product only can be offered to customers with prior agreement.
public function setIsCustomerAgreement(?bool $isCustomerAgreement): self { $this->initialized['isCustomerAgreement'] = true; $this->isCustomerAgreement = $isCustomerAgreement; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function form_is_available_to_create_a_customer()\n {\n\n }", "abstract function has_purchased_before();", "public function shouldAcceptLicense()\n {\n return !Config::get('licenseAccepted');\n }", "abstract function is_only_premium();", "public function isIndependentCreditSupported();", "public function maybe_print_subscription_limit_notice()\n {\n\n global $product;\n\n // Product limits are applied\n if (!$this->maybe_make_product_not_purchasable(true, $product)) {\n\n // One non-terminated subscription per customer per site\n if (RP_SUB_Settings::is('subscription_limit', 'one_per_customer')) {\n wc_print_notice(__('Sorry, you are not allowed to purchase this product as you already have a subscription on this site.', 'subscriptio'), 'notice');\n }\n // One non-terminated subscription per product per customer per site\n else if (RP_SUB_Settings::is('subscription_limit', 'one_per_product')) {\n wc_print_notice(__('Sorry, you are not allowed to purchase this product as you already have it in one of your subscriptions.', 'subscriptio'), 'notice');\n }\n }\n }", "public function form_is_available_to_update_customers()\n {\n\n }", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}", "private function COIRequiresApproval()\r\n {\r\n global $db;\r\n\r\n // if there is more than one COI form in the db then approvals are required\r\n $sql = \"SELECT * FROM `forms_coi`\r\n WHERE `form_tracking_id` = \" . $this->trackingFormId . \"\r\n and `coi_none` = '0'\";\r\n $result = $db->getAll($sql);\r\n\r\n if (count($result) <= 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "protected function isOfferValid ()\n {\n return $this->offerApplicableAmount >= $this->offer->minimum_order_amount;\n }", "function mc_do_not_allow_3_month_renewals( $subscription_can_be_renewed, $subscription, $subscription_key, $user_id ) {\n if( $subscription['product_id'] == 3622 ) {\n return false;\n }\n else {\n return $subscription_can_be_renewed;\n }\n}", "public function canClaim() {\r\n return $this->getSparePower() >= $this->factionsLevel->getSettings()->powerPerPlot;\r\n }", "public function isAllowOrder() {\n $qtyAllow = false;\n \n // check qty\n if ($this->quantity >= $this->minimum_quantity) {\n $qtyAllow = true;\n }\n else {\n if ($this->when_out_of_stock == 1) {\n $qtyAllow = true;\n }\n }\n \n // check all\n if (($qtyAllow) & ($this->active) & ($this->available_for_order)) {\n return true;\n }\n \n return false;\n }", "public function canPayment()\n {\n return true;\n }", "public function isAllowedToApplyLoan()\n {\n return $this->getAge() >= 18;\n }", "public function forceCheckoutOnContribute(){\n\t\tif(!$this->canContribute()){\n\t\t\t$_SESSION['flashMessage'] = \"Sorry, you will need complete this purchase before you can send another gift.\";\n\t\t\tview::Redirect('cart', 'index');\n\t\t}\n\t}", "public function isValid()\n {\n return $this->getStatus() != 'unlicensed';\n }", "public function getIsCustomerAccessLimited(): bool;", "private function validateAvailableProduct() {\n\n\t\t$studio_data = &$this->session->data['studio_data'][$this->request->post['price_studio_id']]; //make it short\n\n\t\t//if price_id_product is not empty\n\t\tif (!isset($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t///if product exists\n\t\t} elseif (!$this->model_opentshirts_product->getTotalProductsByID($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t//if product price is setted up\n\t\t}else if ($this->model_opentshirts_price_product->getMinQuantity($studio_data['id_product'])===false) {\n\t\t\t$this->error['warning'] = $this->language->get('error_not_available');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function validateMinimumAmount()\n {\n return !(Mage::getStoreConfigFlag('sales/minimum_order/active')\n && Mage::getStoreConfigFlag('sales/minimum_order/multi_address')\n && !$this->getQuote()->validateMinimumAmount());\n }", "public function authorize()\n {\n return Cart::load()->getTotalQuantity() > 1;\n }", "function is_paying_or_trial__premium_only() {\n\t\t\treturn $this->is_premium() && $this->is_paying_or_trial();\n\t\t}", "public function isApproved()\n {\n\n return false;\n }", "private function unbalancedSupply() {\n $rapporto = $_POST['quantitaCercata'] / $_POST['quantitaOfferta'];\n if ($rapporto >= 0.5 && $rapporto <= 2)\n return false;\n return true;\n }", "private function purchaseRestrictionsApproval($ins) {\n if($ins['liter'] > 100) {\n\t $response = [\n\t \"status\" => \"error\", \n\t \"message\" => \"Customer tidak diizinkan mengisi lebih dari 100 lt ({$ins['liter']} lt).\\n\\nSilakan ubah volume!\", \n\t ];\n\t echo json_encode($response);\t \n } else {\n\t $response = [\n\t \"status\" => \"ok\", \n\t \"message\" => \"Customer ingin mengisi biosolar dengan volume {$ins['liter']} liter pada pembelian ke - {$ins['numOfBuy']}\"\n\t ];\n\t echo json_encode($response);\t \n } \n }", "public function declined()\n\t{\n\t\treturn !$this->approved();\n\t}", "public function isOrderEditable()\n {\n return !\\XLite::isFreeLicense();\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function canSkipOrderReviewStep()\n {\n return !$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON);\n }", "public function canBeFree()\n {\n return count($this->getCurrentStudentCareerSchoolYear()) > 0;\n\n }", "abstract function is_premium();", "function is_paying__premium_only() {\n\t\t\treturn ( $this->is__premium_only() && $this->is_paying() );\n\t\t}", "function is_not_paying() {\n\t\t\treturn ( $this->is_trial() || $this->is_free_plan() );\n\t\t}", "public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "function check_requirements()\n\t{\n\t\tif (!$this->obj_customer->verify_id())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested customer (\". $this->obj_customer->id .\") does not exist - possibly the customer has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\n\t\treturn 1;\n\t}", "public function isAllowed()\n {\n return in_array(\n $this->vippsQuote->getStatus(),\n [\n QuoteStatusInterface::STATUS_NEW,\n QuoteStatusInterface::STATUS_PENDING,\n QuoteStatusInterface::STATUS_RESERVE_FAILED,\n QuoteStatusInterface::STATUS_REVERT_FAILED\n ],\n true\n );\n }", "public function applyNewLicenseRange()\n {\n $paypal = new paypalLicense;\n $lastPayInfo = $this->getPaidInfo();\n\n if (false === isset($lastPayInfo->items)) {\n return true;\n }\n\n $newRangeDate = DateTime::createFromFormat('m/d/Y H:i:s', paypalLicense::NEW_RANGE_DATE_APPLY);\n $payDate = new DateTime($lastPayInfo->date);\n\n return $newRangeDate < $payDate;\n }", "public function maybe_make_product_not_purchasable($is_purchasable, $product)\n {\n\n global $wp;\n\n // TODO: Problem - when subscriptions are limited but product can be purchased, warning is being displayed when navigating to product page from the thank you page (something goes wrong at the very moment of checkout)\n\n // Result not yet in cache\n if (!isset($this->product_is_purchasable[$product->get_id()])) {\n\n // Make sure this is a subscription product and we are not on the \"Thank You\" page\n if ($is_purchasable && subscriptio_is_subscription_product($product) && !is_order_received_page()) {\n\n // Get product id to check\n $product_id = $product->is_type('variation') ? $product->get_parent_id() : $product->get_id();\n\n // Subscription limits are enabled\n if (!RP_SUB_Settings::is('subscription_limit', 'no_limit')) {\n\n // Iterate over non-terminated customer subscriptions\n foreach (subscriptio_get_customer_subscriptions() as $subscription) {\n\n // One non-terminated subscription per customer per site\n if (RP_SUB_Settings::is('subscription_limit', 'one_per_customer')) {\n\n // Customer already has a non-terminated subscription on this site\n $is_purchasable = false;\n } // One non-terminated subscription per product per customer per site\n else if (RP_SUB_Settings::is('subscription_limit', 'one_per_product')) {\n\n // Iterate over subscription items\n foreach ($subscription->get_items() as $item) {\n\n // Compare product ids\n if ($item->get_product_id() === $product_id) {\n\n // Customer already has a non-terminated subscription for this product on this site\n $is_purchasable = false;\n }\n }\n }\n }\n }\n }\n\n // Add result to cache\n $this->product_is_purchasable[$product->get_id()] = $is_purchasable;\n }\n\n // Return result from cache\n return $this->product_is_purchasable[$product->get_id()];\n }", "public function canDecline()\n {\n $user = $this->getUser();\n\n if (\n $this->getData('status') == Service\\BalanceWithdrawals::STATUS_PENDING &&\n $user->getData('role') == 'Admin'\n ) {\n return true;\n }\n\n return false;\n }", "function edd_pup_eligible_updates( $payment_id, $updated_products, $object = true, $licenseditems = null, $email_id = 0 ){\r\n\r\n\tif ( empty( $payment_id) || empty( $updated_products ) || $email_id = 0 ) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif ( is_null( $licenseditems ) ) {\r\n\t\tglobal $wpdb;\r\n\t\t$licenseditems = $wpdb->get_results( \"SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_edd_sl_enabled' AND meta_value = 1\", OBJECT_K );\r\n\t}\r\n\r\n\t$customer_updates = '';\r\n\t$licensing = edd_get_option( 'edd_pup_license' );\r\n\t$payment_meta = get_post_meta( $payment_id, '_edd_payment_meta', true );\r\n\r\n\tif ( ( $licensing != false ) && is_plugin_active('edd-software-licensing/edd-software-licenses.php' ) ) {\r\n\t\t$licenses = edd_pup_get_license_keys( $payment_id );\r\n\t}\r\n\r\n\tforeach ( maybe_unserialize( $payment_meta['cart_details'] ) as $item ){\r\n\t\t$item['name'] = addslashes( $item['name'] );\r\n\r\n\t\t// Skip $item if it is not a product being updated\r\n\t\tif ( !isset( $updated_products[ $item['id'] ] ) ){\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// If Software Licensing integration is active and the $item has software licensing enabled\r\n\t\tif ( ( $licensing != false ) && isset( $licenseditems[ $item['id'] ] ) ) {\r\n\r\n\t\t\t// If the customer has licenses and the license for this $item is enabled and active\r\n\t\t\t$enabled = get_post_status( $licenses[$item['id']]['license_id'] ) == 'publish' ? true : false;\r\n\r\n\t\t\tif ( !empty( $licenses ) && $enabled && in_array( edd_software_licensing()->get_license_status( $licenses[$item['id']]['license_id'] ), apply_filters( 'edd_pup_valid_license_statuses', array( 'active', 'inactive' ) ) ) ) {\r\n\t\t\t\t// Add the $item as an eligible updates\r\n\t\t\t\t$customer_updates[ $item['id'] ] = $object ? $item : $item['name'];\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t\t// Add the $item as an eligible updates\r\n\t\t\t\t$customer_updates[ $item['id'] ] = $object ? $item : $item['name'];\r\n\t\t}\r\n\t}\r\n\r\n\treturn $customer_updates;\r\n}", "function checkLicence() {\n\n $isValid = true;\n \n return $isValid;\n}", "protected function _maybe_show_notice() {\n\t\tif ( false === $this->is_valid && ! SermonManager::getOption( 'license_key' ) ) {\n\t\t\tPlugin::instance()->notice_manager->add_info( 'licensing_activate', 'Please <a href=\"' . admin_url( 'edit.php?post_type=wpfc_sermon&page=sm-settings&tab=licensing' ) . '\" target=\"_self\">enter and activate</a> your license key to enable automatic updates.', 10, 'licensing', true );\n\t\t} else {\n\t\t\tPlugin::instance()->notice_manager->set_seen( 'licensing_activate', true );\n\t\t}\n\t}", "public function is_purchased( TPM_Product $product ) {\n\n\t\t//check old licenses\n\t\t$thrive_license = get_option( 'thrive_license', array() );\n\t\tif ( in_array( 'all', $thrive_license, false ) || in_array( $product->get_tag(), $thrive_license, false ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/** @var $license TPM_License */\n\t\tforeach ( $this->get_ttw_license_instances() as $id => $license ) {\n\t\t\tif ( $license->has_tag( $product->get_tag() ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}", "public function canBeAccepted()\n {\n return $this->isReadyForIssuing();\n }", "public function isStatusNotPaid()\n {\n return $this->status == self::_ORDER_STATUS_NEW || $this->status == self::_ORDER_STATUS_REJECTED;\n }", "public function isVersionActivelyMaintained() {}", "public function tellNotEnoughMoneyInAccount()\n {\n }", "public function form_is_available_to_create_a_note()\n {\n\n }", "public function isUnderpaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_UNDERPAID;\n }", "protected function shouldAddPayment(): bool\r\n {\r\n return DocumentTypes::hasPayments($this->documentType);\r\n }", "public function canAddToCart($product)\n {\n return (!$product->getData('personalization_allowed') || !$product->getData('personalization_required'));\n }", "public function isApplicable();", "public function isVatRateCurrentlyApplicable($vat_rate_commencement_date,$order_id,$product_id){\n //get the date when this order was done\n $order_date = getdate(strtotime($this->getTheDateOfThisOrder($order_id,$product_id)));\n $date_vat_commenced = getdate(strtotime($vat_rate_commencement_date));\n \n if(($order_date['year'] - $date_vat_commenced['year'])>0){\n return true;\n }else if(($order_date['year'] - $date_vat_commenced['year'])<0){\n return false;\n }else{\n if(($order_date['mon'] - $date_vat_commenced['mon'])>0){\n return true;\n }else if(($order_date['mon'] - $date_vat_commenced['mon'])<0){\n return false;\n }else{\n if(($order_date['mday'] - $date_vat_commenced['mday'])>0){\n return true;\n }else if(($order_date['mday'] - $date_vat_commenced['mday'])==0){\n return true;\n }else{\n return false;\n }\n }\n }\n \n \n }", "public function use_for_claims() {\n\t\treturn $this->get_product_meta( 'use_for_claims' ) === 'yes';\n\t}", "function can_use_premium_code__premium_only() {\n\t\t\treturn $this->is_premium() && $this->can_use_premium_code();\n\t\t}", "function needs_payment() {\n\t\t\tif ( $this->total > 0 ) return true; else return false;\n\t\t}", "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }", "public static function is_eligible_to_bid( $user_id = null , $product_id = null ) {\n\n if( !$user_id ) return false;\n if( !$product_id ) return false;\n if( WAUC_Functions::is_user_forbidden( $user_id ) ) return false;\n\n if( strtotime( WAUC_Functions::get_auction_start_time( $product_id ) ) < time() && time() < strtotime( WAUC_Functions::get_auction_end_time( $product_id ) ) ) {\n return true;\n } ;\n\n return false;\n\n }", "abstract function has_paid_plan();", "protected function restrict() {\n $this->restrict_to_permission('manage_products');\n }", "public function isAccountEligibleForChargeGeneration()\n\t{\n\t\t$objAccount = Account::getForId($this->account);\n\t\tif ($objAccount == null)\n\t\t{\n\t\t\tthrow new Exception(\"Associated Account (Id: {$this->account}) could not be found\");\n\t\t}\n\t\t\n\t\t// RecurringCharges only get generated if their associated account is active\n\t\tif ($objAccount->archived == ACCOUNT_STATUS_ACTIVE)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function unpaid(): bool\n {\n return in_array($this->status, [self::PENDING]);\n }", "function is_purchasable() {\n\t\t$purchasable = WCS_Limiter::is_purchasable( parent::is_purchasable(), $this );\n\n\t\treturn apply_filters( 'woocommerce_subscription_is_purchasable', $purchasable, $this );\n\t}", "function dispatch_licenses(){\n\t\n//1get all unfinished orders which are paid\n//2fetch all available licences\n\n//if 1 > 0 \n\t//loop for (unfinished orders)\n \t\t//compare ordered product id with available licences\n\t\t//if available\n\t\t\t//fetch email of buyer + send email + add buyer to database\n\t\t//else \n\t\t\t//mail not available to admin\n\t//loop end\n\t\n}", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('catalog/productsupdater');\r\n }", "public function testDeclined(){ \n\n $unBuyableProduct = Product::where('price', '>', 75)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($unBuyableProduct, $this->testVisaPan);\n $response->assertSee(\"Declined\");\n\n\n //test card 2\n $response = $this->checkoutAction($unBuyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Declined\"); \n \n }", "public function canBeDeclined()\n {\n return $this->isAwaitingFee();\n }", "public function isCreditCardPurchase()\n {\n return $this->payment_method->id != 1;\n }", "public function testIsApplicableWithNonAuthorizedUser()\n {\n $paymentMethod = $this->createMock(\\Magento\\Payment\\Model\\MethodInterface::class);\n $quote = $this->createPartialMock(\\Magento\\Quote\\Model\\Quote::class, ['getCustomerId']);\n $quote->expects($this->once())->method('getCustomerId')->willReturn(null);\n $this->assertTrue($this->hasCompanyPermission->isApplicable($paymentMethod, $quote));\n }", "public function testReactTakesPrecedenceOverDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountPaid' => 1,\n\t\t\t'getCountDisagreed' => 2,\n\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_REACT,\n\t\t\t$result\n\t\t);\n\t}", "public function ensure_keys_are_actually_active () {\n $already_active = (array)$this->get_activated_products();\n $products = $this->get_detected_products();\n if ( 0 < count( $already_active ) ) {\n foreach ( $already_active as $k => $v ) {\n //** Only look through activated plugins */\n if( !array_key_exists( $k, $products ) ) {\n continue;\n }\n $deactivate = true;\n \n if ( !empty( $already_active[ $k ][2] ) ) {\n //** Get license and activation email */\n $data = base64_decode( $already_active[ $k ][2] );\n $data = explode( '::', $data );\n $license_key = isset( $data[0] ) ? trim( $data[0] ) : '';\n $activation_email = isset( $data[1] ) ? trim( $data[1] ) : '';\n\n //** Do request */\n $response = $this->api->status( array(\n 'product_id' \t=> $already_active[ $k ][0],\n 'instance' \t\t=> $already_active[ $k ][1],\n 'email' => trim($activation_email),\n 'licence_key' => trim($license_key),\n ), false, false );\n \n //** Do not deactivate if cannot reach UD */\n if ( $response === false ) {\n continue;\n }\n if( is_array( $response ) && !empty( $response[ 'status_check' ] ) && $response[ 'status_check' ] == 'active' ) {\n $deactivate = false;\n }\n }\n if( $deactivate ) {\n $this->deactivate_product( $k, true );\n }\n }\n }\n }", "public function canWithdraw()\n {\n return true;\n }", "public function canBeReincorporated()\n {\n return count(StudentFreePeer::retrieveCurrentAndIsFree(null, $this->getId())) > 0;\n\n }", "public function updateLicenseStatus()\n {\n $transient = get_transient($this->slug);\n\n // If set and valid, return.\n if (VALID === $transient) {\n error_log('Active...');\n return;\n }\n // If expired, do something to never req again.\n\n // If not then, perform a check\n // error_log('Checking ...');\n // $response = $this->checkLicenseKey();\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_Vendors::vendors_sellers');\n }", "public function needs_payment() {\n\t\treturn apply_filters( 'woocommerce_cart_needs_payment', 0 < $this->get_total( 'edit' ), $this );\n\t}", "public function testOneDisagreedNoCancelIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}", "protected function checkProductRequirements()\n {\n $activeProductIds = $expiredProductIds = array();\n if ($this->_user) {\n $activeProductIds = $this->_user->getActiveProductIds();\n $expiredProductIds = $this->_user->getExpiredProductIds();\n }\n $error = $this->getDi()->productTable->checkRequirements($this->getProducts(), $activeProductIds, $expiredProductIds);\n return $error ? $error : null;\n }", "public function chekcingForMarketplaceSellerOrNot() {\n /**\n * Initilize customer and seller group id\n */\n $customerGroupIdVal = $sellerGroupIdVal = $customerStatusValue = '';\n /**\n * Get customer group id\n * @var int\n */\n $customerGroupIdVal = Mage::getSingleton ( 'customer/session' )->getCustomerGroupId ();\n $sellerGroupIdVal = Mage::helper ( 'marketplace' )->getGroupId ();\n /**\n * Get customer status\n * @var int\n */\n $customerStatusValue = Mage::getSingleton ( 'customer/session' )->getCustomer ()->getCustomerstatus ();\n /**\n * Checking for customer group id and seller group id\n */\n if (! Mage::getSingleton ( 'customer/session' )->isLoggedIn () && $customerGroupIdVal != $sellerGroupIdVal) {\n /**\n * add error message\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You must have a Seller Account to access this page' ) );\n $this->_redirect ( 'marketplace/seller/login' );\n return false;\n }\n /**\n * Checking whether customer approved or not\n */\n if ($customerStatusValue != 1) {\n /**\n * add error message\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'Admin Approval is required. Please wait until admin confirms your Seller Account' ) );\n $this->_redirect ( 'marketplace/seller/login' );\n return false;\n }\n }", "abstract function can_use_premium_code();", "public function canBeManagedForCareerSubjectAllowed()\n {\n return $this->countCareerStudents() > 0;\n\n }", "public function permittedFor(UserLicense $account, $method);", "public function testIsAvailableWithCanceledGuarantee()\n {\n $orderId = 123;\n\n /** @var CaseInterface|\\PHPUnit_Framework_MockObject_MockObject $case */\n $case = $this->getMockBuilder(CaseInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $case->expects($this->once())\n ->method('getGuaranteeDisposition')\n ->willReturn(CaseEntity::GUARANTEE_CANCELED);\n\n $this->caseManagement->expects($this->once())\n ->method('getByOrderId')\n ->with($orderId)\n ->willReturn($case);\n\n $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId));\n }", "function is_valid_for_use() {\n\t\t\tif ( ! in_array( get_woocommerce_currency(), apply_filters( 'woocommerce_esewa_supported_currencies', array( 'NPR' ) ) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "private function getAlreadyPurchasedProduct()\n {\n // If is Guest then hide the review form\n if (!$this->getCustomerId()) {\n return false;\n }\n try {\n $product = $this->getProductInfo();\n $orders = $this->getCustomerOrders();\n foreach ($orders as $order) {\n // Get all visible items in the order\n /** @var $items \\Magento\\Sales\\Api\\Data\\OrderItemInterface[] **/\n $items = $order->getAllVisibleItems();\n // Loop all items\n foreach ($items as $item) {\n // Check whether the current product exist in the order.\n if ($item->getProductId() == $product->getId()) {\n return true;\n }\n }\n }\n return false;\n } catch (\\Exception $e) {\n return false;\n }\n }", "function approve(){\n\t\t$points= $this->ref('currently_requested_to_id')->get('points_available');\n\t\tif($points < 3000)\n\t\t\t$this->api->js()->univ()->errorMessage(\"Not suficcient points available, [ $points ]\")->execute();\n\t\t// Send point to the requester and less from your self ... \n\n\t\t$purchaser= $this->add('Model_MemberAll')->addCondition(\"id\",$this['request_from_id'])->tryLoadAny();\n\t\t$purchaser['points_available'] = $purchaser['points_available'] + 3000;\n\t\t$purchaser->save();\n\n\t\t$seller=$this->add('Model_MemberAll')->addCondition(\"id\",$this['currently_requested_to_id'])->tryLoadAny();\n\t\t$seller['points_available'] = $seller['points_available'] - 3000;\n\t\t$seller->save();\n\n\t\tif($this->api->auth->model->id == 1)\n\t\t\t$this['status']='Approved By Admin';\n\t\telse\n\t\t\t$this['status']='Approved';\n\n\t\t$this->save();\n\n\n\t}", "public function showing_restricted_products() {\n\t\treturn ! $this->hiding_restricted_products();\n\t}", "public function user_has_access_to_product( $user_id, $product_id ) {\n\n if ( $user_id == get_current_user_id() && current_user_can( 'edit_users' ) )\n return true;\n\n $user_has_access = apply_filters( 'yith_wcmbs_user_has_access_to_product', false, $user_id, $product_id );\n if ( $user_has_access )\n return true;\n\n $product_plans = $this->product_is_in_plans( $product_id );\n\n $delay = get_post_meta( $product_id, '_yith_wcmbs_plan_delay', true );\n $member = YITH_WCMBS_Members()->get_member( $user_id );\n\n $user_plans = $member->get_membership_plans( array( 'return' => 'complete' ) );\n\n foreach ( $user_plans as $membership ) {\n $plan_ids = array_intersect( array_merge( array( $membership->plan_id ), $membership->get_linked_plans() ), $product_plans );\n if ( !empty( $plan_ids ) ) {\n\n $start_date = $membership->start_date + ( $membership->paused_days * 60 * 60 * 24 );\n if ( !empty( $delay ) ) {\n if ( !isset( $delay[ $membership->plan_id ] ) ) {\n $linked = $membership->get_linked_plans();\n $min_delay_time = 0;\n $first = true;\n foreach ( $linked as $plan_id ) {\n if ( isset( $delay[ $plan_id ] ) ) {\n if ( $first ) {\n $min_delay_time = $delay[ $plan_id ];\n $first = false;\n } else {\n if ( $delay[ $plan_id ] < $min_delay_time ) {\n $min_delay_time = $delay[ $plan_id ];\n }\n }\n }\n }\n\n if ( $min_delay_time > 0 ) {\n if ( strtotime( '+' . $min_delay_time . ' days midnight', $start_date ) <= strtotime( 'midnight' ) ) {\n return true;\n }\n } else {\n return true;\n }\n } else {\n if ( $delay[ $membership->plan_id ] < 1 || strtotime( '+' . $delay[ $membership->plan_id ] . ' days midnight', $start_date ) <= strtotime( 'midnight' ) ) {\n return true;\n }\n }\n } else {\n return true;\n }\n }\n }\n\n return false;\n // VECCHIO codice -------------------------------------------------\n $user_plans = $member->get_membership_plans( array( 'return' => 'id_date', 'include_linked' => true ) );\n\n if ( !empty( $user_plans ) ) {\n foreach ( $user_plans as $plan ) {\n if ( in_array( $plan[ 'id' ], $product_plans ) ) {\n if ( isset( $delay[ $plan[ 'id' ] ] ) ) {\n $delay_days = $delay[ $plan[ 'id' ] ];\n\n if ( strtotime( '+' . $delay_days . ' days midnight', $plan[ 'date' ] ) <= strtotime( 'midnight' ) )\n return true;\n } else {\n return true;\n }\n }\n }\n }\n\n return false;\n }", "public function isReadyForIssuing()\n {\n return $this->isFeePaid();\n }", "function disable_repeat_purchase_for_tamboo( $purchasable, $product ) {\n $product_id = $product->get_id();\n \n // Bailout if not a product with Attribute \"Purchase\"\n $string_values = $product->get_attribute('Purchase');\n if (( empty($string_values) )) { \n return $purchasable;\n }\n\n // return false if the customer has bought the product\n if ( wc_customer_bought_product( wp_get_current_user()->user_email, get_current_user_id(), $product_id ) ) {\n $purchasable = false;\n }\n \n // Double-check for variations: if parent is not purchasable, then variation is not\n if ( $purchasable && $product->is_type( 'variation' ) ) {\n $parent = wc_get_product( $product->get_parent_id() );\n $purchasable = $parent->is_purchasable();\n }\n return $purchasable;\n}", "function isEligibleToSubscribe($mid, $isVerified){\n\t\t// If free user restrict after 100 subscription form submission\n\t\t// Restrict per minute 5 submission\n\t\t// Restrict per day 100 submission\n\n\t\t$retVal = false;\n\t\tif(!$isVerified){\n\t\t\t$rsCountSignupContact = $this->db->query(\"Select count(subscriber_id) as totSubscribed from red_email_subscribers where subscriber_created_by='$mid' and is_signup=1 and date_format(subscriber_date_added,'%Y-%m-%d') = curdate()\");\n\t\t\t$intTotalSubscribed = $rsCountSignupContact->row()->totSubscribed;\n\t\t\t$rsCountSignupContact->free_result();\n\t\t\t//if($intTotalSubscribed < 26){\n\t\t\tif($intTotalSubscribed < 6){\n\t\t\t\t$retVal = true;\n\t\t\t}\n\t\t}else{\n\t\t\t$retVal = true;\n\n\t\t\t/* $user_packages_array=$this->UserModel->get_user_packages(array('member_id'=>$mid,'is_deleted'=>0));\n\t\t\t$package_id=$user_packages_array[0]['package_id'];\n\t\t\tif($package_id > 0){\n\t\t\t\t$retVal = true;\n\t\t\t}else{\n\t\t\t\t$rsCountSignupContact = $this->db->query(\"Select count(subscriber_id) as totSubscribed from red_email_subscribers where subscriber_created_by='$mid' and is_signup=1 and is_deleted=1\");\n\t\t\t\t$intTotalSubscribed = $rsCountSignupContact->row()->totSubscribed;\n\t\t\t\t$rsCountSignupContact->free_result();\n\t\t\t\tif($intTotalSubscribed < 3){\n\t\t\t\t\t$retVal = true;\n\t\t\t\t}\n\t\t\t} */\n\n\n\t\t}\n\t\treturn $retVal ;\n\t}", "public function isRejected() {\n\t\treturn $this->approved == -1;\n\t}", "public function no_items() {\r\n\t\t_e( 'No customers avaliable.', 'ac' );\r\n\t}", "public function getCanMakePurchaseOrdersAttribute()\n {\n \treturn true;\n }", "public function askForFeeConfirmation()\n {\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magestore_InventorySuccess::adjuststock');\n }", "public function approveAndEarmark() {\n // Check if user has enough money available on card to pay for amount on authorization request.\n // Assumption: it's enough to check if the available balance is no greater than the amount that has been authorized.\n if ($this->card->availableBalance() > $this->authorizationRequest->getAuthorizedAmount()) {\n // Approve request.\n $this->authorizationRequest->approve();\n // Earmark the amount in the authorization request on the card.\n $this->card->earmark($this->authorizationRequest);\n } else {\n throw new Exception(\"User does not have enough money available on their card.\");\n }\n }", "public function authorize()\n {\n return $this->user()->hasPermission('subscription-service-create-plan');\n }", "public function is_needed() {\n\t\treturn $this->context->site_represents === 'company';\n\t}" ]
[ "0.66637474", "0.65660894", "0.65564406", "0.647481", "0.643241", "0.6331137", "0.6238166", "0.62024635", "0.61867654", "0.60360765", "0.6010349", "0.60037494", "0.5983805", "0.59480965", "0.5947196", "0.5934996", "0.59339064", "0.5899457", "0.5896936", "0.58629864", "0.5862095", "0.58576405", "0.58575976", "0.58498526", "0.5828273", "0.58269334", "0.5820909", "0.5812024", "0.5805248", "0.5793897", "0.5786965", "0.5781591", "0.5778615", "0.57718897", "0.5763404", "0.57571596", "0.57501084", "0.57473093", "0.5736294", "0.57238877", "0.5713056", "0.57093036", "0.5706166", "0.5698307", "0.5693065", "0.56927884", "0.568733", "0.5674441", "0.5671786", "0.56659025", "0.5661114", "0.566099", "0.5651291", "0.56448054", "0.56336606", "0.56226915", "0.561906", "0.5612734", "0.56090117", "0.5606172", "0.5593246", "0.55931175", "0.5589", "0.55856794", "0.55837554", "0.5577647", "0.55733025", "0.5550995", "0.5550545", "0.5546837", "0.5545046", "0.55395097", "0.55390143", "0.55310875", "0.553086", "0.55277455", "0.55249983", "0.5522651", "0.55205566", "0.5516544", "0.5516237", "0.5513565", "0.5511333", "0.5508495", "0.55070156", "0.55067396", "0.5498051", "0.5496104", "0.54912484", "0.54845196", "0.5483538", "0.54812735", "0.54770947", "0.5472612", "0.5464141", "0.5463407", "0.5462996", "0.5462371", "0.5451341", "0.54488856", "0.5448846" ]
0.0
-1
Group of serviceCodes that are mutually exclusive. Only one serviceCode among the list must be applied for a shipment.
public function getServiceCodeMutuallyExclusiveGroups(): ?array { return $this->serviceCodeMutuallyExclusiveGroups; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setServiceCodeMutuallyExclusiveGroups(?array $serviceCodeMutuallyExclusiveGroups): self\n {\n $this->initialized['serviceCodeMutuallyExclusiveGroups'] = true;\n $this->serviceCodeMutuallyExclusiveGroups = $serviceCodeMutuallyExclusiveGroups;\n\n return $this;\n }", "private function _serviceEliminateDuplicates()\n {\n return Mage::getModel('mmdebugging_blockinformation_service/match_text_eliminateduplicates', array(\n 'form' => $this->getForm(),\n 'parent_service' => $this,\n ));\n }", "public function getServiceCodeDependencyRuleGroups(): ?array\n {\n return $this->serviceCodeDependencyRuleGroups;\n }", "function build_servicegroups_array()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\t\n\t$servicegroups = $NagiosData->getProperty('servicegroups');\t\t\t\n\t$services = $NagiosData->getProperty('services');\t\t\n\t$services = user_filtering($services,'services'); \n\t\n\t$servicegroups_details = array(); //multi-dim array to hold servicegroups \t\n\tforeach($servicegroups as $groupname => $members)\n\t{\n\t\t$servicegroups_details[$groupname] = array();\n \t\t//array_dump($members); \n\t\tforeach($services as $service)\n\t\t{\t\n\t\t\tif(isset($members[$service['host_name']]) && in_array($service['service_description'],$members[$service['host_name']]))\t{\n\t\t\t\tprocess_service_status_keys($service);\t\t\n\t\t\t\t$servicegroups_details[$groupname][] = $service;\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}\n\n\treturn $servicegroups_details; \n}", "public function getAllServices_crm() {\r\n\t\t$billingServicesObj = new billing_SERVICES();\r\n $services = $billingServicesObj->getAllServiceDataForActiveServices();\r\n foreach ($services as $key=>$val) {\r\n if (strpos($val[\"SERVICEID\"], 'M') && $val[\"SERVICEID\"] != 'M3' && $val[\"SERVICEID\"] != 'M') {\r\n \tunset($services[$key]);\r\n }\r\n }\r\n return $services;\r\n }", "public function findServiceGroups(): array;", "public function servicesArray()\n {\n return [\n self::PAINTING,\n self::TIRE,\n self::BODY_WORK,\n self::TO,\n self::WASHING,\n ];\n }", "private function supverisorGroupId(){\n return array('1');\n }", "public function getShippingServices($intShippingId = 0)\n {\n if (!$intShippingId)\n return 0;\n //Set the shipstation mapping with the X-Cart.\n $arrShippingServices = array(\n '5' => 'USPS_USPPM',//USPS Priority Mail\n '6' => 'USPS_USPEXP',//USPS Priority Mail Express\n '7' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '8' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '10' => 'USPS_USPFC',//USPS First Class Mail\n '11' => 'USPS_USPMM',//USPS Media Mail\n '13' => 'USPS_USPPM',//USPS Priority Mail\n '14' => 'USPS_USPEXP',//USPS Priority Mail Express\n '15' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '16' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '18' => 'USPS_USPFC',//USPS First Class Mail\n '19' => 'USPS_USPMM',//USPS Media Mail\n '21' => 'USPS_USPPM',//USPS Priority Mail\n '22' => 'USPS_USPEXP',//USPS Priority Mail Express\n '23' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '24' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '26' => 'UPS_UPSGND',//UPS® Ground\n '27' => 'UPS_UPS3DS',//UPS 3 Day Select®\n '28' => 'UPS_UPS2ND',//UPS 2nd Day Air®\n '29' => 'WEXPP',//UPS Worldwide Express Plus®\n '30' => 'UPS_UPSWEX',//UPS Worldwide Express®\n '31' => 'UPS_UPSNDS',//UPS Next Day Air Saver®\n '32' => 'UPS_UPSNDA',//UPS Next Day Air®\n '33' => 'UPS_UPSWEP',//UPS Worldwide Expedited®\n '34' => 'UPS_UPSWSV',//UPS Worldwide Saver®\n '35' => 'UPS_UPSCAN',//UPS Standard®\n '36' => 'UPS_UPS2DE',//UPS 2nd Day Air AM®\n '37' => 'UPS_UPSNDE',//UPS Next Day Air® Early\n '50' => 'FEDEX_GROUND',//FedEx Ground®\n '51' => 'GROUND_HOME_DELIVERY',//FedEx Home Delivery®\n '52' => 'FEDEX_2_DAY',//FedEx 2Day®\n '53' => 'FEDEX_2_DAY_AM',//FedEx 2Day® A.M.\n '54' => 'FEDEX_EXPRESS_SAVER',//FedEx Express Saver®\n '55' => 'STANDARD_OVERNIGHT',//FedEx Standard Overnight®\n '56' => 'PRIORITY_OVERNIGHT',//FedEx Priority Overnight®\n '57' => 'FIRST_OVERNIGHT',//FedEx First Overnight®\n '59' => 'INTERNATIONAL_ECONOMY',//FedEx International Economy®\n '60' => 'INTERNATIONAL_PRIORITY',//FedEx International Priority®\n '61' => 'INTERNATIONAL_FIRST',//FedEx International First®\n '67' => 'FEDEX_1_DAY_FREIGHT',//FedEx 1Day® Freight\n '68' => 'FEDEX_2_DAY_FREIGHT',//FedEx 2Day® Freight\n '69' => 'FEDEX_3_DAY_FREIGHT',//FedEx 3Day® Freight\n '70' => 'INTERNATIONAL_ECONOMY_FREIGHT',//FedEx International Economy® Freight\n '71' => 'INTERNATIONAL_PRIORITY_FREIGHT',//FedEx International Priority® Freight\n '73' => 'FEDEX_FDXIGND',//FedEx International Ground®\n '98' => 'DOM.RP',//Regular Parcel\n '99' => 'DOM.EP',//Expedited Parcel\n '100' => 'DOM.XP',//Xpresspost\n '101' => 'DOM.XP.CERT',//Xpresspost Certified\n '102' => 'DOM.PC',//Priority\n '103' => 'DOM.LIB',//Library Books\n '104' => 'USA.EP',//Expedited Parcel USA\n '105' => 'USA.PW.ENV',//Priority Worldwide Envelope USA\n '106' => 'USA.PW.PAK',//Priority Worldwide pak USA\n '107' => 'USA.PW.PARCEL',//Priority Worldwide Parcel USA\n '115' => 'INT.PW.ENV',//Priority Worldwide Envelope Intl\n '116' => 'INT.PW.PAK',//Priority Worldwide pak Intl\n '117' => 'INT.PW.PARCEL',//Priority Worldwide parcel Intl\n '118' => 'INT.SP.AIR',//Small Packet International Air\n '119' => 'INT.SP.SURF',//Small Packet International Surface\n '120' => 'INT.TP',//Tracked Packet - International\n '2700' => 'USPS_USPFC',//USPS First Class Mail\n '2701' => 'USPS_USPMM',//USPS Media Mail\n '2709' => 'USPS_USPPM',//USPS Priority Mail\n '2732' => 'USPS_USPPMI',//USPS Priority Mail International\n '2735' => 'USPS_USPEMI',//USPS Priority Mail Express International\n '2760' => 'UPS_UPSGND',//UPS Ground\n '2762' => 'UPS_UPS3DS',//UPS 3 Day Select\n '2763' => 'UPS_UPS2DE',//UPS 2nd Day Air\n '2765' => 'UPS_UPSNDAS',//UPS Next Day Air Saver\n '2766' => 'UPS_UPSNDA',//UPS Next Day Air\n );\n\n if (isset($arrShippingServices[$intShippingId])) {\n return $arrShippingServices[$intShippingId]; \n } else {\n return 0;\n }\n }", "public function getServiceNameAllowableValues()\n {\n return [\n self::SERVICE_NAME_BOUNTY_MISSIONS,\n self::SERVICE_NAME_ASSASSINATION_MISSIONS,\n self::SERVICE_NAME_COURIER_MISSIONS,\n self::SERVICE_NAME_INTERBUS,\n self::SERVICE_NAME_REPROCESSING_PLANT,\n self::SERVICE_NAME_REFINERY,\n self::SERVICE_NAME_MARKET,\n self::SERVICE_NAME_BLACK_MARKET,\n self::SERVICE_NAME_STOCK_EXCHANGE,\n self::SERVICE_NAME_CLONING,\n self::SERVICE_NAME_SURGERY,\n self::SERVICE_NAME_DNA_THERAPY,\n self::SERVICE_NAME_REPAIR_FACILITIES,\n self::SERVICE_NAME_FACTORY,\n self::SERVICE_NAME_LABORATORY,\n self::SERVICE_NAME_GAMBLING,\n self::SERVICE_NAME_FITTING,\n self::SERVICE_NAME_PAINTSHOP,\n self::SERVICE_NAME_NEWS,\n self::SERVICE_NAME_STORAGE,\n self::SERVICE_NAME_INSURANCE,\n self::SERVICE_NAME_DOCKING,\n self::SERVICE_NAME_OFFICE_RENTAL,\n self::SERVICE_NAME_JUMP_CLONE_FACILITY,\n self::SERVICE_NAME_LOYALTY_POINT_STORE,\n self::SERVICE_NAME_NAVY_OFFICES,\n self::SERVICE_NAME_SECURITY_OFFICE,\n ];\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "public function getMappedShippingMethods(){\n\n try {\n $activeCarriers = $this->shipConfig->getActiveCarriers();\n $methods = array();\n foreach ($activeCarriers as $carrierCode => $carrierModel) {\n\n if(in_array($carrierCode, self::EXCLUDED_CARRIERS)){\n continue;\n }\n\n if(isset(WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode])){\n $carrierCode = WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode];\n $methods[] = $carrierCode;\n }\n }\n\n return $methods;\n\n }catch(\\Exception $e){\n $this->logger->error(\"Error on WeSupply getMappedShippingMethods: \" . $e->getMessage());\n return [];\n }\n }", "public function getRights($serviceid) {\r\n \tif(!empty($serviceid)){\r\n\t $serviceid_arr = @explode(\",\", $serviceid);\r\n\t unset($rights);\r\n\t $billingCompObj = new billing_COMPONENTS();\r\n\t for ($i = 0; $i < count($serviceid_arr); $i++) {\r\n\t $packRights = $billingCompObj->getPackRights($serviceid_arr[$i]);\r\n\t if(empty($packRights)){\r\n\t \t$rights[] = $billingCompObj->getRights($serviceid_arr[$i]);\r\n\t } else {\r\n\t \t$rights[] = $packRights;\r\n\t }\r\n\t }\r\n\t }\r\n return $rights;\r\n }", "public static function createShipmentsValidationWarning(): array\n {\n $wsdl = __DIR__ . '/../../_files/bcs-3.3.2/geschaeftskundenversand-api-3.3.2.wsdl';\n $response = __DIR__ . '/../../_files/createshipment/multiShipmentValidationWarning.xml';\n\n $authStorage = AuthenticationStorageProvider::authSuccess();\n\n $labelRequest = ShipmentRequestProvider::createMultiShipmentPartialSuccess();\n $labelResponse = \\file_get_contents($response);\n\n return [\n 'multi label partial success' => [$wsdl, $authStorage, $labelRequest, $labelResponse],\n ];\n }", "protected function processServiceListBlock($code) {\n $ret = '';\n foreach ($this->services as $service) {\n $this->serviceBeingProcessed = $service;\n $blockForService = str_replace(self::_SERVICE_, $service->name, $code);\n\n\n $processed = $this->searchForBlocksAndApplyProcessing($blockForService, self::METHOD, 'processMethodListBlock');\n if ($processed) {\n $blockForService = $processed;\n }\n\n $ret .= $blockForService;\n }\n return $ret;\n }", "public function getShippingAsOptions($servicesObject)\n\t{\n\t\t$services = array();\n\t\t$domesticServices = array();\n\t\t$domesticServiceTypes = array();\n\t\t$internationalServices = array();\n\t\t$internationalServiceTypes = array();\n\n\t\t$supportedServiceTypes = array('Flat', 'Calculated');\n\n\t\tforeach ($servicesObject as $service) {\n\t\t\t$service = get_object_vars($service);\n\n\t\t\t// service is no longer valid? exclude\n\t\t\tif (empty($service['ValidForSellingFlow'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// the service code. eg USPSGlobalExpress\n\t\t\t$serviceCode = $service['ShippingService'];\n\n\t\t\t// the shipping carier for the service\n\t\t\t$carrier = 'Other';\n\t\t\tif (isset($service['ShippingCarrier'])) {\n\t\t\t\t$carrier = $service['ShippingCarrier'];\n\t\t\t}\n\n\t\t\t$newService = array(\n\t\t\t\t'id' \t\t=> $service['ShippingServiceID'], // numerical ID of the service\n\t\t\t\t'service'\t=> $serviceCode,\n\t\t\t\t'name'\t\t=> $service['Description'],\n\t\t\t\t'carrier'\t=> $carrier,\n\t\t\t);\n\n\t\t\t// The service types this service is valid for (Flat, Calculated, Freight etc)\n\t\t\t$serviceTypes = $service['ServiceType'];\n\t\t\tif (!is_array($serviceTypes)) {\n\t\t\t\t$serviceTypes = array($serviceTypes);\n\t\t\t}\n\n\t\t\t// The packages that are valid for this service\n\t\t\t$packages = array();\n\t\t\tif (!empty($service['ShippingPackage'])) {\n\t\t\t\t$packages = $service['ShippingPackage'];\n\t\t\t}\n\n\t\t\t$dimensionsRequired = !empty($service['DimensionsRequired']);\n\t\t\t$weightRequired = !empty($service['WeightRequired']);\n\t\t\t$expeditedService = !empty($service['ExpeditedService']);\n\n\t\t\t// Add the service into our appropriate arrays\n\t\t\tforeach ($serviceTypes as $serviceType) {\n\t\t\t\t// skip any unspported types\n\t\t\t\tif (!in_array($serviceType, $supportedServiceTypes)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// for Calculated type we should build a list of classes that are used in the select options\n\t\t\t\t$classes = array();\n\t\t\t\tif ($serviceType == 'Calculated') {\n\t\t\t\t\t$classes += $packages;\n\t\t\t\t}\n\n\t\t\t\tif ($expeditedService) {\n\t\t\t\t\t$classes[] = 'ExpeditedService';\n\t\t\t\t}\n\n\t\t\t\tif (!empty($classes)) {\n\t\t\t\t\t$classString = implode(' ', $classes);\n\t\t\t\t\t$newService['class'] = $classString;\n\t\t\t\t}\n\n\t\t\t\t// is this an international or domestic service?\n\t\t\t\tif (!empty($service['InternationalService'])) {\n\t\t\t\t\t$internationalServices[$serviceType][$carrier][$serviceCode] = $newService;\n\n\t\t\t\t\t$internationalServiceTypes[$serviceType] = GetLang('ServiceType' . $serviceType);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$domesticServices[$serviceType][$carrier][$serviceCode] = $newService;\n\n\t\t\t\t\t$domesticServiceTypes[$serviceType] = GetLang('ServiceType' . $serviceType);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$services = array(\n\t\t\t'Domestic' => array(\n\t\t\t\t'Services' \t\t=> $domesticServices,\n\t\t\t\t'ServiceTypes'\t=> $domesticServiceTypes,\n\t\t\t),\n\t\t\t'International'\t=> array(\n\t\t\t\t'Services' \t\t=> $internationalServices,\n\t\t\t\t'ServiceTypes'\t=> $internationalServiceTypes,\n\t\t\t),\n\t\t);\n\n\t\treturn $services;\n\t}", "protected function setStationCode(){\n\t\t$result = array(\"sta_code\",\"sta_code\");\n\t\treturn $result;\n\t}", "protected function setStationCode(){\n\t\t$result = array(\"sta_code\",\"sta_code\");\n\t\treturn $result;\n\t}", "public function disableCorporation() {\n $deletedGroupings = $this->deleteCorporationGroupings();\n\n return $deletedGroupings;\n }", "public function getServiceGroupsForStpl(int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtStplSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtStplSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\"\n );\n }\n $this->stmtStplSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtStplSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtStplSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public function allowMultiple() {\n return false;\n }", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function insert_multiple_service() {\r\n if (USER_ROLE == ROLE_ONE) {\r\n $inserts = json_decode($this->input->post('services'));\r\n $vouchers_ids = \",\";\r\n $flag = false;\r\n foreach ($inserts as $item) {\r\n $data['service_name'] = $item[0];\r\n $data['provided_by'] = $item[1];\r\n $data['billing_id'] = $item[2];\r\n $data['notes'] = $item[3];\r\n $data['cost'] = $item[4];\r\n $data['currency_type'] = $item[5];\r\n $data['received_date'] = $item[6];\r\n $data['insert_number'] = $item[7];\r\n $data['quantity'] = $item[8];\r\n $result = $this->service_model->add_service($data);\r\n if ($result != -1) {\r\n $vouchers_ids .= $result . \",\";\r\n $flag = true;\r\n } else if ($result == -1) {\r\n $flag = false;\r\n $result2 = $this->service_model->delete_many_services($vouchers_ids);\r\n }\r\n if ($flag != true)\r\n break;\r\n }\r\n if ($flag) {\r\n echo json_encode(array('status' => true, 'msg' => $result.\"تم إدخال البيانات بنجاح\"));\r\n } else {\r\n echo json_encode(array('status' => false, 'msg' => $result2.\"لم يتم إدخال البيانات هناك خطأ في البيانات المدخلة\"));\r\n }\r\n }\r\n }", "public function getAllowedServices()\n {\n return $this->allowed_services;\n }", "public static function updateSecurityGroups(\\PDO $dbh, int $id, array $parms, $updatedBy){\r\n $sArray = array();\r\n $stmt = $dbh->query(\"select `Group_Code` as 'Code', `Description` from `w_groups`;\");\r\n $groups = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\r\n\r\n foreach ($groups as $group) {\r\n $sArray[$group['Code']] = $group;\r\n }\r\n\r\n\r\n\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setStoredVal($id);\r\n $rows = EditRS::select($dbh, $secRS, array($secRS->idName));\r\n\r\n foreach ($rows as $r) {\r\n $sArray[$r['Group_Code']][\"exist\"] = \"t\";\r\n }\r\n\r\n $updtd = FALSE;\r\n\r\n foreach ($sArray as $code=>$g) {\r\n\t\t\t\r\n if (isset($parms[\"grpSec_\" . $code])) {\r\n\r\n if (!isset($g[\"exist\"]) && $parms[\"grpSec_\" . $code] == \"checked\") {\r\n\r\n // new group code to put into the database\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setNewVal($id);\r\n $secRS->Group_Code->setNewVal($code);\r\n $n = EditRS::insert($dbh, $secRS);\r\n\r\n NameLog::writeInsert($dbh, $secRS, $id, $updatedBy);\r\n $updtd = TRUE;\r\n\r\n } else if (isset($g[\"exist\"]) && $parms[\"grpSec_\" . $code] != \"checked\") {\r\n\r\n // group code to delete from the database.\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setStoredVal($id);\r\n $secRS->Group_Code->setStoredVal($code);\r\n $n = EditRS::delete($dbh, $secRS, array($secRS->idName, $secRS->Group_Code));\r\n\r\n if ($n == 1) {\r\n NameLog::writeDelete($dbh, $secRS, $id, $updatedBy);\r\n $updtd = TRUE;\r\n }\r\n }\r\n }\r\n }\r\n return $updtd;\r\n }", "public function getAllowedMethods($allServices) {\n\n $allowedServices = explode(\",\", core()->getConfigData('sales.carriers.mpusps.services'));\n\n foreach ($allServices as $services) {\n $allowedMethod =[];\n foreach ($services as $service) {\n\n foreach ($service as $serviceType =>$fedexService) {\n if (in_array($serviceType , $allowedServices)) {\n $allowedMethod[] = [\n $serviceType => $fedexService\n ];\n } else {\n $notAllowed[] = [\n $serviceType => $fedexService\n ];\n }\n }\n }\n\n if ($allowedMethod == null) {\n continue;\n } else {\n $allowedMethods[] = $allowedMethod;\n }\n\n }\n\n if (isset($allowedMethods)) {\n\n return $this->getCommonMethods($allowedMethods);\n } else {\n return false;\n }\n }", "public function getValidSecondaryCurrencyCodes()\n {\n return $this->getEndpoint('GetValidSecondaryCurrencyCodes');\n }", "public static function restrict_shipping_methods_by_shipclass($rates)\n {\n global $woocommerce;\n $configs = OmnivaLt_Core::get_configs();\n $settings = get_option($configs['plugin']['settings_key']);\n $cart_classes_ids = array();\n\n foreach( $woocommerce->cart->get_cart() as $cart_item ) {\n $shipping_classes = get_the_terms($cart_item['product_id'], 'product_shipping_class');\n if ( empty($shipping_classes) ) {\n continue;\n }\n foreach ( $shipping_classes as $class ) {\n $cart_classes_ids[] = $class->term_id;\n }\n }\n $cart_classes_ids = array_unique($cart_classes_ids);\n\n $restricted_shipclass = $settings['restricted_shipclass'] ?? array();\n if ( ! is_array($restricted_shipclass) ) {\n $restricted_shipclass = array($restricted_shipclass);\n }\n\n foreach ( $cart_classes_ids as $cart_product_class_id ) {\n if ( in_array($cart_product_class_id, $restricted_shipclass) ) {\n foreach ( $configs['method_params'] as $ship_method => $ship_method_values ) {\n if ( ! $ship_method_values['is_shipping_method'] ) continue;\n unset($rates['omnivalt_' . $ship_method_values['key']]);\n }\n break;\n }\n }\n\n return $rates;\n }", "public static function getCodes()\n\t{\n\t\treturn [\n\t\t\tBase::Mail,\n\t\t\tBase::Call,\n\t\t\tBase::Imol,\n\t\t\tBase::Site,\n\t\t\tBase::Site24,\n\t\t\tBase::Shop24,\n\t\t\tBase::SiteDomain,\n\t\t\tBase::Button,\n\t\t\tBase::Form,\n\t\t\tBase::Callback,\n\t\t\tBase::FbLeadAds,\n\t\t\tBase::VkLeadAds,\n\t\t\tBase::Rest,\n\t\t\tBase::Order,\n\t\t\tBase::SalesCenter,\n\t\t];\n\t}", "public function rules($serviceTransaction)\n {\n $requestStatuses = RequestStatus::pluck('id');\n\n $requestStatuses = $requestStatuses->join(',');\n\n return [\n 'request_status_id' => \"required|in:{$requestStatuses}\"\n ];\n }", "function filter_shipping( $fields_array ) {\n\t\t\t$fields_array = array_replace($fields_array, $this->update_shipping);\n\t\t\treturn array_diff_key($fields_array, array_flip($this->disabled_shipping));\n\t\t}", "public function CreateAccessCodesShared() {\n $request = array();\n $request['CancelUrl'] = $this->CancelUrl;\n $request['LogoUrl'] = $this->LogoUrl;\n $request['HeaderText'] = $this->HeaderText;\n $request['CustomerReadOnly'] = $this->CustomerReadOnly;\n $request['Customer'] = null;\n $request['ShippingAddress'] = null;\n $request['Customer'] = array(\"TokenCustomerID\" => $this->Cust_TokenCustomerID, \"Reference\" => $this->Cust_Reference, \"Title\" => $this->Cust_Title, \"FirstName\" => $this->Cust_FirstName, \"LastName\" => $this->Cust_LastName, \"CompanyName\" => $this->Cust_CompanyName, \"JobDescription\" => $this->Cust_JobDescription, \"Street1\" => $this->Cust_Street1, \"Street2\" => $this->Cust_Street2, \"City\" => $this->Cust_City, \"State\" => $this->Cust_State, \"PostalCode\" => $this->Cust_PostalCode, \"Country\" => $this->Cust_Country, \"Email\" => $this->Cust_Email, \"Phone\" => $this->Cust_Phone, \"Mobile\" => $this->Cust_Mobile, \"Comments\" => $this->Cust_Comments, \"Fax\" => $this->Cust_Fax, \"Url\" => $this->Cust_Url);\n $request['ShippingAddress'] = array(\"FirstName\" => $this->Ship_add_FirstName, \"LastName\" => $this->Ship_add_LastName, \"Street1\" => $this->Ship_add_Street1, \"Street2\" => $this->Ship_add_Street2, \"City\" => $this->Ship_add_City, \"State\" => $this->Ship_add_State, \"Country\" => $this->Ship_add_Country, \"PostalCode\" => $this->Ship_add_PostalCode, \"Email\" => $this->Ship_add_Email, \"Phone\" => $this->Ship_add_Phone, \"ShippingMethod\" => $this->Ship_add_ShippingMethod);\n $request[\"Items\"] = $this->Items;\n $request[\"Options\"] = $this->Options;\n $request[\"Payment\"] = array(\"TotalAmount\" => $this->TotalAmount, \"InvoiceNumber\" => null, \"InvoiceDescription\" => null, \"InvoiceReference\" => null, \"CurrencyCode\" => $this->CurrencyCode);\n $request[\"RedirectUrl\"] = $this->RedirectUrl;\n $request[\"Method\"] = $this->Method;\n $request[\"TransactionType\"] = $this->TransactionType;\n $request[\"CustomerIP\"] = $this->CustomerIP;\n $request[\"DeviceID\"] = $this->DeviceID;\n //$request['CardDetails'] = array(\"Name\"=>\"Krishna Bhat\", \"Number\"=>\"4444333322221111\", \"ExpiryMonth\"=>\"03\", \"ExpiryYear\"=>\"2016\", \"StartMonth\"=>null, \"StartYear\"=>null, \"IssueNumber\"=>null, \"CVN\"=>\"123\");\n //echo \"<pre>\";print_r($request);echo \"</pre><br /><br />\";die();\n $request = json_encode($request);\n //echo $request;die();\n //$request = '{\"CancelUrl\":\"http:\\/\\/ci.draftserver.com\\/countrytrack\\/rapid-3-1-eway\\/examples\\/ResponsiveSharedPage\\/\",\"LogoUrl\":\"\",\"HeaderText\":\"\",\"CustomerReadOnly\":true,\"Customer\":{\"TokenCustomerID\":null,\"Reference\":null,\"Title\":null,\"FirstName\":null,\"LastName\":null,\"CompanyName\":null,\"JobDescription\":null,\"Street1\":null,\"Street2\":null,\"City\":null,\"State\":null,\"PostalCode\":null,\"Country\":null,\"Email\":null,\"Phone\":null,\"Mobile\":null,\"Comments\":null,\"Fax\":null,\"Url\":null},\"ShippingAddress\":{\"FirstName\":null,\"LastName\":null,\"Street1\":null,\"Street2\":null,\"City\":null,\"State\":null,\"Country\":null,\"PostalCode\":null,\"Email\":null,\"Phone\":null,\"ShippingMethod\":null},\"Items\":null,\"Options\":null,\"Payment\":{\"TotalAmount\":\"100\",\"InvoiceNumber\":null,\"InvoiceDescription\":null,\"InvoiceReference\":null,\"CurrencyCode\":\"AUD\"},\"RedirectUrl\":\"http:\\/\\/ci.draftserver.com\\/countrytrack\\/rapid-3-1-eway\\/examples\\/ResponsiveSharedPage\\/\",\"Method\":\"ProcessPayment\",\"TransactionType\":\"\",\"CustomerIP\":\"202.166.198.119\",\"DeviceID\":null}';\n $response = $this->PostToRapidAPI(\"AccessCodesShared\", $request);\n return json_decode($response);\n }", "public function getSaleableStatusIds()\n {\n return [self::STATUS_ENABLED];\n }", "private function getServiceGroups(int $serviceId)\n {\n $host = Host::getInstance($this->dependencyInjector);\n $servicegroup = ServiceGroup::getInstance($this->dependencyInjector);\n $this->serviceCache[$serviceId]['sg'] = $servicegroup->getServiceGroupsForStpl($serviceId);\n foreach ($this->serviceCache[$serviceId]['sg'] as &$sg) {\n if ($host->isHostTemplate($this->currentHostId, $sg['host_host_id'])) {\n $servicegroup->addServiceInSg(\n $sg['servicegroup_sg_id'],\n $this->currentServiceId,\n $this->currentServiceDescription,\n $this->currentHostId,\n $this->currentHostName\n );\n Relations\\ServiceGroupRelation::getInstance($this->dependencyInjector)->addRelationHostService(\n $sg['servicegroup_sg_id'],\n $sg['host_host_id'],\n $serviceId\n );\n }\n }\n }", "public function multiShippingCheck($mes) {\n global $usces;\n\n if (isset($_REQUEST['offer']['payment_name'])) {\n $payments = $usces->getPayments(wp_unslash($_REQUEST['offer']['payment_name']));\n if ($this->module->getActingFlag() === $payments['settlement']) {\n if (isset($_SESSION['msa_cart'])) {\n if (\n count($_SESSION['msa_cart']) > 0 &&\n isset($_REQUEST['delivery']['delivery_flag']) &&\n (int)wp_unslash($_REQUEST['delivery']['delivery_flag']) === 2 &&\n $this->module->getMultiShippingSupport() === false\n ) {\n $mes .= sprintf(\n // translators: settlement module name\n __('%s cannot be used when multiple shipping addresses are specified.', 'smodule'),\n $this->module->getPaymentName()\n ) . '<br/>';\n }\n }\n }\n }\n\n return $mes;\n }", "public function setServiceCodeDependencyRuleGroups(?array $serviceCodeDependencyRuleGroups): self\n {\n $this->initialized['serviceCodeDependencyRuleGroups'] = true;\n $this->serviceCodeDependencyRuleGroups = $serviceCodeDependencyRuleGroups;\n\n return $this;\n }", "public static function getPartnerNonDisbursedStatuses(): Collection\n {\n $statuses = collect(self::STATUS)\n ->filter(function(string $status) {\n return starts_with($status, 'partner_') && $status !== 'partner_disbursed';\n });\n\n return self::whereIn('status', $statuses->all())->get();\n }", "public function getAllServiceProviderRequests($merchant_id) {\n $stmt1 = $this->conn->prepare(\"SELECT * FROM `declined_request` where service_provider_id = ?\");\n $stmt1->bind_param(\"i\", $merchant_id);\n $stmt1->execute();\n $stmt1->store_result();\n $num_rows = $stmt1->num_rows;\n $stmt1->close();\n if ($num_rows > 0) {\n $stmt2 = $this->conn->prepare(\"SELECT group_concat(service_request_id) as reqid FROM `declined_request` where service_provider_id = ?\");\n $stmt2->bind_param(\"i\", $merchant_id);\n $stmt2->execute();\n $stmt2->bind_result($concat);\n $stmt2->fetch();\n $stmt2->close();\n \n $stmt3 = $this->conn->prepare(\"SELECT r.* , a.latitude, a.longitude, a.addressline0, a.addressline1, a.addressline2, a.addressline3, a.locality, a.city, a.state, a.pincode, a.country FROM service_request r inner join user_address a on (r.address_id = a.id) WHERE r.id not in ( \".$concat.\" ) && r.status = 0 && r.progress = 0 ORDER by r.service_date ASC\");\n $stmt3->execute();\n $requests = $stmt3->get_result();\n $stmt3->close();\n \n return $requests;\n } else {\n $stmt4 = $this->conn->prepare(\"SELECT r.* , a.latitude, a.longitude, a.addressline0, a.addressline1, a.addressline2, a.addressline3, a.locality, a.city, a.state, a.pincode, a.country from service_request r inner join user_address a on (r.address_id = a.id) where r.status = 0 && r.progress = 0 order by r.service_date ASC\");\n $stmt4->execute();\n $requests = $stmt4->get_result();\n $stmt4->close();\n return $requests;\n }\n\n\n // $stmt = $this->conn->prepare(\"SELECT t.* FROM tasks t, user_tasks ut WHERE t.id = ut.task_id AND ut.user_id = ?\");\n // $stmt->bind_param(\"i\", $merchant_id);\n // $stmt->execute();\n // $tasks = $stmt->get_result();\n // $stmt->close();\n // return $tasks;\n }", "public static function filterIndustries()\n {\n return [\n 'Agriculture, Forestry and Fishing',\n 'Mining',\n 'Manufacturing',\n 'Electricity, Gas, Water and Waste Services',\n 'Construction',\n 'Wholesale Trade',\n 'Retail Trade',\n 'Accommodation and Food Services',\n 'Transport, Postal and Warehousing',\n 'Information Media and Telecommunications',\n 'Financial and Insurance Services',\n 'Rental, Hiring and Real Estate Services',\n 'Professional, Scientific and Technical Services',\n 'Administrative and Support Services',\n 'Public Administration and Safety',\n 'Education and Training',\n 'Health Care and Social Assistance',\n 'Arts and Recreation Services',\n 'Other Services'\n ];\n }", "public function getIsMultiple();", "private function SaveMultipleShippingAddresses()\n\t{\n\t\t// Split shipping only works for signed in users\n\t\tif(!CustomerIsSignedIn()) {\n\t\t\tredirect(getConfig('ShopPath').'/checkout.php?action=checkout');\n\t\t}\n\n\t\t// If split shipping is not available, take the customer back to the shipping address selection page\n\t\tif(!gzte11(ISC_MEDIUMPRINT) || !GetConfig('MultipleShippingAddresses') || !isset($_POST['multiaddress'])) {\n\t\t\tredirect(getConfig('ShopPath').'/checkout.php?action=choose_shipping_address&type=single');\n\t\t}\n\n\t\t$silent = false;\n\t\tif(isset($_POST['addAnotherAddress'])) {\n\t\t\t$silent = true;\n\t\t}\n\n\t\t$customerAddresses = getClass('ISC_CUSTOMER')\n\t\t\t->getCustomerShippingAddresses();\n\n\t\t$quoteItems = $this->getQuote()->getItems();\n\t\t$addressItems = array();\n\t\tforeach($quoteItems as $item) {\n\t\t\t// Digital items aren't shipped\n\t\t\tif($item->isDigital()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If we don't have an address for this product, we need to throw back to the address\n\t\t\t// selection page, as they've done something dodgy.\n\t\t\t$quantity = $item->getQuantity();\n\t\t\t$itemId = $item->getId();\n\t\t\tfor($i = 1; $i <= $quantity; ++$i) {\n\t\t\t\t$id = $itemId.'_'.$i;\n\t\t\t\tif(!isset($_POST['multiaddress'][$id]) ||\n\t\t\t\t\t!isset($customerAddresses[$_POST['multiaddress'][$id]]) && $silent == false) {\n\t\t\t\t\t\tredirect(GetConfig('ShopPath').'/checkout.php?action=choose_shipping_address&type=single');\n\t\t\t\t}\n\n\t\t\t\t$customerAddressId = $customerAddresses[$_POST['multiaddress'][$id]]['shipid'];\n\t\t\t\tif(!isset($addressItems[$customerAddressId])) {\n\t\t\t\t\t$addressItems[$customerAddressId] = array();\n\t\t\t\t}\n\t\t\t\tif(!isset($addressItems[$customerAddressId][$itemId])) {\n\t\t\t\t\t$addressItems[$customerAddressId][$itemId] = 0;\n\t\t\t\t}\n\t\t\t\t++$addressItems[$customerAddressId][$itemId];\n\t\t\t}\n\t\t}\n\n\t\t// Remove all shipping addresses on the order and start fresh\n\t\t$this->getQuote()->setIsSplitShipping(true);\n\t\t$this->getQuote()->removeAllShippingAddresses();\n\n\t\t$updatedItems = array();\n\t\t$first = true;\n\t\tforeach($addressItems as $addressId => $items) {\n\t\t\t$address = getClass('ISC_ACCOUNT')->getShippingAddress($addressId,\n\t\t\t\tgetClass('ISC_CUSTOMER')->getCustomerId()\n\t\t\t);\n\n\t\t\t// Invalid address was selected\n\t\t\tif(!$address) {\n\t\t\t\tredirect(GetConfig('ShopPath').'/checkout.php?action=choose_shipping_address&type=single');\n\t\t\t}\n\n\t\t\t// First iteration should use existing shipping address\n\t\t\tif($first) {\n\t\t\t\t$quoteShippingAddress = $this->getQuote()->getShippingAddress();\n\t\t\t\t$first = false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$quoteShippingAddress = new ISC_QUOTE_ADDRESS_SHIPPING;\n\t\t\t\t$quoteShippingAddress->setQuote($this->getQuote());\n\t\t\t\t$this->getQuote()->addShippingAddress($quoteShippingAddress);\n\t\t\t}\n\n\t\t\t$quoteShippingAddress->setAddressByArray($address);\n\n\t\t\t// If the address has custom fields, load those in too\n\t\t\tif($address['shipformsessionid']) {\n\t\t\t\t$formFields = $GLOBALS['ISC_CLASS_FORM']->getSavedSessionData(\n\t\t\t\t\t$address['shipformsessionid'],\n\t\t\t\t\tarray(),\n\t\t\t\t\tFORMFIELDS_FORM_ADDRESS\n\t\t\t\t);\n\t\t\t\t$quoteShippingAddress->setCustomFields($formFields);\n\t\t\t}\n\n\t\t\t$quoteAddressId = $quoteShippingAddress->getId();\n\t\t\tforeach($items as $itemId => $qty) {\n\t\t\t\t$item = $this->getQuote()->getItemById($itemId);\n\t\t\t\tif(!in_array($itemId, $updatedItems)) {\n\t\t\t\t\t$item->setAddressId($quoteAddressId);\n\t\t\t\t\t$item->setQuantity($qty, false);\n\t\t\t\t\t$updatedItems[] = $itemId;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$newItem = clone $item;\n\t\t\t\t\t$newItem->setQuantity($qty, false);\n\t\t\t\t\t$newItem->setAddressId($quoteAddressId);\n\t\t\t\t\t$this->getQuote()->addItem($newItem, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Do we need to go to the add address page?\n\t\tif(isset($_POST['addAnotherAddress'])) {\n\t\t\t$this_page = urlencode(\"checkout.php?action=choose_shipping_address\");\n\t\t\tredirect(getConfig('ShopPath').'/account.php?action=add_shipping_address&from='.$this_page);\n\t\t}\n\n\t\t// OK, the shipping method has been set, move on to the next step\n\t\tredirect(getConfig('ShopPath').'/checkout.php?action=choose_shipper');\n\t}", "private function groups_check(){\n\t\t\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$needed_groups = $production_formats->get_product_groups( $this->slug );\n\t\t$needed_groups_ = array_flip( $needed_groups );\n\t\t$todo_groups = $this->get_todo_groups();\n\t\tforeach ($todo_groups as $key => $value) {\t\t\n\t\t\tif ( array_key_exists( $key, $needed_groups_)) {\n\t\t\t\t$index = $needed_groups_[ $key ];\n\t\t\t\tunset($needed_groups[ $index ]);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ( count( $needed_groups) > 0) {\n\t\t\t\t\t\n\t\t}\n\t}", "function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "public function services(): BelongsToMany\n {\n return $this->morphedByMany(Service::class, 'emailable');\n }", "public function getAdminServiceIds(): array\n {\n return $this->adminServiceCodes;\n }", "public function test_get_sbps_notify_cod($carriers, $codes, $from, $to, $negative)\n {\n $shipment_status_waiting = fetch_code('shipment_status_waiting');\n $this->CI->db\n ->select('order_detail.id, order_detail.delivery_date, customer.last_name, customer.first_name, customer.mail_address_pc, customer.mail_address_mb')\n ->from('order_detail')\n ->join('contract_order', 'contract_order.id = order_detail.contract_order_id')\n ->join_subquery_start('contract', 'contract.id = contract_order.contract_id')\n ->select('id, customer_id')\n ->from('contract')\n ->where('contract.disable', self::STATUS_ENABLE)\n ->{is_array($carriers) ? 'where_in' : 'where'}('settlement_type_id', $carriers)\n ->subquery_close()\n ->join('customer', 'customer.id = contract.customer_id')\n ->join('settlement_type', 'settlement_type.id = order_detail.settlement_type_id')\n ->where('customer.disable', self::STATUS_ENABLE)\n ->where('settlement_type.disable', self::STATUS_ENABLE)\n ->where('settlement_type.column_name', Settlement_type::PAYMENT_COD)\n ->where('order_detail.disable', self::STATUS_ENABLE)\n ->where('order_detail.shipping_status_code', $shipment_status_waiting)\n ->where('contract_order.disable', self::STATUS_ENABLE);\n\n if ($negative)\n {\n if (is_array($codes))\n {\n $this->CI->db->where_not_in('contract_order.order_type_code', $codes);\n }\n else\n {\n $this->CI->db->where(sprintf(\"contract_order.order_type_code <> %d\", $codes));\n }\n }\n else\n {\n $this->CI->db->{is_array($codes) ? 'where_in' : 'where'}('contract_order.order_type_code', $codes);\n }\n\n if (empty($to))\n {\n if (!empty($from))\n {\n $this->CI->db->where(sprintf(\"order_detail.instruction_plan_date = '%s'\", addslashes($from)));\n }\n }\n else\n {\n if (!empty($from))\n {\n $this->CI->db->where(sprintf(\"order_detail.instruction_plan_date >= '%s'\", addslashes($from)));\n }\n\n $this->CI->db->where(sprintf(\"order_detail.instruction_plan_date <= '%s'\", addslashes($to)));\n }\n\n $query = $this->CI->db->get();\n $collection = $query->row_array();\n $query->free_result();\n\n /** @var array $actual */\n $query = $this->CI->contract->get_sbps_notify_cod($carriers, $codes, $from, $to, $negative);\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 getConflictedExcludingPackages() {\n\t\t$conflictedPackages = array();\n\t\t$sql = \"SELECT\t\tpackage.*, package_exclusion.*\n\t\t\tFROM\t\twcf\".WCF_N.\"_package_exclusion package_exclusion\n\t\t\tLEFT JOIN\twcf\".WCF_N.\"_package package\n\t\t\tON\t\t(package.packageID = package_exclusion.packageID)\t\n\t\t\tWHERE\t\texcludedPackage = '\".$this->packageInfo['name'].\"'\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\tif (!empty($row['excludedPackageVersion'])) {\n\t\t\t\tif (Package::compareVersion($this->packageInfo['version'], $row['excludedPackageVersion'], '<')) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$conflictedPackages[$row['packageID']] = $row;\n\t\t}\n\t\t\n\t\treturn $conflictedPackages;\n\t}", "public function getServices()\n\t{\n\t\treturn ['card', 'topup_mobile', 'topup_mobile_post', 'topup_game'];\n\t}", "public function getCcAvailableTypes()\n {\n //Listando apenas cielo pois já contem todas as bandeiras\n $_types = Mage::getModel('gwap/source_cctypes_cielo')->toOptionArray();\n //$_types[] = Mage::getModel('gwap/source_cctypes_redecard')->toOptionArray();\n \n $types = array();\n foreach ($_types as $data) {\n if (isset($data['label']) && isset($data['value']) && $data['value']!='') {\n $types[substr_replace($data['value'],'',-2)] = $data['label'];\n }\n }\n \n if ($method = $this->getMethod()) {\n //Armazena os cartões habilitados nas duas operadoras\n $availableTypes = $method->getConfigData('cctypes_rcard');\n $availableTypes .= ','.$method->getConfigData('cctypes_cielo');\n \n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n $allTypes = array();\n // Remove 2 ultimos caracteres do cartão\n foreach($availableTypes as $substype){\n $allTypes[] = substr_replace($substype,'',-2);\n }\n //Compara com cartões disponíveis\n foreach ($types as $code=>$name) {\n if (!in_array($code, $allTypes)) {\n unset($types[$code]);\n }\n }\n }\n }\n return $types;\n }", "function edd_social_discounts_get_shared_product_ids() {\n\t// get all discount IDs\n\t$discounts = edd_get_discounts();\n\t$discount_ids = array();\n\t$share_ids = array();\n\t\n\tif ( $discounts ) {\n\t\tforeach ( $discounts as $discount ) {\n\t\t\t$discount_ids[] = $discount->ID;\n\t\t}\n\t}\n\n\tforeach ( $discount_ids as $id ) {\n\t\t$products = get_post_meta( $id, '_edd_discount_social_discount_products', true );\n\n\t\tif ( $products ) {\n\t\t\tforeach ($products as $product) {\n\t\t\t\tarray_push( $share_ids, $product );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (array) apply_filters( 'edd_social_discounts_get_share_array', $share_ids );\n}", "public function groupIds();", "public function getOptionGroupIdsOfSellerProduct($sp_id)\n\t{\n\t\t//options of a product\n\t\t$sp_options = SPOptionRelation::with('option.optionGroup')->where('sp_id','=',$sp_id)->get();\n\t\t$option_groups = [];\n\t\tforeach ($sp_options as $key => $sp_option) {\n\t\t\t$og = ucfirst($sp_option->option->optionGroup->option_g_id);\n // dd($og);\n\t\t\tif(!array_has($option_groups,$og)){\n\t\t\t\t$option_groups[$og]=array();\n\t\t\t}\n\t\t}\n\t}", "public function usergroupConditionDoesNotMatchDefaulUserGroupIds() {}", "public function getConflictedExcludedPackages() {\n\t\t$conflictedPackages = array();\n\t\tif (count($this->excludedPackages) > 0) {\n\t\t\t$sql = \"SELECT\t*\n\t\t\t\tFROM\twcf\".WCF_N.\"_package\n\t\t\t\tWHERE\tpackage IN ('\".implode(\"','\", array_keys($this->excludedPackages)).\"')\";\n\t\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\tif (!empty($this->excludedPackages[$row['package']]['version'])) {\n\t\t\t\t\tif (Package::compareVersion($row['packageVersion'], $this->excludedPackages[$row['package']]['version'], '<')) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$conflictedPackages[$row['packageID']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $conflictedPackages;\n\t}", "function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}", "public static function getExcludedChannelCodes()\n {\n if (!static::canUse()) {\n return array();\n }\n\n static $codes = null;\n if ($codes === null) {\n $codes = ImConnector\\Connector::getListConnectorNotNewsletter();\n }\n\n return $codes;\n }", "function instance_allow_multiple() {\n return false;\n }", "function instance_allow_multiple() {\n return false;\n }", "function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['preDel']=array('rw','rwv','admin');\n $g['dashboard']=array('ro','rw','rwv','admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "function testNotAllowedCommunityAppsArray()\n {\n \t$appid = XiptLibApps::getNotAllowedCommunityAppsArray(1);\n \t$result = array(44, 48, 50);\n \t$this->assertEquals($appid, $result);\n \t\n \t//return array of appid for Profiletype 2\n \t$appid = XiptLibApps::getNotAllowedCommunityAppsArray(2);\n \t$result = array(47, 46, 49);\n \t$this->assertEquals($appid, $result);\n \t\n \t//return array of appid for Profiletype 3\n \t$appid = XiptLibApps::getNotAllowedCommunityAppsArray(3);\n \t$result = array(44, 45, 49, 50);\n \t$this->assertEquals($appid, $result);\n \t\n \t//return array of appid for Profiletype 4\n \t$appid = XiptLibApps::getNotAllowedCommunityAppsArray(4);\n \t$result = array(44, 49, 50);\n \t$this->assertEquals($appid, $result);\n }", "public function inactive_client_cache_services($service_name)\r\n\t{\r\n\t\t$inactive_cache = array('SEARCH', 'GETCALENDARFARE', 'FARERULE');\r\n\t\t//$inactive_cache = array();\r\n\t\tif(in_array(strtoupper($service_name), $inactive_cache) == true){\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['index']=array('ro','rw','rwv','admin');\n $g['clearStats']=array('admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "public function getGroupsAttribute(){\n // ------------------------------------------------------------------\n $groups = array();\n $types = config('const.COMPANY_TYPES');\n // ------------------------------------------------------------------\n\n // ------------------------------------------------------------------\n // Get company types\n // ------------------------------------------------------------------\n if( !empty( $types )) foreach( $types as $name => $type ){\n if( !empty( $this->{ $type })) $groups[] = __( 'label.$company.type.'. $name );\n }\n // ------------------------------------------------------------------\n return join( ', ', $groups );\n // ------------------------------------------------------------------\n }", "public function getServiceAreaSpecification($service_id)\n {\n $result = DB::table('member_package_services')->select('area_specification')->whereIn('id', explode(\",\", $service_id))->get();\n $result = json_decode(json_encode($result), true);\n $result = array_column($result, 'area_specification');\n $unique_area_specifications = [];\n foreach ($result as $value) {\n if (!empty($value)) {\n $array = explode(\",\", $value);\n $unique_area_specifications = array_merge($unique_area_specifications, $array);\n }\n }\n return array_unique($unique_area_specifications);\n }", "public function getMapShippingTypes()\n {\n return $this->map_shipping_types;\n }", "public static function validateResponse_GroupForArrayConstraintsFromSetResponse_Group(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem) {\n // validation for constraint: itemType\n if (!$get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem instanceof \\WorkdayWsdl\\\\StructType\\Workers_Compensation_Code_Response_GroupType) {\n $invalidValues[] = is_object($get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem) ? get_class($get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem) : sprintf('%s(%s)', gettype($get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem), var_export($get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Response_Group property can only contain items of type \\WorkdayWsdl\\\\StructType\\Workers_Compensation_Code_Response_GroupType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['preConvertCoords']=array('ro', 'rw', 'rwv', 'admin');\n $g['procConvertCoords']=array('ro', 'rw', 'rwv', 'admin');\n $g['convertCoords']=array('none', 'ro', 'rw', 'rwv', 'admin');\n $g['geoSearch']=array('ro', 'rw','rwv','admin');\n $g['simpleLayerKML']=array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['rawLayer']=array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['geoCodeAuto']=array('admin');\n $g['procStat']=array('ro', 'rw', 'rwv', 'admin');\n $g['simpleMap'] = array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['simpleMap2'] = array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['xPoiList'] = array('ro', 'rw', 'rwv', 'admin');\n $g['xDisplayMarker'] = array('none', 'ro', 'rw', 'rwv', 'admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['clean_cache']=array('admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n else return $g[$function];\n }\n return false;\n }", "function secGroups($function, $group=NULL) {\n $g=array();\n if (true || $_SERVER['REMOTE_ADDR'] == '80.13.99.120' || $_SERVER['REMOTE_ADDR'] == '78.231.77.57'){\n $g['tests'] = array('none');\n }\n $g['wtsCheckLine'] = array('none');\n $g['ajaxMotDePasse'] = array('none');\n $g['wtsLireOffres'] = array('none');\n $g['viewOffre'] = array('none');\n $g['wtscommande']=array('none');\n $g['wtssaisieforfaits']=array('none');\n $g['wtsCtrlSaisieForfaits'] = array('none');\n $g['wtsCaddieDisp']=array('none');\n $g['wtsAjaxCaddieDisp'] = array('none');\n $g['wtsadd2caddie']=array('none');\n $g['wtsCaddieSuppr']=array('none');\n $g['wtsCaddieToggleLine']=array('none');\n $g['wtsCaddieSupprPack']=array('none'); // a tester\n $g['wtsPreValidateOrder'] = array('none');\n $g['wtsDevis'] = array('none');\n $g['wtsCtrlValidateOrder'] = array('none');\n $g['wtsValidateOrder'] = array('none');\n $g['wtsCtrlValidateCustomerCreation'] = array('none');\n $g['wtsValidateCustomerCreation'] = array('none');\n $g['wtsPrePaiement'] = array('none');\n $g['wtsDisplayOrder'] = array('none');\n $g['wtsCheckWTP'] = array('none');\n $g['wtsAddCard'] = array('none');\n $g['wtsPaiementZero'] = array('none');\n $g['wtsPaiementCheque'] = array('none');\n $g['wtsAdhesion'] = array('none');\n $g['wtsUseReduction'] = array('none');\n \n $g['checkStructures'] = array('admin');\n $g['repairStructures'] = array('admin');\n $g['repairOneStructure'] = array('admin');\n $g['checkSets'] = array('admin');\n $g['verifgrps'] = array('admin');\n $g['verifVentePro'] = array('admin');\n $g['checkEPLProducts'] = array('admin');\n\n $g['getCaddie'] = array('none');\n \n $g['procAuthGroup'] = array('none');\n $g['closeAuthGroup'] = array('none');\n $g['ajaxProcAuthMembre'] = array('none'); // non ecrite\n $g['initCurrentUser'] = array('none');\n $g['closeAuthMembre'] = array('none');\n\n // fonctions de la vente pro\n $g['wtsprolistewtp'] = array('none'); // ro normalement\n $g['wtsproadd2caddie'] = array('none'); // ro normalement\n $g['wtsProPaiement'] = array('none');\n $g['wtsProCancelOrder'] = array('none');\n $g['proAccount'] = array('none');\n // fonctions de la gestion des comtpes clients\n $g['myAccount'] = array('none');\n $g['procCreateMyAccount'] = array('none');\n $g['procEditMyAccount'] = array('none');\n $g['procEditProAccount'] = array('none');\n\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function, $group);\n }", "public function getProductCombinations($onlyAvailable = true)\n {\n $this->_reset();\n $combinations = array();\n\n if ($onlyAvailable) {\n $this->addDateFilter();\n }\n\n $this->getSelect()->reset(Varien_Db_Select::COLUMNS);\n $this->join(\n array('psa' => 'deutschepost_prodws/product_sales_additional'),\n 'psa.salesproduct_id = main_table.salesproduct_id',\n array('main_table.salesproduct_id', 'main_table.basicproduct_id', 'psa.additionalproduct_id')\n );\n\n foreach ($this->getData() as $row) {\n if (!isset($combinations[$row['salesproduct_id']])) {\n $combinations[$row['salesproduct_id']] = array(\n 'product' => $row['basicproduct_id'],\n 'services' => array($row['additionalproduct_id']),\n );\n } else {\n $combinations[$row['salesproduct_id']]['services'][]= $row['additionalproduct_id'];\n }\n }\n\n return $combinations;\n }", "public function getComboSubservicios()\n {\n return $this->comboSubservicios;\n }", "function sv_wc_pip_packing_list_grouping( $group_items, $order_id, $document_type ) {\n\t// bail unless we're looking at a pick list\n\tif ( 'pick-list' !== $document_type ) {\n\t\treturn $group_items;\n\t}\n\t$order = wc_get_order( $order_id );\n\tif ( ! $order->is_paid() ) {\n\t\treturn false;\n\t}\n\treturn $group_items;\n}", "public function shareService ()\n {\n \n $list = $this->services->findAll();\n return $list;\n }", "protected function groupByCampaignTypeNotCampaign() {\n if (!empty($this->_groupByArray)) {\n if (!in_array('campaign.id', $this->_groupByArray)) {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function isMultiAddressDelivery(){\n static $cache = null;\n\n if (is_null($cache)) {\n $db = JFactory::getDBO();\n\n $query = \"SELECT count(distinct address_delivery_id) FROM \" . $db->quoteName('#__jeproshop_cart_product');\n $query .= \" AS cart_product WHERE cart_product.cart_id = \" . (int)$this->cart_id;\n\n $db->setQuery($query);\n $cache = (bool)($db->loadResult() > 1);\n }\n return $cache;\n }", "private function joinShipments($shipmentArray, $addSHPTest)\n {\n\n $stringresponse = 'om_f.shipment in ';\n $i = 1;\n $shipmentArray=array_unique($shipmentArray);\n sort($shipmentArray);\n $totalitems = count($shipmentArray);\n foreach ($shipmentArray as $item) {\n\n\n if ($i == 1 && $totalitems == 1) {\n return $stringresponse .= \"('\" . $this->addSHP($item, $addSHPTest) . \"')\";\n } elseif ($i == 1) {\n $stringresponse .= \"('\" . $this->addSHP($item, $addSHPTest) . \"',\";\n } elseif ($i == $totalitems) {\n $stringresponse .= \"'\" . $this->addSHP($item, $addSHPTest) . \"')\";\n } else {\n $stringresponse .= \"'\" . $this->addSHP($item, $addSHPTest) . \"',\";\n }\n\n $i++;\n }\n return $stringresponse;\n\n }", "public static function getSubscribedServices()\n {\n return array_merge(\n parent::getSubscribedServices(), [\n 'comsa_booking_payment_method_mollie' => MollieType::class,\n ]\n );\n }", "public static function exclusive()\n {\n // Change setting\n self::$settings['exclude'] = true;\n\n // Return exclusion list\n return self::$exclude;\n }", "function getfaircoin_edd_unset_other_gateways( $gateway_list ) {\r\n $download_ids = edd_get_cart_contents();\r\n if ( ! $download_ids )\r\n return $gateway_list;\r\n $download_ids = wp_list_pluck( $download_ids, 'id' );\r\n\r\n if ( $download_ids ) {\r\n foreach ( $download_ids as $id ) {\r\n $gatoWay = get_post_meta( $id, '_edd_gateway', true);\r\n //echo ':'.$gatoWay.':';//print $gatoWay;\r\n foreach ( $gateway_list as $key => $val) {\r\n if ( $key !== $gatoWay) {\r\n if ( $gatoWay == 'coopshares_mixed' && $key == 'coopshares_transfer' ) {\r\n // to let choose at checkout one or the other\r\n } elseif ( ($gatoWay == 'fc2invest_mixed' && $key == 'fc2invest_transfer') || ($gatoWay == 'fc2invest_mixed' && $key == 'localnode') ) {\r\n\r\n // to let choose at checkout one or the other\r\n\r\n } elseif ( ($gatoWay == 'fairmarket_mixed' && $key == 'fairmarket_transfer') ) { //|| ($gatoWay == 'fairmarket_mixed' && $key == 'localnode') ) {\r\n\r\n // to let choose at checkout one or the other\r\n\r\n } else {\r\n unset( $gateway_list[ $key ] );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $gateway_list;\r\n}", "protected function getGroups()\n {\n $groups = parent::getGroups();\n\n // If an ID is already selected, we don't want the auto-generate option:\n if (!empty($this->value)) {\n unset($groups[0][1]);\n }\n\n return $groups;\n }", "public function isMutipleMatching()\n {\n return $this->mutipleMatching;\n }", "public function checkShipment($items) {\n if (!is_array($items)) {\n return 0;\n }\n $arItems = array();\n $arStockItems = array();\n $orderItems = Mage::getModel('sales/order_item')\n ->getCollection()\n ->addFieldToFilter('item_id', array('in' => array_keys($items)));\n if ($orderItems->getSize()) {\n foreach ($orderItems as $orderItem) {\n $arItems[$orderItem->getId()] = $orderItem;\n $arStockItems[$orderItem->getProductId()] = $orderItem->getProductId();\n }\n }\n\n $stockItems = Mage::getModel('cataloginventory/stock_item')\n ->getCollection()\n ->addFieldToFilter('product_id', array('in' => array_keys($arStockItems)));\n if ($stockItems->getSize()) {\n foreach ($stockItems as $stockItem) {\n $arStockItems[$stockItem->getProductId()] = $stockItem;\n }\n }\n foreach ($items as $item_id => $qty) {\n $item = $arItems[$item_id];\n $stockItem = $arStockItems[$item->getProductId()];\n $manageStock = $stockItem->getManageStock();\n if ($stockItem->getUseConfigManageStock()) {\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock', Mage::app()->getStore()->getStoreId());\n }\n if (!$manageStock) {\n continue;\n }\n if (in_array($item->getProductType(), array('configurable', 'bundle', 'grouped', 'virtual', 'downloadable')))\n continue;\n\n if ($this->selectWarehouseToShip($item->getProductId(), $qty) == 0) {\n return 0;\n };\n }\n return 1;\n }", "protected function _customerGroups()\n\t{\n\t\t$customerGroup = $this->_customGroupCollectionFactory->create();\n\t\treturn $customerGroup->getAllIds();\t\t\n\t}", "public function List_canceled_services($user_master_id)\n\t{\n\t\t$sQuery = \"SELECT\n\t\t\t\t\tA.id,\n\t\t\t\t\tA.service_location,\n\t\t\t\t\tDATE_FORMAT(A.order_date, '%W %M %e %Y') as order_date,\n\t\t\t\t\tA.status,\n\t\t\t\t\tB.main_cat_name,\n\t\t\t\t\tB.main_cat_ta_name,\n\t\t\t\t\tC.sub_cat_name,\n\t\t\t\t\tC.sub_cat_ta_name,\n\t\t\t\t\tD.service_name,\n\t\t\t\t\tD.service_ta_name,\n\t\t\t\t\tE.from_time,\n\t\t\t\t\tE.to_time\n\t\t\t\tFROM\n\t\t\t\t\tservice_orders A,\n\t\t\t\t\tmain_category B,\n\t\t\t\t\tsub_category C,\n\t\t\t\t\tservices D,\n\t\t\t\t\tservice_timeslot E\n\t\t\t\tWHERE\n\t\t\t\t\t A.serv_pers_id = '\".$user_master_id.\"' AND A.status = 'Canceled' AND A.`main_cat_id` = B.id AND A.`sub_cat_id` = C.id AND A.`service_id` = D.id AND A.`order_timeslot` = E.id\";\n\t\t$serv_result = $this->db->query($sQuery);\n\t\t$service_result = $serv_result->result();\n\n\t\tif($serv_result->num_rows()>0) {\n\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"Service Order List\", \"list_services_order\"=>$service_result);\n\t\t} else {\n\t\t\t$response = array(\"status\" => \"error\", \"msg\" => \"Service Order List Not found\");\n\t\t}\n\t\treturn $response;\n\t}", "function attendance_get_sharedipoptions() {\n $options = array();\n $options[ATTENDANCE_SHAREDIP_DISABLED] = get_string('no');\n $options[ATTENDANCE_SHAREDIP_FORCE] = get_string('yes');\n $options[ATTENDANCE_SHAREDIP_MINUTES] = get_string('setperiod', 'attendance');\n\n return $options;\n}", "public function getServiceGroupsForService(int $hostId, int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtServiceSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtServiceSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\n AND (host_host_id = :host_id OR host_host_id IS NULL)\"\n );\n }\n $this->stmtServiceSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtServiceSg->bindParam(':host_id', $hostId, PDO::PARAM_INT);\n $this->stmtServiceSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtServiceSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public function getTypes(SecurityContext $securityContext) {\n $security = array();\n// dump($this->container->getParameter('block_security'));\n// exit;\n foreach ($this->container->getParameter('block_security') as $role => $services) {\n foreach ($services as $service) {\n $security[$service] = $role;\n }\n }\n// $disabledBlocks = $this->container->getParameter('block_disabled');\n\n uasort($this->services, function($a, $b) {\n if ($a['grouporder'] == $b['grouporder']) {\n if ($a['ordre'] == $b['ordre']) return 0;\n return $a['ordre'] > $b['ordre'] ? 1 : -1;\n }\n return $a['grouporder'] > $b['grouporder'] ? 1 : -1;\n });\n// uasort($this->services, function($a, $b) {\n// if($a['ordre'] == $b['ordre']) return 0;\n// return $a['ordre'] > $b['ordre'] ? 1 : -1;\n// });\n\n// dump($this->services);\n// exit;\n\n $list = [];\n foreach ($this->services as $name => $service) {\n if ($service['service'] instanceof BlockServiceInterface) {\n\n if (isset($security[$name]) && $securityContext->isGranted($security[$name])) { // AND !in_array($name, $disabledBlocks)\n $list[$service['group']][$name] = $service['service']->getName();\n }\n }\n }\n\n\n\n return $list;\n }", "public function changeSwappRequestDataProvider(){\n\n // scenarios data\n // 2 means that response to request should be 200 or 304\n // 3 means that response to request needs to be 304\n // 4 means that response to request should be 404\n return [\n \"1. case: \" => [5, \"ACCEPTED\", 2],\n \"1b. case: \" => [5, \"ACCEPTED\", 3],\n \"2. case: \" => [\"8\", \"DECLINED\", 2],\n \"3. case: \" => [\"num\", \"ACCEPTED\", 4],\n \"4. case: \" => [null, \"DECLINED\", 4],\n \"5. case: \" => [array(5,1122), \"ACCEPTED\", 4],\n \"6. case: \" => [12, \"declined\", 2],\n \"7. case: \" => [12, \"Declined\", 2],\n \"8. case: \" => [12, 5, 4],\n \"9. case: \" => [12, \"UNKNOWN\", 4],\n ];\n }", "public static function getGroups(): array\n {\n return [\"group2\"];\n }", "public static function duplicate($service) {\n\n $serviceid = $service->id;\n\n // duplicate service\n $newservice = ORM::forTable('service')->create();\n Admin::duplicateRecord($service, $newservice);\n $newservice->code = \"CHANGE\";\n $newservice->date = date(\"Y-m-d\");\n $newservice->visible = 0;\n $newservice->save();\n $newserviceid = $newservice->id();\n\n // duplicate destinations\n // create a map of old to new ids\n $destmap = array();\n $destinations = ORM::forTable('destination')->where('serviceid', $serviceid)->findMany();\n if ($destinations) {\n foreach ($destinations as $destination) {\n $newdestination = ORM::forTable('destination')->create();\n Admin::duplicateRecord($destination, $newdestination);\n $newdestination->serviceid = $newserviceid;\n $newdestination->save();\n $destmap[$destination->id] = $newdestination->id();\n }\n }\n\n // duplicate pricebandgroup\n // create a map of old to new ids\n $pbmap = array();\n $pricebandgroups = ORM::forTable('pricebandgroup')->where('serviceid', $serviceid)->findMany();\n if ($pricebandgroups) {\n foreach ($pricebandgroups as $pricebandgroup) {\n $newpricebandgroup = ORM::forTable('pricebandgroup')->create();\n $newpricebandgroup->serviceid = $newserviceid;\n $newpricebandgroup->name = $pricebandgroup->name;\n $newpricebandgroup->save();\n $pbmap[$pricebandgroup->id] = $newpricebandgroup->id();\n }\n }\n\n // duplicate joining\n $joinings = ORM::forTable('joining')->where('serviceid', $serviceid)->findMany();\n if ($joinings) {\n foreach ($joinings as $joining) {\n $newjoining = ORM::forTable('joining')->create();\n Admin::duplicateRecord($joining, $newjoining);\n $newjoining->serviceid = $newserviceid;\n if (empty($pbmap[$joining->pricebandgroupid])) {\n throw new Exception('No pricebandgroup mapping exists for id = ' . $joining->pricebandgroupid);\n }\n $newjoining->pricebandgroupid = $pbmap[$joining->pricebandgroupid];\n $newjoining->save();\n }\n }\n\n // duplicate pricebands\n $pricebands = ORM::forTable('priceband')->where('serviceid', $serviceid)->findMany();\n if ($pricebands) {\n foreach ($pricebands as $priceband) {\n if (empty($pbmap[$priceband->pricebandgroupid])) {\n throw new Exception('No pricebandgroup mapping exists for id = ' . $priceband->pricebandgroupid);\n }\n $newpriceband = ORM::forTable('priceband')->create();\n Admin::duplicateRecord($priceband, $newpriceband);\n $newpriceband->serviceid = $newserviceid;\n if (empty($destmap[$priceband->destinationid])) {\n throw new Exception('No destination mapping exists for id = ' . $priceband->destinationid);\n }\n $newpriceband->destinationid = $destmap[$priceband->destinationid];\n if (empty($pbmap[$priceband->pricebandgroupid])) {\n throw new Exception('No pricebandgroup mapping exists for id = ' . $priceband->pricebandgroupid);\n }\n $newpriceband->pricebandgroupid = $pbmap[$priceband->pricebandgroupid];\n $newpriceband->save();\n }\n }\n\n // duplicate limits\n $limits = ORM::forTable('limits')->where('serviceid', $serviceid)->findOne();\n if ($limits) {\n $newlimits = ORM::forTable('limits')->create();\n Admin::duplicateRecord($limits, $newlimits);\n $newlimits->serviceid = $newserviceid;\n $newlimits->save();\n }\n\n return $newservice;\n }", "public function getGroupCandidates(){\n\t\t$groups = GroupQuery::create()\n\t\t\t\t\t \t\t\t->select(\"Id\")\n\t\t\t\t\t\t\t\t->filterByUser($this)\n\t\t\t\t\t\t\t\t->find(); \n\n\t\t$candidates = GroupQuery::create()\n\t\t\t\t\t\t\t\t\t\t\t->filterById($groups, Criteria::NOT_IN)\n\t\t\t\t\t\t\t\t\t\t\t->find();\n\t\treturn $candidates;\n\t}", "public function getExcludedIds();", "public function test_chainedNoMask()\n {\n //signature\tsignaturesignature\t#Ђ#M#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMask:getServiceWithoutMask:#K#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\TestService.CLASS_NAME|?\n\n $testService = $this->classBroker->getClassWithoutMask(ServiceBroker::CLASS_NAME)->getServiceWithoutMask(TestService::CLASS_NAME);\n//signature\t#M#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMask.getServiceWithoutMask|#☘#M#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMask.getServiceWithoutMaskª#K#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\TestService.CLASS_NAME♣|#M#☘#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMaskª#K#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ServiceBroker.CLASS_NAME♣.getServiceWithoutMask\n $testService->run();\n }" ]
[ "0.58850074", "0.49553943", "0.49392864", "0.4848271", "0.48201522", "0.4686679", "0.4649376", "0.46396685", "0.46146575", "0.45713502", "0.4563714", "0.45408788", "0.44908535", "0.44529673", "0.44430092", "0.44409707", "0.4421516", "0.4421516", "0.4415551", "0.44083655", "0.44073927", "0.43989298", "0.43979347", "0.4395287", "0.4394417", "0.4393479", "0.43905038", "0.43810615", "0.43128577", "0.4287851", "0.42869803", "0.42824492", "0.42804116", "0.4278512", "0.427838", "0.42625868", "0.4260789", "0.423316", "0.4217495", "0.42173162", "0.42165166", "0.42133814", "0.4208584", "0.42018506", "0.41985294", "0.4194262", "0.41937718", "0.41839752", "0.41784513", "0.41730896", "0.41711226", "0.41627386", "0.41624835", "0.41572037", "0.41564703", "0.41555667", "0.41540396", "0.41507608", "0.41507608", "0.41507608", "0.4143999", "0.4143999", "0.4143999", "0.4143999", "0.4143999", "0.4137906", "0.41369212", "0.4131932", "0.4129261", "0.41280925", "0.4124924", "0.41223863", "0.41222417", "0.41210458", "0.41177496", "0.41143882", "0.41072804", "0.4107211", "0.41057605", "0.41038075", "0.40952387", "0.40920442", "0.40901932", "0.4085275", "0.4083166", "0.40785843", "0.40772462", "0.40711144", "0.4070959", "0.40701327", "0.40695915", "0.40639833", "0.40620732", "0.4059036", "0.40587986", "0.40587482", "0.40565148", "0.40558302", "0.40477565", "0.40451816" ]
0.62914324
0
Group of serviceCodes that are mutually exclusive. Only one serviceCode among the list must be applied for a shipment.
public function setServiceCodeMutuallyExclusiveGroups(?array $serviceCodeMutuallyExclusiveGroups): self { $this->initialized['serviceCodeMutuallyExclusiveGroups'] = true; $this->serviceCodeMutuallyExclusiveGroups = $serviceCodeMutuallyExclusiveGroups; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getServiceCodeMutuallyExclusiveGroups(): ?array\n {\n return $this->serviceCodeMutuallyExclusiveGroups;\n }", "private function _serviceEliminateDuplicates()\n {\n return Mage::getModel('mmdebugging_blockinformation_service/match_text_eliminateduplicates', array(\n 'form' => $this->getForm(),\n 'parent_service' => $this,\n ));\n }", "public function getServiceCodeDependencyRuleGroups(): ?array\n {\n return $this->serviceCodeDependencyRuleGroups;\n }", "function build_servicegroups_array()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\t\n\t$servicegroups = $NagiosData->getProperty('servicegroups');\t\t\t\n\t$services = $NagiosData->getProperty('services');\t\t\n\t$services = user_filtering($services,'services'); \n\t\n\t$servicegroups_details = array(); //multi-dim array to hold servicegroups \t\n\tforeach($servicegroups as $groupname => $members)\n\t{\n\t\t$servicegroups_details[$groupname] = array();\n \t\t//array_dump($members); \n\t\tforeach($services as $service)\n\t\t{\t\n\t\t\tif(isset($members[$service['host_name']]) && in_array($service['service_description'],$members[$service['host_name']]))\t{\n\t\t\t\tprocess_service_status_keys($service);\t\t\n\t\t\t\t$servicegroups_details[$groupname][] = $service;\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}\n\n\treturn $servicegroups_details; \n}", "public function getAllServices_crm() {\r\n\t\t$billingServicesObj = new billing_SERVICES();\r\n $services = $billingServicesObj->getAllServiceDataForActiveServices();\r\n foreach ($services as $key=>$val) {\r\n if (strpos($val[\"SERVICEID\"], 'M') && $val[\"SERVICEID\"] != 'M3' && $val[\"SERVICEID\"] != 'M') {\r\n \tunset($services[$key]);\r\n }\r\n }\r\n return $services;\r\n }", "public function findServiceGroups(): array;", "public function servicesArray()\n {\n return [\n self::PAINTING,\n self::TIRE,\n self::BODY_WORK,\n self::TO,\n self::WASHING,\n ];\n }", "private function supverisorGroupId(){\n return array('1');\n }", "public function getShippingServices($intShippingId = 0)\n {\n if (!$intShippingId)\n return 0;\n //Set the shipstation mapping with the X-Cart.\n $arrShippingServices = array(\n '5' => 'USPS_USPPM',//USPS Priority Mail\n '6' => 'USPS_USPEXP',//USPS Priority Mail Express\n '7' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '8' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '10' => 'USPS_USPFC',//USPS First Class Mail\n '11' => 'USPS_USPMM',//USPS Media Mail\n '13' => 'USPS_USPPM',//USPS Priority Mail\n '14' => 'USPS_USPEXP',//USPS Priority Mail Express\n '15' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '16' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '18' => 'USPS_USPFC',//USPS First Class Mail\n '19' => 'USPS_USPMM',//USPS Media Mail\n '21' => 'USPS_USPPM',//USPS Priority Mail\n '22' => 'USPS_USPEXP',//USPS Priority Mail Express\n '23' => 'USPS_USPEMI',//USPS Priority Mail Express Intl\n '24' => 'USPS_USPPMI',//USPS Priority Mail Intl\n '26' => 'UPS_UPSGND',//UPS® Ground\n '27' => 'UPS_UPS3DS',//UPS 3 Day Select®\n '28' => 'UPS_UPS2ND',//UPS 2nd Day Air®\n '29' => 'WEXPP',//UPS Worldwide Express Plus®\n '30' => 'UPS_UPSWEX',//UPS Worldwide Express®\n '31' => 'UPS_UPSNDS',//UPS Next Day Air Saver®\n '32' => 'UPS_UPSNDA',//UPS Next Day Air®\n '33' => 'UPS_UPSWEP',//UPS Worldwide Expedited®\n '34' => 'UPS_UPSWSV',//UPS Worldwide Saver®\n '35' => 'UPS_UPSCAN',//UPS Standard®\n '36' => 'UPS_UPS2DE',//UPS 2nd Day Air AM®\n '37' => 'UPS_UPSNDE',//UPS Next Day Air® Early\n '50' => 'FEDEX_GROUND',//FedEx Ground®\n '51' => 'GROUND_HOME_DELIVERY',//FedEx Home Delivery®\n '52' => 'FEDEX_2_DAY',//FedEx 2Day®\n '53' => 'FEDEX_2_DAY_AM',//FedEx 2Day® A.M.\n '54' => 'FEDEX_EXPRESS_SAVER',//FedEx Express Saver®\n '55' => 'STANDARD_OVERNIGHT',//FedEx Standard Overnight®\n '56' => 'PRIORITY_OVERNIGHT',//FedEx Priority Overnight®\n '57' => 'FIRST_OVERNIGHT',//FedEx First Overnight®\n '59' => 'INTERNATIONAL_ECONOMY',//FedEx International Economy®\n '60' => 'INTERNATIONAL_PRIORITY',//FedEx International Priority®\n '61' => 'INTERNATIONAL_FIRST',//FedEx International First®\n '67' => 'FEDEX_1_DAY_FREIGHT',//FedEx 1Day® Freight\n '68' => 'FEDEX_2_DAY_FREIGHT',//FedEx 2Day® Freight\n '69' => 'FEDEX_3_DAY_FREIGHT',//FedEx 3Day® Freight\n '70' => 'INTERNATIONAL_ECONOMY_FREIGHT',//FedEx International Economy® Freight\n '71' => 'INTERNATIONAL_PRIORITY_FREIGHT',//FedEx International Priority® Freight\n '73' => 'FEDEX_FDXIGND',//FedEx International Ground®\n '98' => 'DOM.RP',//Regular Parcel\n '99' => 'DOM.EP',//Expedited Parcel\n '100' => 'DOM.XP',//Xpresspost\n '101' => 'DOM.XP.CERT',//Xpresspost Certified\n '102' => 'DOM.PC',//Priority\n '103' => 'DOM.LIB',//Library Books\n '104' => 'USA.EP',//Expedited Parcel USA\n '105' => 'USA.PW.ENV',//Priority Worldwide Envelope USA\n '106' => 'USA.PW.PAK',//Priority Worldwide pak USA\n '107' => 'USA.PW.PARCEL',//Priority Worldwide Parcel USA\n '115' => 'INT.PW.ENV',//Priority Worldwide Envelope Intl\n '116' => 'INT.PW.PAK',//Priority Worldwide pak Intl\n '117' => 'INT.PW.PARCEL',//Priority Worldwide parcel Intl\n '118' => 'INT.SP.AIR',//Small Packet International Air\n '119' => 'INT.SP.SURF',//Small Packet International Surface\n '120' => 'INT.TP',//Tracked Packet - International\n '2700' => 'USPS_USPFC',//USPS First Class Mail\n '2701' => 'USPS_USPMM',//USPS Media Mail\n '2709' => 'USPS_USPPM',//USPS Priority Mail\n '2732' => 'USPS_USPPMI',//USPS Priority Mail International\n '2735' => 'USPS_USPEMI',//USPS Priority Mail Express International\n '2760' => 'UPS_UPSGND',//UPS Ground\n '2762' => 'UPS_UPS3DS',//UPS 3 Day Select\n '2763' => 'UPS_UPS2DE',//UPS 2nd Day Air\n '2765' => 'UPS_UPSNDAS',//UPS Next Day Air Saver\n '2766' => 'UPS_UPSNDA',//UPS Next Day Air\n );\n\n if (isset($arrShippingServices[$intShippingId])) {\n return $arrShippingServices[$intShippingId]; \n } else {\n return 0;\n }\n }", "public function getServiceNameAllowableValues()\n {\n return [\n self::SERVICE_NAME_BOUNTY_MISSIONS,\n self::SERVICE_NAME_ASSASSINATION_MISSIONS,\n self::SERVICE_NAME_COURIER_MISSIONS,\n self::SERVICE_NAME_INTERBUS,\n self::SERVICE_NAME_REPROCESSING_PLANT,\n self::SERVICE_NAME_REFINERY,\n self::SERVICE_NAME_MARKET,\n self::SERVICE_NAME_BLACK_MARKET,\n self::SERVICE_NAME_STOCK_EXCHANGE,\n self::SERVICE_NAME_CLONING,\n self::SERVICE_NAME_SURGERY,\n self::SERVICE_NAME_DNA_THERAPY,\n self::SERVICE_NAME_REPAIR_FACILITIES,\n self::SERVICE_NAME_FACTORY,\n self::SERVICE_NAME_LABORATORY,\n self::SERVICE_NAME_GAMBLING,\n self::SERVICE_NAME_FITTING,\n self::SERVICE_NAME_PAINTSHOP,\n self::SERVICE_NAME_NEWS,\n self::SERVICE_NAME_STORAGE,\n self::SERVICE_NAME_INSURANCE,\n self::SERVICE_NAME_DOCKING,\n self::SERVICE_NAME_OFFICE_RENTAL,\n self::SERVICE_NAME_JUMP_CLONE_FACILITY,\n self::SERVICE_NAME_LOYALTY_POINT_STORE,\n self::SERVICE_NAME_NAVY_OFFICES,\n self::SERVICE_NAME_SECURITY_OFFICE,\n ];\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "public function getMappedShippingMethods(){\n\n try {\n $activeCarriers = $this->shipConfig->getActiveCarriers();\n $methods = array();\n foreach ($activeCarriers as $carrierCode => $carrierModel) {\n\n if(in_array($carrierCode, self::EXCLUDED_CARRIERS)){\n continue;\n }\n\n if(isset(WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode])){\n $carrierCode = WeSupplyMappings::MAPPED_CARRIER_CODES[$carrierCode];\n $methods[] = $carrierCode;\n }\n }\n\n return $methods;\n\n }catch(\\Exception $e){\n $this->logger->error(\"Error on WeSupply getMappedShippingMethods: \" . $e->getMessage());\n return [];\n }\n }", "public function getRights($serviceid) {\r\n \tif(!empty($serviceid)){\r\n\t $serviceid_arr = @explode(\",\", $serviceid);\r\n\t unset($rights);\r\n\t $billingCompObj = new billing_COMPONENTS();\r\n\t for ($i = 0; $i < count($serviceid_arr); $i++) {\r\n\t $packRights = $billingCompObj->getPackRights($serviceid_arr[$i]);\r\n\t if(empty($packRights)){\r\n\t \t$rights[] = $billingCompObj->getRights($serviceid_arr[$i]);\r\n\t } else {\r\n\t \t$rights[] = $packRights;\r\n\t }\r\n\t }\r\n\t }\r\n return $rights;\r\n }", "public static function createShipmentsValidationWarning(): array\n {\n $wsdl = __DIR__ . '/../../_files/bcs-3.3.2/geschaeftskundenversand-api-3.3.2.wsdl';\n $response = __DIR__ . '/../../_files/createshipment/multiShipmentValidationWarning.xml';\n\n $authStorage = AuthenticationStorageProvider::authSuccess();\n\n $labelRequest = ShipmentRequestProvider::createMultiShipmentPartialSuccess();\n $labelResponse = \\file_get_contents($response);\n\n return [\n 'multi label partial success' => [$wsdl, $authStorage, $labelRequest, $labelResponse],\n ];\n }", "protected function processServiceListBlock($code) {\n $ret = '';\n foreach ($this->services as $service) {\n $this->serviceBeingProcessed = $service;\n $blockForService = str_replace(self::_SERVICE_, $service->name, $code);\n\n\n $processed = $this->searchForBlocksAndApplyProcessing($blockForService, self::METHOD, 'processMethodListBlock');\n if ($processed) {\n $blockForService = $processed;\n }\n\n $ret .= $blockForService;\n }\n return $ret;\n }", "public function getShippingAsOptions($servicesObject)\n\t{\n\t\t$services = array();\n\t\t$domesticServices = array();\n\t\t$domesticServiceTypes = array();\n\t\t$internationalServices = array();\n\t\t$internationalServiceTypes = array();\n\n\t\t$supportedServiceTypes = array('Flat', 'Calculated');\n\n\t\tforeach ($servicesObject as $service) {\n\t\t\t$service = get_object_vars($service);\n\n\t\t\t// service is no longer valid? exclude\n\t\t\tif (empty($service['ValidForSellingFlow'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// the service code. eg USPSGlobalExpress\n\t\t\t$serviceCode = $service['ShippingService'];\n\n\t\t\t// the shipping carier for the service\n\t\t\t$carrier = 'Other';\n\t\t\tif (isset($service['ShippingCarrier'])) {\n\t\t\t\t$carrier = $service['ShippingCarrier'];\n\t\t\t}\n\n\t\t\t$newService = array(\n\t\t\t\t'id' \t\t=> $service['ShippingServiceID'], // numerical ID of the service\n\t\t\t\t'service'\t=> $serviceCode,\n\t\t\t\t'name'\t\t=> $service['Description'],\n\t\t\t\t'carrier'\t=> $carrier,\n\t\t\t);\n\n\t\t\t// The service types this service is valid for (Flat, Calculated, Freight etc)\n\t\t\t$serviceTypes = $service['ServiceType'];\n\t\t\tif (!is_array($serviceTypes)) {\n\t\t\t\t$serviceTypes = array($serviceTypes);\n\t\t\t}\n\n\t\t\t// The packages that are valid for this service\n\t\t\t$packages = array();\n\t\t\tif (!empty($service['ShippingPackage'])) {\n\t\t\t\t$packages = $service['ShippingPackage'];\n\t\t\t}\n\n\t\t\t$dimensionsRequired = !empty($service['DimensionsRequired']);\n\t\t\t$weightRequired = !empty($service['WeightRequired']);\n\t\t\t$expeditedService = !empty($service['ExpeditedService']);\n\n\t\t\t// Add the service into our appropriate arrays\n\t\t\tforeach ($serviceTypes as $serviceType) {\n\t\t\t\t// skip any unspported types\n\t\t\t\tif (!in_array($serviceType, $supportedServiceTypes)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// for Calculated type we should build a list of classes that are used in the select options\n\t\t\t\t$classes = array();\n\t\t\t\tif ($serviceType == 'Calculated') {\n\t\t\t\t\t$classes += $packages;\n\t\t\t\t}\n\n\t\t\t\tif ($expeditedService) {\n\t\t\t\t\t$classes[] = 'ExpeditedService';\n\t\t\t\t}\n\n\t\t\t\tif (!empty($classes)) {\n\t\t\t\t\t$classString = implode(' ', $classes);\n\t\t\t\t\t$newService['class'] = $classString;\n\t\t\t\t}\n\n\t\t\t\t// is this an international or domestic service?\n\t\t\t\tif (!empty($service['InternationalService'])) {\n\t\t\t\t\t$internationalServices[$serviceType][$carrier][$serviceCode] = $newService;\n\n\t\t\t\t\t$internationalServiceTypes[$serviceType] = GetLang('ServiceType' . $serviceType);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$domesticServices[$serviceType][$carrier][$serviceCode] = $newService;\n\n\t\t\t\t\t$domesticServiceTypes[$serviceType] = GetLang('ServiceType' . $serviceType);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$services = array(\n\t\t\t'Domestic' => array(\n\t\t\t\t'Services' \t\t=> $domesticServices,\n\t\t\t\t'ServiceTypes'\t=> $domesticServiceTypes,\n\t\t\t),\n\t\t\t'International'\t=> array(\n\t\t\t\t'Services' \t\t=> $internationalServices,\n\t\t\t\t'ServiceTypes'\t=> $internationalServiceTypes,\n\t\t\t),\n\t\t);\n\n\t\treturn $services;\n\t}", "protected function setStationCode(){\n\t\t$result = array(\"sta_code\",\"sta_code\");\n\t\treturn $result;\n\t}", "protected function setStationCode(){\n\t\t$result = array(\"sta_code\",\"sta_code\");\n\t\treturn $result;\n\t}", "public function disableCorporation() {\n $deletedGroupings = $this->deleteCorporationGroupings();\n\n return $deletedGroupings;\n }", "public function allowMultiple() {\n return false;\n }", "public function getServiceGroupsForStpl(int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtStplSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtStplSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\"\n );\n }\n $this->stmtStplSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtStplSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtStplSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function insert_multiple_service() {\r\n if (USER_ROLE == ROLE_ONE) {\r\n $inserts = json_decode($this->input->post('services'));\r\n $vouchers_ids = \",\";\r\n $flag = false;\r\n foreach ($inserts as $item) {\r\n $data['service_name'] = $item[0];\r\n $data['provided_by'] = $item[1];\r\n $data['billing_id'] = $item[2];\r\n $data['notes'] = $item[3];\r\n $data['cost'] = $item[4];\r\n $data['currency_type'] = $item[5];\r\n $data['received_date'] = $item[6];\r\n $data['insert_number'] = $item[7];\r\n $data['quantity'] = $item[8];\r\n $result = $this->service_model->add_service($data);\r\n if ($result != -1) {\r\n $vouchers_ids .= $result . \",\";\r\n $flag = true;\r\n } else if ($result == -1) {\r\n $flag = false;\r\n $result2 = $this->service_model->delete_many_services($vouchers_ids);\r\n }\r\n if ($flag != true)\r\n break;\r\n }\r\n if ($flag) {\r\n echo json_encode(array('status' => true, 'msg' => $result.\"تم إدخال البيانات بنجاح\"));\r\n } else {\r\n echo json_encode(array('status' => false, 'msg' => $result2.\"لم يتم إدخال البيانات هناك خطأ في البيانات المدخلة\"));\r\n }\r\n }\r\n }", "public function getAllowedServices()\n {\n return $this->allowed_services;\n }", "public static function updateSecurityGroups(\\PDO $dbh, int $id, array $parms, $updatedBy){\r\n $sArray = array();\r\n $stmt = $dbh->query(\"select `Group_Code` as 'Code', `Description` from `w_groups`;\");\r\n $groups = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\r\n\r\n foreach ($groups as $group) {\r\n $sArray[$group['Code']] = $group;\r\n }\r\n\r\n\r\n\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setStoredVal($id);\r\n $rows = EditRS::select($dbh, $secRS, array($secRS->idName));\r\n\r\n foreach ($rows as $r) {\r\n $sArray[$r['Group_Code']][\"exist\"] = \"t\";\r\n }\r\n\r\n $updtd = FALSE;\r\n\r\n foreach ($sArray as $code=>$g) {\r\n\t\t\t\r\n if (isset($parms[\"grpSec_\" . $code])) {\r\n\r\n if (!isset($g[\"exist\"]) && $parms[\"grpSec_\" . $code] == \"checked\") {\r\n\r\n // new group code to put into the database\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setNewVal($id);\r\n $secRS->Group_Code->setNewVal($code);\r\n $n = EditRS::insert($dbh, $secRS);\r\n\r\n NameLog::writeInsert($dbh, $secRS, $id, $updatedBy);\r\n $updtd = TRUE;\r\n\r\n } else if (isset($g[\"exist\"]) && $parms[\"grpSec_\" . $code] != \"checked\") {\r\n\r\n // group code to delete from the database.\r\n $secRS = new Id_SecurityGroupRS();\r\n $secRS->idName->setStoredVal($id);\r\n $secRS->Group_Code->setStoredVal($code);\r\n $n = EditRS::delete($dbh, $secRS, array($secRS->idName, $secRS->Group_Code));\r\n\r\n if ($n == 1) {\r\n NameLog::writeDelete($dbh, $secRS, $id, $updatedBy);\r\n $updtd = TRUE;\r\n }\r\n }\r\n }\r\n }\r\n return $updtd;\r\n }", "public function getAllowedMethods($allServices) {\n\n $allowedServices = explode(\",\", core()->getConfigData('sales.carriers.mpusps.services'));\n\n foreach ($allServices as $services) {\n $allowedMethod =[];\n foreach ($services as $service) {\n\n foreach ($service as $serviceType =>$fedexService) {\n if (in_array($serviceType , $allowedServices)) {\n $allowedMethod[] = [\n $serviceType => $fedexService\n ];\n } else {\n $notAllowed[] = [\n $serviceType => $fedexService\n ];\n }\n }\n }\n\n if ($allowedMethod == null) {\n continue;\n } else {\n $allowedMethods[] = $allowedMethod;\n }\n\n }\n\n if (isset($allowedMethods)) {\n\n return $this->getCommonMethods($allowedMethods);\n } else {\n return false;\n }\n }", "public function getValidSecondaryCurrencyCodes()\n {\n return $this->getEndpoint('GetValidSecondaryCurrencyCodes');\n }", "public static function restrict_shipping_methods_by_shipclass($rates)\n {\n global $woocommerce;\n $configs = OmnivaLt_Core::get_configs();\n $settings = get_option($configs['plugin']['settings_key']);\n $cart_classes_ids = array();\n\n foreach( $woocommerce->cart->get_cart() as $cart_item ) {\n $shipping_classes = get_the_terms($cart_item['product_id'], 'product_shipping_class');\n if ( empty($shipping_classes) ) {\n continue;\n }\n foreach ( $shipping_classes as $class ) {\n $cart_classes_ids[] = $class->term_id;\n }\n }\n $cart_classes_ids = array_unique($cart_classes_ids);\n\n $restricted_shipclass = $settings['restricted_shipclass'] ?? array();\n if ( ! is_array($restricted_shipclass) ) {\n $restricted_shipclass = array($restricted_shipclass);\n }\n\n foreach ( $cart_classes_ids as $cart_product_class_id ) {\n if ( in_array($cart_product_class_id, $restricted_shipclass) ) {\n foreach ( $configs['method_params'] as $ship_method => $ship_method_values ) {\n if ( ! $ship_method_values['is_shipping_method'] ) continue;\n unset($rates['omnivalt_' . $ship_method_values['key']]);\n }\n break;\n }\n }\n\n return $rates;\n }", "public static function getCodes()\n\t{\n\t\treturn [\n\t\t\tBase::Mail,\n\t\t\tBase::Call,\n\t\t\tBase::Imol,\n\t\t\tBase::Site,\n\t\t\tBase::Site24,\n\t\t\tBase::Shop24,\n\t\t\tBase::SiteDomain,\n\t\t\tBase::Button,\n\t\t\tBase::Form,\n\t\t\tBase::Callback,\n\t\t\tBase::FbLeadAds,\n\t\t\tBase::VkLeadAds,\n\t\t\tBase::Rest,\n\t\t\tBase::Order,\n\t\t\tBase::SalesCenter,\n\t\t];\n\t}", "public function rules($serviceTransaction)\n {\n $requestStatuses = RequestStatus::pluck('id');\n\n $requestStatuses = $requestStatuses->join(',');\n\n return [\n 'request_status_id' => \"required|in:{$requestStatuses}\"\n ];\n }", "function filter_shipping( $fields_array ) {\n\t\t\t$fields_array = array_replace($fields_array, $this->update_shipping);\n\t\t\treturn array_diff_key($fields_array, array_flip($this->disabled_shipping));\n\t\t}", "public function CreateAccessCodesShared() {\n $request = array();\n $request['CancelUrl'] = $this->CancelUrl;\n $request['LogoUrl'] = $this->LogoUrl;\n $request['HeaderText'] = $this->HeaderText;\n $request['CustomerReadOnly'] = $this->CustomerReadOnly;\n $request['Customer'] = null;\n $request['ShippingAddress'] = null;\n $request['Customer'] = array(\"TokenCustomerID\" => $this->Cust_TokenCustomerID, \"Reference\" => $this->Cust_Reference, \"Title\" => $this->Cust_Title, \"FirstName\" => $this->Cust_FirstName, \"LastName\" => $this->Cust_LastName, \"CompanyName\" => $this->Cust_CompanyName, \"JobDescription\" => $this->Cust_JobDescription, \"Street1\" => $this->Cust_Street1, \"Street2\" => $this->Cust_Street2, \"City\" => $this->Cust_City, \"State\" => $this->Cust_State, \"PostalCode\" => $this->Cust_PostalCode, \"Country\" => $this->Cust_Country, \"Email\" => $this->Cust_Email, \"Phone\" => $this->Cust_Phone, \"Mobile\" => $this->Cust_Mobile, \"Comments\" => $this->Cust_Comments, \"Fax\" => $this->Cust_Fax, \"Url\" => $this->Cust_Url);\n $request['ShippingAddress'] = array(\"FirstName\" => $this->Ship_add_FirstName, \"LastName\" => $this->Ship_add_LastName, \"Street1\" => $this->Ship_add_Street1, \"Street2\" => $this->Ship_add_Street2, \"City\" => $this->Ship_add_City, \"State\" => $this->Ship_add_State, \"Country\" => $this->Ship_add_Country, \"PostalCode\" => $this->Ship_add_PostalCode, \"Email\" => $this->Ship_add_Email, \"Phone\" => $this->Ship_add_Phone, \"ShippingMethod\" => $this->Ship_add_ShippingMethod);\n $request[\"Items\"] = $this->Items;\n $request[\"Options\"] = $this->Options;\n $request[\"Payment\"] = array(\"TotalAmount\" => $this->TotalAmount, \"InvoiceNumber\" => null, \"InvoiceDescription\" => null, \"InvoiceReference\" => null, \"CurrencyCode\" => $this->CurrencyCode);\n $request[\"RedirectUrl\"] = $this->RedirectUrl;\n $request[\"Method\"] = $this->Method;\n $request[\"TransactionType\"] = $this->TransactionType;\n $request[\"CustomerIP\"] = $this->CustomerIP;\n $request[\"DeviceID\"] = $this->DeviceID;\n //$request['CardDetails'] = array(\"Name\"=>\"Krishna Bhat\", \"Number\"=>\"4444333322221111\", \"ExpiryMonth\"=>\"03\", \"ExpiryYear\"=>\"2016\", \"StartMonth\"=>null, \"StartYear\"=>null, \"IssueNumber\"=>null, \"CVN\"=>\"123\");\n //echo \"<pre>\";print_r($request);echo \"</pre><br /><br />\";die();\n $request = json_encode($request);\n //echo $request;die();\n //$request = '{\"CancelUrl\":\"http:\\/\\/ci.draftserver.com\\/countrytrack\\/rapid-3-1-eway\\/examples\\/ResponsiveSharedPage\\/\",\"LogoUrl\":\"\",\"HeaderText\":\"\",\"CustomerReadOnly\":true,\"Customer\":{\"TokenCustomerID\":null,\"Reference\":null,\"Title\":null,\"FirstName\":null,\"LastName\":null,\"CompanyName\":null,\"JobDescription\":null,\"Street1\":null,\"Street2\":null,\"City\":null,\"State\":null,\"PostalCode\":null,\"Country\":null,\"Email\":null,\"Phone\":null,\"Mobile\":null,\"Comments\":null,\"Fax\":null,\"Url\":null},\"ShippingAddress\":{\"FirstName\":null,\"LastName\":null,\"Street1\":null,\"Street2\":null,\"City\":null,\"State\":null,\"Country\":null,\"PostalCode\":null,\"Email\":null,\"Phone\":null,\"ShippingMethod\":null},\"Items\":null,\"Options\":null,\"Payment\":{\"TotalAmount\":\"100\",\"InvoiceNumber\":null,\"InvoiceDescription\":null,\"InvoiceReference\":null,\"CurrencyCode\":\"AUD\"},\"RedirectUrl\":\"http:\\/\\/ci.draftserver.com\\/countrytrack\\/rapid-3-1-eway\\/examples\\/ResponsiveSharedPage\\/\",\"Method\":\"ProcessPayment\",\"TransactionType\":\"\",\"CustomerIP\":\"202.166.198.119\",\"DeviceID\":null}';\n $response = $this->PostToRapidAPI(\"AccessCodesShared\", $request);\n return json_decode($response);\n }", "public function getSaleableStatusIds()\n {\n return [self::STATUS_ENABLED];\n }", "private function getServiceGroups(int $serviceId)\n {\n $host = Host::getInstance($this->dependencyInjector);\n $servicegroup = ServiceGroup::getInstance($this->dependencyInjector);\n $this->serviceCache[$serviceId]['sg'] = $servicegroup->getServiceGroupsForStpl($serviceId);\n foreach ($this->serviceCache[$serviceId]['sg'] as &$sg) {\n if ($host->isHostTemplate($this->currentHostId, $sg['host_host_id'])) {\n $servicegroup->addServiceInSg(\n $sg['servicegroup_sg_id'],\n $this->currentServiceId,\n $this->currentServiceDescription,\n $this->currentHostId,\n $this->currentHostName\n );\n Relations\\ServiceGroupRelation::getInstance($this->dependencyInjector)->addRelationHostService(\n $sg['servicegroup_sg_id'],\n $sg['host_host_id'],\n $serviceId\n );\n }\n }\n }", "public function multiShippingCheck($mes) {\n global $usces;\n\n if (isset($_REQUEST['offer']['payment_name'])) {\n $payments = $usces->getPayments(wp_unslash($_REQUEST['offer']['payment_name']));\n if ($this->module->getActingFlag() === $payments['settlement']) {\n if (isset($_SESSION['msa_cart'])) {\n if (\n count($_SESSION['msa_cart']) > 0 &&\n isset($_REQUEST['delivery']['delivery_flag']) &&\n (int)wp_unslash($_REQUEST['delivery']['delivery_flag']) === 2 &&\n $this->module->getMultiShippingSupport() === false\n ) {\n $mes .= sprintf(\n // translators: settlement module name\n __('%s cannot be used when multiple shipping addresses are specified.', 'smodule'),\n $this->module->getPaymentName()\n ) . '<br/>';\n }\n }\n }\n }\n\n return $mes;\n }", "public function setServiceCodeDependencyRuleGroups(?array $serviceCodeDependencyRuleGroups): self\n {\n $this->initialized['serviceCodeDependencyRuleGroups'] = true;\n $this->serviceCodeDependencyRuleGroups = $serviceCodeDependencyRuleGroups;\n\n return $this;\n }", "public static function getPartnerNonDisbursedStatuses(): Collection\n {\n $statuses = collect(self::STATUS)\n ->filter(function(string $status) {\n return starts_with($status, 'partner_') && $status !== 'partner_disbursed';\n });\n\n return self::whereIn('status', $statuses->all())->get();\n }", "public function getIsMultiple();", "public static function filterIndustries()\n {\n return [\n 'Agriculture, Forestry and Fishing',\n 'Mining',\n 'Manufacturing',\n 'Electricity, Gas, Water and Waste Services',\n 'Construction',\n 'Wholesale Trade',\n 'Retail Trade',\n 'Accommodation and Food Services',\n 'Transport, Postal and Warehousing',\n 'Information Media and Telecommunications',\n 'Financial and Insurance Services',\n 'Rental, Hiring and Real Estate Services',\n 'Professional, Scientific and Technical Services',\n 'Administrative and Support Services',\n 'Public Administration and Safety',\n 'Education and Training',\n 'Health Care and Social Assistance',\n 'Arts and Recreation Services',\n 'Other Services'\n ];\n }", "public function getAllServiceProviderRequests($merchant_id) {\n $stmt1 = $this->conn->prepare(\"SELECT * FROM `declined_request` where service_provider_id = ?\");\n $stmt1->bind_param(\"i\", $merchant_id);\n $stmt1->execute();\n $stmt1->store_result();\n $num_rows = $stmt1->num_rows;\n $stmt1->close();\n if ($num_rows > 0) {\n $stmt2 = $this->conn->prepare(\"SELECT group_concat(service_request_id) as reqid FROM `declined_request` where service_provider_id = ?\");\n $stmt2->bind_param(\"i\", $merchant_id);\n $stmt2->execute();\n $stmt2->bind_result($concat);\n $stmt2->fetch();\n $stmt2->close();\n \n $stmt3 = $this->conn->prepare(\"SELECT r.* , a.latitude, a.longitude, a.addressline0, a.addressline1, a.addressline2, a.addressline3, a.locality, a.city, a.state, a.pincode, a.country FROM service_request r inner join user_address a on (r.address_id = a.id) WHERE r.id not in ( \".$concat.\" ) && r.status = 0 && r.progress = 0 ORDER by r.service_date ASC\");\n $stmt3->execute();\n $requests = $stmt3->get_result();\n $stmt3->close();\n \n return $requests;\n } else {\n $stmt4 = $this->conn->prepare(\"SELECT r.* , a.latitude, a.longitude, a.addressline0, a.addressline1, a.addressline2, a.addressline3, a.locality, a.city, a.state, a.pincode, a.country from service_request r inner join user_address a on (r.address_id = a.id) where r.status = 0 && r.progress = 0 order by r.service_date ASC\");\n $stmt4->execute();\n $requests = $stmt4->get_result();\n $stmt4->close();\n return $requests;\n }\n\n\n // $stmt = $this->conn->prepare(\"SELECT t.* FROM tasks t, user_tasks ut WHERE t.id = ut.task_id AND ut.user_id = ?\");\n // $stmt->bind_param(\"i\", $merchant_id);\n // $stmt->execute();\n // $tasks = $stmt->get_result();\n // $stmt->close();\n // return $tasks;\n }", "private function SaveMultipleShippingAddresses()\n\t{\n\t\t// Split shipping only works for signed in users\n\t\tif(!CustomerIsSignedIn()) {\n\t\t\tredirect(getConfig('ShopPath').'/checkout.php?action=checkout');\n\t\t}\n\n\t\t// If split shipping is not available, take the customer back to the shipping address selection page\n\t\tif(!gzte11(ISC_MEDIUMPRINT) || !GetConfig('MultipleShippingAddresses') || !isset($_POST['multiaddress'])) {\n\t\t\tredirect(getConfig('ShopPath').'/checkout.php?action=choose_shipping_address&type=single');\n\t\t}\n\n\t\t$silent = false;\n\t\tif(isset($_POST['addAnotherAddress'])) {\n\t\t\t$silent = true;\n\t\t}\n\n\t\t$customerAddresses = getClass('ISC_CUSTOMER')\n\t\t\t->getCustomerShippingAddresses();\n\n\t\t$quoteItems = $this->getQuote()->getItems();\n\t\t$addressItems = array();\n\t\tforeach($quoteItems as $item) {\n\t\t\t// Digital items aren't shipped\n\t\t\tif($item->isDigital()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If we don't have an address for this product, we need to throw back to the address\n\t\t\t// selection page, as they've done something dodgy.\n\t\t\t$quantity = $item->getQuantity();\n\t\t\t$itemId = $item->getId();\n\t\t\tfor($i = 1; $i <= $quantity; ++$i) {\n\t\t\t\t$id = $itemId.'_'.$i;\n\t\t\t\tif(!isset($_POST['multiaddress'][$id]) ||\n\t\t\t\t\t!isset($customerAddresses[$_POST['multiaddress'][$id]]) && $silent == false) {\n\t\t\t\t\t\tredirect(GetConfig('ShopPath').'/checkout.php?action=choose_shipping_address&type=single');\n\t\t\t\t}\n\n\t\t\t\t$customerAddressId = $customerAddresses[$_POST['multiaddress'][$id]]['shipid'];\n\t\t\t\tif(!isset($addressItems[$customerAddressId])) {\n\t\t\t\t\t$addressItems[$customerAddressId] = array();\n\t\t\t\t}\n\t\t\t\tif(!isset($addressItems[$customerAddressId][$itemId])) {\n\t\t\t\t\t$addressItems[$customerAddressId][$itemId] = 0;\n\t\t\t\t}\n\t\t\t\t++$addressItems[$customerAddressId][$itemId];\n\t\t\t}\n\t\t}\n\n\t\t// Remove all shipping addresses on the order and start fresh\n\t\t$this->getQuote()->setIsSplitShipping(true);\n\t\t$this->getQuote()->removeAllShippingAddresses();\n\n\t\t$updatedItems = array();\n\t\t$first = true;\n\t\tforeach($addressItems as $addressId => $items) {\n\t\t\t$address = getClass('ISC_ACCOUNT')->getShippingAddress($addressId,\n\t\t\t\tgetClass('ISC_CUSTOMER')->getCustomerId()\n\t\t\t);\n\n\t\t\t// Invalid address was selected\n\t\t\tif(!$address) {\n\t\t\t\tredirect(GetConfig('ShopPath').'/checkout.php?action=choose_shipping_address&type=single');\n\t\t\t}\n\n\t\t\t// First iteration should use existing shipping address\n\t\t\tif($first) {\n\t\t\t\t$quoteShippingAddress = $this->getQuote()->getShippingAddress();\n\t\t\t\t$first = false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$quoteShippingAddress = new ISC_QUOTE_ADDRESS_SHIPPING;\n\t\t\t\t$quoteShippingAddress->setQuote($this->getQuote());\n\t\t\t\t$this->getQuote()->addShippingAddress($quoteShippingAddress);\n\t\t\t}\n\n\t\t\t$quoteShippingAddress->setAddressByArray($address);\n\n\t\t\t// If the address has custom fields, load those in too\n\t\t\tif($address['shipformsessionid']) {\n\t\t\t\t$formFields = $GLOBALS['ISC_CLASS_FORM']->getSavedSessionData(\n\t\t\t\t\t$address['shipformsessionid'],\n\t\t\t\t\tarray(),\n\t\t\t\t\tFORMFIELDS_FORM_ADDRESS\n\t\t\t\t);\n\t\t\t\t$quoteShippingAddress->setCustomFields($formFields);\n\t\t\t}\n\n\t\t\t$quoteAddressId = $quoteShippingAddress->getId();\n\t\t\tforeach($items as $itemId => $qty) {\n\t\t\t\t$item = $this->getQuote()->getItemById($itemId);\n\t\t\t\tif(!in_array($itemId, $updatedItems)) {\n\t\t\t\t\t$item->setAddressId($quoteAddressId);\n\t\t\t\t\t$item->setQuantity($qty, false);\n\t\t\t\t\t$updatedItems[] = $itemId;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$newItem = clone $item;\n\t\t\t\t\t$newItem->setQuantity($qty, false);\n\t\t\t\t\t$newItem->setAddressId($quoteAddressId);\n\t\t\t\t\t$this->getQuote()->addItem($newItem, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Do we need to go to the add address page?\n\t\tif(isset($_POST['addAnotherAddress'])) {\n\t\t\t$this_page = urlencode(\"checkout.php?action=choose_shipping_address\");\n\t\t\tredirect(getConfig('ShopPath').'/account.php?action=add_shipping_address&from='.$this_page);\n\t\t}\n\n\t\t// OK, the shipping method has been set, move on to the next step\n\t\tredirect(getConfig('ShopPath').'/checkout.php?action=choose_shipper');\n\t}", "private function groups_check(){\n\t\t\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$needed_groups = $production_formats->get_product_groups( $this->slug );\n\t\t$needed_groups_ = array_flip( $needed_groups );\n\t\t$todo_groups = $this->get_todo_groups();\n\t\tforeach ($todo_groups as $key => $value) {\t\t\n\t\t\tif ( array_key_exists( $key, $needed_groups_)) {\n\t\t\t\t$index = $needed_groups_[ $key ];\n\t\t\t\tunset($needed_groups[ $index ]);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ( count( $needed_groups) > 0) {\n\t\t\t\t\t\n\t\t}\n\t}", "function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "public function services(): BelongsToMany\n {\n return $this->morphedByMany(Service::class, 'emailable');\n }", "public function getAdminServiceIds(): array\n {\n return $this->adminServiceCodes;\n }", "public function test_get_sbps_notify_cod($carriers, $codes, $from, $to, $negative)\n {\n $shipment_status_waiting = fetch_code('shipment_status_waiting');\n $this->CI->db\n ->select('order_detail.id, order_detail.delivery_date, customer.last_name, customer.first_name, customer.mail_address_pc, customer.mail_address_mb')\n ->from('order_detail')\n ->join('contract_order', 'contract_order.id = order_detail.contract_order_id')\n ->join_subquery_start('contract', 'contract.id = contract_order.contract_id')\n ->select('id, customer_id')\n ->from('contract')\n ->where('contract.disable', self::STATUS_ENABLE)\n ->{is_array($carriers) ? 'where_in' : 'where'}('settlement_type_id', $carriers)\n ->subquery_close()\n ->join('customer', 'customer.id = contract.customer_id')\n ->join('settlement_type', 'settlement_type.id = order_detail.settlement_type_id')\n ->where('customer.disable', self::STATUS_ENABLE)\n ->where('settlement_type.disable', self::STATUS_ENABLE)\n ->where('settlement_type.column_name', Settlement_type::PAYMENT_COD)\n ->where('order_detail.disable', self::STATUS_ENABLE)\n ->where('order_detail.shipping_status_code', $shipment_status_waiting)\n ->where('contract_order.disable', self::STATUS_ENABLE);\n\n if ($negative)\n {\n if (is_array($codes))\n {\n $this->CI->db->where_not_in('contract_order.order_type_code', $codes);\n }\n else\n {\n $this->CI->db->where(sprintf(\"contract_order.order_type_code <> %d\", $codes));\n }\n }\n else\n {\n $this->CI->db->{is_array($codes) ? 'where_in' : 'where'}('contract_order.order_type_code', $codes);\n }\n\n if (empty($to))\n {\n if (!empty($from))\n {\n $this->CI->db->where(sprintf(\"order_detail.instruction_plan_date = '%s'\", addslashes($from)));\n }\n }\n else\n {\n if (!empty($from))\n {\n $this->CI->db->where(sprintf(\"order_detail.instruction_plan_date >= '%s'\", addslashes($from)));\n }\n\n $this->CI->db->where(sprintf(\"order_detail.instruction_plan_date <= '%s'\", addslashes($to)));\n }\n\n $query = $this->CI->db->get();\n $collection = $query->row_array();\n $query->free_result();\n\n /** @var array $actual */\n $query = $this->CI->contract->get_sbps_notify_cod($carriers, $codes, $from, $to, $negative);\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 getConflictedExcludingPackages() {\n\t\t$conflictedPackages = array();\n\t\t$sql = \"SELECT\t\tpackage.*, package_exclusion.*\n\t\t\tFROM\t\twcf\".WCF_N.\"_package_exclusion package_exclusion\n\t\t\tLEFT JOIN\twcf\".WCF_N.\"_package package\n\t\t\tON\t\t(package.packageID = package_exclusion.packageID)\t\n\t\t\tWHERE\t\texcludedPackage = '\".$this->packageInfo['name'].\"'\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\tif (!empty($row['excludedPackageVersion'])) {\n\t\t\t\tif (Package::compareVersion($this->packageInfo['version'], $row['excludedPackageVersion'], '<')) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$conflictedPackages[$row['packageID']] = $row;\n\t\t}\n\t\t\n\t\treturn $conflictedPackages;\n\t}", "public function getServices()\n\t{\n\t\treturn ['card', 'topup_mobile', 'topup_mobile_post', 'topup_game'];\n\t}", "public function getCcAvailableTypes()\n {\n //Listando apenas cielo pois já contem todas as bandeiras\n $_types = Mage::getModel('gwap/source_cctypes_cielo')->toOptionArray();\n //$_types[] = Mage::getModel('gwap/source_cctypes_redecard')->toOptionArray();\n \n $types = array();\n foreach ($_types as $data) {\n if (isset($data['label']) && isset($data['value']) && $data['value']!='') {\n $types[substr_replace($data['value'],'',-2)] = $data['label'];\n }\n }\n \n if ($method = $this->getMethod()) {\n //Armazena os cartões habilitados nas duas operadoras\n $availableTypes = $method->getConfigData('cctypes_rcard');\n $availableTypes .= ','.$method->getConfigData('cctypes_cielo');\n \n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n $allTypes = array();\n // Remove 2 ultimos caracteres do cartão\n foreach($availableTypes as $substype){\n $allTypes[] = substr_replace($substype,'',-2);\n }\n //Compara com cartões disponíveis\n foreach ($types as $code=>$name) {\n if (!in_array($code, $allTypes)) {\n unset($types[$code]);\n }\n }\n }\n }\n return $types;\n }", "function edd_social_discounts_get_shared_product_ids() {\n\t// get all discount IDs\n\t$discounts = edd_get_discounts();\n\t$discount_ids = array();\n\t$share_ids = array();\n\t\n\tif ( $discounts ) {\n\t\tforeach ( $discounts as $discount ) {\n\t\t\t$discount_ids[] = $discount->ID;\n\t\t}\n\t}\n\n\tforeach ( $discount_ids as $id ) {\n\t\t$products = get_post_meta( $id, '_edd_discount_social_discount_products', true );\n\n\t\tif ( $products ) {\n\t\t\tforeach ($products as $product) {\n\t\t\t\tarray_push( $share_ids, $product );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (array) apply_filters( 'edd_social_discounts_get_share_array', $share_ids );\n}", "public function groupIds();", "public function getOptionGroupIdsOfSellerProduct($sp_id)\n\t{\n\t\t//options of a product\n\t\t$sp_options = SPOptionRelation::with('option.optionGroup')->where('sp_id','=',$sp_id)->get();\n\t\t$option_groups = [];\n\t\tforeach ($sp_options as $key => $sp_option) {\n\t\t\t$og = ucfirst($sp_option->option->optionGroup->option_g_id);\n // dd($og);\n\t\t\tif(!array_has($option_groups,$og)){\n\t\t\t\t$option_groups[$og]=array();\n\t\t\t}\n\t\t}\n\t}", "public function usergroupConditionDoesNotMatchDefaulUserGroupIds() {}", "public function getConflictedExcludedPackages() {\n\t\t$conflictedPackages = array();\n\t\tif (count($this->excludedPackages) > 0) {\n\t\t\t$sql = \"SELECT\t*\n\t\t\t\tFROM\twcf\".WCF_N.\"_package\n\t\t\t\tWHERE\tpackage IN ('\".implode(\"','\", array_keys($this->excludedPackages)).\"')\";\n\t\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\tif (!empty($this->excludedPackages[$row['package']]['version'])) {\n\t\t\t\t\tif (Package::compareVersion($row['packageVersion'], $this->excludedPackages[$row['package']]['version'], '<')) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$conflictedPackages[$row['packageID']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $conflictedPackages;\n\t}", "function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}", "public static function getExcludedChannelCodes()\n {\n if (!static::canUse()) {\n return array();\n }\n\n static $codes = null;\n if ($codes === null) {\n $codes = ImConnector\\Connector::getListConnectorNotNewsletter();\n }\n\n return $codes;\n }", "function instance_allow_multiple() {\n return false;\n }", "function instance_allow_multiple() {\n return false;\n }", "function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['preDel']=array('rw','rwv','admin');\n $g['dashboard']=array('ro','rw','rwv','admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "function testNotAllowedCommunityAppsArray()\n {\n \t$appid = XiptLibApps::getNotAllowedCommunityAppsArray(1);\n \t$result = array(44, 48, 50);\n \t$this->assertEquals($appid, $result);\n \t\n \t//return array of appid for Profiletype 2\n \t$appid = XiptLibApps::getNotAllowedCommunityAppsArray(2);\n \t$result = array(47, 46, 49);\n \t$this->assertEquals($appid, $result);\n \t\n \t//return array of appid for Profiletype 3\n \t$appid = XiptLibApps::getNotAllowedCommunityAppsArray(3);\n \t$result = array(44, 45, 49, 50);\n \t$this->assertEquals($appid, $result);\n \t\n \t//return array of appid for Profiletype 4\n \t$appid = XiptLibApps::getNotAllowedCommunityAppsArray(4);\n \t$result = array(44, 49, 50);\n \t$this->assertEquals($appid, $result);\n }", "public function inactive_client_cache_services($service_name)\r\n\t{\r\n\t\t$inactive_cache = array('SEARCH', 'GETCALENDARFARE', 'FARERULE');\r\n\t\t//$inactive_cache = array();\r\n\t\tif(in_array(strtoupper($service_name), $inactive_cache) == true){\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['index']=array('ro','rw','rwv','admin');\n $g['clearStats']=array('admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "public function getGroupsAttribute(){\n // ------------------------------------------------------------------\n $groups = array();\n $types = config('const.COMPANY_TYPES');\n // ------------------------------------------------------------------\n\n // ------------------------------------------------------------------\n // Get company types\n // ------------------------------------------------------------------\n if( !empty( $types )) foreach( $types as $name => $type ){\n if( !empty( $this->{ $type })) $groups[] = __( 'label.$company.type.'. $name );\n }\n // ------------------------------------------------------------------\n return join( ', ', $groups );\n // ------------------------------------------------------------------\n }", "public static function validateResponse_GroupForArrayConstraintsFromSetResponse_Group(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem) {\n // validation for constraint: itemType\n if (!$get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem instanceof \\WorkdayWsdl\\\\StructType\\Workers_Compensation_Code_Response_GroupType) {\n $invalidValues[] = is_object($get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem) ? get_class($get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem) : sprintf('%s(%s)', gettype($get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem), var_export($get_Workers_Compensation_Codes_RequestTypeResponse_GroupItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Response_Group property can only contain items of type \\WorkdayWsdl\\\\StructType\\Workers_Compensation_Code_Response_GroupType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "public function getMapShippingTypes()\n {\n return $this->map_shipping_types;\n }", "public function getServiceAreaSpecification($service_id)\n {\n $result = DB::table('member_package_services')->select('area_specification')->whereIn('id', explode(\",\", $service_id))->get();\n $result = json_decode(json_encode($result), true);\n $result = array_column($result, 'area_specification');\n $unique_area_specifications = [];\n foreach ($result as $value) {\n if (!empty($value)) {\n $array = explode(\",\", $value);\n $unique_area_specifications = array_merge($unique_area_specifications, $array);\n }\n }\n return array_unique($unique_area_specifications);\n }", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['preConvertCoords']=array('ro', 'rw', 'rwv', 'admin');\n $g['procConvertCoords']=array('ro', 'rw', 'rwv', 'admin');\n $g['convertCoords']=array('none', 'ro', 'rw', 'rwv', 'admin');\n $g['geoSearch']=array('ro', 'rw','rwv','admin');\n $g['simpleLayerKML']=array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['rawLayer']=array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['geoCodeAuto']=array('admin');\n $g['procStat']=array('ro', 'rw', 'rwv', 'admin');\n $g['simpleMap'] = array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['simpleMap2'] = array('none', 'list', 'ro', 'rw', 'rwv', 'admin');\n $g['xPoiList'] = array('ro', 'rw', 'rwv', 'admin');\n $g['xDisplayMarker'] = array('none', 'ro', 'rw', 'rwv', 'admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function,$group);\n }", "function secGroups($function, $group=NULL) {\n $g=array();\n $g['clean_cache']=array('admin');\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n else return $g[$function];\n }\n return false;\n }", "function secGroups($function, $group=NULL) {\n $g=array();\n if (true || $_SERVER['REMOTE_ADDR'] == '80.13.99.120' || $_SERVER['REMOTE_ADDR'] == '78.231.77.57'){\n $g['tests'] = array('none');\n }\n $g['wtsCheckLine'] = array('none');\n $g['ajaxMotDePasse'] = array('none');\n $g['wtsLireOffres'] = array('none');\n $g['viewOffre'] = array('none');\n $g['wtscommande']=array('none');\n $g['wtssaisieforfaits']=array('none');\n $g['wtsCtrlSaisieForfaits'] = array('none');\n $g['wtsCaddieDisp']=array('none');\n $g['wtsAjaxCaddieDisp'] = array('none');\n $g['wtsadd2caddie']=array('none');\n $g['wtsCaddieSuppr']=array('none');\n $g['wtsCaddieToggleLine']=array('none');\n $g['wtsCaddieSupprPack']=array('none'); // a tester\n $g['wtsPreValidateOrder'] = array('none');\n $g['wtsDevis'] = array('none');\n $g['wtsCtrlValidateOrder'] = array('none');\n $g['wtsValidateOrder'] = array('none');\n $g['wtsCtrlValidateCustomerCreation'] = array('none');\n $g['wtsValidateCustomerCreation'] = array('none');\n $g['wtsPrePaiement'] = array('none');\n $g['wtsDisplayOrder'] = array('none');\n $g['wtsCheckWTP'] = array('none');\n $g['wtsAddCard'] = array('none');\n $g['wtsPaiementZero'] = array('none');\n $g['wtsPaiementCheque'] = array('none');\n $g['wtsAdhesion'] = array('none');\n $g['wtsUseReduction'] = array('none');\n \n $g['checkStructures'] = array('admin');\n $g['repairStructures'] = array('admin');\n $g['repairOneStructure'] = array('admin');\n $g['checkSets'] = array('admin');\n $g['verifgrps'] = array('admin');\n $g['verifVentePro'] = array('admin');\n $g['checkEPLProducts'] = array('admin');\n\n $g['getCaddie'] = array('none');\n \n $g['procAuthGroup'] = array('none');\n $g['closeAuthGroup'] = array('none');\n $g['ajaxProcAuthMembre'] = array('none'); // non ecrite\n $g['initCurrentUser'] = array('none');\n $g['closeAuthMembre'] = array('none');\n\n // fonctions de la vente pro\n $g['wtsprolistewtp'] = array('none'); // ro normalement\n $g['wtsproadd2caddie'] = array('none'); // ro normalement\n $g['wtsProPaiement'] = array('none');\n $g['wtsProCancelOrder'] = array('none');\n $g['proAccount'] = array('none');\n // fonctions de la gestion des comtpes clients\n $g['myAccount'] = array('none');\n $g['procCreateMyAccount'] = array('none');\n $g['procEditMyAccount'] = array('none');\n $g['procEditProAccount'] = array('none');\n\n if(isset($g[$function])) {\n if(!empty($group)) return in_array($group, $g[$function]);\n return $g[$function];\n }\n return parent::secGroups($function, $group);\n }", "function sv_wc_pip_packing_list_grouping( $group_items, $order_id, $document_type ) {\n\t// bail unless we're looking at a pick list\n\tif ( 'pick-list' !== $document_type ) {\n\t\treturn $group_items;\n\t}\n\t$order = wc_get_order( $order_id );\n\tif ( ! $order->is_paid() ) {\n\t\treturn false;\n\t}\n\treturn $group_items;\n}", "public function getProductCombinations($onlyAvailable = true)\n {\n $this->_reset();\n $combinations = array();\n\n if ($onlyAvailable) {\n $this->addDateFilter();\n }\n\n $this->getSelect()->reset(Varien_Db_Select::COLUMNS);\n $this->join(\n array('psa' => 'deutschepost_prodws/product_sales_additional'),\n 'psa.salesproduct_id = main_table.salesproduct_id',\n array('main_table.salesproduct_id', 'main_table.basicproduct_id', 'psa.additionalproduct_id')\n );\n\n foreach ($this->getData() as $row) {\n if (!isset($combinations[$row['salesproduct_id']])) {\n $combinations[$row['salesproduct_id']] = array(\n 'product' => $row['basicproduct_id'],\n 'services' => array($row['additionalproduct_id']),\n );\n } else {\n $combinations[$row['salesproduct_id']]['services'][]= $row['additionalproduct_id'];\n }\n }\n\n return $combinations;\n }", "public function getComboSubservicios()\n {\n return $this->comboSubservicios;\n }", "public function shareService ()\n {\n \n $list = $this->services->findAll();\n return $list;\n }", "protected function groupByCampaignTypeNotCampaign() {\n if (!empty($this->_groupByArray)) {\n if (!in_array('campaign.id', $this->_groupByArray)) {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function isMultiAddressDelivery(){\n static $cache = null;\n\n if (is_null($cache)) {\n $db = JFactory::getDBO();\n\n $query = \"SELECT count(distinct address_delivery_id) FROM \" . $db->quoteName('#__jeproshop_cart_product');\n $query .= \" AS cart_product WHERE cart_product.cart_id = \" . (int)$this->cart_id;\n\n $db->setQuery($query);\n $cache = (bool)($db->loadResult() > 1);\n }\n return $cache;\n }", "private function joinShipments($shipmentArray, $addSHPTest)\n {\n\n $stringresponse = 'om_f.shipment in ';\n $i = 1;\n $shipmentArray=array_unique($shipmentArray);\n sort($shipmentArray);\n $totalitems = count($shipmentArray);\n foreach ($shipmentArray as $item) {\n\n\n if ($i == 1 && $totalitems == 1) {\n return $stringresponse .= \"('\" . $this->addSHP($item, $addSHPTest) . \"')\";\n } elseif ($i == 1) {\n $stringresponse .= \"('\" . $this->addSHP($item, $addSHPTest) . \"',\";\n } elseif ($i == $totalitems) {\n $stringresponse .= \"'\" . $this->addSHP($item, $addSHPTest) . \"')\";\n } else {\n $stringresponse .= \"'\" . $this->addSHP($item, $addSHPTest) . \"',\";\n }\n\n $i++;\n }\n return $stringresponse;\n\n }", "public static function getSubscribedServices()\n {\n return array_merge(\n parent::getSubscribedServices(), [\n 'comsa_booking_payment_method_mollie' => MollieType::class,\n ]\n );\n }", "public static function exclusive()\n {\n // Change setting\n self::$settings['exclude'] = true;\n\n // Return exclusion list\n return self::$exclude;\n }", "function getfaircoin_edd_unset_other_gateways( $gateway_list ) {\r\n $download_ids = edd_get_cart_contents();\r\n if ( ! $download_ids )\r\n return $gateway_list;\r\n $download_ids = wp_list_pluck( $download_ids, 'id' );\r\n\r\n if ( $download_ids ) {\r\n foreach ( $download_ids as $id ) {\r\n $gatoWay = get_post_meta( $id, '_edd_gateway', true);\r\n //echo ':'.$gatoWay.':';//print $gatoWay;\r\n foreach ( $gateway_list as $key => $val) {\r\n if ( $key !== $gatoWay) {\r\n if ( $gatoWay == 'coopshares_mixed' && $key == 'coopshares_transfer' ) {\r\n // to let choose at checkout one or the other\r\n } elseif ( ($gatoWay == 'fc2invest_mixed' && $key == 'fc2invest_transfer') || ($gatoWay == 'fc2invest_mixed' && $key == 'localnode') ) {\r\n\r\n // to let choose at checkout one or the other\r\n\r\n } elseif ( ($gatoWay == 'fairmarket_mixed' && $key == 'fairmarket_transfer') ) { //|| ($gatoWay == 'fairmarket_mixed' && $key == 'localnode') ) {\r\n\r\n // to let choose at checkout one or the other\r\n\r\n } else {\r\n unset( $gateway_list[ $key ] );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $gateway_list;\r\n}", "protected function getGroups()\n {\n $groups = parent::getGroups();\n\n // If an ID is already selected, we don't want the auto-generate option:\n if (!empty($this->value)) {\n unset($groups[0][1]);\n }\n\n return $groups;\n }", "public function isMutipleMatching()\n {\n return $this->mutipleMatching;\n }", "public function checkShipment($items) {\n if (!is_array($items)) {\n return 0;\n }\n $arItems = array();\n $arStockItems = array();\n $orderItems = Mage::getModel('sales/order_item')\n ->getCollection()\n ->addFieldToFilter('item_id', array('in' => array_keys($items)));\n if ($orderItems->getSize()) {\n foreach ($orderItems as $orderItem) {\n $arItems[$orderItem->getId()] = $orderItem;\n $arStockItems[$orderItem->getProductId()] = $orderItem->getProductId();\n }\n }\n\n $stockItems = Mage::getModel('cataloginventory/stock_item')\n ->getCollection()\n ->addFieldToFilter('product_id', array('in' => array_keys($arStockItems)));\n if ($stockItems->getSize()) {\n foreach ($stockItems as $stockItem) {\n $arStockItems[$stockItem->getProductId()] = $stockItem;\n }\n }\n foreach ($items as $item_id => $qty) {\n $item = $arItems[$item_id];\n $stockItem = $arStockItems[$item->getProductId()];\n $manageStock = $stockItem->getManageStock();\n if ($stockItem->getUseConfigManageStock()) {\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock', Mage::app()->getStore()->getStoreId());\n }\n if (!$manageStock) {\n continue;\n }\n if (in_array($item->getProductType(), array('configurable', 'bundle', 'grouped', 'virtual', 'downloadable')))\n continue;\n\n if ($this->selectWarehouseToShip($item->getProductId(), $qty) == 0) {\n return 0;\n };\n }\n return 1;\n }", "protected function _customerGroups()\n\t{\n\t\t$customerGroup = $this->_customGroupCollectionFactory->create();\n\t\treturn $customerGroup->getAllIds();\t\t\n\t}", "public function List_canceled_services($user_master_id)\n\t{\n\t\t$sQuery = \"SELECT\n\t\t\t\t\tA.id,\n\t\t\t\t\tA.service_location,\n\t\t\t\t\tDATE_FORMAT(A.order_date, '%W %M %e %Y') as order_date,\n\t\t\t\t\tA.status,\n\t\t\t\t\tB.main_cat_name,\n\t\t\t\t\tB.main_cat_ta_name,\n\t\t\t\t\tC.sub_cat_name,\n\t\t\t\t\tC.sub_cat_ta_name,\n\t\t\t\t\tD.service_name,\n\t\t\t\t\tD.service_ta_name,\n\t\t\t\t\tE.from_time,\n\t\t\t\t\tE.to_time\n\t\t\t\tFROM\n\t\t\t\t\tservice_orders A,\n\t\t\t\t\tmain_category B,\n\t\t\t\t\tsub_category C,\n\t\t\t\t\tservices D,\n\t\t\t\t\tservice_timeslot E\n\t\t\t\tWHERE\n\t\t\t\t\t A.serv_pers_id = '\".$user_master_id.\"' AND A.status = 'Canceled' AND A.`main_cat_id` = B.id AND A.`sub_cat_id` = C.id AND A.`service_id` = D.id AND A.`order_timeslot` = E.id\";\n\t\t$serv_result = $this->db->query($sQuery);\n\t\t$service_result = $serv_result->result();\n\n\t\tif($serv_result->num_rows()>0) {\n\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"Service Order List\", \"list_services_order\"=>$service_result);\n\t\t} else {\n\t\t\t$response = array(\"status\" => \"error\", \"msg\" => \"Service Order List Not found\");\n\t\t}\n\t\treturn $response;\n\t}", "function attendance_get_sharedipoptions() {\n $options = array();\n $options[ATTENDANCE_SHAREDIP_DISABLED] = get_string('no');\n $options[ATTENDANCE_SHAREDIP_FORCE] = get_string('yes');\n $options[ATTENDANCE_SHAREDIP_MINUTES] = get_string('setperiod', 'attendance');\n\n return $options;\n}", "public function getServiceGroupsForService(int $hostId, int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtServiceSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtServiceSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\n AND (host_host_id = :host_id OR host_host_id IS NULL)\"\n );\n }\n $this->stmtServiceSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtServiceSg->bindParam(':host_id', $hostId, PDO::PARAM_INT);\n $this->stmtServiceSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtServiceSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public static function getGroups(): array\n {\n return [\"group2\"];\n }", "public function getTypes(SecurityContext $securityContext) {\n $security = array();\n// dump($this->container->getParameter('block_security'));\n// exit;\n foreach ($this->container->getParameter('block_security') as $role => $services) {\n foreach ($services as $service) {\n $security[$service] = $role;\n }\n }\n// $disabledBlocks = $this->container->getParameter('block_disabled');\n\n uasort($this->services, function($a, $b) {\n if ($a['grouporder'] == $b['grouporder']) {\n if ($a['ordre'] == $b['ordre']) return 0;\n return $a['ordre'] > $b['ordre'] ? 1 : -1;\n }\n return $a['grouporder'] > $b['grouporder'] ? 1 : -1;\n });\n// uasort($this->services, function($a, $b) {\n// if($a['ordre'] == $b['ordre']) return 0;\n// return $a['ordre'] > $b['ordre'] ? 1 : -1;\n// });\n\n// dump($this->services);\n// exit;\n\n $list = [];\n foreach ($this->services as $name => $service) {\n if ($service['service'] instanceof BlockServiceInterface) {\n\n if (isset($security[$name]) && $securityContext->isGranted($security[$name])) { // AND !in_array($name, $disabledBlocks)\n $list[$service['group']][$name] = $service['service']->getName();\n }\n }\n }\n\n\n\n return $list;\n }", "public function changeSwappRequestDataProvider(){\n\n // scenarios data\n // 2 means that response to request should be 200 or 304\n // 3 means that response to request needs to be 304\n // 4 means that response to request should be 404\n return [\n \"1. case: \" => [5, \"ACCEPTED\", 2],\n \"1b. case: \" => [5, \"ACCEPTED\", 3],\n \"2. case: \" => [\"8\", \"DECLINED\", 2],\n \"3. case: \" => [\"num\", \"ACCEPTED\", 4],\n \"4. case: \" => [null, \"DECLINED\", 4],\n \"5. case: \" => [array(5,1122), \"ACCEPTED\", 4],\n \"6. case: \" => [12, \"declined\", 2],\n \"7. case: \" => [12, \"Declined\", 2],\n \"8. case: \" => [12, 5, 4],\n \"9. case: \" => [12, \"UNKNOWN\", 4],\n ];\n }", "public function getGroupCandidates(){\n\t\t$groups = GroupQuery::create()\n\t\t\t\t\t \t\t\t->select(\"Id\")\n\t\t\t\t\t\t\t\t->filterByUser($this)\n\t\t\t\t\t\t\t\t->find(); \n\n\t\t$candidates = GroupQuery::create()\n\t\t\t\t\t\t\t\t\t\t\t->filterById($groups, Criteria::NOT_IN)\n\t\t\t\t\t\t\t\t\t\t\t->find();\n\t\treturn $candidates;\n\t}", "public static function duplicate($service) {\n\n $serviceid = $service->id;\n\n // duplicate service\n $newservice = ORM::forTable('service')->create();\n Admin::duplicateRecord($service, $newservice);\n $newservice->code = \"CHANGE\";\n $newservice->date = date(\"Y-m-d\");\n $newservice->visible = 0;\n $newservice->save();\n $newserviceid = $newservice->id();\n\n // duplicate destinations\n // create a map of old to new ids\n $destmap = array();\n $destinations = ORM::forTable('destination')->where('serviceid', $serviceid)->findMany();\n if ($destinations) {\n foreach ($destinations as $destination) {\n $newdestination = ORM::forTable('destination')->create();\n Admin::duplicateRecord($destination, $newdestination);\n $newdestination->serviceid = $newserviceid;\n $newdestination->save();\n $destmap[$destination->id] = $newdestination->id();\n }\n }\n\n // duplicate pricebandgroup\n // create a map of old to new ids\n $pbmap = array();\n $pricebandgroups = ORM::forTable('pricebandgroup')->where('serviceid', $serviceid)->findMany();\n if ($pricebandgroups) {\n foreach ($pricebandgroups as $pricebandgroup) {\n $newpricebandgroup = ORM::forTable('pricebandgroup')->create();\n $newpricebandgroup->serviceid = $newserviceid;\n $newpricebandgroup->name = $pricebandgroup->name;\n $newpricebandgroup->save();\n $pbmap[$pricebandgroup->id] = $newpricebandgroup->id();\n }\n }\n\n // duplicate joining\n $joinings = ORM::forTable('joining')->where('serviceid', $serviceid)->findMany();\n if ($joinings) {\n foreach ($joinings as $joining) {\n $newjoining = ORM::forTable('joining')->create();\n Admin::duplicateRecord($joining, $newjoining);\n $newjoining->serviceid = $newserviceid;\n if (empty($pbmap[$joining->pricebandgroupid])) {\n throw new Exception('No pricebandgroup mapping exists for id = ' . $joining->pricebandgroupid);\n }\n $newjoining->pricebandgroupid = $pbmap[$joining->pricebandgroupid];\n $newjoining->save();\n }\n }\n\n // duplicate pricebands\n $pricebands = ORM::forTable('priceband')->where('serviceid', $serviceid)->findMany();\n if ($pricebands) {\n foreach ($pricebands as $priceband) {\n if (empty($pbmap[$priceband->pricebandgroupid])) {\n throw new Exception('No pricebandgroup mapping exists for id = ' . $priceband->pricebandgroupid);\n }\n $newpriceband = ORM::forTable('priceband')->create();\n Admin::duplicateRecord($priceband, $newpriceband);\n $newpriceband->serviceid = $newserviceid;\n if (empty($destmap[$priceband->destinationid])) {\n throw new Exception('No destination mapping exists for id = ' . $priceband->destinationid);\n }\n $newpriceband->destinationid = $destmap[$priceband->destinationid];\n if (empty($pbmap[$priceband->pricebandgroupid])) {\n throw new Exception('No pricebandgroup mapping exists for id = ' . $priceband->pricebandgroupid);\n }\n $newpriceband->pricebandgroupid = $pbmap[$priceband->pricebandgroupid];\n $newpriceband->save();\n }\n }\n\n // duplicate limits\n $limits = ORM::forTable('limits')->where('serviceid', $serviceid)->findOne();\n if ($limits) {\n $newlimits = ORM::forTable('limits')->create();\n Admin::duplicateRecord($limits, $newlimits);\n $newlimits->serviceid = $newserviceid;\n $newlimits->save();\n }\n\n return $newservice;\n }", "public function getExcludedIds();", "public function test_chainedNoMask()\n {\n //signature\tsignaturesignature\t#Ђ#M#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMask:getServiceWithoutMask:#K#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\TestService.CLASS_NAME|?\n\n $testService = $this->classBroker->getClassWithoutMask(ServiceBroker::CLASS_NAME)->getServiceWithoutMask(TestService::CLASS_NAME);\n//signature\t#M#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMask.getServiceWithoutMask|#☘#M#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMask.getServiceWithoutMaskª#K#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\TestService.CLASS_NAME♣|#M#☘#M#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ClassBroker.getClassWithoutMaskª#K#C\\DynamicReturnTypePluginTestEnvironment\\TestClasses\\ServiceBroker.CLASS_NAME♣.getServiceWithoutMask\n $testService->run();\n }" ]
[ "0.6291504", "0.49534437", "0.49397144", "0.48473418", "0.48183835", "0.46865356", "0.46495193", "0.4640016", "0.46138838", "0.45725414", "0.45638192", "0.45411426", "0.44887283", "0.44548804", "0.44414827", "0.443988", "0.44215247", "0.44215247", "0.44161674", "0.4409899", "0.44066286", "0.4399541", "0.4398549", "0.43957764", "0.43937293", "0.4392775", "0.43907523", "0.4380723", "0.43122646", "0.4288137", "0.42869532", "0.42830804", "0.4280645", "0.42786968", "0.427736", "0.42637625", "0.42605338", "0.42325854", "0.42176875", "0.4217449", "0.42169464", "0.42146605", "0.4210311", "0.42010552", "0.41971323", "0.4194395", "0.41922843", "0.4184231", "0.41778737", "0.41726887", "0.41703358", "0.416416", "0.41613784", "0.41587728", "0.41563806", "0.41545823", "0.41544825", "0.41524953", "0.41524953", "0.41524953", "0.4145951", "0.4145951", "0.4145951", "0.4145951", "0.4145951", "0.4138825", "0.4137563", "0.41304532", "0.4129943", "0.4128808", "0.41241753", "0.41222334", "0.41221455", "0.41215757", "0.4118329", "0.41154313", "0.41077468", "0.41071486", "0.41054404", "0.41029054", "0.40966", "0.4091958", "0.40905234", "0.40846863", "0.40833613", "0.40794128", "0.40779933", "0.40721798", "0.40711924", "0.40699407", "0.4067452", "0.40634826", "0.40606034", "0.40600586", "0.40597427", "0.4059322", "0.40553653", "0.40552133", "0.40481335", "0.40456676" ]
0.58839995
1
Dependency rule groups for a particular serviceCode.
public function getServiceCodeDependencyRuleGroups(): ?array { return $this->serviceCodeDependencyRuleGroups; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setServiceCodeDependencyRuleGroups(?array $serviceCodeDependencyRuleGroups): self\n {\n $this->initialized['serviceCodeDependencyRuleGroups'] = true;\n $this->serviceCodeDependencyRuleGroups = $serviceCodeDependencyRuleGroups;\n\n return $this;\n }", "public function testGetRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function getServiceGroups(int $serviceId)\n {\n $host = Host::getInstance($this->dependencyInjector);\n $servicegroup = ServiceGroup::getInstance($this->dependencyInjector);\n $this->serviceCache[$serviceId]['sg'] = $servicegroup->getServiceGroupsForStpl($serviceId);\n foreach ($this->serviceCache[$serviceId]['sg'] as &$sg) {\n if ($host->isHostTemplate($this->currentHostId, $sg['host_host_id'])) {\n $servicegroup->addServiceInSg(\n $sg['servicegroup_sg_id'],\n $this->currentServiceId,\n $this->currentServiceDescription,\n $this->currentHostId,\n $this->currentHostName\n );\n Relations\\ServiceGroupRelation::getInstance($this->dependencyInjector)->addRelationHostService(\n $sg['servicegroup_sg_id'],\n $sg['host_host_id'],\n $serviceId\n );\n }\n }\n }", "public function testCreateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function createResourceGroups()\n {\n foreach ($this->api->getServices() as $service) {\n $this->resourceGroups[] = new ResourceGroup($service);\n }\n }", "function build_servicegroups_array()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\t\n\t$servicegroups = $NagiosData->getProperty('servicegroups');\t\t\t\n\t$services = $NagiosData->getProperty('services');\t\t\n\t$services = user_filtering($services,'services'); \n\t\n\t$servicegroups_details = array(); //multi-dim array to hold servicegroups \t\n\tforeach($servicegroups as $groupname => $members)\n\t{\n\t\t$servicegroups_details[$groupname] = array();\n \t\t//array_dump($members); \n\t\tforeach($services as $service)\n\t\t{\t\n\t\t\tif(isset($members[$service['host_name']]) && in_array($service['service_description'],$members[$service['host_name']]))\t{\n\t\t\t\tprocess_service_status_keys($service);\t\t\n\t\t\t\t$servicegroups_details[$groupname][] = $service;\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}\n\n\treturn $servicegroups_details; \n}", "private static final function parseRules($code)\n {\n $rules = array();\n foreach (preg_split(\"#\\r?\\n#\", $code) as $line) {\n if (!preg_match('#^(?<input>\\w+)\\s+to\\s+(?<output>\\w+)\\s+as\\s+(?<relationship>\\w+)(\\s+(?<options>.+))?$#', $line, $match))\n continue;\n\n $rule = new stdClass();\n\n $rule->input = $match['input' ];\n $rule->output = $match['output'];\n $rule->relationship = $match['relationship' ];\n if (!isset($match['options']))\n $rule->options = array();\n else\n $rule->options = preg_split('#\\s+#', $match['options']);\n\n $rules[] = $rule;\n }\n\n return $rules;\n }", "public function getGroupedRules(): array;", "public function testDeleteRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function findServiceGroups(): array;", "public function getServiceGroupsForStpl(int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtStplSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtStplSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\"\n );\n }\n $this->stmtStplSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtStplSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtStplSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public function testAggregateRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getGroupSchemas($regionCode, $modelCode, $modificationCode, $groupCode)\n {/* {\n $groupSchemas[$aData['num_image']] = array(Constants::NAME => $aData['num_image'], Constants::OPTIONS => array(\n Constants::CD => $aData['catalog'].$aData['sub_dir'].$aData['sub_wheel'],\n \t'num_model' => $aNumModel['num_model'],\n 'num_image' => $aData['num_image']\n ));\n }*/\n\t\t$groupSchemas = array();\n return $groupSchemas;\n }", "public function getGroupSchemas($regionCode, $modelCode, $modificationCode, $groupCode)\n {/* {\n $groupSchemas[$aData['num_image']] = array(Constants::NAME => $aData['num_image'], Constants::OPTIONS => array(\n Constants::CD => $aData['catalog'].$aData['sub_dir'].$aData['sub_wheel'],\n \t'num_model' => $aNumModel['num_model'],\n 'num_image' => $aData['num_image']\n ));\n }*/\n\t\t$groupSchemas = array();\n return $groupSchemas;\n }", "public function group() {\n\t\t$this->addRule($v = new ValidationRuleGroup($this));\n\t\treturn $v;\n\t}", "public function getServiceGroupsForService(int $hostId, int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtServiceSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtServiceSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\n AND (host_host_id = :host_id OR host_host_id IS NULL)\"\n );\n }\n $this->stmtServiceSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtServiceSg->bindParam(':host_id', $hostId, PDO::PARAM_INT);\n $this->stmtServiceSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtServiceSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "private function _loadRules()\n\t{\n\t\t//load rules\n\t\trequire_once( PROJECT_ROOT . '/data/configs/groups/global.php' );\n\n\t\t//TODO: make group selector\n\t\tif ( is_array( $this->_auth->getGroups( ) ) )\n\t\t{\n\t\t\t//load active group\n\t\t\t$activeGroup = $this->_auth->getActiveGroup();\n\n\t\t\tif ( !$activeGroup\n\t\t\t || !file_exists( PROJECT_ROOT . '/data/configs/groups/' . $activeGroup . '.php' )\n\t\t\t)\n\t\t\t{\n\t\t\t\tforeach ( $this->_auth->getGroups() as $groupId )\n\t\t\t\t{\n\t\t\t\t\t$ruleFile = PROJECT_ROOT . '/data/configs/groups/' . $groupId . '.php';\n\t\t\t\t\tif ( file_exists( $ruleFile ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$activeGroup = $groupId;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $activeGroup )\n\t\t\t{\n\t\t\t\trequire_once( PROJECT_ROOT . '/data/configs/groups/' . $activeGroup . '.php' );\n\t\t\t\t$this->_auth->setActiveGroup( $activeGroup );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\treturn;\n\t}", "public function getGroups() {}", "public function testQueryRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function rules() : array\n {\n return [\n 'service.service_type_id' => 'required',\n// 'service.currency_id' => 'required',\n// 'service.user_exchange_rate' => 'required',\n 'service.service_model_id' => 'required',\n// 'service_item.*.*' => 'required_if:service.payment_method_id,3296',\n// 'service_item.*.*' => 'required_if:service.payment_method_id,3296',\n// 'service_item.*.item_id' => 'required',\n// 'service_item.*.quantity' => 'required',\n// 'service_item.*.unit_cost' => 'required',\n// 'service_item.*.total' => 'required',\n// 'service_item.*.unit_id' => 'required',\n// 'service_item_direct.*.*' => 'required_if:service.payment_method_id,3297',\n\n ];\n }", "public function rules()\n {\n\n $services = [\n 'services.basic.*.*' => 'numeric',\n 'services.additional.*' => 'numeric',\n 'services.custom.*.name' => 'required|string',\n 'services.custom.*.1' => 'numeric',\n 'services.custom.*.2' => 'numeric',\n 'services.custom.*.3' => 'numeric',\n 'services.custom.*.4' => 'numeric',\n ];\n\n $rules = [\n 'name' => 'required|string|max:60',\n 'type' => 'required',\n 'email' => 'nullable|email',\n// 'phone' => 'regex:',\n 'location' => 'nullable|json',\n 'city' => 'nullable|string',\n 'address' => 'nullable|string',\n 'image' => 'nullable|image',\n 'posts' => 'nullable|integer',\n 'schedule.*.*' => 'required',\n// 'requisites' => 'required'\n ];\n\n return array_merge($rules, $services);\n }", "public function testUpdateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function rules()\n {\n $types = TypeService::get();\n $codes = $types->pluck('code')->toArray();\n\n return [\n 'service_type' => Rule::in($codes),\n 'start_date' => 'date_format:Y-m-d',\n 'end_date' => 'date_format:Y-m-d',\n 'page_number' => 'integer|min:1',\n 'page_size' => 'integer|min:1',\n ];\n }", "public function groups();", "public function groups();", "public function setServiceCodeMutuallyExclusiveGroups(?array $serviceCodeMutuallyExclusiveGroups): self\n {\n $this->initialized['serviceCodeMutuallyExclusiveGroups'] = true;\n $this->serviceCodeMutuallyExclusiveGroups = $serviceCodeMutuallyExclusiveGroups;\n\n return $this;\n }", "public function getServiceCodeMutuallyExclusiveGroups(): ?array\n {\n return $this->serviceCodeMutuallyExclusiveGroups;\n }", "function new_groups()\n {\n \n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n case 'POST':\n {\n return [\n 'project_id' => 'required|integer',\n 'name' => 'required|string|unique:groups,name,' . $this->get('name') . ',id,project_id,' . $this->project_id,\n 'enabled' => 'required|boolean'\n ];\n }\n case 'PUT':\n case 'PATCH':\n {\n return [\n 'project_id' => 'required|integer',\n 'name' => 'required|string|unique:groups,name,' . $this->get('id') . ',id,project_id,' . $this->project_id,\n 'enabled' => 'required|boolean'\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n $this->rule = Refund::$ServiceProcessMap;\n return [\n 'id' => 'required',\n 'handle' => Rule::in(array_keys($this->rule)),\n ];\n }", "public function getServiceGroupsFromScope(\\Scope $scope){\n $dql = \"SELECT sg\n FROM ServiceGroup sg\n JOIN sg.scopes sc\n WHERE sc.id = :id\n ORDER BY sg.name\";\n $query = $this->em->createQuery($dql)\n ->setParameter(\":id\", $scope->getId());\n return $query->getResult();\n }", "protected function getGroupposition_LegendService()\n {\n return $this->services['groupposition.legend'] = new \\phpbb\\groupposition\\legend(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'});\n }", "public static function getGroups(): array\r\n {\r\n return [\r\n 'dev',\r\n 'pre',\r\n ];\r\n }", "public function groups()\n {\n return $this->hasMany(get_class(new KpiGroup()));\n }", "public function groups()\n {\n return $this->hasMany('App\\ERP\\SItemGroup');\n }", "public function rules()\n {\n return [\n 'title' => 'required|max:50',\n 'slogan' => 'required|max:255',\n 'image_service_1' => 'image|dimensions:min_width=200,max_width=360,min_height=200,max_height=360',\n 'title_service_1' => 'required|max:30',\n 'description_service_1' => 'required|max:255',\n 'image_service_2' => 'image|dimensions:min_width=200,max_width=360,min_height=200,max_height=360',\n 'title_service_2' => 'required|max:30',\n 'description_service_2' => 'required|max:255',\n 'image_service_3' => 'image|dimensions:min_width=200,max_width=360,min_height=200,max_height=360',\n 'title_service_3' => 'required|max:30',\n 'description_service_3' => 'required|max:255',\n ];\n }", "public function getServices() {\n $serviceNames = $this->getServiceNames($this->serviceFolderPaths);\n $ret = $ret1 = array();\n// require_once AMFPHP_ROOTPATH.'Plugins/AmfphpDiscovery/CReflection.php';\n foreach ($serviceNames as $serviceName) {\n/* $methods = array();\n $objC = new CReflection(APP_PATH.'/app/controllers/'.$serviceName.'.php');\n $objComment = $objC->getDocComment();\n $arrMethod = $objC->getMethods();\n foreach ($arrMethod as $objMethods)\n {\n $methodComment = $objMethods->getDocComment();\n $parsedMethodComment = $this->parseMethodComment($methodComment);\n $arrParamenter = $objMethods->getParameters();\n foreach ($arrParamenter as $Paramenter)\n {\n $parameterInfo = new AmfphpDiscovery_ParameterDescriptor($Paramenter, '');\n $parameters[] = $parameterInfo;\n }\n $methods[$objMethods->_name] = new AmfphpDiscovery_MethodDescriptor($objMethods->_name, $parameters, $methodComment, $parsedMethodComment['return']);\n }\n\n $ret[$serviceName] = new AmfphpDiscovery_ServiceDescriptor($serviceName, $methods, $objComment); */\n $ret1[] = array('label'=>$serviceName,'date'=>'');\n }\n// var_dump($ret);exit();\n //note : filtering must be done at the end, as for example excluding a Vo class needed by another creates issues\n foreach ($ret as $serviceName => $serviceObj) {\n foreach (self::$excludePaths as $excludePath) {\n if (strpos($serviceName, $excludePath) !== false) {\n unset($ret[$serviceName]);\n break;\n }\n }\n }\n return $ret1;\n }", "protected function addMetaNesting(array $attributeMeta, string $groupCode, string $attributeCode): array\n {\n return [\n $groupCode => [\n 'arguments' => ['data' => ['config' => ['dataScope' => 'data.product']]],\n 'children' => [\n 'container_' . $attributeCode => [\n 'children' => [$attributeCode => ['arguments' => ['data' => ['config' => $attributeMeta]]]],\n ],\n ],\n ],\n ];\n }", "function clsGrp($pName) {\n $this->name = $pName;\n if (function_exists('before_group_' . $pName)) $this->beforeEvent = true;\n if (function_exists('after_group_' . $pName)) $this->afterEvent = true;\n }", "function group_create($data){\n $dval = $data['umd_val'];\n if(!isset($this->domains[$dval])) return 2;\n if(!in_array($dval,$this->quest_provider('d:group','create',TRUE,FALSE)))\n return 3;\n $tmp = $this->domains[$dval]->group_create($data);\n if($tmp>0) return $tmp;\n return $this->gdn_make($data['gname'],$dval);\n }", "public function getGroups();", "public function getGroups();", "public function groups() {\n\t\tif (empty($this->_compiledGroupNames)) {\n\t\t\tforeach ($this->settings['groups'] as $group) {\n\t\t\t\t$this->_compiledGroupNames[] = $this->settings['prefix'] . $group;\n\t\t\t}\n\t\t}\n\n\t\t$groups = $this->_Memcached->getMulti($this->_compiledGroupNames);\n\t\tif (count($groups) !== count($this->settings['groups'])) {\n\t\t\tforeach ($this->_compiledGroupNames as $group) {\n\t\t\t\tif (!isset($groups[$group])) {\n\t\t\t\t\t$this->_Memcached->set($group, 1, 0);\n\t\t\t\t\t$groups[$group] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tksort($groups);\n\t\t}\n\n\t\t$result = array();\n\t\t$groups = array_values($groups);\n\t\tforeach ($this->settings['groups'] as $i => $group) {\n\t\t\t$result[] = $group . $groups[$i];\n\t\t}\n\n\t\treturn $result;\n\t}", "public function findGroups() {\n\t\t\n\t}", "public function __construct()\n {\n $this->Service = new GroupService();\n }", "public function rules()\n {\n\n if ($this->input('service_type') == t( 'mogaz service'))\n {\n\n\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'owner_id' => '',\n 'plate_number' => '',\n 'serial_number' => '',\n 'car_url' => '',\n ];\n\n\n\n }\n if ($this->input('service_type') == t( 'estimation title'))\n {\n\n\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'first_owner_name' => 'required|mb_between:2,100',\n 'middle_owner_name' => 'required|mb_between:2,100',\n 'last_owner_name' => 'required|mb_between:2,100',\n 'Mobile_number' => 'required|regex:/^[0-9]+$/',\n 'car_type' => 'required',\n 'car_category' => 'required',\n 'car_brand' => 'required',\n 'Year_manufacture' => 'required|regex:/^[0-9]+$/',\n 'Kilometers' => 'required',\n 'car_Pictures' =>'required',\n\n ];\n\n\n\n }\n\n if ($this->input('service_type') == t( 'ownership_title'))\n {\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'seller_name' => '',\n 'purchaser_name' => 'required|mb_between:2,100',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'owner_id' => 'required|regex:/^[0-9]+$/|digits:10',\n 'user_id' => 'required|regex:/^[0-9]+$/|digits:10',\n 'seller_phone' => 'required|regex:/^[0-9]+$/',\n 'purchaser_phone' => 'required|regex:/^[0-9]+$/',\n 'Kilometers' => 'required',\n 'price' => 'required',\n 'driving_license' => 'required|image|mimes:' . getUploadFileTypes('image'),\n 'seller_id_image' => '',\n 'purchaser_id_image' => 'required|image|mimes:' . getUploadFileTypes('image'),\n 'car_Pictures' => '',\n 'exhibitions_place' => '',\n 'exhibitions_id' => '',\n 'car_url' => '',\n\n ];\n\n\n }\n\n if ($this->input('service_type') == t( 'checking_title'))\n {\n $timedate =date('Y-m-d H:i:s');\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'car_url' => 'required',\n 'checking_time' => 'required',\n 'checking_date' => 'required',\n 'address' =>'required',\n 'phone' =>'required',\n\n ];\n\n\n\n }\n if ($this->input('service_type') == t('shipping_title'))\n {\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'car_url' => '',\n 'shipping_id' =>'required',\n 'address' =>'required',\n 'owner_id' => '',\n 'plate_number' => '',\n 'serial_number' => '',\n 'address_to' =>'required',\n 'car_Pictures' => 'required',\n ];\n\n\n\n }\n if ($this->input('service_type') == t( 'maintenance_title'))\n {\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'car_place' => 'required',\n 'car_url' => '',\n 'maintenance_id' =>'',\n 'maintenance_id_yes' =>'',\n 'address' =>'',\n 'owner_id' => '',\n 'plate_number' => '',\n 'serial_number' => '',\n ];\n\n\n\n }\n\n if ($this->input('service_type') == t( 'estimation title'))\n {\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n }\n if (!empty($this->input('for_shipping')))\n {\n\n if ($this->input('for_shipping')== \"no\" ){\n\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n $rules['address'] = 'required|' . $rules['address'];\n\n }elseif($this->input('for_shipping') == \"yes\" ){\n\n $rules['car_url'] = 'required|' . $rules['car_url'];\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n }\n }else{\n if ($this->input('service_type') == t('shipping_title'))\n {\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n $rules['address'] = 'required|' . $rules['address'];\n }}\n\n\n if (!empty($this->input('for_mainten')))\n {\n if ($this->input('for_mainten') == \"no\" ){\n\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n $rules['address'] = 'required|' . $rules['address'];\n $rules['maintenance_id'] = 'required|' . $rules['maintenance_id'];\n\n }elseif($this->input('for_mainten') == \"yes\" ){\n\n $rules['car_url'] = 'required|' . $rules['car_url'];\n $rules['maintenance_id_yes'] = 'required|' . $rules['maintenance_id_yes'];\n }\n }else{\n if ($this->input('service_type') == t( 'maintenance_title') )\n {\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n $rules['address'] = 'required|' . $rules['address'];\n $rules['maintenance_id'] = 'required|' . $rules['maintenance_id'];\n }}\n\n if (!empty($this->input('for_mogaz')))\n {\n if ($this->input('for_mogaz') == \"no\" ){\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n\n\n }elseif($this->input('for_mogaz') == \"yes\" ){\n $rules['car_url'] = 'required|' . $rules['car_url'];\n }\n }else{\n if ($this->input('service_type') == t( 'mogaz service') )\n {\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n\n }}\n\n\n\n if (!empty($this->input('for_ownership')))\n {\n\n if ($this->input('for_ownership')== \"no\" ){\n $rules['seller_name'] = 'required|' . $rules['seller_name'];\n $rules['seller_id_image'] = 'required|image|mimes:' . getUploadFileTypes('image'). $rules['seller_id_image'];\n $rules['car_Pictures'] = 'required';\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n $rules['exhibitions_id'] = 'required|' . $rules['exhibitions_id'];\n $rules['exhibitions_place'] = 'required|' . $rules['exhibitions_place'];\n\n }elseif($this->input('for_ownership')== \"yes\" ){\n $rules['car_url'] = 'required|' . $rules['car_url'];\n }\n }else{\n\n if ($this->input('service_type') == t( 'ownership_title')){\n $rules['seller_name'] = 'required|' . $rules['seller_name'];\n $rules['seller_id_image'] = 'required|image|mimes:' . getUploadFileTypes('image'). $rules['seller_id_image'];\n $rules['car_Pictures'] = 'required';\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image');\n $rules['exhibitions_id'] = 'required|' . $rules['exhibitions_id'];\n $rules['exhibitions_place'] = 'required|' . $rules['exhibitions_place'];\n }}\n\n if ($this->input('service_type') =='contact_page'){\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'last_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => 'required|mb_between:5,500',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n ];\n }\n\n\n return $rules;\n }", "public function setServiceCodeRuleName(?string $serviceCodeRuleName): self\n {\n $this->initialized['serviceCodeRuleName'] = true;\n $this->serviceCodeRuleName = $serviceCodeRuleName;\n\n return $this;\n }", "public function rules()\n {\n $lastUrl = \\GLobalHelper::lastUrl();\n\n if(!empty(\\Request::segment(2))) :\n $rules['group_name'] = 'required|unique:groups,group_name,'.$lastUrl.',group_id';\n else :\n $rules['group_name'] = 'required|unique:groups,group_name';\n endif;\n\n return $rules;\n }", "public function rules()\n {\n\n $hourBasedServiceIds = WageService::whereUnit(ApplicationSettings::get()->services_hour_unit)\n ->pluck('id')->toArray();\n\n return [\n 'accounting' => 'sometimes|array|prohibits:logbook,project',\n 'accounting.*' => [\n Rule::exists('accounting', 'id')->where(function ($query) use ($hourBasedServiceIds) {\n return $query\n ->where('employee_id', Auth::id())\n ->whereIn('service_id', $hourBasedServiceIds);\n }),\n ],\n 'logbook' => 'sometimes|array|prohibits:accounting,project',\n 'logbook.*' => [\n Rule::exists('logbook', 'id')->where(function ($query) {\n return $query->where('employee_id', Auth::id());\n }),\n ],\n 'project' => 'sometimes|exists:projects,id|prohibits:accounting,logbook'\n ];\n }", "public function getGroups() {\n\t\t$groups = array(\n\t\t\t'get_posts' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use WP_Query instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_posts',\n\t\t\t\t\t'wp_get_recent_posts',\n\t\t\t\t\t'get_children',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_terms' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use get_the_terms() instead. Use wp_list_pluck() to get the IDs.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_terms',\n\t\t\t\t\t'wp_get_object_terms',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_categories' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use the equivalent get_the_* version instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_categories',\n\t\t\t\t\t'wp_get_post_tags',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_old_slug_redirect' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use wpcom_vip_old_slug_redirect() instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_old_slug_redirect',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'get_term_by' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_get_term_by() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_term_by',\n\t\t\t\t\t'get_cat_ID',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$wpcom_vip_fns = array(\n\t\t\t'get_category_by_slug',\n\t\t\t'get_term_link',\n\t\t\t'get_page_by_title',\n\t\t\t'get_page_by_path',\n\t\t\t'url_to_postid',\n\t\t);\n\t\tforeach ( $wpcom_vip_fns as $function ) {\n\t\t\t$groups[ $function ] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_$function() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t$function\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn $groups;\n\t}", "protected function _deriveRuleSpecific($errors = array(), $code = 412) {\n\t\t$model = key($errors);\n\t\t$field = key($errors[$model]);\n\t\t$error = $errors[$model][$field][0];\n\n\t\t$instance = ClassRegistry::getObject($model);\n\t\tif (!isset($instance->validate[$field])) {\n\t\t\treturn $code;\n\t\t}\n\n\t\tforeach ($instance->validate[$field] as $key => $rule) {\n\t\t\t$matchesMessage = (isset($rule['message']) && $error === $rule['message']);\n\t\t\tif ($key !== $error && !$matchesMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->message = sprintf('%s.%s : %s', $model, $field, $error);\n\t\t\tif (!empty($rule['code'])) {\n\t\t\t\t$code = $rule['code'];\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $code;\n\t}", "function apply_filter_required_rule($mform, $key, $fields) {\n\n if ($mform->elementExists($key.'_grp')) {\n $mform->addRule($key.'_grp', get_string('required'), 'required', null, 'client');\n $mform->registerRule('custom_rule','function','course_completion_check_custom_rule');\n $mform->addRule($key.'_grp', get_string('required'), 'custom_rule', array($key,$fields));\n }\n\n return $mform;\n }", "public function rules()\n {\n $rules = [\n 'service_code' => 'required|exists:services',\n 'description' => 'required|min:10|max:5000',\n 'title' => 'max:255',\n 'lat' => 'min:-90|max:90|required_with:long',\n 'long' => 'min:-180|max:180|required_with:lat',\n 'address_string' => 'max:255',\n 'zip_code' => 'max:255',\n 'email' => 'email|max:255',\n 'first_name' => 'max:255',\n 'last_name' => 'max:255',\n 'phone' => 'max:255',\n 'media_url' => 'max:255'\n ];\n\n $photos = count($this->input('media'));\n foreach (range(0, $photos) as $index) {\n $rules['media.' . $index] = 'image|mimes:jpeg,bmp,png|max:40000';\n }\n\n return $rules;\n }", "public function getGroups(): array;", "public function group()\n {\n return $this->hasMany('Antares\\Customfields\\Model\\FieldGroup', 'category_id', 'id');\n }", "private function findGroupIdWithCode(string $code): int\n {\n /** @var GroupRepositoryInterface $groupRepository */\n $groupRepository = $this->objectManager->create(GroupRepositoryInterface::class);\n /** @var SearchCriteriaBuilder $searchBuilder */\n $searchBuilder = $this->objectManager->create(SearchCriteriaBuilder::class);\n\n foreach ($groupRepository->getList($searchBuilder->create())->getItems() as $group) {\n if ($group->getCode() === $code) {\n return (int)$group->getId();\n }\n }\n\n return -1;\n }", "public function postProcess(): void {\n $groupsToAddTo = (array) $this->getSubmittedValue('groups');\n $summaryInfo = ['groups' => [], 'tags' => []];\n foreach ($groupsToAddTo as $groupID) {\n // This is a convenience for now - really url & name should be determined at\n // presentation stage - ie the summary screen. The only info we are really\n // preserving is which groups were created vs already existed.\n $summaryInfo['groups'][$groupID] = [\n 'url' => CRM_Utils_System::url('civicrm/group/search', 'reset=1&force=1&context=smog&gid=' . $groupID),\n 'name' => Group::get(FALSE)\n ->addWhere('id', '=', $groupID)\n ->addSelect('name')\n ->execute()\n ->first()['name'],\n 'new' => FALSE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n\n if ($this->getSubmittedValue('newGroupName')) {\n /* Create a new group */\n $groupsToAddTo[] = $groupID = Group::create(FALSE)->setValues([\n 'title' => $this->getSubmittedValue('newGroupName'),\n 'description' => $this->getSubmittedValue('newGroupDesc'),\n 'group_type' => $this->getSubmittedValue('newGroupType') ?? [],\n 'is_active' => TRUE,\n ])->execute()->first()['id'];\n $summaryInfo['groups'][$groupID] = [\n 'url' => CRM_Utils_System::url('civicrm/group/search', 'reset=1&force=1&context=smog&gid=' . $groupID),\n 'name' => $this->getSubmittedValue('newGroupName'),\n 'new' => TRUE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n $tagsToAdd = (array) $this->getSubmittedValue('tag');\n foreach ($tagsToAdd as $tagID) {\n // This is a convenience for now - really url & name should be determined at\n // presentation stage - ie the summary screen. The only info we are really\n // preserving is which tags were created vs already existed.\n $summaryInfo['tags'][$tagID] = [\n 'url' => CRM_Utils_System::url('civicrm/contact/search', 'reset=1&force=1&context=smog&id=' . $tagID),\n 'name' => Tag::get(FALSE)\n ->addWhere('id', '=', $tagID)\n ->addSelect('name')\n ->execute()\n ->first()['name'],\n 'new' => TRUE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n if ($this->getSubmittedValue('newTagName')) {\n $tagsToAdd[] = $tagID = Tag::create(FALSE)->setValues([\n 'name' => $this->getSubmittedValue('newTagName'),\n 'description' => $this->getSubmittedValue('newTagDesc'),\n 'is_selectable' => TRUE,\n 'used_for' => 'civicrm_contact',\n //NYSS new tags during import should be imported as keywords\n 'parent_id'\t=> 296,\n ])->execute()->first()['id'];\n $summaryInfo['tags'][$tagID] = [\n 'url' => CRM_Utils_System::url('civicrm/contact/search', 'reset=1&force=1&context=smog&id=' . $tagID),\n 'name' => $this->getSubmittedValue('newTagName'),\n 'new' => FALSE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n // Store the actions to take on each row & the data to present at the end to the userJob.\n $this->updateUserJobMetadata('post_actions', [\n 'group' => $groupsToAddTo,\n 'tag' => $tagsToAdd,\n ]);\n $this->updateUserJobMetadata('summary_info', $summaryInfo);\n\n // If ACL applies to the current user, update cache before running the import.\n if (!CRM_Core_Permission::check('view all contacts')) {\n $userID = CRM_Core_Session::getLoggedInContactID();\n CRM_ACL_BAO_Cache::deleteEntry($userID);\n CRM_ACL_BAO_Cache::deleteContactCacheEntry($userID);\n }\n\n $this->runTheImport();\n }", "public function rules()\n {\n return collect([\n\n 'mission_statement' => 'required|max:500',\n 'phone_number' => 'required_without_all:mobile_number|max:255',\n 'mobile_number' => 'required_without_all:phone_number|max:255',\n 'organization_name' => 'required|max:255|unique:service_providers,organization_name',\n 'fax' => 'max:255',\n 'website' => 'max:255',\n 'contact_person' => 'required|max:255',\n 'contact_person_title' => 'required|max:255',])\n ->merge(collect(config('extra_types.service_provider'))->mapWithKeys(function ($item) {\n return [\"extra.$item\" => 'required'];\n }))->toArray();\n }", "function acf_convert_rules_to_groups($rules, $anyorall = 'any')\n{\n}", "public function rules()\n {\n return [\n 'name' => 'required|unique:groups',\n\t\t\t'alias' => 'required|unique:groups',\n 'memo' => 'required',\n 'type' => 'required',\n ];\n }", "protected function getRegisteredTaskGroups() {}", "public function testComAdobeCqSocialGroupImplGroupServiceImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.group.impl.GroupServiceImpl';\n\n $crawler = $client->request('POST', $path);\n }", "public static function importGroups() {\n $validation = self::validateGroups();\n $error = $validation['error'];\n\n if (strlen($validation['comment']) == 0) {\n self::deleteDocumentGroupTable();\n foreach (array_keys($validation['data']) as $key) {\n $name = $key;\n try {\n self::$em = self::createNewEntityManager();\n self::insertDocumentGroups($name);\n } catch (Exception $e) {\n $error .= $e->getMessage();\n break;\n }\n }\n }\n\n return array(\n 'data' => $validation['data'],\n 'comment' => $validation['comment'],\n 'duplicates' => $validation['duplicates'],\n 'error' => $error\n );\n }", "private static function getValidationGroups(FormInterface $form)\n {\n do {\n $groups = $form->getConfig()->getOption('validation_groups');\n\n if (null !== $groups) {\n return self::resolveValidationGroups($groups, $form);\n }\n\n $form = $form->getParent();\n } while (null !== $form);\n\n return array(Constraint::DEFAULT_GROUP);\n }", "public function getGroupConfig()\n {\n $groups = [];\n $config = $this->getAllConfigInfo();\n\n foreach ($config as $process) {\n $groupName = $process['group'];\n\n if (! isset($groups[$groupName])) {\n $groups[$groupName] = [\n 'name' => $groupName,\n 'priority' => $process['group_prio'],\n 'inuse' => $process['inuse'],\n 'processes' => [],\n ];\n }\n\n $groups[$groupName]['processes'][$process['name']] = [\n 'name' => $process['name'],\n 'priority' => $process['process_prio'],\n 'autostart' => $process['autostart'],\n ];\n }\n\n return $groups;\n }", "function create_group( $args ) {\r\n global $wpdb;\r\n\r\n //checking that Client Circle not exist other ID\r\n $result = $wpdb->get_row( $wpdb->prepare( \"SELECT group_id FROM {$wpdb->prefix}wpc_client_groups WHERE LOWER(group_name) = '%s'\", strtolower( $args['group_name'] ) ), \"ARRAY_A\");\r\n if ( $result ) {\r\n if ( \"0\" != $args['group_id'] && $result['group_id'] == $args['group_id'] ) {\r\n\r\n } else {\r\n //if Client Circle exist with other ID\r\n wp_redirect( add_query_arg( array( 'page' => 'wpclients_groups', 'updated' => 'true', 'dmsg' => urlencode( __( 'The Group already exists!!!', WPC_CLIENT_TEXT_DOMAIN ) ) ), 'admin.php' ) );\r\n exit;\r\n }\r\n }\r\n\r\n\r\n if ( '0' != $args['group_id'] ) {\r\n //update when edit Client Circle\r\n $result = $wpdb->query( $wpdb->prepare( \"UPDATE {$wpdb->prefix}wpc_client_groups SET group_name = '%s', auto_select = '%s', auto_add_clients = '%s' WHERE group_id = %d\",\r\n trim( $args['group_name'] ),\r\n $args['auto_select'],\r\n $args['auto_add_clients'],\r\n $args['group_id'] ) );\r\n wp_redirect( add_query_arg( array( 'page' => 'wpclients_groups', 'updated' => 'true', 'dmsg' => urlencode( __( 'The changes of the group are saved!', WPC_CLIENT_TEXT_DOMAIN ) ) ), 'admin.php' ) );\r\n exit;\r\n } else {\r\n //create new Client Circle\r\n $result = $wpdb->query( $wpdb->prepare( \"INSERT INTO {$wpdb->prefix}wpc_client_groups SET group_name = '%s', auto_select = '%s', auto_add_clients = '%s'\",\r\n trim( $args['group_name'] ),\r\n $args['auto_select'],\r\n $args['auto_add_clients']\r\n ) );\r\n\r\n //assign all clients\r\n if ( '1' == $args['assign_all'] ) {\r\n $new_group_id = $wpdb->insert_id;\r\n\r\n $args = array(\r\n 'role' => 'wpc_client',\r\n );\r\n\r\n $clients = get_users( $args );\r\n\r\n if ( is_array( $clients ) && 0 < count( $clients ) )\r\n foreach ( $clients as $client ) {\r\n $wpdb->query( $wpdb->prepare( \"INSERT INTO {$wpdb->prefix}wpc_client_group_clients SET group_id = %d, client_id = '%d'\", $new_group_id, $client->ID ) );\r\n }\r\n\r\n }\r\n\r\n\r\n wp_redirect( add_query_arg( array( 'page' => 'wpclients_groups', 'updated' => 'true', 'dmsg' => urlencode( __( 'Client Circle is created!', WPC_CLIENT_TEXT_DOMAIN ) ) ), 'admin.php' ) );\r\n exit;\r\n }\r\n\r\n }", "function addValidationRules(){\n\t\t$this->registerRule('validDate','function','validDate');\n\t\t$this->registerRule('validPeriod','function','validPeriod');\n\t\t$this->registerRule('existe','function','existe');\n\t\t$this->registerRule('number_range','function','number_range');\n\t\t$this->registerRule('validInterval','function','validInterval');\n\t\t$this->registerRule('couple_not_null','function','couple_not_null');\n\t\t$this->registerRule('validParam','function','validParam');\n\t\t$this->registerRule('validUnit_existe','function','validUnit_existe');\n\t\t$this->registerRule('validUnit_required','function','validUnit_required');\n\t\t$this->addRule('dats_title','Data description: Metadata informative title is required','required');\n\t\t$this->addRule('dats_title','Data description: Dataset name exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$this->addRule('dats_date_begin','Temporal coverage: Date begin is not a date','validDate');\n\t\t$this->addRule('dats_date_end','Temporal coverage: Date end is not a date','validDate');\n\t\t$this->addRule(array('dats_date_begin','dats_date_end'),'Temporal coverage: Date end must be after date begin','validPeriod');\n\t\tif ($this->dataset->dats_id == 0){\n\t\t\t$this->addRule('dats_title','Data description: A dataset with the same title exists in the database','existe',array('dataset','dats_title'));\n\t\t}\n\t\t\n\t\tif (isset($this->dataset->data_policy) && !empty($this->dataset->data_policy) && $this->dataset->data_policy->data_policy_id > 0){\n\t\t\t$this->getElement('new_data_policy')->setAttribute('onfocus','blur()');\n\t\t}\n\t\t$this->addRule('new_data_policy','Data use information: Data policy exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$attrs = array();\n\t\tif (isset($this->dataset->database) && !empty($this->dataset->database) && $this->dataset->database->database_id > 0){\n\t\t\t//$this->getElement('new_database')->setAttribute('onfocus','blur()');\n\t\t\t//$this->getElement('new_db_url')->setAttribute('onfocus','blur()');\n\t\t\t$this->disableElement('new_database');\n\t\t\t$this->disableElement('new_db_url');\n\t\t}\n\t\t/*else {\n\t\t\t//$this->addRule('new_database','A database with the same title already exists','existe',array('database','database_name'));\n\t\t}*/\n\t\t$this->addRule('new_database','Data use information: Database name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t$this->addRule('new_db_url','Data use information: Database url exceeds the maximum length allowed (250 characters)','maxlength',250);\t\n\t\t//Formats\n\t\tfor ($i = 0; $i < $this->dataset->nbFormats; $i++){\n\t\t\t$this->addRule('data_format_'.$i,'Data use information: Format name '.($i+1).' exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t\tif (isset($this->dataset->data_formats[$i]) && !empty($this->dataset->data_formats[$i]) && $this->dataset->data_formats[$i]->data_format_id > 0){\n\t\t\t\t//$this->getElement('new_data_format_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('new_data_format_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('new_data_format_'.$i,'Data format '.($i+1).': This format already exists in the database','existe',array('data_format','data_format_name'));\n\t\t\t}*/\n\t\t}\n\t\t//Contacts\n\t\t$this->addRule('pi_0','Contact 1 is required','couple_not_null',array($this,'pi_name_0'));\n\t\t$this->addRule('organism_0','Contact 1: organism is required','couple_not_null',array($this,'org_sname_0'));\n\t\t$this->addRule('email1_0','Contact 1: email1 is required','required');\t\n\t\tfor ($i = 0; $i < $this->dataset->nbPis; $i++){\n\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': Name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 is incorrect','email');\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 is incorrect','email');\n\t\t\t$this->addRule('org_fname_'.$i,'Contact '.($i+1).': Organism full name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('org_sname_'.$i,'Contact '.($i+1).': Organism short name exceeds the maximum length allowed (50 characters)','maxlength',50);\n\t\t\t$this->addRule('org_url_'.$i,'Contact '.($i+1).': Organism url exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\tif (isset($this->dataset->originators[$i]) && !empty($this->dataset->originators[$i]) && $this->dataset->originators[$i]->pers_id > 0){\n\t\t\t\t//$this->getElement('pi_name_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email1_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email2_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('organism_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('pi_name_'.$i);\n\t\t\t\t$this->disableElement('email1_'.$i);\n\t\t\t\t$this->disableElement('email2_'.$i);\n\t\t\t\t$this->disableElement('organism_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('pi_name_'.$i,'Contact '.($i+1).': A contact with the same name is already present in the database. Select it in the drop-down list.','existe',array('personne','pers_name'));\n\t\t\t}*/\n\t\t\tif (isset($this->dataset->originators[$i]->organism) && !empty($this->dataset->originators[$i]->organism) && $this->dataset->originators[$i]->organism->org_id > 0){\n\t\t\t\t//$this->getElement('org_sname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_fname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_url_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('org_sname_'.$i);\n\t\t\t\t$this->disableElement('org_fname_'.$i);\n\t\t\t\t$this->disableElement('org_url_'.$i);\n\t\t\t}\n\t\t\tif ($i != 0){\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': email1 is required','contact_email_required',array($this,$i));\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': organism is required','contact_organism_required',array($this,$i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add validation rules\n\t\t$this->AddModValidationRules();\n\t\t$this->AddSatValidationRules();\n\t\t$this->AddInstruValidationRules();\n\n\t\t//$this->addRule('grid_type','Coverage: Grid type exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t$this->addVaValidationRulesResolution('Coverage');\n\t\t//$this->addRule('sensor_resol_temp','Coverage: Temporal resolution is incorrect','validDate');\n\t\t$this->addRule('sensor_resol_tmp','Coverage: temporal resolution is incorrect','regex',\"/^[0-9]{2}[:][0-9]{2}[:][0-9]{2}$/\");\n\t\t$this->addValidationRulesGeoCoverage();\n\t\t//PARAMETER\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->addValidationRulesVariable($i,$i,'Parameter '.($i+1));\n\t\t}\n\t\t\n\t}", "function add_group(array $data = array())\n\t{\n\t\treturn get_instance()->kbcore->groups->create($data);\n\t}", "public function ruleProvider()\n {\n return [\n [0, 2],\n [1, 1],\n [2, 3],\n [3, 3],\n [11, 2],\n [12, 2],\n [13, 2],\n [19, 2],\n [20, 2],\n [21, 1],\n [40, 2],\n [100, 2],\n [101, 1],\n [110, 2],\n [111, 2],\n [128, 3],\n ];\n }", "public function rules()\n\t{\n\t\treturn PaginateHelper::getRules([\n\t\t\t'groupid'\t=> 'array',\n\t\t\t'groupid.*'\t=> 'integer',\n\t\t\t'hostid'\t=> 'array',\n\t\t\t'hostid.*'\t=> 'integer',\n\t\t\t'host'\t\t=> 'string|max:255',\n\t\t],\n\t\t[\n\t\t\t'hostid',\n\t\t\t'host'\n\t\t],\n\t\t[\n\t\t\t'hostid',\n\t\t\t'host'\n\t\t]);\n\t}", "public static function getGroups(): array\n {\n return [\"group2\"];\n }", "public function rules()\n {\n return [\n 'name' => 'required|string|max:250|unique:mongodb.content_groups,' . $this->contentGroup->_id,\n 'structure' => 'required|json',\n ];\n }", "public function getRules()\n\t{\n\t\t$rules['org_id']\t= ['required', 'integer', 'exists:'. app()->make(\\App\\Org::class)->getTable() . ',id'];\n\t\t$rules['name']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t$rules['code']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t// $rules['group']\t\t\t\t\t= ['required', 'string', 'in:'.implode(',', SELF::GROUP)];\n\t\t$rules['group']\t\t\t\t\t= ['required', 'string'];\n\t\t$rules['description']\t\t\t= ['nullable', 'string'];\n\t\t$rules['threshold']\t\t\t\t= ['nullable', 'numeric', 'min:0'];\n\t\t$rules['unit']\t\t\t\t\t= ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(3, $value);\n }", "protected function set_initial_groups()\n {\n $this->_groups = apply_filters('ngg_admin_requirements_manager_groups', array('phpext' => __('NextGen Gallery requires the following PHP extensions to function correctly. Please contact your hosting provider or systems admin and ask them for assistance:', 'nggallery'), 'phpver' => __('NextGen Gallery has degraded functionality because of your PHP version. Please contact your hosting provider or systems admin and ask them for assistance:', 'nggallery'), 'dirperms' => __('NextGen Gallery has found an issue trying to access the following files or directories. Please ensure the following locations have the correct permissions:', 'nggallery')));\n }", "protected function getGroups()\n\t{\n\t\t// Initialize variables.\n\t\t$groups = array();\n\n\t\t// Get the client and client_id.\n\t\t$client = (string) $this->element['client'];\n\t\t$clientId = ($client == 'administrator') ? 1 : 0;\n\n\t\t// Get the database object and a new query object.\n\t\t$db\t\t= JFactory::getDBO();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t// Build the query.\n\t\t$query->select('id, title, template');\n\t\t$query->from('#__template_styles');\n\t\t$query->where('client_id = '.(int) $clientId);\n\t\t$query->order('template');\n\t\t$query->order('title');\n\n\t\t// Set the query and load the styles.\n\t\t$db->setQuery($query);\n\t\t$styles = $db->loadObjectList();\n\n\t\t// Build the grouped list array.\n\t\tforeach($styles as $style) {\n\n\t\t\t// Initialize the group if necessary.\n\t\t\tif (!isset($groups[$style->template])) {\n\t\t\t\t$groups[$style->template] = array();\n\t\t\t}\n\n\t\t\t$groups[$style->template][] = JHtml::_('select.option', $style->id, $style->title);\n\t\t}\n\n\t\t// Merge any additional groups in the XML definition.\n\t\t$groups = array_merge(parent::getGroups(), $groups);\n\n\t\treturn $groups;\n\t}", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(4, $value);\n }", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(4, $value);\n }", "public function getAclGroups()\n {\n $aclGroupsConfig = include(__DIR__ . '/Acl/AclGroupsConfig.php');\n return $aclGroupsConfig;\n }", "private function parseGroups()\n\t{\n\t\t/**\n\t\t * Grupos\n\t\t */\n\t\t$groups = $this->habbo->groups;\n\n\t\t/**\n\t\t * Convertirlos a Entity\n\t\t */\n\t\tforeach( $groups as $group )\n\t\t\t$this->addGroup( new Group( $group ) );\n\t}", "public static function BUILD_VCS($prd_code)\n {\n $data = self::GET_CTRLSUMM($prd_code);\n\t\t\n\t\t// print_r($prd_code);exit;\n\t\t\n $dataset = [];\n $fsdata = [];\n\t\t\n\t\t$phMon = explode('/',$prd_code);\n\t\t$mon = (int)$phMon[0];\n\t\t$fmon = strtoupper(date(\"F\", mktime(0, 0, 0, (int)$mon, 10)));\n\t\t$fyr = strtoupper(date(\"Y\", mktime(0, 0, 0, 1, 1, (int)$phMon[1])));\n\t\t$m = self::MNTH($mon);\n\t\t$m1 = self::MNTH($mon-1);\n\t\t$m2 = self::MNTH($mon-2);\n\t\t\n\t\t$labels []= ['label'=>$m2];\n\t\t$labels []= ['label'=>$m1];\n\t\t$labels []= ['label'=>$m];\n\t\t\n\t\t\n $gross = [];\n $ded = [];\n $net = [];\n\t\t\n foreach ($data as $key => $value) {\n $obj = (object)$value;\n\t\t\tif($obj->TRAN_NAME=='GROSS PAY'){\n\t\t\t\t$gross[] = ['value'=>$obj->PREV2];\n\t\t\t\t$gross[] = ['value'=>$obj->PREV1];\n\t\t\t\t$gross[] = ['value'=>$obj->CURR];\n\t\t\t}\n\t\t\tif($obj->TRAN_NAME=='TOTAL DEDUCTION'){\n\t\t\t\t$ded[] = ['value'=>$obj->PREV2];\n\t\t\t\t$ded[] = ['value'=>$obj->PREV1];\n\t\t\t\t$ded[] = ['value'=>$obj->CURR];\n\t\t\t}\n\t\t\tif($obj->TRAN_NAME=='NET PAY'){\n\t\t\t\t$net[] = ['value'=>$obj->PREV2];\n\t\t\t\t$net[] = ['value'=>$obj->PREV1];\n\t\t\t\t$net[] = ['value'=>$obj->CURR];\n\t\t\t}\n\t\t\t\n }\n\t\t\n\t\t$dataset[]=[\"seriesname\"=>\"GROSS\",\"data\"=>$gross];\n\t\t$dataset[]=[\"seriesname\"=>\"DEDUCTIONS\",\"data\"=>$ded];\n\t\t$dataset[]=[\"seriesname\"=>\"NET\",\"data\"=>$net];\n\n $graphData = [\n\t\t\t'type'=>'MSarea',\n\t\t\t'renderAt'=>'controlsum-chart',\n\t\t\t'width'=>'100%',\n\t\t\t'height'=>'100%',\n\t\t\t'dataFormat'=>'json',\n\t\t\t'dataSource'=>[\n\t\t\t\t\"chart\"=>[\n\t\t\t\t\t\"caption\"=> $fmon.\",\".$fyr,\n\t\t\t\t\t\"subCaption\"=>\"vs Last two months\",\n\t\t\t\t\t\"linethickness\"=>\"4\",\n\t\t\t\t\t\"exportEnabled\"=>\"1\",\n\t\t\t\t\t\"numberPrefix\"=>\"KSh.\",\n\t\t\t\t\t\"paletteColors\"=>\"#0075c2,#1aaf5d,#ff0000\",\n\t\t\t\t\t\"bgColor\"=>\"#ffffff\",\n\t\t\t\t\t\"showBorder\"=>\"0\",\n\t\t\t\t\t\"showCanvasBorder\"=>\"0\",\n\t\t\t\t\t\"plotBorderAlpha\"=>\"10\",\n\t\t\t\t\t\"usePlotGradientColor\"=>\"0\",\n\t\t\t\t\t\"autoScale\"=>\"1\",\n\t\t\t\t\t\"legendBorderAlpha\"=>\"0\",\n\t\t\t\t\t\"legendShadow\"=>\"0\",\n\t\t\t\t\t\"plotFillAlpha\"=>\"60\",\n\t\t\t\t\t\"showXAxisLine\"=>\"1\",\n\t\t\t\t\t\"axisLineAlpha\"=>\"25\", \n\t\t\t\t\t\"showValues\"=>\"0\",\n\t\t\t\t\t\"captionFontSize\"=>\"14\",\n\t\t\t\t\t\"subcaptionFontSize\"=>\"14\",\n\t\t\t\t\t\"subcaptionFontBold\"=>\"0\",\n\t\t\t\t\t\"divlineColor\"=>\"#999999\", \n\t\t\t\t\t\"divLineIsDashed\"=>\"1\",\n\t\t\t\t\t\"divLineDashLen\"=>\"1\",\n\t\t\t\t\t\"divLineGapLen\"=>\"1\",\n\t\t\t\t\t\"showAlternateHGridColor\"=>\"0\",\n\t\t\t\t\t\"toolTipColor\"=>\"#ffffff\",\n\t\t\t\t\t\"outCnvBaseFontColor\"=>\"#000000\",\n\t\t\t\t\t\"toolTipBorderThickness\"=>\"0\",\n\t\t\t\t\t\"toolTipBgColor\"=>\"#000000\",\n\t\t\t\t\t\"toolTipBgAlpha\"=>\"80\",\n\t\t\t\t\t\"toolTipBorderRadius\"=>\"2\",\n\t\t\t\t\t\"toolTipPadding\"=>\"5\",\n\t\t\t\t],\n\t\t\t\t\"categories\"=>[\n\t\t\t\t\t[\"category\"=>$labels],\n\t\t\t\t],\n\t\t\t\t\"dataset\"=>$dataset,\n\t\t\t]\n\t\t];\n\t\t\n\t\t$fsdata = $graphData;\n\n return $fsdata;\n }", "public function loadRules($weight, $subtotal, $items, $pcode)\n {\n\t$collection = Mage::getModel('temando/rule')->getCollection();\n\t/* @var $collection Ewave_Temando_Model_Mysql4_Rule_Collection */\n\t\n\t$collection->addFieldToFilter('is_active', '1')\n\t\t ->setOrder('priority', 'ASC');\n\t\n\t//admin - manual order creation\n\tif(Mage::app()->getStore()->isAdmin()) {\n\t $store_id = Mage::app()->getRequest()->getParam('store_id');\n\t} else {\n\t $store_id = Mage::app()->getStore(null)->getId();\n\t}\n\tforeach($collection->getItems() as $rule) {\n\t /* @var $rule Ewave_Temando_Model_Rule */\n\t if(!$rule->validateDate()) {\n\t\tcontinue;\n\t }\n\t \n\t $store_ids = explode(',', $rule->getStoreIds());\n\t if(in_array($store_id, $store_ids) && \n\t $rule->isValid($weight, $subtotal, $items, $pcode))\n\t {\n\t\t$this->_validRules[] = $rule;\n\t }\n\t}\n\t\n\treturn $this;\n }", "public function groups()\n {\n return $this->hasMany(static::class, 'parent_id');\n }", "protected function processServiceListBlock($code) {\n $ret = '';\n foreach ($this->services as $service) {\n $this->serviceBeingProcessed = $service;\n $blockForService = str_replace(self::_SERVICE_, $service->name, $code);\n\n\n $processed = $this->searchForBlocksAndApplyProcessing($blockForService, self::METHOD, 'processMethodListBlock');\n if ($processed) {\n $blockForService = $processed;\n }\n\n $ret .= $blockForService;\n }\n return $ret;\n }", "public function ledgerGroups()\n {\n return $this->hasMany(LedgerGroup::class,'principle_id');\n }", "public function rules()\n {\n switch ($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n {\n return [\n 'key' => [\n 'bail',\n 'string',\n 'required',\n 'min:2',\n 'max:20',\n Rule::unique('group_configs')->where(function ($query) {\n $query->where('group_id', $this->route('group_id'));\n })\n\n ],\n 'value' => 'required|min:1',\n ];\n }\n case 'PUT':\n case 'PATCH':\n {\n return [\n 'key' => [\n 'bail',\n 'string',\n 'required',\n 'min:2',\n 'max:20',\n Rule::unique('group_configs')->where(function ($query) {\n $query->where('group_id', $this->route('group_id'))->where('id', '!=', $this->route('id'));\n })\n\n ],\n 'value' => 'required|min:1',\n ];\n }\n default:\n break;\n }\n }", "function recurringdowntime_get_servicegroup_cfg($servicegroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"servicegroup\") {\n continue;\n }\n }\n if ($servicegroup && !(strtolower($schedule[\"servicegroup_name\"]) == strtolower($servicegroup))) {\n continue;\n }\n if (array_key_exists('servicegroup_name', $schedule)) {\n if (is_authorized_for_servicegroup(0, $schedule[\"servicegroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "protected function generateOneServiceFileCode($code) {\n $codeMatchingService = str_replace(self::_SERVICE_, $this->serviceBeingProcessed->name, $code);\n $processed = $this->searchForBlocksAndApplyProcessing($codeMatchingService, self::METHOD, 'processMethodListBlock');\n if ($processed) {\n $codeMatchingService = $processed;\n }\n return $codeMatchingService;\n }", "function getGroupsForStudy($theStudyID, $clientID) {\n global $definitions;\n\n $groupsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['groups'], $clientID);\n $groupsAssociatedStudyID = getClientPropertyID_RelatedWith_byName($definitions['groupsStudyID'], $clientID);\n\n //First get the relation associated\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $groupsAssociatedStudyID, 'value' => $theStudyID);\n\n $groups = getFilteredItemsIDs($groupsItemTypeID, $clientID, $filters, $returnProperties);\n\n return $groups;\n\n}", "public function rules()\n {\n return [\n 'name' => 'required|string',\n 'group_id' => 'required|exists:role_groups,id',\n 'type' => 'required|in:user,manager',\n 'groups' => 'array',\n 'groups.*' => 'integer|exists:permission_groups,id',\n 'permission' => 'required|array'\n ];\n }", "public function groups() {\n return $this->hasMany(Group::class, 'category_id');\n }", "protected function addFieldGroupConfigs()\n {\n // TODO: add acf field group configs\n }", "public function getSubGroups() {}", "final protected function buildDependencyMap() {\n\n\t\t$this->dependencyMap = array();\n\t\t$this->prioritiesHandlers = array();\n $p = new dummyPriorityhookHandler();\n\t\t$this->prioritiesHandlers[self::NORMAL] = $p;\n $this->priorityBased = array('min' => array(),'max' => array());\n\t\t//$this->priorityBased['min'][self::NORMAL][spl_object_hash($p)] = $p;\n\t\tforeach ($this->objects as $hash => $handler) {\n\t\t\t$this->priorityBased['min'][self::NORMAL][$hash] = $handler;\n\t\t\t$this->dependencyMap[$hash] = array('priority' => $this->prioritiesHandlers[self::NORMAL]);\n\t\t\t$this->priorityBased['max'][self::LATEST-1][$hash] = $handler;\n\t\t\t$handler->registerDependencies($this);\n\t\t}\n\t}", "public function rules()\n {\n return [\n 'code' => 'required|unique:layout,code,' . $this->get('id') . ',id',\n ];\n }", "public function rules()\n {\n return [\n 'name' => ['string', 'required'],\n 'google_project_id' => [\n 'required',\n Rule::in($this->user()->currentTeam->googleProjects()->pluck('id'))\n ],\n 'source_provider_id' => [\n 'required',\n Rule::exists('source_providers', 'id')->where(function ($query) {\n $query->where('user_id', $this->user()->id);\n })\n ],\n 'region' => [\n 'required',\n Rule::in(collect(GoogleProject::REGIONS)->keys()),\n ],\n 'type' => [\n 'required',\n Rule::in(collect(Project::TYPES)->keys()),\n ],\n 'repository' => [\n 'required',\n 'string',\n new ValidRepository(SourceProvider::find($this->source_provider_id))\n ],\n ];\n }", "public static function getRulesByApplicationIdAndGroupId($applicationId, $groupId) {\n\t\t$rules = new GroupRulesDao();\n\t\t$rules->setServerAddress($applicationId);\n\n\t\t$builder = new QueryBuilder($rules);\n\t\t$rows = $builder->select('*')\n\t\t\t\t\t\t->where('app_id', $applicationId)\n\t\t\t\t\t\t->where('group_id', $groupId)\n\t\t\t\t\t\t->order('rule_order')\n\t\t\t\t\t\t->findList();\n\n\t\treturn SecurityDaoBase::makeObjectsFromSelectListResult($rows, 'GroupRulesDao');\n\t}", "public function groups()\n {\n return $this->hasMany('App\\Models\\Group');\n }", "private function _get_groups() {\n\n\t\t$request = new Gitlab();\n\t\t$gitlab = $request->init_request();\n\n\t\t$groups = [];\n\t\t$page_index = 1;\n\n\t\tdo {\n\n\t\t\t$response = $gitlab->get( \"groups?per_page=100&page=$page_index\" );\n\t\t\t$response_arr = json_decode( $response->body, true );\n\n\t\t\t$groups = array_merge( $groups, $response_arr );\n\n\t\t\t$page_index = get_next_page( $response );\n\n\t\t} while ( ! empty( $page_index ) );\n\n\t\treturn $groups;\n\n\t}", "public static function getGroups(): array\n {\n return ['test'];\n }" ]
[ "0.6945669", "0.5391789", "0.53563416", "0.51035523", "0.5008549", "0.50082374", "0.4981849", "0.4923943", "0.48742232", "0.4836029", "0.48235476", "0.48104113", "0.47624975", "0.47624975", "0.4750398", "0.47161323", "0.46397656", "0.46376863", "0.46341503", "0.4630065", "0.46132982", "0.4604138", "0.45810232", "0.45490232", "0.45490232", "0.4525668", "0.45192063", "0.4476655", "0.44722882", "0.44624475", "0.4462006", "0.44286433", "0.44133237", "0.43934193", "0.4368971", "0.43627343", "0.43511894", "0.43477285", "0.434361", "0.43387294", "0.43363294", "0.43363294", "0.43285218", "0.43264866", "0.43186903", "0.42859888", "0.42728236", "0.42660373", "0.42548636", "0.42538282", "0.42483574", "0.4235655", "0.42269477", "0.42224663", "0.4220499", "0.4216876", "0.4208772", "0.4203773", "0.41976812", "0.41955933", "0.4191177", "0.4190632", "0.4183168", "0.41831577", "0.4170461", "0.41699082", "0.41617283", "0.41612577", "0.41584688", "0.41578457", "0.41575897", "0.4156957", "0.41500664", "0.4144826", "0.41421002", "0.41396448", "0.413784", "0.413784", "0.41353738", "0.41341248", "0.41340473", "0.4125967", "0.4123231", "0.41207796", "0.411991", "0.411477", "0.41142124", "0.41135353", "0.4107753", "0.40976006", "0.4096394", "0.4092828", "0.4092252", "0.40842813", "0.40828082", "0.40780365", "0.40766963", "0.40716767", "0.4071554", "0.40550178" ]
0.70263803
0
Dependency rule groups for a particular serviceCode.
public function setServiceCodeDependencyRuleGroups(?array $serviceCodeDependencyRuleGroups): self { $this->initialized['serviceCodeDependencyRuleGroups'] = true; $this->serviceCodeDependencyRuleGroups = $serviceCodeDependencyRuleGroups; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getServiceCodeDependencyRuleGroups(): ?array\n {\n return $this->serviceCodeDependencyRuleGroups;\n }", "public function testGetRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function getServiceGroups(int $serviceId)\n {\n $host = Host::getInstance($this->dependencyInjector);\n $servicegroup = ServiceGroup::getInstance($this->dependencyInjector);\n $this->serviceCache[$serviceId]['sg'] = $servicegroup->getServiceGroupsForStpl($serviceId);\n foreach ($this->serviceCache[$serviceId]['sg'] as &$sg) {\n if ($host->isHostTemplate($this->currentHostId, $sg['host_host_id'])) {\n $servicegroup->addServiceInSg(\n $sg['servicegroup_sg_id'],\n $this->currentServiceId,\n $this->currentServiceDescription,\n $this->currentHostId,\n $this->currentHostName\n );\n Relations\\ServiceGroupRelation::getInstance($this->dependencyInjector)->addRelationHostService(\n $sg['servicegroup_sg_id'],\n $sg['host_host_id'],\n $serviceId\n );\n }\n }\n }", "public function testCreateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function createResourceGroups()\n {\n foreach ($this->api->getServices() as $service) {\n $this->resourceGroups[] = new ResourceGroup($service);\n }\n }", "function build_servicegroups_array()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\t\n\t$servicegroups = $NagiosData->getProperty('servicegroups');\t\t\t\n\t$services = $NagiosData->getProperty('services');\t\t\n\t$services = user_filtering($services,'services'); \n\t\n\t$servicegroups_details = array(); //multi-dim array to hold servicegroups \t\n\tforeach($servicegroups as $groupname => $members)\n\t{\n\t\t$servicegroups_details[$groupname] = array();\n \t\t//array_dump($members); \n\t\tforeach($services as $service)\n\t\t{\t\n\t\t\tif(isset($members[$service['host_name']]) && in_array($service['service_description'],$members[$service['host_name']]))\t{\n\t\t\t\tprocess_service_status_keys($service);\t\t\n\t\t\t\t$servicegroups_details[$groupname][] = $service;\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}\n\n\treturn $servicegroups_details; \n}", "private static final function parseRules($code)\n {\n $rules = array();\n foreach (preg_split(\"#\\r?\\n#\", $code) as $line) {\n if (!preg_match('#^(?<input>\\w+)\\s+to\\s+(?<output>\\w+)\\s+as\\s+(?<relationship>\\w+)(\\s+(?<options>.+))?$#', $line, $match))\n continue;\n\n $rule = new stdClass();\n\n $rule->input = $match['input' ];\n $rule->output = $match['output'];\n $rule->relationship = $match['relationship' ];\n if (!isset($match['options']))\n $rule->options = array();\n else\n $rule->options = preg_split('#\\s+#', $match['options']);\n\n $rules[] = $rule;\n }\n\n return $rules;\n }", "public function getGroupedRules(): array;", "public function testDeleteRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function findServiceGroups(): array;", "public function getServiceGroupsForStpl(int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtStplSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtStplSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\"\n );\n }\n $this->stmtStplSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtStplSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtStplSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "public function testAggregateRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getGroupSchemas($regionCode, $modelCode, $modificationCode, $groupCode)\n {/* {\n $groupSchemas[$aData['num_image']] = array(Constants::NAME => $aData['num_image'], Constants::OPTIONS => array(\n Constants::CD => $aData['catalog'].$aData['sub_dir'].$aData['sub_wheel'],\n \t'num_model' => $aNumModel['num_model'],\n 'num_image' => $aData['num_image']\n ));\n }*/\n\t\t$groupSchemas = array();\n return $groupSchemas;\n }", "public function getGroupSchemas($regionCode, $modelCode, $modificationCode, $groupCode)\n {/* {\n $groupSchemas[$aData['num_image']] = array(Constants::NAME => $aData['num_image'], Constants::OPTIONS => array(\n Constants::CD => $aData['catalog'].$aData['sub_dir'].$aData['sub_wheel'],\n \t'num_model' => $aNumModel['num_model'],\n 'num_image' => $aData['num_image']\n ));\n }*/\n\t\t$groupSchemas = array();\n return $groupSchemas;\n }", "public function group() {\n\t\t$this->addRule($v = new ValidationRuleGroup($this));\n\t\treturn $v;\n\t}", "public function getServiceGroupsForService(int $hostId, int $serviceId)\n {\n // Get from the cache\n if (isset($this->sgRelationCache[$serviceId])) {\n return $this->sgRelationCache[$serviceId];\n }\n if ($this->doneCache == 1) {\n return [];\n }\n\n if (is_null($this->stmtServiceSg)) {\n // Meaning, linked with the host or hostgroup (for the null expression)\n $this->stmtServiceSg = $this->backendInstance->db->prepare(\n \"SELECT servicegroup_sg_id, host_host_id, service_service_id\n FROM servicegroup_relation\n WHERE service_service_id = :service_id\n AND (host_host_id = :host_id OR host_host_id IS NULL)\"\n );\n }\n $this->stmtServiceSg->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtServiceSg->bindParam(':host_id', $hostId, PDO::PARAM_INT);\n $this->stmtServiceSg->execute();\n $this->sgRelationCache[$serviceId] = array_merge(\n $this->stmtServiceSg->fetchAll(PDO::FETCH_ASSOC),\n $this->sgRelationCache[$serviceId]\n );\n return $this->sgRelationCache[$serviceId];\n }", "private function _loadRules()\n\t{\n\t\t//load rules\n\t\trequire_once( PROJECT_ROOT . '/data/configs/groups/global.php' );\n\n\t\t//TODO: make group selector\n\t\tif ( is_array( $this->_auth->getGroups( ) ) )\n\t\t{\n\t\t\t//load active group\n\t\t\t$activeGroup = $this->_auth->getActiveGroup();\n\n\t\t\tif ( !$activeGroup\n\t\t\t || !file_exists( PROJECT_ROOT . '/data/configs/groups/' . $activeGroup . '.php' )\n\t\t\t)\n\t\t\t{\n\t\t\t\tforeach ( $this->_auth->getGroups() as $groupId )\n\t\t\t\t{\n\t\t\t\t\t$ruleFile = PROJECT_ROOT . '/data/configs/groups/' . $groupId . '.php';\n\t\t\t\t\tif ( file_exists( $ruleFile ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$activeGroup = $groupId;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $activeGroup )\n\t\t\t{\n\t\t\t\trequire_once( PROJECT_ROOT . '/data/configs/groups/' . $activeGroup . '.php' );\n\t\t\t\t$this->_auth->setActiveGroup( $activeGroup );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\treturn;\n\t}", "public function getGroups() {}", "public function testQueryRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function rules() : array\n {\n return [\n 'service.service_type_id' => 'required',\n// 'service.currency_id' => 'required',\n// 'service.user_exchange_rate' => 'required',\n 'service.service_model_id' => 'required',\n// 'service_item.*.*' => 'required_if:service.payment_method_id,3296',\n// 'service_item.*.*' => 'required_if:service.payment_method_id,3296',\n// 'service_item.*.item_id' => 'required',\n// 'service_item.*.quantity' => 'required',\n// 'service_item.*.unit_cost' => 'required',\n// 'service_item.*.total' => 'required',\n// 'service_item.*.unit_id' => 'required',\n// 'service_item_direct.*.*' => 'required_if:service.payment_method_id,3297',\n\n ];\n }", "public function rules()\n {\n\n $services = [\n 'services.basic.*.*' => 'numeric',\n 'services.additional.*' => 'numeric',\n 'services.custom.*.name' => 'required|string',\n 'services.custom.*.1' => 'numeric',\n 'services.custom.*.2' => 'numeric',\n 'services.custom.*.3' => 'numeric',\n 'services.custom.*.4' => 'numeric',\n ];\n\n $rules = [\n 'name' => 'required|string|max:60',\n 'type' => 'required',\n 'email' => 'nullable|email',\n// 'phone' => 'regex:',\n 'location' => 'nullable|json',\n 'city' => 'nullable|string',\n 'address' => 'nullable|string',\n 'image' => 'nullable|image',\n 'posts' => 'nullable|integer',\n 'schedule.*.*' => 'required',\n// 'requisites' => 'required'\n ];\n\n return array_merge($rules, $services);\n }", "public function testUpdateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function rules()\n {\n $types = TypeService::get();\n $codes = $types->pluck('code')->toArray();\n\n return [\n 'service_type' => Rule::in($codes),\n 'start_date' => 'date_format:Y-m-d',\n 'end_date' => 'date_format:Y-m-d',\n 'page_number' => 'integer|min:1',\n 'page_size' => 'integer|min:1',\n ];\n }", "public function groups();", "public function groups();", "public function setServiceCodeMutuallyExclusiveGroups(?array $serviceCodeMutuallyExclusiveGroups): self\n {\n $this->initialized['serviceCodeMutuallyExclusiveGroups'] = true;\n $this->serviceCodeMutuallyExclusiveGroups = $serviceCodeMutuallyExclusiveGroups;\n\n return $this;\n }", "public function getServiceCodeMutuallyExclusiveGroups(): ?array\n {\n return $this->serviceCodeMutuallyExclusiveGroups;\n }", "function new_groups()\n {\n \n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n case 'POST':\n {\n return [\n 'project_id' => 'required|integer',\n 'name' => 'required|string|unique:groups,name,' . $this->get('name') . ',id,project_id,' . $this->project_id,\n 'enabled' => 'required|boolean'\n ];\n }\n case 'PUT':\n case 'PATCH':\n {\n return [\n 'project_id' => 'required|integer',\n 'name' => 'required|string|unique:groups,name,' . $this->get('id') . ',id,project_id,' . $this->project_id,\n 'enabled' => 'required|boolean'\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n $this->rule = Refund::$ServiceProcessMap;\n return [\n 'id' => 'required',\n 'handle' => Rule::in(array_keys($this->rule)),\n ];\n }", "public function getServiceGroupsFromScope(\\Scope $scope){\n $dql = \"SELECT sg\n FROM ServiceGroup sg\n JOIN sg.scopes sc\n WHERE sc.id = :id\n ORDER BY sg.name\";\n $query = $this->em->createQuery($dql)\n ->setParameter(\":id\", $scope->getId());\n return $query->getResult();\n }", "protected function getGroupposition_LegendService()\n {\n return $this->services['groupposition.legend'] = new \\phpbb\\groupposition\\legend(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'});\n }", "public static function getGroups(): array\r\n {\r\n return [\r\n 'dev',\r\n 'pre',\r\n ];\r\n }", "public function groups()\n {\n return $this->hasMany(get_class(new KpiGroup()));\n }", "public function groups()\n {\n return $this->hasMany('App\\ERP\\SItemGroup');\n }", "public function rules()\n {\n return [\n 'title' => 'required|max:50',\n 'slogan' => 'required|max:255',\n 'image_service_1' => 'image|dimensions:min_width=200,max_width=360,min_height=200,max_height=360',\n 'title_service_1' => 'required|max:30',\n 'description_service_1' => 'required|max:255',\n 'image_service_2' => 'image|dimensions:min_width=200,max_width=360,min_height=200,max_height=360',\n 'title_service_2' => 'required|max:30',\n 'description_service_2' => 'required|max:255',\n 'image_service_3' => 'image|dimensions:min_width=200,max_width=360,min_height=200,max_height=360',\n 'title_service_3' => 'required|max:30',\n 'description_service_3' => 'required|max:255',\n ];\n }", "public function getServices() {\n $serviceNames = $this->getServiceNames($this->serviceFolderPaths);\n $ret = $ret1 = array();\n// require_once AMFPHP_ROOTPATH.'Plugins/AmfphpDiscovery/CReflection.php';\n foreach ($serviceNames as $serviceName) {\n/* $methods = array();\n $objC = new CReflection(APP_PATH.'/app/controllers/'.$serviceName.'.php');\n $objComment = $objC->getDocComment();\n $arrMethod = $objC->getMethods();\n foreach ($arrMethod as $objMethods)\n {\n $methodComment = $objMethods->getDocComment();\n $parsedMethodComment = $this->parseMethodComment($methodComment);\n $arrParamenter = $objMethods->getParameters();\n foreach ($arrParamenter as $Paramenter)\n {\n $parameterInfo = new AmfphpDiscovery_ParameterDescriptor($Paramenter, '');\n $parameters[] = $parameterInfo;\n }\n $methods[$objMethods->_name] = new AmfphpDiscovery_MethodDescriptor($objMethods->_name, $parameters, $methodComment, $parsedMethodComment['return']);\n }\n\n $ret[$serviceName] = new AmfphpDiscovery_ServiceDescriptor($serviceName, $methods, $objComment); */\n $ret1[] = array('label'=>$serviceName,'date'=>'');\n }\n// var_dump($ret);exit();\n //note : filtering must be done at the end, as for example excluding a Vo class needed by another creates issues\n foreach ($ret as $serviceName => $serviceObj) {\n foreach (self::$excludePaths as $excludePath) {\n if (strpos($serviceName, $excludePath) !== false) {\n unset($ret[$serviceName]);\n break;\n }\n }\n }\n return $ret1;\n }", "protected function addMetaNesting(array $attributeMeta, string $groupCode, string $attributeCode): array\n {\n return [\n $groupCode => [\n 'arguments' => ['data' => ['config' => ['dataScope' => 'data.product']]],\n 'children' => [\n 'container_' . $attributeCode => [\n 'children' => [$attributeCode => ['arguments' => ['data' => ['config' => $attributeMeta]]]],\n ],\n ],\n ],\n ];\n }", "function clsGrp($pName) {\n $this->name = $pName;\n if (function_exists('before_group_' . $pName)) $this->beforeEvent = true;\n if (function_exists('after_group_' . $pName)) $this->afterEvent = true;\n }", "function group_create($data){\n $dval = $data['umd_val'];\n if(!isset($this->domains[$dval])) return 2;\n if(!in_array($dval,$this->quest_provider('d:group','create',TRUE,FALSE)))\n return 3;\n $tmp = $this->domains[$dval]->group_create($data);\n if($tmp>0) return $tmp;\n return $this->gdn_make($data['gname'],$dval);\n }", "public function getGroups();", "public function getGroups();", "public function groups() {\n\t\tif (empty($this->_compiledGroupNames)) {\n\t\t\tforeach ($this->settings['groups'] as $group) {\n\t\t\t\t$this->_compiledGroupNames[] = $this->settings['prefix'] . $group;\n\t\t\t}\n\t\t}\n\n\t\t$groups = $this->_Memcached->getMulti($this->_compiledGroupNames);\n\t\tif (count($groups) !== count($this->settings['groups'])) {\n\t\t\tforeach ($this->_compiledGroupNames as $group) {\n\t\t\t\tif (!isset($groups[$group])) {\n\t\t\t\t\t$this->_Memcached->set($group, 1, 0);\n\t\t\t\t\t$groups[$group] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tksort($groups);\n\t\t}\n\n\t\t$result = array();\n\t\t$groups = array_values($groups);\n\t\tforeach ($this->settings['groups'] as $i => $group) {\n\t\t\t$result[] = $group . $groups[$i];\n\t\t}\n\n\t\treturn $result;\n\t}", "public function findGroups() {\n\t\t\n\t}", "public function __construct()\n {\n $this->Service = new GroupService();\n }", "public function rules()\n {\n\n if ($this->input('service_type') == t( 'mogaz service'))\n {\n\n\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'owner_id' => '',\n 'plate_number' => '',\n 'serial_number' => '',\n 'car_url' => '',\n ];\n\n\n\n }\n if ($this->input('service_type') == t( 'estimation title'))\n {\n\n\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'first_owner_name' => 'required|mb_between:2,100',\n 'middle_owner_name' => 'required|mb_between:2,100',\n 'last_owner_name' => 'required|mb_between:2,100',\n 'Mobile_number' => 'required|regex:/^[0-9]+$/',\n 'car_type' => 'required',\n 'car_category' => 'required',\n 'car_brand' => 'required',\n 'Year_manufacture' => 'required|regex:/^[0-9]+$/',\n 'Kilometers' => 'required',\n 'car_Pictures' =>'required',\n\n ];\n\n\n\n }\n\n if ($this->input('service_type') == t( 'ownership_title'))\n {\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'seller_name' => '',\n 'purchaser_name' => 'required|mb_between:2,100',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'owner_id' => 'required|regex:/^[0-9]+$/|digits:10',\n 'user_id' => 'required|regex:/^[0-9]+$/|digits:10',\n 'seller_phone' => 'required|regex:/^[0-9]+$/',\n 'purchaser_phone' => 'required|regex:/^[0-9]+$/',\n 'Kilometers' => 'required',\n 'price' => 'required',\n 'driving_license' => 'required|image|mimes:' . getUploadFileTypes('image'),\n 'seller_id_image' => '',\n 'purchaser_id_image' => 'required|image|mimes:' . getUploadFileTypes('image'),\n 'car_Pictures' => '',\n 'exhibitions_place' => '',\n 'exhibitions_id' => '',\n 'car_url' => '',\n\n ];\n\n\n }\n\n if ($this->input('service_type') == t( 'checking_title'))\n {\n $timedate =date('Y-m-d H:i:s');\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'car_url' => 'required',\n 'checking_time' => 'required',\n 'checking_date' => 'required',\n 'address' =>'required',\n 'phone' =>'required',\n\n ];\n\n\n\n }\n if ($this->input('service_type') == t('shipping_title'))\n {\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'car_url' => '',\n 'shipping_id' =>'required',\n 'address' =>'required',\n 'owner_id' => '',\n 'plate_number' => '',\n 'serial_number' => '',\n 'address_to' =>'required',\n 'car_Pictures' => 'required',\n ];\n\n\n\n }\n if ($this->input('service_type') == t( 'maintenance_title'))\n {\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => '',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n 'car_place' => 'required',\n 'car_url' => '',\n 'maintenance_id' =>'',\n 'maintenance_id_yes' =>'',\n 'address' =>'',\n 'owner_id' => '',\n 'plate_number' => '',\n 'serial_number' => '',\n ];\n\n\n\n }\n\n if ($this->input('service_type') == t( 'estimation title'))\n {\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n }\n if (!empty($this->input('for_shipping')))\n {\n\n if ($this->input('for_shipping')== \"no\" ){\n\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n $rules['address'] = 'required|' . $rules['address'];\n\n }elseif($this->input('for_shipping') == \"yes\" ){\n\n $rules['car_url'] = 'required|' . $rules['car_url'];\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n }\n }else{\n if ($this->input('service_type') == t('shipping_title'))\n {\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n $rules['address'] = 'required|' . $rules['address'];\n }}\n\n\n if (!empty($this->input('for_mainten')))\n {\n if ($this->input('for_mainten') == \"no\" ){\n\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n $rules['address'] = 'required|' . $rules['address'];\n $rules['maintenance_id'] = 'required|' . $rules['maintenance_id'];\n\n }elseif($this->input('for_mainten') == \"yes\" ){\n\n $rules['car_url'] = 'required|' . $rules['car_url'];\n $rules['maintenance_id_yes'] = 'required|' . $rules['maintenance_id_yes'];\n }\n }else{\n if ($this->input('service_type') == t( 'maintenance_title') )\n {\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n $rules['address'] = 'required|' . $rules['address'];\n $rules['maintenance_id'] = 'required|' . $rules['maintenance_id'];\n }}\n\n if (!empty($this->input('for_mogaz')))\n {\n if ($this->input('for_mogaz') == \"no\" ){\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n\n\n }elseif($this->input('for_mogaz') == \"yes\" ){\n $rules['car_url'] = 'required|' . $rules['car_url'];\n }\n }else{\n if ($this->input('service_type') == t( 'mogaz service') )\n {\n $rules['owner_id'] = 'required|regex:/^[0-9]+$/|digits:10' . $rules['owner_id'];\n $rules['plate_number'] = 'required|' . $rules['plate_number'];\n $rules['serial_number'] = 'required|' . $rules['serial_number'];\n\n }}\n\n\n\n if (!empty($this->input('for_ownership')))\n {\n\n if ($this->input('for_ownership')== \"no\" ){\n $rules['seller_name'] = 'required|' . $rules['seller_name'];\n $rules['seller_id_image'] = 'required|image|mimes:' . getUploadFileTypes('image'). $rules['seller_id_image'];\n $rules['car_Pictures'] = 'required';\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image') ;\n $rules['exhibitions_id'] = 'required|' . $rules['exhibitions_id'];\n $rules['exhibitions_place'] = 'required|' . $rules['exhibitions_place'];\n\n }elseif($this->input('for_ownership')== \"yes\" ){\n $rules['car_url'] = 'required|' . $rules['car_url'];\n }\n }else{\n\n if ($this->input('service_type') == t( 'ownership_title')){\n $rules['seller_name'] = 'required|' . $rules['seller_name'];\n $rules['seller_id_image'] = 'required|image|mimes:' . getUploadFileTypes('image'). $rules['seller_id_image'];\n $rules['car_Pictures'] = 'required';\n $rules['car_Pictures.*'] ='image|mimes:' . getUploadFileTypes('image');\n $rules['exhibitions_id'] = 'required|' . $rules['exhibitions_id'];\n $rules['exhibitions_place'] = 'required|' . $rules['exhibitions_place'];\n }}\n\n if ($this->input('service_type') =='contact_page'){\n $rules = [\n 'first_name' => 'required|mb_between:2,100',\n 'last_name' => 'required|mb_between:2,100',\n 'email' => 'required|email|whitelist_email|whitelist_domain',\n 'message' => 'required|mb_between:5,500',\n 'g-recaptcha-response' => (config('settings.security.recaptcha_activation')) ? 'required' : '',\n ];\n }\n\n\n return $rules;\n }", "public function setServiceCodeRuleName(?string $serviceCodeRuleName): self\n {\n $this->initialized['serviceCodeRuleName'] = true;\n $this->serviceCodeRuleName = $serviceCodeRuleName;\n\n return $this;\n }", "public function rules()\n {\n $lastUrl = \\GLobalHelper::lastUrl();\n\n if(!empty(\\Request::segment(2))) :\n $rules['group_name'] = 'required|unique:groups,group_name,'.$lastUrl.',group_id';\n else :\n $rules['group_name'] = 'required|unique:groups,group_name';\n endif;\n\n return $rules;\n }", "public function rules()\n {\n\n $hourBasedServiceIds = WageService::whereUnit(ApplicationSettings::get()->services_hour_unit)\n ->pluck('id')->toArray();\n\n return [\n 'accounting' => 'sometimes|array|prohibits:logbook,project',\n 'accounting.*' => [\n Rule::exists('accounting', 'id')->where(function ($query) use ($hourBasedServiceIds) {\n return $query\n ->where('employee_id', Auth::id())\n ->whereIn('service_id', $hourBasedServiceIds);\n }),\n ],\n 'logbook' => 'sometimes|array|prohibits:accounting,project',\n 'logbook.*' => [\n Rule::exists('logbook', 'id')->where(function ($query) {\n return $query->where('employee_id', Auth::id());\n }),\n ],\n 'project' => 'sometimes|exists:projects,id|prohibits:accounting,logbook'\n ];\n }", "public function getGroups() {\n\t\t$groups = array(\n\t\t\t'get_posts' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use WP_Query instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_posts',\n\t\t\t\t\t'wp_get_recent_posts',\n\t\t\t\t\t'get_children',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_terms' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use get_the_terms() instead. Use wp_list_pluck() to get the IDs.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_terms',\n\t\t\t\t\t'wp_get_object_terms',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_categories' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use the equivalent get_the_* version instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_categories',\n\t\t\t\t\t'wp_get_post_tags',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_old_slug_redirect' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use wpcom_vip_old_slug_redirect() instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_old_slug_redirect',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'get_term_by' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_get_term_by() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_term_by',\n\t\t\t\t\t'get_cat_ID',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$wpcom_vip_fns = array(\n\t\t\t'get_category_by_slug',\n\t\t\t'get_term_link',\n\t\t\t'get_page_by_title',\n\t\t\t'get_page_by_path',\n\t\t\t'url_to_postid',\n\t\t);\n\t\tforeach ( $wpcom_vip_fns as $function ) {\n\t\t\t$groups[ $function ] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_$function() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t$function\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn $groups;\n\t}", "protected function _deriveRuleSpecific($errors = array(), $code = 412) {\n\t\t$model = key($errors);\n\t\t$field = key($errors[$model]);\n\t\t$error = $errors[$model][$field][0];\n\n\t\t$instance = ClassRegistry::getObject($model);\n\t\tif (!isset($instance->validate[$field])) {\n\t\t\treturn $code;\n\t\t}\n\n\t\tforeach ($instance->validate[$field] as $key => $rule) {\n\t\t\t$matchesMessage = (isset($rule['message']) && $error === $rule['message']);\n\t\t\tif ($key !== $error && !$matchesMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->message = sprintf('%s.%s : %s', $model, $field, $error);\n\t\t\tif (!empty($rule['code'])) {\n\t\t\t\t$code = $rule['code'];\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $code;\n\t}", "function apply_filter_required_rule($mform, $key, $fields) {\n\n if ($mform->elementExists($key.'_grp')) {\n $mform->addRule($key.'_grp', get_string('required'), 'required', null, 'client');\n $mform->registerRule('custom_rule','function','course_completion_check_custom_rule');\n $mform->addRule($key.'_grp', get_string('required'), 'custom_rule', array($key,$fields));\n }\n\n return $mform;\n }", "public function rules()\n {\n $rules = [\n 'service_code' => 'required|exists:services',\n 'description' => 'required|min:10|max:5000',\n 'title' => 'max:255',\n 'lat' => 'min:-90|max:90|required_with:long',\n 'long' => 'min:-180|max:180|required_with:lat',\n 'address_string' => 'max:255',\n 'zip_code' => 'max:255',\n 'email' => 'email|max:255',\n 'first_name' => 'max:255',\n 'last_name' => 'max:255',\n 'phone' => 'max:255',\n 'media_url' => 'max:255'\n ];\n\n $photos = count($this->input('media'));\n foreach (range(0, $photos) as $index) {\n $rules['media.' . $index] = 'image|mimes:jpeg,bmp,png|max:40000';\n }\n\n return $rules;\n }", "public function getGroups(): array;", "public function group()\n {\n return $this->hasMany('Antares\\Customfields\\Model\\FieldGroup', 'category_id', 'id');\n }", "private function findGroupIdWithCode(string $code): int\n {\n /** @var GroupRepositoryInterface $groupRepository */\n $groupRepository = $this->objectManager->create(GroupRepositoryInterface::class);\n /** @var SearchCriteriaBuilder $searchBuilder */\n $searchBuilder = $this->objectManager->create(SearchCriteriaBuilder::class);\n\n foreach ($groupRepository->getList($searchBuilder->create())->getItems() as $group) {\n if ($group->getCode() === $code) {\n return (int)$group->getId();\n }\n }\n\n return -1;\n }", "public function postProcess(): void {\n $groupsToAddTo = (array) $this->getSubmittedValue('groups');\n $summaryInfo = ['groups' => [], 'tags' => []];\n foreach ($groupsToAddTo as $groupID) {\n // This is a convenience for now - really url & name should be determined at\n // presentation stage - ie the summary screen. The only info we are really\n // preserving is which groups were created vs already existed.\n $summaryInfo['groups'][$groupID] = [\n 'url' => CRM_Utils_System::url('civicrm/group/search', 'reset=1&force=1&context=smog&gid=' . $groupID),\n 'name' => Group::get(FALSE)\n ->addWhere('id', '=', $groupID)\n ->addSelect('name')\n ->execute()\n ->first()['name'],\n 'new' => FALSE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n\n if ($this->getSubmittedValue('newGroupName')) {\n /* Create a new group */\n $groupsToAddTo[] = $groupID = Group::create(FALSE)->setValues([\n 'title' => $this->getSubmittedValue('newGroupName'),\n 'description' => $this->getSubmittedValue('newGroupDesc'),\n 'group_type' => $this->getSubmittedValue('newGroupType') ?? [],\n 'is_active' => TRUE,\n ])->execute()->first()['id'];\n $summaryInfo['groups'][$groupID] = [\n 'url' => CRM_Utils_System::url('civicrm/group/search', 'reset=1&force=1&context=smog&gid=' . $groupID),\n 'name' => $this->getSubmittedValue('newGroupName'),\n 'new' => TRUE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n $tagsToAdd = (array) $this->getSubmittedValue('tag');\n foreach ($tagsToAdd as $tagID) {\n // This is a convenience for now - really url & name should be determined at\n // presentation stage - ie the summary screen. The only info we are really\n // preserving is which tags were created vs already existed.\n $summaryInfo['tags'][$tagID] = [\n 'url' => CRM_Utils_System::url('civicrm/contact/search', 'reset=1&force=1&context=smog&id=' . $tagID),\n 'name' => Tag::get(FALSE)\n ->addWhere('id', '=', $tagID)\n ->addSelect('name')\n ->execute()\n ->first()['name'],\n 'new' => TRUE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n if ($this->getSubmittedValue('newTagName')) {\n $tagsToAdd[] = $tagID = Tag::create(FALSE)->setValues([\n 'name' => $this->getSubmittedValue('newTagName'),\n 'description' => $this->getSubmittedValue('newTagDesc'),\n 'is_selectable' => TRUE,\n 'used_for' => 'civicrm_contact',\n //NYSS new tags during import should be imported as keywords\n 'parent_id'\t=> 296,\n ])->execute()->first()['id'];\n $summaryInfo['tags'][$tagID] = [\n 'url' => CRM_Utils_System::url('civicrm/contact/search', 'reset=1&force=1&context=smog&id=' . $tagID),\n 'name' => $this->getSubmittedValue('newTagName'),\n 'new' => FALSE,\n 'added' => 0,\n 'notAdded' => 0,\n ];\n }\n // Store the actions to take on each row & the data to present at the end to the userJob.\n $this->updateUserJobMetadata('post_actions', [\n 'group' => $groupsToAddTo,\n 'tag' => $tagsToAdd,\n ]);\n $this->updateUserJobMetadata('summary_info', $summaryInfo);\n\n // If ACL applies to the current user, update cache before running the import.\n if (!CRM_Core_Permission::check('view all contacts')) {\n $userID = CRM_Core_Session::getLoggedInContactID();\n CRM_ACL_BAO_Cache::deleteEntry($userID);\n CRM_ACL_BAO_Cache::deleteContactCacheEntry($userID);\n }\n\n $this->runTheImport();\n }", "public function rules()\n {\n return collect([\n\n 'mission_statement' => 'required|max:500',\n 'phone_number' => 'required_without_all:mobile_number|max:255',\n 'mobile_number' => 'required_without_all:phone_number|max:255',\n 'organization_name' => 'required|max:255|unique:service_providers,organization_name',\n 'fax' => 'max:255',\n 'website' => 'max:255',\n 'contact_person' => 'required|max:255',\n 'contact_person_title' => 'required|max:255',])\n ->merge(collect(config('extra_types.service_provider'))->mapWithKeys(function ($item) {\n return [\"extra.$item\" => 'required'];\n }))->toArray();\n }", "function acf_convert_rules_to_groups($rules, $anyorall = 'any')\n{\n}", "public function rules()\n {\n return [\n 'name' => 'required|unique:groups',\n\t\t\t'alias' => 'required|unique:groups',\n 'memo' => 'required',\n 'type' => 'required',\n ];\n }", "protected function getRegisteredTaskGroups() {}", "public function testComAdobeCqSocialGroupImplGroupServiceImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.group.impl.GroupServiceImpl';\n\n $crawler = $client->request('POST', $path);\n }", "public static function importGroups() {\n $validation = self::validateGroups();\n $error = $validation['error'];\n\n if (strlen($validation['comment']) == 0) {\n self::deleteDocumentGroupTable();\n foreach (array_keys($validation['data']) as $key) {\n $name = $key;\n try {\n self::$em = self::createNewEntityManager();\n self::insertDocumentGroups($name);\n } catch (Exception $e) {\n $error .= $e->getMessage();\n break;\n }\n }\n }\n\n return array(\n 'data' => $validation['data'],\n 'comment' => $validation['comment'],\n 'duplicates' => $validation['duplicates'],\n 'error' => $error\n );\n }", "private static function getValidationGroups(FormInterface $form)\n {\n do {\n $groups = $form->getConfig()->getOption('validation_groups');\n\n if (null !== $groups) {\n return self::resolveValidationGroups($groups, $form);\n }\n\n $form = $form->getParent();\n } while (null !== $form);\n\n return array(Constraint::DEFAULT_GROUP);\n }", "public function getGroupConfig()\n {\n $groups = [];\n $config = $this->getAllConfigInfo();\n\n foreach ($config as $process) {\n $groupName = $process['group'];\n\n if (! isset($groups[$groupName])) {\n $groups[$groupName] = [\n 'name' => $groupName,\n 'priority' => $process['group_prio'],\n 'inuse' => $process['inuse'],\n 'processes' => [],\n ];\n }\n\n $groups[$groupName]['processes'][$process['name']] = [\n 'name' => $process['name'],\n 'priority' => $process['process_prio'],\n 'autostart' => $process['autostart'],\n ];\n }\n\n return $groups;\n }", "function create_group( $args ) {\r\n global $wpdb;\r\n\r\n //checking that Client Circle not exist other ID\r\n $result = $wpdb->get_row( $wpdb->prepare( \"SELECT group_id FROM {$wpdb->prefix}wpc_client_groups WHERE LOWER(group_name) = '%s'\", strtolower( $args['group_name'] ) ), \"ARRAY_A\");\r\n if ( $result ) {\r\n if ( \"0\" != $args['group_id'] && $result['group_id'] == $args['group_id'] ) {\r\n\r\n } else {\r\n //if Client Circle exist with other ID\r\n wp_redirect( add_query_arg( array( 'page' => 'wpclients_groups', 'updated' => 'true', 'dmsg' => urlencode( __( 'The Group already exists!!!', WPC_CLIENT_TEXT_DOMAIN ) ) ), 'admin.php' ) );\r\n exit;\r\n }\r\n }\r\n\r\n\r\n if ( '0' != $args['group_id'] ) {\r\n //update when edit Client Circle\r\n $result = $wpdb->query( $wpdb->prepare( \"UPDATE {$wpdb->prefix}wpc_client_groups SET group_name = '%s', auto_select = '%s', auto_add_clients = '%s' WHERE group_id = %d\",\r\n trim( $args['group_name'] ),\r\n $args['auto_select'],\r\n $args['auto_add_clients'],\r\n $args['group_id'] ) );\r\n wp_redirect( add_query_arg( array( 'page' => 'wpclients_groups', 'updated' => 'true', 'dmsg' => urlencode( __( 'The changes of the group are saved!', WPC_CLIENT_TEXT_DOMAIN ) ) ), 'admin.php' ) );\r\n exit;\r\n } else {\r\n //create new Client Circle\r\n $result = $wpdb->query( $wpdb->prepare( \"INSERT INTO {$wpdb->prefix}wpc_client_groups SET group_name = '%s', auto_select = '%s', auto_add_clients = '%s'\",\r\n trim( $args['group_name'] ),\r\n $args['auto_select'],\r\n $args['auto_add_clients']\r\n ) );\r\n\r\n //assign all clients\r\n if ( '1' == $args['assign_all'] ) {\r\n $new_group_id = $wpdb->insert_id;\r\n\r\n $args = array(\r\n 'role' => 'wpc_client',\r\n );\r\n\r\n $clients = get_users( $args );\r\n\r\n if ( is_array( $clients ) && 0 < count( $clients ) )\r\n foreach ( $clients as $client ) {\r\n $wpdb->query( $wpdb->prepare( \"INSERT INTO {$wpdb->prefix}wpc_client_group_clients SET group_id = %d, client_id = '%d'\", $new_group_id, $client->ID ) );\r\n }\r\n\r\n }\r\n\r\n\r\n wp_redirect( add_query_arg( array( 'page' => 'wpclients_groups', 'updated' => 'true', 'dmsg' => urlencode( __( 'Client Circle is created!', WPC_CLIENT_TEXT_DOMAIN ) ) ), 'admin.php' ) );\r\n exit;\r\n }\r\n\r\n }", "function addValidationRules(){\n\t\t$this->registerRule('validDate','function','validDate');\n\t\t$this->registerRule('validPeriod','function','validPeriod');\n\t\t$this->registerRule('existe','function','existe');\n\t\t$this->registerRule('number_range','function','number_range');\n\t\t$this->registerRule('validInterval','function','validInterval');\n\t\t$this->registerRule('couple_not_null','function','couple_not_null');\n\t\t$this->registerRule('validParam','function','validParam');\n\t\t$this->registerRule('validUnit_existe','function','validUnit_existe');\n\t\t$this->registerRule('validUnit_required','function','validUnit_required');\n\t\t$this->addRule('dats_title','Data description: Metadata informative title is required','required');\n\t\t$this->addRule('dats_title','Data description: Dataset name exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$this->addRule('dats_date_begin','Temporal coverage: Date begin is not a date','validDate');\n\t\t$this->addRule('dats_date_end','Temporal coverage: Date end is not a date','validDate');\n\t\t$this->addRule(array('dats_date_begin','dats_date_end'),'Temporal coverage: Date end must be after date begin','validPeriod');\n\t\tif ($this->dataset->dats_id == 0){\n\t\t\t$this->addRule('dats_title','Data description: A dataset with the same title exists in the database','existe',array('dataset','dats_title'));\n\t\t}\n\t\t\n\t\tif (isset($this->dataset->data_policy) && !empty($this->dataset->data_policy) && $this->dataset->data_policy->data_policy_id > 0){\n\t\t\t$this->getElement('new_data_policy')->setAttribute('onfocus','blur()');\n\t\t}\n\t\t$this->addRule('new_data_policy','Data use information: Data policy exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$attrs = array();\n\t\tif (isset($this->dataset->database) && !empty($this->dataset->database) && $this->dataset->database->database_id > 0){\n\t\t\t//$this->getElement('new_database')->setAttribute('onfocus','blur()');\n\t\t\t//$this->getElement('new_db_url')->setAttribute('onfocus','blur()');\n\t\t\t$this->disableElement('new_database');\n\t\t\t$this->disableElement('new_db_url');\n\t\t}\n\t\t/*else {\n\t\t\t//$this->addRule('new_database','A database with the same title already exists','existe',array('database','database_name'));\n\t\t}*/\n\t\t$this->addRule('new_database','Data use information: Database name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t$this->addRule('new_db_url','Data use information: Database url exceeds the maximum length allowed (250 characters)','maxlength',250);\t\n\t\t//Formats\n\t\tfor ($i = 0; $i < $this->dataset->nbFormats; $i++){\n\t\t\t$this->addRule('data_format_'.$i,'Data use information: Format name '.($i+1).' exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t\tif (isset($this->dataset->data_formats[$i]) && !empty($this->dataset->data_formats[$i]) && $this->dataset->data_formats[$i]->data_format_id > 0){\n\t\t\t\t//$this->getElement('new_data_format_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('new_data_format_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('new_data_format_'.$i,'Data format '.($i+1).': This format already exists in the database','existe',array('data_format','data_format_name'));\n\t\t\t}*/\n\t\t}\n\t\t//Contacts\n\t\t$this->addRule('pi_0','Contact 1 is required','couple_not_null',array($this,'pi_name_0'));\n\t\t$this->addRule('organism_0','Contact 1: organism is required','couple_not_null',array($this,'org_sname_0'));\n\t\t$this->addRule('email1_0','Contact 1: email1 is required','required');\t\n\t\tfor ($i = 0; $i < $this->dataset->nbPis; $i++){\n\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': Name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 is incorrect','email');\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 is incorrect','email');\n\t\t\t$this->addRule('org_fname_'.$i,'Contact '.($i+1).': Organism full name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('org_sname_'.$i,'Contact '.($i+1).': Organism short name exceeds the maximum length allowed (50 characters)','maxlength',50);\n\t\t\t$this->addRule('org_url_'.$i,'Contact '.($i+1).': Organism url exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\tif (isset($this->dataset->originators[$i]) && !empty($this->dataset->originators[$i]) && $this->dataset->originators[$i]->pers_id > 0){\n\t\t\t\t//$this->getElement('pi_name_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email1_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email2_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('organism_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('pi_name_'.$i);\n\t\t\t\t$this->disableElement('email1_'.$i);\n\t\t\t\t$this->disableElement('email2_'.$i);\n\t\t\t\t$this->disableElement('organism_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('pi_name_'.$i,'Contact '.($i+1).': A contact with the same name is already present in the database. Select it in the drop-down list.','existe',array('personne','pers_name'));\n\t\t\t}*/\n\t\t\tif (isset($this->dataset->originators[$i]->organism) && !empty($this->dataset->originators[$i]->organism) && $this->dataset->originators[$i]->organism->org_id > 0){\n\t\t\t\t//$this->getElement('org_sname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_fname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_url_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('org_sname_'.$i);\n\t\t\t\t$this->disableElement('org_fname_'.$i);\n\t\t\t\t$this->disableElement('org_url_'.$i);\n\t\t\t}\n\t\t\tif ($i != 0){\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': email1 is required','contact_email_required',array($this,$i));\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': organism is required','contact_organism_required',array($this,$i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add validation rules\n\t\t$this->AddModValidationRules();\n\t\t$this->AddSatValidationRules();\n\t\t$this->AddInstruValidationRules();\n\n\t\t//$this->addRule('grid_type','Coverage: Grid type exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t$this->addVaValidationRulesResolution('Coverage');\n\t\t//$this->addRule('sensor_resol_temp','Coverage: Temporal resolution is incorrect','validDate');\n\t\t$this->addRule('sensor_resol_tmp','Coverage: temporal resolution is incorrect','regex',\"/^[0-9]{2}[:][0-9]{2}[:][0-9]{2}$/\");\n\t\t$this->addValidationRulesGeoCoverage();\n\t\t//PARAMETER\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->addValidationRulesVariable($i,$i,'Parameter '.($i+1));\n\t\t}\n\t\t\n\t}", "function add_group(array $data = array())\n\t{\n\t\treturn get_instance()->kbcore->groups->create($data);\n\t}", "public function ruleProvider()\n {\n return [\n [0, 2],\n [1, 1],\n [2, 3],\n [3, 3],\n [11, 2],\n [12, 2],\n [13, 2],\n [19, 2],\n [20, 2],\n [21, 1],\n [40, 2],\n [100, 2],\n [101, 1],\n [110, 2],\n [111, 2],\n [128, 3],\n ];\n }", "public function rules()\n\t{\n\t\treturn PaginateHelper::getRules([\n\t\t\t'groupid'\t=> 'array',\n\t\t\t'groupid.*'\t=> 'integer',\n\t\t\t'hostid'\t=> 'array',\n\t\t\t'hostid.*'\t=> 'integer',\n\t\t\t'host'\t\t=> 'string|max:255',\n\t\t],\n\t\t[\n\t\t\t'hostid',\n\t\t\t'host'\n\t\t],\n\t\t[\n\t\t\t'hostid',\n\t\t\t'host'\n\t\t]);\n\t}", "public static function getGroups(): array\n {\n return [\"group2\"];\n }", "public function rules()\n {\n return [\n 'name' => 'required|string|max:250|unique:mongodb.content_groups,' . $this->contentGroup->_id,\n 'structure' => 'required|json',\n ];\n }", "public function getRules()\n\t{\n\t\t$rules['org_id']\t= ['required', 'integer', 'exists:'. app()->make(\\App\\Org::class)->getTable() . ',id'];\n\t\t$rules['name']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t$rules['code']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t// $rules['group']\t\t\t\t\t= ['required', 'string', 'in:'.implode(',', SELF::GROUP)];\n\t\t$rules['group']\t\t\t\t\t= ['required', 'string'];\n\t\t$rules['description']\t\t\t= ['nullable', 'string'];\n\t\t$rules['threshold']\t\t\t\t= ['nullable', 'numeric', 'min:0'];\n\t\t$rules['unit']\t\t\t\t\t= ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(3, $value);\n }", "protected function set_initial_groups()\n {\n $this->_groups = apply_filters('ngg_admin_requirements_manager_groups', array('phpext' => __('NextGen Gallery requires the following PHP extensions to function correctly. Please contact your hosting provider or systems admin and ask them for assistance:', 'nggallery'), 'phpver' => __('NextGen Gallery has degraded functionality because of your PHP version. Please contact your hosting provider or systems admin and ask them for assistance:', 'nggallery'), 'dirperms' => __('NextGen Gallery has found an issue trying to access the following files or directories. Please ensure the following locations have the correct permissions:', 'nggallery')));\n }", "protected function getGroups()\n\t{\n\t\t// Initialize variables.\n\t\t$groups = array();\n\n\t\t// Get the client and client_id.\n\t\t$client = (string) $this->element['client'];\n\t\t$clientId = ($client == 'administrator') ? 1 : 0;\n\n\t\t// Get the database object and a new query object.\n\t\t$db\t\t= JFactory::getDBO();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t// Build the query.\n\t\t$query->select('id, title, template');\n\t\t$query->from('#__template_styles');\n\t\t$query->where('client_id = '.(int) $clientId);\n\t\t$query->order('template');\n\t\t$query->order('title');\n\n\t\t// Set the query and load the styles.\n\t\t$db->setQuery($query);\n\t\t$styles = $db->loadObjectList();\n\n\t\t// Build the grouped list array.\n\t\tforeach($styles as $style) {\n\n\t\t\t// Initialize the group if necessary.\n\t\t\tif (!isset($groups[$style->template])) {\n\t\t\t\t$groups[$style->template] = array();\n\t\t\t}\n\n\t\t\t$groups[$style->template][] = JHtml::_('select.option', $style->id, $style->title);\n\t\t}\n\n\t\t// Merge any additional groups in the XML definition.\n\t\t$groups = array_merge(parent::getGroups(), $groups);\n\n\t\treturn $groups;\n\t}", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(4, $value);\n }", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(4, $value);\n }", "public function getAclGroups()\n {\n $aclGroupsConfig = include(__DIR__ . '/Acl/AclGroupsConfig.php');\n return $aclGroupsConfig;\n }", "private function parseGroups()\n\t{\n\t\t/**\n\t\t * Grupos\n\t\t */\n\t\t$groups = $this->habbo->groups;\n\n\t\t/**\n\t\t * Convertirlos a Entity\n\t\t */\n\t\tforeach( $groups as $group )\n\t\t\t$this->addGroup( new Group( $group ) );\n\t}", "public static function BUILD_VCS($prd_code)\n {\n $data = self::GET_CTRLSUMM($prd_code);\n\t\t\n\t\t// print_r($prd_code);exit;\n\t\t\n $dataset = [];\n $fsdata = [];\n\t\t\n\t\t$phMon = explode('/',$prd_code);\n\t\t$mon = (int)$phMon[0];\n\t\t$fmon = strtoupper(date(\"F\", mktime(0, 0, 0, (int)$mon, 10)));\n\t\t$fyr = strtoupper(date(\"Y\", mktime(0, 0, 0, 1, 1, (int)$phMon[1])));\n\t\t$m = self::MNTH($mon);\n\t\t$m1 = self::MNTH($mon-1);\n\t\t$m2 = self::MNTH($mon-2);\n\t\t\n\t\t$labels []= ['label'=>$m2];\n\t\t$labels []= ['label'=>$m1];\n\t\t$labels []= ['label'=>$m];\n\t\t\n\t\t\n $gross = [];\n $ded = [];\n $net = [];\n\t\t\n foreach ($data as $key => $value) {\n $obj = (object)$value;\n\t\t\tif($obj->TRAN_NAME=='GROSS PAY'){\n\t\t\t\t$gross[] = ['value'=>$obj->PREV2];\n\t\t\t\t$gross[] = ['value'=>$obj->PREV1];\n\t\t\t\t$gross[] = ['value'=>$obj->CURR];\n\t\t\t}\n\t\t\tif($obj->TRAN_NAME=='TOTAL DEDUCTION'){\n\t\t\t\t$ded[] = ['value'=>$obj->PREV2];\n\t\t\t\t$ded[] = ['value'=>$obj->PREV1];\n\t\t\t\t$ded[] = ['value'=>$obj->CURR];\n\t\t\t}\n\t\t\tif($obj->TRAN_NAME=='NET PAY'){\n\t\t\t\t$net[] = ['value'=>$obj->PREV2];\n\t\t\t\t$net[] = ['value'=>$obj->PREV1];\n\t\t\t\t$net[] = ['value'=>$obj->CURR];\n\t\t\t}\n\t\t\t\n }\n\t\t\n\t\t$dataset[]=[\"seriesname\"=>\"GROSS\",\"data\"=>$gross];\n\t\t$dataset[]=[\"seriesname\"=>\"DEDUCTIONS\",\"data\"=>$ded];\n\t\t$dataset[]=[\"seriesname\"=>\"NET\",\"data\"=>$net];\n\n $graphData = [\n\t\t\t'type'=>'MSarea',\n\t\t\t'renderAt'=>'controlsum-chart',\n\t\t\t'width'=>'100%',\n\t\t\t'height'=>'100%',\n\t\t\t'dataFormat'=>'json',\n\t\t\t'dataSource'=>[\n\t\t\t\t\"chart\"=>[\n\t\t\t\t\t\"caption\"=> $fmon.\",\".$fyr,\n\t\t\t\t\t\"subCaption\"=>\"vs Last two months\",\n\t\t\t\t\t\"linethickness\"=>\"4\",\n\t\t\t\t\t\"exportEnabled\"=>\"1\",\n\t\t\t\t\t\"numberPrefix\"=>\"KSh.\",\n\t\t\t\t\t\"paletteColors\"=>\"#0075c2,#1aaf5d,#ff0000\",\n\t\t\t\t\t\"bgColor\"=>\"#ffffff\",\n\t\t\t\t\t\"showBorder\"=>\"0\",\n\t\t\t\t\t\"showCanvasBorder\"=>\"0\",\n\t\t\t\t\t\"plotBorderAlpha\"=>\"10\",\n\t\t\t\t\t\"usePlotGradientColor\"=>\"0\",\n\t\t\t\t\t\"autoScale\"=>\"1\",\n\t\t\t\t\t\"legendBorderAlpha\"=>\"0\",\n\t\t\t\t\t\"legendShadow\"=>\"0\",\n\t\t\t\t\t\"plotFillAlpha\"=>\"60\",\n\t\t\t\t\t\"showXAxisLine\"=>\"1\",\n\t\t\t\t\t\"axisLineAlpha\"=>\"25\", \n\t\t\t\t\t\"showValues\"=>\"0\",\n\t\t\t\t\t\"captionFontSize\"=>\"14\",\n\t\t\t\t\t\"subcaptionFontSize\"=>\"14\",\n\t\t\t\t\t\"subcaptionFontBold\"=>\"0\",\n\t\t\t\t\t\"divlineColor\"=>\"#999999\", \n\t\t\t\t\t\"divLineIsDashed\"=>\"1\",\n\t\t\t\t\t\"divLineDashLen\"=>\"1\",\n\t\t\t\t\t\"divLineGapLen\"=>\"1\",\n\t\t\t\t\t\"showAlternateHGridColor\"=>\"0\",\n\t\t\t\t\t\"toolTipColor\"=>\"#ffffff\",\n\t\t\t\t\t\"outCnvBaseFontColor\"=>\"#000000\",\n\t\t\t\t\t\"toolTipBorderThickness\"=>\"0\",\n\t\t\t\t\t\"toolTipBgColor\"=>\"#000000\",\n\t\t\t\t\t\"toolTipBgAlpha\"=>\"80\",\n\t\t\t\t\t\"toolTipBorderRadius\"=>\"2\",\n\t\t\t\t\t\"toolTipPadding\"=>\"5\",\n\t\t\t\t],\n\t\t\t\t\"categories\"=>[\n\t\t\t\t\t[\"category\"=>$labels],\n\t\t\t\t],\n\t\t\t\t\"dataset\"=>$dataset,\n\t\t\t]\n\t\t];\n\t\t\n\t\t$fsdata = $graphData;\n\n return $fsdata;\n }", "public function loadRules($weight, $subtotal, $items, $pcode)\n {\n\t$collection = Mage::getModel('temando/rule')->getCollection();\n\t/* @var $collection Ewave_Temando_Model_Mysql4_Rule_Collection */\n\t\n\t$collection->addFieldToFilter('is_active', '1')\n\t\t ->setOrder('priority', 'ASC');\n\t\n\t//admin - manual order creation\n\tif(Mage::app()->getStore()->isAdmin()) {\n\t $store_id = Mage::app()->getRequest()->getParam('store_id');\n\t} else {\n\t $store_id = Mage::app()->getStore(null)->getId();\n\t}\n\tforeach($collection->getItems() as $rule) {\n\t /* @var $rule Ewave_Temando_Model_Rule */\n\t if(!$rule->validateDate()) {\n\t\tcontinue;\n\t }\n\t \n\t $store_ids = explode(',', $rule->getStoreIds());\n\t if(in_array($store_id, $store_ids) && \n\t $rule->isValid($weight, $subtotal, $items, $pcode))\n\t {\n\t\t$this->_validRules[] = $rule;\n\t }\n\t}\n\t\n\treturn $this;\n }", "public function groups()\n {\n return $this->hasMany(static::class, 'parent_id');\n }", "protected function processServiceListBlock($code) {\n $ret = '';\n foreach ($this->services as $service) {\n $this->serviceBeingProcessed = $service;\n $blockForService = str_replace(self::_SERVICE_, $service->name, $code);\n\n\n $processed = $this->searchForBlocksAndApplyProcessing($blockForService, self::METHOD, 'processMethodListBlock');\n if ($processed) {\n $blockForService = $processed;\n }\n\n $ret .= $blockForService;\n }\n return $ret;\n }", "public function ledgerGroups()\n {\n return $this->hasMany(LedgerGroup::class,'principle_id');\n }", "public function rules()\n {\n switch ($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n {\n return [\n 'key' => [\n 'bail',\n 'string',\n 'required',\n 'min:2',\n 'max:20',\n Rule::unique('group_configs')->where(function ($query) {\n $query->where('group_id', $this->route('group_id'));\n })\n\n ],\n 'value' => 'required|min:1',\n ];\n }\n case 'PUT':\n case 'PATCH':\n {\n return [\n 'key' => [\n 'bail',\n 'string',\n 'required',\n 'min:2',\n 'max:20',\n Rule::unique('group_configs')->where(function ($query) {\n $query->where('group_id', $this->route('group_id'))->where('id', '!=', $this->route('id'));\n })\n\n ],\n 'value' => 'required|min:1',\n ];\n }\n default:\n break;\n }\n }", "function recurringdowntime_get_servicegroup_cfg($servicegroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"servicegroup\") {\n continue;\n }\n }\n if ($servicegroup && !(strtolower($schedule[\"servicegroup_name\"]) == strtolower($servicegroup))) {\n continue;\n }\n if (array_key_exists('servicegroup_name', $schedule)) {\n if (is_authorized_for_servicegroup(0, $schedule[\"servicegroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "protected function generateOneServiceFileCode($code) {\n $codeMatchingService = str_replace(self::_SERVICE_, $this->serviceBeingProcessed->name, $code);\n $processed = $this->searchForBlocksAndApplyProcessing($codeMatchingService, self::METHOD, 'processMethodListBlock');\n if ($processed) {\n $codeMatchingService = $processed;\n }\n return $codeMatchingService;\n }", "function getGroupsForStudy($theStudyID, $clientID) {\n global $definitions;\n\n $groupsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['groups'], $clientID);\n $groupsAssociatedStudyID = getClientPropertyID_RelatedWith_byName($definitions['groupsStudyID'], $clientID);\n\n //First get the relation associated\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $groupsAssociatedStudyID, 'value' => $theStudyID);\n\n $groups = getFilteredItemsIDs($groupsItemTypeID, $clientID, $filters, $returnProperties);\n\n return $groups;\n\n}", "public function rules()\n {\n return [\n 'name' => 'required|string',\n 'group_id' => 'required|exists:role_groups,id',\n 'type' => 'required|in:user,manager',\n 'groups' => 'array',\n 'groups.*' => 'integer|exists:permission_groups,id',\n 'permission' => 'required|array'\n ];\n }", "public function groups() {\n return $this->hasMany(Group::class, 'category_id');\n }", "protected function addFieldGroupConfigs()\n {\n // TODO: add acf field group configs\n }", "public function getSubGroups() {}", "final protected function buildDependencyMap() {\n\n\t\t$this->dependencyMap = array();\n\t\t$this->prioritiesHandlers = array();\n $p = new dummyPriorityhookHandler();\n\t\t$this->prioritiesHandlers[self::NORMAL] = $p;\n $this->priorityBased = array('min' => array(),'max' => array());\n\t\t//$this->priorityBased['min'][self::NORMAL][spl_object_hash($p)] = $p;\n\t\tforeach ($this->objects as $hash => $handler) {\n\t\t\t$this->priorityBased['min'][self::NORMAL][$hash] = $handler;\n\t\t\t$this->dependencyMap[$hash] = array('priority' => $this->prioritiesHandlers[self::NORMAL]);\n\t\t\t$this->priorityBased['max'][self::LATEST-1][$hash] = $handler;\n\t\t\t$handler->registerDependencies($this);\n\t\t}\n\t}", "public function rules()\n {\n return [\n 'code' => 'required|unique:layout,code,' . $this->get('id') . ',id',\n ];\n }", "public function rules()\n {\n return [\n 'name' => ['string', 'required'],\n 'google_project_id' => [\n 'required',\n Rule::in($this->user()->currentTeam->googleProjects()->pluck('id'))\n ],\n 'source_provider_id' => [\n 'required',\n Rule::exists('source_providers', 'id')->where(function ($query) {\n $query->where('user_id', $this->user()->id);\n })\n ],\n 'region' => [\n 'required',\n Rule::in(collect(GoogleProject::REGIONS)->keys()),\n ],\n 'type' => [\n 'required',\n Rule::in(collect(Project::TYPES)->keys()),\n ],\n 'repository' => [\n 'required',\n 'string',\n new ValidRepository(SourceProvider::find($this->source_provider_id))\n ],\n ];\n }", "public static function getRulesByApplicationIdAndGroupId($applicationId, $groupId) {\n\t\t$rules = new GroupRulesDao();\n\t\t$rules->setServerAddress($applicationId);\n\n\t\t$builder = new QueryBuilder($rules);\n\t\t$rows = $builder->select('*')\n\t\t\t\t\t\t->where('app_id', $applicationId)\n\t\t\t\t\t\t->where('group_id', $groupId)\n\t\t\t\t\t\t->order('rule_order')\n\t\t\t\t\t\t->findList();\n\n\t\treturn SecurityDaoBase::makeObjectsFromSelectListResult($rows, 'GroupRulesDao');\n\t}", "public function groups()\n {\n return $this->hasMany('App\\Models\\Group');\n }", "private function _get_groups() {\n\n\t\t$request = new Gitlab();\n\t\t$gitlab = $request->init_request();\n\n\t\t$groups = [];\n\t\t$page_index = 1;\n\n\t\tdo {\n\n\t\t\t$response = $gitlab->get( \"groups?per_page=100&page=$page_index\" );\n\t\t\t$response_arr = json_decode( $response->body, true );\n\n\t\t\t$groups = array_merge( $groups, $response_arr );\n\n\t\t\t$page_index = get_next_page( $response );\n\n\t\t} while ( ! empty( $page_index ) );\n\n\t\treturn $groups;\n\n\t}", "public static function getGroups(): array\n {\n return ['test'];\n }" ]
[ "0.70263803", "0.5391789", "0.53563416", "0.51035523", "0.5008549", "0.50082374", "0.4981849", "0.4923943", "0.48742232", "0.4836029", "0.48235476", "0.48104113", "0.47624975", "0.47624975", "0.4750398", "0.47161323", "0.46397656", "0.46376863", "0.46341503", "0.4630065", "0.46132982", "0.4604138", "0.45810232", "0.45490232", "0.45490232", "0.4525668", "0.45192063", "0.4476655", "0.44722882", "0.44624475", "0.4462006", "0.44286433", "0.44133237", "0.43934193", "0.4368971", "0.43627343", "0.43511894", "0.43477285", "0.434361", "0.43387294", "0.43363294", "0.43363294", "0.43285218", "0.43264866", "0.43186903", "0.42859888", "0.42728236", "0.42660373", "0.42548636", "0.42538282", "0.42483574", "0.4235655", "0.42269477", "0.42224663", "0.4220499", "0.4216876", "0.4208772", "0.4203773", "0.41976812", "0.41955933", "0.4191177", "0.4190632", "0.4183168", "0.41831577", "0.4170461", "0.41699082", "0.41617283", "0.41612577", "0.41584688", "0.41578457", "0.41575897", "0.4156957", "0.41500664", "0.4144826", "0.41421002", "0.41396448", "0.413784", "0.413784", "0.41353738", "0.41341248", "0.41340473", "0.4125967", "0.4123231", "0.41207796", "0.411991", "0.411477", "0.41142124", "0.41135353", "0.4107753", "0.40976006", "0.4096394", "0.4092828", "0.4092252", "0.40842813", "0.40828082", "0.40780365", "0.40766963", "0.40716767", "0.4071554", "0.40550178" ]
0.6945669
1
The date when the rates for DHL products and services is provided.
public function getPricingDate(): ?string { return $this->pricingDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentDate();", "public function getDate() { return $this->date; }", "public function getDate(){\n\t\treturn $this->laDate;\n\t}", "public function getDateDebut();", "function getDateRated() {\n\t\treturn $this->getData('dateRated');\n\t}", "public function getPayDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->payDate;\r\n\t}", "function getDate() {\n return $this->date;\n }", "public function getDate();", "public function getDate();", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate() {\n return ($this->date1_reduced === $this->date2_reduced) ? $this->date1_reduced: $this->date1_reduced . \"- \" . $this->date2_reduced;\n }", "public function getUseDate() \n \t{\n \t\treturn $this->use_date;\n \t}", "public function getDate()\r\n {\r\n return $this->date;\r\n }", "function getDate() {\n\t\treturn $this->data_array['adddate'];\n\t}", "public function getDate() {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "function getDate( )\r\n\t{\r\n\t\treturn $this->date;\r\n\t}", "public function getQuotdate()\n {\n return $this->quotdate;\n }", "public function show_sales_review_date()\n {\n $query = $this->db->query(\"SELECT `date`,`product_id`,`type`,`weight`, SUM(`amount`) as amoun,SUM(`price`) as price FROM `sales` WHERE DATE(`date`)=CURDATE() GROUP BY `product_id`\");\n return $query->result();\n }", "function getDateResponseDue() {\n\t\treturn $this->getData('dateResponseDue');\n\t}", "public function getDate(){\n\t\treturn $this->_date;\n\t}", "public function getSaleDate()\n {\n if (!$this->sale_date) return null;\n return Formatter::date($this->sale_date);\n }", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getRecordDate()\n {\n return $this->record_date;\n }", "public function getDollarsDebitedToday()\n {\n $today = Carbon::now();\n return $this->getDollarsDebitedOn($today);\n }", "public function getDate()\n {\n return $this->_date;\n }", "public function getTradeDate()\n {\n return $this->TradeDate;\n }", "public function getDate() {\n\t\treturn $this->_date;\n\t}", "public function getDatenaissance()\n {\n return $this->date_naissance;\n }", "public function requestDate();", "function wc_marketplace_date() {\n global $wmp;\n $wmp->output_report_date();\n }", "public function getReportDate()\n {\n return $this->reportDate;\n }", "public function get_date_permastruct()\n {\n }", "function getDateReminded() {\n\t\treturn $this->getData('dateReminded');\n\t}", "public function calculateDate()\r\n {\r\n return YBCore_Utility_DateTime::getNextGameDateTime();\r\n }", "public function _getShipmentDate() {\n\t\treturn $this->_shipmentDate;\n\t}", "public function getFundDateEstimate()\n\t{\n\t\treturn $this->fund_date;\n\t}", "public function get_bookDate() {\n return $this->bookDate;\n }", "private function getCalculatedDate(){\n date_default_timezone_set('GMT+1');//@todo get the information from system\n\n $oneDay = 86400;//seconds\n $numDays = 7; //default are 7 days\n $today = strtotime('now');\n\n if(!empty($this->settings['flexform']['countDays'])){\n $numDays = $this->settings['flexform']['countDays'];\n }\n\n //calcaulate date\n $date = date(\"d.m.Y\",$today-($numDays * $oneDay));\n\n return $date;\n }", "public function getRecDate()\n {\n return $this->rec_date;\n }", "public function getWarrantyDate()\n {\n return $this->warrantyDate;\n }", "public function getPaymentDate(): RDate\n {\n \\Logger::getLogger(\\get_class($this))\n ->info(\n \\sprintf(\n __METHOD__.\" get '%s'\",\n $this->paymentDate->format(RDate::SQL_DATE)\n )\n );\n return $this->paymentDate;\n }", "public function getReceptionDate();", "public function getExpDate()\n {\n return $this->ExpDate;\n }", "public function getFormattedPaymentDate(): string;", "public function getOpenBetaDate();", "public function getReportedDate();", "public function getMaturityDate()\n {\n $maturityDates = $this->collectData();\n\n return $maturityDates[0];\n }", "public function getDateSeance() {\r\n return $this->dateSeance;\r\n }", "public function getDateCom()\n {\n return $this->Date_com;\n }", "public function getPaydates()\n\t{\n\t\treturn $this->paydates;\n\t}", "function getDateHeure()\n {\n return $this->formatDateDBversLocal(date('Y-m-d H:i:s'), 3);\n }", "public function getReviewDate() {\n\t\t\t\treturn ($this->reviewDate);\n\t\t\t}", "function it_finds_a_daily_rate_price_from_date_range_rate()\n {\n $dailyPrice = Price::fromString('10', Currency::fromString('EUR'));\n $equipment = new Equipment('Jack Hammer', new Rate(null, $dailyPrice, 1));\n\n $rentalQuery = new RentalQuery(\n $equipment,\n RentalPeriod::fromDateTime(new \\DateTime('2014-07-01'), new \\DateTime('2014-07-07'), 1)\n );\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($dailyPrice);\n\n //////////\n $tempPrice = Price::fromString('8', Currency::fromString('EUR'));\n $equipment->addRate(\n RentalPeriod::fromDateTime(new \\DateTime('2014-07-04'), new \\DateTime('2014-07-10')),\n $tempPrice,\n 1\n );\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($tempPrice);\n\n }", "function getDateDue() {\n\t\treturn $this->getData('dateDue');\n\t}", "public function getShippingDate()\n {\n return $this->shippingDate;\n }", "public function getOrderDate()\n {\n return $this->order_date;\n }", "function vads_trans_date() {\n $date = date('YmdHis');\n return $date;\n }", "public function getFilingDate() {\n\t\treturn self::$_filingDate;\n\t}", "public function getDate()\n {\n $yearconst = $this->getValue(self::XPATH_YEAR);\n $monthconst = $this->getValue(self::XPATH_MONTH);\n $dayconst = $this->getValue(self::XPATH_DAY);\n\n return $this->formateDate($yearconst, $monthconst, $dayconst);\n }", "public function getInvoiceDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->invoiceDate;\r\n\t}", "public function getClosedBetaDate();", "public function getOrderdate()\n {\n return $this->orderdate;\n }", "public function getDateEn() {\n return $this->date;\n }", "public function getDueDate(){\n return $this->getParameter('due_date');\n }", "public function getRelease_date()\n {\n return $this->release_date;\n }", "public function getRelease_date()\n {\n return $this->release_date;\n }", "function getData()\n {\n return $this->date;\n }" ]
[ "0.6436603", "0.6209873", "0.61414266", "0.6127206", "0.6116815", "0.6050596", "0.60500246", "0.6048442", "0.6048442", "0.60428214", "0.6032265", "0.6032265", "0.6010004", "0.6000642", "0.5993065", "0.5968674", "0.5959125", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5957036", "0.5954143", "0.5939902", "0.5936156", "0.5920841", "0.5908137", "0.5907863", "0.5897062", "0.5897062", "0.5897062", "0.58942014", "0.58918184", "0.5880682", "0.5870384", "0.5863155", "0.5850843", "0.584701", "0.5833223", "0.5804287", "0.5789494", "0.57849413", "0.5778991", "0.5773165", "0.57722855", "0.57614005", "0.57612264", "0.5754522", "0.57534975", "0.57355905", "0.57348895", "0.57334", "0.57304263", "0.5712725", "0.5693636", "0.5691277", "0.5691204", "0.5691025", "0.56877273", "0.568746", "0.56840545", "0.56733185", "0.5649475", "0.5647443", "0.562727", "0.5625278", "0.56250393", "0.5624049", "0.5622177", "0.5620798", "0.5612598", "0.5609657", "0.56081504", "0.56025195", "0.56025195", "0.55979717" ]
0.60497963
7
The date when the rates for DHL products and services is provided.
public function setPricingDate(?string $pricingDate): self { $this->initialized['pricingDate'] = true; $this->pricingDate = $pricingDate; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentDate();", "public function getDate() { return $this->date; }", "public function getDate(){\n\t\treturn $this->laDate;\n\t}", "public function getDateDebut();", "function getDateRated() {\n\t\treturn $this->getData('dateRated');\n\t}", "public function getPayDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->payDate;\r\n\t}", "public function getPricingDate(): ?string\n {\n return $this->pricingDate;\n }", "function getDate() {\n return $this->date;\n }", "public function getDate();", "public function getDate();", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate() {\n return ($this->date1_reduced === $this->date2_reduced) ? $this->date1_reduced: $this->date1_reduced . \"- \" . $this->date2_reduced;\n }", "public function getUseDate() \n \t{\n \t\treturn $this->use_date;\n \t}", "public function getDate()\r\n {\r\n return $this->date;\r\n }", "function getDate() {\n\t\treturn $this->data_array['adddate'];\n\t}", "public function getDate() {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "function getDate( )\r\n\t{\r\n\t\treturn $this->date;\r\n\t}", "public function getQuotdate()\n {\n return $this->quotdate;\n }", "public function show_sales_review_date()\n {\n $query = $this->db->query(\"SELECT `date`,`product_id`,`type`,`weight`, SUM(`amount`) as amoun,SUM(`price`) as price FROM `sales` WHERE DATE(`date`)=CURDATE() GROUP BY `product_id`\");\n return $query->result();\n }", "function getDateResponseDue() {\n\t\treturn $this->getData('dateResponseDue');\n\t}", "public function getSaleDate()\n {\n if (!$this->sale_date) return null;\n return Formatter::date($this->sale_date);\n }", "public function getDate(){\n\t\treturn $this->_date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getRecordDate()\n {\n return $this->record_date;\n }", "public function getDollarsDebitedToday()\n {\n $today = Carbon::now();\n return $this->getDollarsDebitedOn($today);\n }", "public function getDate()\n {\n return $this->_date;\n }", "public function getTradeDate()\n {\n return $this->TradeDate;\n }", "public function getDate() {\n\t\treturn $this->_date;\n\t}", "public function getDatenaissance()\n {\n return $this->date_naissance;\n }", "public function requestDate();", "function wc_marketplace_date() {\n global $wmp;\n $wmp->output_report_date();\n }", "public function getReportDate()\n {\n return $this->reportDate;\n }", "public function get_date_permastruct()\n {\n }", "function getDateReminded() {\n\t\treturn $this->getData('dateReminded');\n\t}", "public function calculateDate()\r\n {\r\n return YBCore_Utility_DateTime::getNextGameDateTime();\r\n }", "public function _getShipmentDate() {\n\t\treturn $this->_shipmentDate;\n\t}", "public function getFundDateEstimate()\n\t{\n\t\treturn $this->fund_date;\n\t}", "private function getCalculatedDate(){\n date_default_timezone_set('GMT+1');//@todo get the information from system\n\n $oneDay = 86400;//seconds\n $numDays = 7; //default are 7 days\n $today = strtotime('now');\n\n if(!empty($this->settings['flexform']['countDays'])){\n $numDays = $this->settings['flexform']['countDays'];\n }\n\n //calcaulate date\n $date = date(\"d.m.Y\",$today-($numDays * $oneDay));\n\n return $date;\n }", "public function get_bookDate() {\n return $this->bookDate;\n }", "public function getRecDate()\n {\n return $this->rec_date;\n }", "public function getWarrantyDate()\n {\n return $this->warrantyDate;\n }", "public function getPaymentDate(): RDate\n {\n \\Logger::getLogger(\\get_class($this))\n ->info(\n \\sprintf(\n __METHOD__.\" get '%s'\",\n $this->paymentDate->format(RDate::SQL_DATE)\n )\n );\n return $this->paymentDate;\n }", "public function getReceptionDate();", "public function getExpDate()\n {\n return $this->ExpDate;\n }", "public function getFormattedPaymentDate(): string;", "public function getOpenBetaDate();", "public function getReportedDate();", "public function getMaturityDate()\n {\n $maturityDates = $this->collectData();\n\n return $maturityDates[0];\n }", "public function getDateSeance() {\r\n return $this->dateSeance;\r\n }", "public function getDateCom()\n {\n return $this->Date_com;\n }", "public function getPaydates()\n\t{\n\t\treturn $this->paydates;\n\t}", "function getDateHeure()\n {\n return $this->formatDateDBversLocal(date('Y-m-d H:i:s'), 3);\n }", "public function getReviewDate() {\n\t\t\t\treturn ($this->reviewDate);\n\t\t\t}", "function it_finds_a_daily_rate_price_from_date_range_rate()\n {\n $dailyPrice = Price::fromString('10', Currency::fromString('EUR'));\n $equipment = new Equipment('Jack Hammer', new Rate(null, $dailyPrice, 1));\n\n $rentalQuery = new RentalQuery(\n $equipment,\n RentalPeriod::fromDateTime(new \\DateTime('2014-07-01'), new \\DateTime('2014-07-07'), 1)\n );\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($dailyPrice);\n\n //////////\n $tempPrice = Price::fromString('8', Currency::fromString('EUR'));\n $equipment->addRate(\n RentalPeriod::fromDateTime(new \\DateTime('2014-07-04'), new \\DateTime('2014-07-10')),\n $tempPrice,\n 1\n );\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($tempPrice);\n\n }", "function getDateDue() {\n\t\treturn $this->getData('dateDue');\n\t}", "public function getShippingDate()\n {\n return $this->shippingDate;\n }", "public function getOrderDate()\n {\n return $this->order_date;\n }", "function vads_trans_date() {\n $date = date('YmdHis');\n return $date;\n }", "public function getFilingDate() {\n\t\treturn self::$_filingDate;\n\t}", "public function getDate()\n {\n $yearconst = $this->getValue(self::XPATH_YEAR);\n $monthconst = $this->getValue(self::XPATH_MONTH);\n $dayconst = $this->getValue(self::XPATH_DAY);\n\n return $this->formateDate($yearconst, $monthconst, $dayconst);\n }", "public function getInvoiceDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->invoiceDate;\r\n\t}", "public function getClosedBetaDate();", "public function getOrderdate()\n {\n return $this->orderdate;\n }", "public function getDateEn() {\n return $this->date;\n }", "public function getDueDate(){\n return $this->getParameter('due_date');\n }", "public function getRelease_date()\n {\n return $this->release_date;\n }", "public function getRelease_date()\n {\n return $this->release_date;\n }", "function getData()\n {\n return $this->date;\n }" ]
[ "0.6435639", "0.62082344", "0.61397845", "0.61246985", "0.6114722", "0.60497844", "0.60495675", "0.60482556", "0.6046553", "0.6046553", "0.6041033", "0.60306317", "0.60306317", "0.6007289", "0.5998567", "0.5991409", "0.5966282", "0.595753", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5955343", "0.5952757", "0.59373677", "0.59350526", "0.5918216", "0.59076995", "0.59063303", "0.5895577", "0.5895577", "0.5895577", "0.5893357", "0.5891041", "0.58790386", "0.58679426", "0.5861706", "0.58480245", "0.5844397", "0.5831739", "0.58034647", "0.5787484", "0.578133", "0.5777142", "0.57727677", "0.57713205", "0.57601625", "0.5759034", "0.5753029", "0.57516664", "0.57358354", "0.57325983", "0.57315475", "0.57298213", "0.5710288", "0.56908125", "0.5689534", "0.5688891", "0.5688411", "0.56851447", "0.56845164", "0.5682308", "0.5673705", "0.5647276", "0.56470144", "0.5625644", "0.5624578", "0.5623364", "0.56225634", "0.5621115", "0.56191415", "0.5610858", "0.5608468", "0.56058824", "0.56008255", "0.56008255", "0.55961907" ]
0.0
-1
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('title',$this->title,true); $criteria->compare('content',$this->content,true); $criteria->compare('parent',$this->parent); $criteria->compare('children',$this->children,true); $criteria->compare('url',$this->url,true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function findAll()\n {\n return $this->model->all();\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getModels()\n {\n return $this->_models;\n }", "public function getSearchFields();", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "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('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "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}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function findBy(array $filters);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function getSearch();", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\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 getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.5979308", "0.5970091", "0.59315383", "0.5928182", "0.59239197", "0.5891605", "0.588925", "0.5849558", "0.58478904", "0.58265656", "0.5818011", "0.5813345", "0.5808009", "0.5790819", "0.57766616", "0.57694167", "0.5765023", "0.57642305", "0.57522315", "0.5740738", "0.5738047", "0.5727545", "0.5724201", "0.5723084", "0.57225823", "0.5721401", "0.5718913", "0.5714439", "0.5712011", "0.5707315", "0.5694636", "0.5680138", "0.56711453", "0.5670484", "0.56703377", "0.56703377", "0.56703377", "0.5669673", "0.56673825", "0.56659126", "0.5656451", "0.5651109", "0.56498116", "0.564325", "0.5635642", "0.5633513", "0.56310356", "0.56235486", "0.56176996", "0.5612909", "0.560956", "0.5595046", "0.5579938", "0.557241", "0.5556209", "0.5550101", "0.55487776", "0.5547998", "0.5547349", "0.5535324", "0.5534813", "0.55342954", "0.55319065", "0.5525128", "0.55199116", "0.5518253", "0.55144674", "0.5509604", "0.55057275", "0.550087", "0.550019", "0.54966915", "0.54966915", "0.54966915", "0.54954666", "0.54937917", "0.5492664", "0.5492298", "0.5490264", "0.5489261", "0.54850507" ]
0.0
-1
calculate and add columns to row
protected function setColumnFuncs($columnFuncsToUse){ $formattedFuncs = array(); for($columnFuncI = 0; $columnFuncI < count($columnFuncsToUse); $columnFuncI++){ $formattedFunc = $columnFuncsToUse[$columnFuncI]; $funcToUse = $columnFuncsToUse[$columnFuncI]["functionName"]; // echo '<br />setting column func :<br />'; // print_r($funcToUse); if(method_exists(__CLASS__, $funcToUse)){ $funcArgs = $columnFuncsToUse[$columnFuncI]["functionArgs"]; // echo '<br />args for func :<br />'; // print_r($funcArgs); // Turn label key into a column index number if( $columnFuncsToUse[$columnFuncI]["functionArgsAreLabels"] == true){ // echo '<br />--- ARGS ARE STRINGS ---<br />'; for($columnFuncArgI = 0; $columnFuncArgI < count($funcArgs); $columnFuncArgI++){ // echo '<br />this one is :<br />'; // print_r($formattedFunc); // print_r($formattedFunc["functionArgs"]); $formattedFunc["functionArgs"][$columnFuncArgI] = self::headerLabelStringToIndex( $this->headers, $funcArgs[$columnFuncArgI]); // echo '<br />BUT NOW IT IS :<br />'; // print_r($formattedFunc); // print_r($formattedFunc["functionArgs"]); } }else{ $formattedFunc["functionArgs"] = $funcArgs; } } // echo '<br /><br />--- setColumnFuncs == Formatted Func is : --- :<br />'; // print_r($formattedFunc); // echo '<br /><br />'; $formattedFuncs[] = $formattedFunc; } $this->columnFuncs = $formattedFuncs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function calculateRowsAndColumns() {}", "abstract protected function _buildCalcRows();", "public function getSumColumn();", "function getCalculatedRows();", "abstract protected function doCols();", "public function addColumns( $value){\n return $this->_add(3, $value);\n }", "private function addDetailsInRows()\n\t{\n\t\tforeach ($this->data_show as &$row)\n\t\t\tforeach ($this->data as $row_original)\n\t\t\t{\n\t\t\t\t$is_group = true;\n\t\t\t\t\n\t\t\t\tforeach ($this->col_group as $key)\n\t\t\t\t\tif($row[$key] != $row_original[$key])\n\t\t\t\t\t\t$is_group = false;\n\t\t\t\t\n\t\t\t\tif($is_group)\n\t\t\t\t{\n\t\t\t\t\t// total amount\n\t\t\t\t\tif($this->col_aggr_sum)\n\t\t\t\t\t\t$row[$this->col_aggr_sum] += $row_original[$this->col_aggr_sum];\n\t\t\t\t\t\n\t\t\t\t\t// add details\n\t\t\t\t\t$row_tmp = array();\n\t\t\t\t\t\n\t\t\t\t\tforeach ($this->data[0] as $col => $val)\n\t\t\t\t\t\tif(!in_array($col, $this->col_show) || $col == $this->col_aggr_sum)\n\t\t\t\t\t\t\t$row_tmp[$col] = $row_original[$col];\n\t\t\t\t\t\n\t\t\t\t\t$row['details'][] = $row_tmp;\n\t\t\t\t}\n\t\t\t}\n\t}", "abstract protected function columns();", "function genTotalRow(){\n\t\t//set our row to be the size of the first row, each cell set to 0\n\t\t$row = array();\n\t\t$row = array_pad($row, sizeof($this->table[0]), 0);\n\n\t\t//sum up the number of users per column\n\t\tforeach ($this->table as $rows) {\n\t\t\tforeach ($rows as $index => $cell) {\n\t\t\t\tif($cell == '&#x2713') \t{\n\t\t\t\t\t$row[$index]=$row[$index]+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$row[0] = 'Total';\n\t\treturn $row;\n\t}", "function addition(){\n\t\techo \"<p>The \" . $_POST[\"rows\"] . \" x \" . $_POST[\"columns\"] . \" addition table.</p>\\n\";\n\t\techo \"<table border = 1>\\n\";\n\t\t//Goes through each row\n\t\tfor($row = 0; $row <= $_POST[\"rows\"]; $row++){\n\t\t\techo \"\\t<tr>\\n\";\n\t\t\t//Goes through each column of each row\n\t\t\tfor($column = 0; $column <= $_POST[\"columns\"]; $column++){\n\t\t\t\t//If the table box is not a top or left hand border, adds the numbers together unbolded\n\t\t\t\tif($row != 0 && $column != 0)\n\t\t\t\t\techo \"\\t\\t<td align='center'>\" . ($row + $column) . \"</td>\\n\";\n\t\t\t\t//If it is a column header, prints the column number in bold\n\t\t\t\telseif($row == 0)\n\t\t\t\t\techo \"\\t\\t<td align='center'><strong>\" . $column . \"</strong></td>\\n\";\n\t\t\t\t//If it is a row header, prints the row number in bold\n\t\t\t\telseif($column == 0)\n\t\t\t\t\techo \"\\t\\t<td align='center'><strong>\" . $row . \"</strong></td>\\n\";\n\t\t\t}\n\t\t\techo \"\\t</tr>\\n\";\n\t\t}\n\t\techo \"</table>\\n\";\n\t}", "public function addRow(array $row){\n\t\t$prependedCols=array();\n\t\t$html=\"\";\n\t\tif(!empty($this->prependedCols)){\n\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t$html.=$this->renderAdditionalCol($col,$row);;\n\t\t\t}\n\t\t\t$prependedCols[\"prependedCol\".$col[\"header\"]]=$html;\n\t\t\t$row=array_merge($prependedCols,$row);\n\t\t}\n\t\t\n\t\t$appendedCols=array();\n\t\t$html=\"\";\n\t\tif(!empty($this->appendedCols)){\n\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t$html.=$this->renderAdditionalCol($col,$row);\n\t\t\t}\n\t\t\t$appendedCols[\"appendedCol\".$col[\"header\"].$counter]=$html;\n\t\t\t$row=array_merge($row,$appendedCols);\n\t\t}\n\t\t\n\t\t$this->rows+=1; \t\t\n\t\t$this->data[]=$row;\n\t}", "public function buildTotalsRow()\n {\n $line = '';\n foreach ($this->Columns as $field => $Column) {\n if (in_array($field, $this->tableOptions['totals'])) {\n $line .= $this->Html->tag('td', $Column->sum(), array('class' => 'cell-number'));\n } else {\n $line .= $this->Html->tag('td', ' ');\n }\n }\n\n return $this->Html->tag('tr', $line, array('class' => 'totalsrow'));\n }", "abstract public static function columnData();", "function AddRow()\n\t{\n\t\tif (!func_num_args())\n\t\t{\n\t\t\t// no parameters were passed\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t// increment the row pointer\n\t\tif (!isset($this->_intCurrentRow))\n\t\t{\n\t\t\t$this->_intCurrentRow = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_intCurrentRow++;\n\t\t}\n\t\t\n\t\t// build the array of column values\t\t\n\t\t$arrColumns = func_get_args();\n\t\t$this->_arrRows[] = Array('Columns'=>$arrColumns);\n\t\t\n\t\treturn $this->_intCurrentRow;\n\t}", "public function row( array $row ) {\n\n\t\t$extra_row_count = 0;\n\n\t\tif ( count( $row ) > 0 ) {\n\t\t\t$extra_rows = array_fill( 0, count( $row ), array() );\n\n\t\t\tforeach( $row as $col => $value ) {\n\n\t\t\t\t$value = str_replace( array( \"\\r\\n\", \"\\n\" ), ' ', $value );\n\n\t\t\t\t$col_width = $this->_widths[ $col ];\n\t\t\t\t$encoding = function_exists( 'mb_detect_encoding' ) ? mb_detect_encoding( $value, null, true /*strict*/ ) : false;\n\t\t\t\t$original_val_width = Colors::width( $value, self::isPreColorized( $col ), $encoding );\n\t\t\t\tif ( $col_width && $original_val_width > $col_width ) {\n\t\t\t\t\t$row[ $col ] = \\cli\\safe_substr( $value, 0, $col_width, true /*is_width*/, $encoding );\n\t\t\t\t\t$value = \\cli\\safe_substr( $value, \\cli\\safe_strlen( $row[ $col ], $encoding ), null /*length*/, false /*is_width*/, $encoding );\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tdo {\n\t\t\t\t\t\t$extra_value = \\cli\\safe_substr( $value, 0, $col_width, true /*is_width*/, $encoding );\n\t\t\t\t\t\t$val_width = Colors::width( $extra_value, self::isPreColorized( $col ), $encoding );\n\t\t\t\t\t\tif ( $val_width ) {\n\t\t\t\t\t\t\t$extra_rows[ $col ][] = $extra_value;\n\t\t\t\t\t\t\t$value = \\cli\\safe_substr( $value, \\cli\\safe_strlen( $extra_value, $encoding ), null /*length*/, false /*is_width*/, $encoding );\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\tif ( $i > $extra_row_count ) {\n\t\t\t\t\t\t\t\t$extra_row_count = $i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} while( $value );\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t$row = array_map(array($this, 'padColumn'), $row, array_keys($row));\n\t\tarray_unshift($row, ''); // First border\n\t\tarray_push($row, ''); // Last border\n\n\t\t$ret = join($this->_characters['border'], $row);\n\t\tif ( $extra_row_count ) {\n\t\t\tforeach( $extra_rows as $col => $col_values ) {\n\t\t\t\twhile( count( $col_values ) < $extra_row_count ) {\n\t\t\t\t\t$col_values[] = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdo {\n\t\t\t\t$row_values = array();\n\t\t\t\t$has_more = false;\n\t\t\t\tforeach( $extra_rows as $col => &$col_values ) {\n\t\t\t\t\t$row_values[ $col ] = ! empty( $col_values ) ? array_shift( $col_values ) : '';\n\t\t\t\t\tif ( count( $col_values ) ) {\n\t\t\t\t\t\t$has_more = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$row_values = array_map(array($this, 'padColumn'), $row_values, array_keys($row_values));\n\t\t\t\tarray_unshift($row_values, ''); // First border\n\t\t\t\tarray_push($row_values, ''); // Last border\n\n\t\t\t\t$ret .= PHP_EOL . join($this->_characters['border'], $row_values);\n\t\t\t} while( $has_more );\n\t\t}\n\t\treturn $ret;\n\t}", "protected function _prepareColumns()\n {\n $this->addColumn('hourbelt_id', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('ID'),\n 'width' => '50px',\n 'index' => 'hourbelt_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Nombre Franja'),\n 'index' => 'name',\n ));\n\n $this->addColumn('start', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Inicio'),\n 'index' => 'start',\n ));\n\n $this->addColumn('finish', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Fin'),\n 'index' => 'finish',\n ));\n\n return parent::_prepareColumns();\n }", "public function nextRow() {\n $row = parent::nextRow();\n\n // If any decimal columns, ensure we map them back to the correct PHP type\n // GETS ROUND A HOPEFULLY TEMPORARY WEIRDNESS WITH PDO/MYSQL\n if ($this->decimalColumns && $row) {\n foreach ($this->decimalColumns as $decimalColumn) {\n $row[$decimalColumn] = doubleval($row[$decimalColumn]);\n }\n }\n\n return $row;\n }", "abstract public function transform(Row $row);", "public function addRows()\n {\n }", "function loop_columns() {\r\n return 3; // 3 products per row\r\n }", "private function addExtraColumns($data, $row): array\n\t{\n\t\tforeach ($this->extraColumns as $extraColumn) {\n\t\t\t$compiledContent = Helper::compileContent($extraColumn['callback']['content'], $row);\n\t\t\t$data = array_merge($data, [$extraColumn['info']['name'] => $compiledContent]);\n\t\t}\n\n\t\treturn $data;\n\t}", "private function compute($row, $column) {\n $upper_row = $this->getNextRow(Direction::UP, $row);\n $lower_row = $this->getNextRow(Direction::DOWN, $row);\n $rows = array($upper_row, $row, $lower_row);\n \n $left_column = $this->getNextColumn(Direction::LEFT, $column);\n $right_column = $this->getNextColumn(Direction::RIGHT, $column);\n $columns = array($left_column, $column, $right_column);\n \n //compute the sum of 3 by 3 square\n $sum = 0;\n foreach($rows as $row) {\n foreach($columns as $column) {\n $sum += $this->get($row, $column);\n }\n }\n return $sum;\n }", "protected function _prepareColumns() {\n $this->addColumn('period', array(\n 'header' => Mage::helper('webpos')->__('Period'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'index' => 'period',\n 'width' => '100px',\n ));\n $this->addColumn('user', array(\n 'header' => Mage::helper('webpos')->__('User'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'index' => 'user',\n 'width' => '200px',\n ));\n $this->addColumn('totals_sales', array(\n 'header' => Mage::helper('webpos')->__('Sales Total'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'width' => '100px',\n 'index' => 'totals_sales',\n 'type' => 'price',\n 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n ));\n $this->addExportType('*/*/exportCsv', Mage::helper('webpos')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('webpos')->__('XML'));\n\n return parent::_prepareColumns();\n }", "abstract public function getCols();", "public function calculateRow($row)\n {\n list($date, $id, $type, $op, $amount, $curr) = $row;\n $amount = $this->convertCurrency($curr, $amount); // convert to EUR\n $sum = 0;\n // set fee\n if ($op === 'cash_in') {\n $max = $this->config->fees->in->max;\n $sum = $amount * $this->config->fees->in->fee / 100;\n if ($sum > $max) {\n $sum = $max;\n }\n } else {\n // cash_out\n if ($type === 'legal') {\n $min = $this->config->fees->out->legal->min;\n $sum = $amount * $this->config->fees->out->legal->fee / 100;\n if ($sum < $min) {\n $sum = $min;\n }\n } else {\n // natural\n $this->addUserToCheck($date, $id, $amount);\n $sum = $this->checkUserWeekDiscountSum($date, $id, $amount);\n $sum = $sum * $this->config->fees->out->natural->fee / 100;\n }\n }\n return $this->convertCurrency($curr, $sum, true); // convert back to given currency\n }", "public function setCombination($data, $fields, $rowsum){\n\t\t//column data\n\t\tforeach($data as $data_key => $data_item){\n\t\t\t$series_data = array();\n\t\t\t$first_column = array_shift($data_item);\n\t\t\t$this->series_array['series'][$data_key]['type'] = 'column';\n\t\t\t$this->series_array['series'][$data_key]['name'] = $first_column;\n\t\t\t\n\t\t\t//delete first element.\n\t\t\tforeach($data_item as $data_value){\n\t\t\t\tarray_push($series_data, floatval($data_value));\n\t\t\t}\n\t\t\t$this->series_array['series'][$data_key]['data'] = array_values($series_data);\n\t\t}\n\t\t\t\t\n\t\t//spline data\n\t\t$ave_data_array = array();\n\t\tfor($i=0;$i<count($fields);$i++){\n\t\t\t$column_sum = '';\n\t\t\tforeach($data as $data_items){\n\t\t\t\t$column_sum = $column_sum + $data_items[$fields[$i]];\n\t\t\t}\n\t\t\tarray_push($ave_data_array, $column_sum/count($data));\n\t\t}\n\t\t$this->series_array['series'][$data_key+1]['type'] = 'spline';\n\t\t$this->series_array['series'][$data_key+1]['name'] = 'Average';\n\t\t$this->series_array['series'][$data_key+1]['data'] = $ave_data_array;\n\t\t\n\t\t//pie data\n\t\t$this->series_array['series'][$data_key+2]['type'] = 'pie';\n\t\t$this->series_array['series'][$data_key+2]['name'] = 'Sum of Rows';\n\t\t\t\t\n\t\tforeach($rowsum as $rowsum_key => $rowsum_value){\n\t\t\t$this->series_array['series'][$data_key+2]['data'][$rowsum_key]['name'] = $rowsum_value['rowname'];\n\t\t\t$this->series_array['series'][$data_key+2]['data'][$rowsum_key]['y'] = (float)$rowsum_value['rowsum'];\n\t\t}\n\t\t$this->series_array['series'][$data_key+2]['center'] = array(100, 10);\n\t\t$this->series_array['series'][$data_key+2]['size'] = 100;\n\t\t$this->series_array['series'][$data_key+2]['showInLegend'] = false;\n\t\t$this->series_array['series'][$data_key+2]['dataLabels']['enabled'] = false;\n\t\t\n\t\t//print_r(json_encode($this->series_array));\n\t}", "public function addRow() {\n if ($this->linesCount >= 0)\n $this->addContent('</div>');\n $this->linesCount ++;\n $this->colunsCount = 0;\n $this->addContent('<div class=\"row\" >');\n }", "abstract public function tableColumns();", "abstract protected function columns(): array;", "public function sum() : ColumnVector\n {\n return ColumnVector::quick(array_map('array_sum', $this->a));\n }", "function AggregateListRow() {\n\t}", "function AddCol($field=-1,$width=-1,$align='L')\r\n{\r\n\tif($field==-1)\r\n\t{\r\n\t\t$field=count($this->columnProp);\r\n\t}\r\n\r\n\t$this->columnProp[$field]=array('f'=>$field,'w'=>$width,'a'=>$align);\r\n\t#$this->Write(5, \"Ajout de colonne : \".$field.\"/\".$width.\"/\".$align); $this->Ln();\r\n}", "public function sum(string $column): float;", "protected function generateColumns()\n\t{\n\t\tforeach ($this->dataSource->getColumns() as $name) {\n\t\t\t$this->addColumn($name);\n\t\t}\n\t}", "protected function calculateRowHeight()\r\n {\r\n return $this->Height / $this->calculateItemsPerColumn();\r\n }", "private function createDataRowForColumns(){\n\t\t$DataRows = [];\n\t\tforeach (\\DB::select('show columns from ' . $this->model->getTable() ) as $column)\n\t\t\t$DataRows[] = (new DataRowColumn)->setModel($this->model)->setField($column->Field)->fillModel();\n\n\t\t$this->DataType->dataRows()->saveMany($DataRows);\n\t}", "public function summaryColumns();", "function sum_column($arr, $column) {\n $output = 0;\n foreach ($arr as $row) {\n $value = lavnn($column, $row, 0);\n if (is_numeric($value))\n $output += $value;\n }\n return $output;\n}", "public function updateCalculations() {\n\n foreach( $this->sheet->contents->sheetData->row as $row ) {\n\n foreach ( $row->c as $col ) {\n\n if ( ! empty ($col->f ) ) {\n unset( $col->v );\n }\n }\n }\n }", "public function single_row_columns($item)\n {\n }", "public function processRow ($row, $idx) {\n\n static $max_rows = 20;\n $cols = array(0,1,7);\n\n # for demo purposes, only return first 20 rows\n if($idx >= $max_rows)\n return null;\n\n\n # headers row, prepend index column\n if ($idx === 0) {\n # modify header row to prepend an index column\n $this->setHeaders($row);\n return array_merge( array(\"Index\"), $this->_extractColumns($row, $idx, $cols));\n }\n\n\n $out = array_merge( array($idx+1), $this->_extractColumns($row, $idx, $cols));\n //return array_intersect($row, $cols);\n return $out;\n\n }", "private static function makerowdata($row, $model)\n {\n // empty array to hold our new \"column\" values\n $columns = array();\n // get all the keys of the passed row\n $keys = array_keys($model);\n // loop over all the keys, unless they are named \"key\" or \"children\"\n foreach ($keys as $pos => $key) {\n if ($key != 'key' && $key != 'children') {\n // add key:value pair to \"columns\" array\n $columns[$model[$key]] = $row[$key];\n }\n }\n return $columns;\n }", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "function NumCols() {}", "function SetRowColumnSpan()\n\t{\n\t\tif ((!func_num_args()) || (!isset($this->_intCurrentRow)))\n\t\t{\n\t\t\t// no parameters were passed or there is no current row\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t// retrieve the width values\n\t\t$arrColSpans = func_get_args();\n\t\t\n\t\t$this->_arrRows[$this->_intCurrentRow]['ColSpans'] = $arrColSpans;\n\n\t\treturn $this->_intCurrentRow;\n\t}", "abstract protected function _getRowNumeric($rs);", "protected function single_row_columns($item)\n {\n }", "function formatRow(){\n $this->hook('formatRow');\n }", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AddCol($field=-1,$width=-1,$caption='',$align='')\r\n{\r\n if($field==-1)\r\n $field=count($this->aCols);\r\n $this->aCols[]=array('f'=>$field,'c'=>$caption,'w'=>$width,'a'=>$align);\r\n}", "public function getPosicoesDasColunasDaPlanilha($rows)\n {\n $index = array(\n 'columns' => array(\n 'nome_completo' => false,\n 'email' => false,\n 'cpf' => false,\n 'data_nascimento' => false,\n 'instituicao' => false\n )\n );\n $x = 0;\n \n while ($row = current($rows)) {\n \n if (in_array('CPF', $row) && in_array('Nome completo', $row) && in_array('Data de nascimento', $row)) {\n $index['row'] = $x + 1;\n \n // buscar índice do campo cpf\n foreach (array(\n 'Data de nascimento',\n 'data de nascimento',\n 'DATA DE NASCIMENTO',\n 'NASCIMENTO'\n ) as $value) {\n if ($index['columns']['data_nascimento'] === false) {\n $index['columns']['data_nascimento'] = array_search($value, $row, false);\n }\n }\n \n // buscar índice do campo cpf\n foreach (array(\n 'CPF',\n 'cpf',\n 'Cpf'\n ) as $value) {\n \n if ($index['columns']['cpf'] === false) {\n $index['columns']['cpf'] = array_search($value, $row, false);\n }\n }\n \n // buscar índice do campo Nome completo\n foreach (array(\n 'Nome completo',\n 'nome completo',\n 'Nome Completo',\n 'NOME COMPLETO'\n ) as $value) {\n if ($index['columns']['nome_completo'] === false) {\n $index['columns']['nome_completo'] = array_search($value, $row, false);\n }\n }\n \n // buscar índice do campo email\n foreach (array(\n 'Email',\n 'email',\n 'e-mail',\n 'EMAIL',\n 'E-MAIL'\n ) as $value) {\n if ($index['columns']['email'] === false) {\n $index['columns']['email'] = array_search($value, $row, false);\n }\n }\n \n // buscar índice do campo Instituição\n foreach (array(\n 'É Estudante do IFBA/Vitória da Conquista',\n 'É Estudante do IFBA/Vitória da Conquista',\n 'É Estudante do IFBA/Vitória da Conquista',\n 'É Estudante do IFBA/Vitória da Conquista'\n ) as $value) {\n if ($index['columns']['instituicao'] === false) {\n $index['columns']['instituicao'] = array_search($value, $row, false);\n }\n }\n }\n $x ++;\n next($rows);\n }\n \n return $index;\n }", "private function generateRowsCharacters()\n {\n $this->rowsCharacters->add([\"+\"]);\n $rowIndex = 1;\n while ($this->shapeIsNotComplete($rowIndex)) {\n $row = $this->getRow($rowIndex);\n $this->rowsCharacters->add($row);\n $rowIndex++;\n }\n }", "protected function _prepareColumns()\n\t{\n\t\t$this->addColumn('id',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('ID'),\n\t\t\t\t\t\t'align' =>'right',\n\t\t\t\t\t\t'width' => '50px',\n\t\t\t\t\t\t'index' => 'id'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\t$this->addColumn('name',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Name'),\n\t\t\t\t\t\t'index' => 'name'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('description',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Description'),\n\t\t\t\t\t\t'index' => 'description'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('percentage',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Percentage'),\n\t\t\t\t\t\t'index' => 'percentage'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\treturn parent::_prepareColumns();\n\t}", "public function getRow();", "private function initColumnArrays()\n {\n foreach ($this->columns as $key => $column) {\n $dql = $this->accessor->getValue($column, 'dql');\n $data = $this->accessor->getValue($column, 'data');\n\n $currentPart = $this->entityShortName;\n $currentAlias = $currentPart;\n $metadata = $this->metadata;\n\n if (true === $this->accessor->getValue($column, 'customDql')) {\n $columnAlias = str_replace('.', '_', $data);\n\n // Select\n $selectDql = preg_replace('/\\{([\\w]+)\\}/', '$1', $dql);\n $this->addSelectColumn(null, $selectDql.' '.$columnAlias);\n // Order on alias column name\n $this->addOrderColumn($column, null, $columnAlias);\n // Fix subqueries alias duplication\n $searchDql = preg_replace('/\\{([\\w]+)\\}/', '$1_search', $dql);\n $this->addSearchColumn($column, null, $searchDql);\n } elseif (true === $this->accessor->getValue($column, 'selectColumn')) {\n $parts = explode('.', $dql);\n\n while (count($parts) > 1) {\n $previousPart = $currentPart;\n $previousAlias = $currentAlias;\n\n $currentPart = array_shift($parts);\n $currentAlias = ($previousPart === $this->entityShortName ? '' : $previousPart.'_').$currentPart;\n\n if (!array_key_exists($previousAlias.'.'.$currentPart, $this->joins)) {\n $this->addJoin($previousAlias.'.'.$currentPart, $currentAlias, $this->accessor->getValue($column, 'joinType'));\n }\n\n $metadata = $this->setIdentifierFromAssociation($currentAlias, $currentPart, $metadata);\n }\n\n $this->addSelectColumn($currentAlias, $this->getIdentifier($metadata));\n $this->addSelectColumn($currentAlias, $parts[0]);\n $this->addSearchOrderColumn($column, $currentAlias, $parts[0]);\n } else {\n // Add Order-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'orderColumn') && true === $this->accessor->getValue($column, 'orderable')) {\n $orderColumn = $this->accessor->getValue($column, 'orderColumn');\n $orderParts = explode('.', $orderColumn);\n if (count($orderParts) < 2) {\n $orderColumn = $this->entityShortName.'.'.$orderColumn;\n }\n $this->orderColumns[] = $orderColumn;\n } else {\n $this->orderColumns[] = null;\n }\n\n // Add Search-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'searchColumn') && true === $this->accessor->getValue($column, 'searchable')) {\n $searchColumn = $this->accessor->getValue($column, 'searchColumn');\n $searchParts = explode('.', $searchColumn);\n if (count($searchParts) < 2) {\n $searchColumn = $this->entityShortName.'.'.$searchColumn;\n }\n $this->searchColumns[] = $searchColumn;\n } else {\n $this->searchColumns[] = null;\n }\n }\n }\n\n return $this;\n }", "protected function _prepareColumns()\n {\n $this->addColumn('increment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'increment_id',\n 'filter_index' => 'main_table.increment_id',\n 'type' => 'text',\n ));\n $this->addColumn('shipment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'entity_id',\n 'filter_index' => 'main_table.entity_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('canpar_shipment_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Shipment #'),\n 'index' => 'canpar_shipment_id',\n 'filter_index' => 'ch_shipment.shipment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('manifest_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Manifest #'),\n 'index' => 'manifest_id',\n 'renderer' => 'canparmodule/adminhtml_canparshipment_renderer_manifestId',\n 'filter_index' => 'ch_shipment.manifest_id',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Date Shipped'),\n 'index' => 'created_at',\n 'filter_index' =>'main_table.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('order_increment_id', array(\n 'header' => Mage::helper('sales')->__('Order #'),\n 'index' => 'order_increment_id',\n 'filter_index'=> 'o.increment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('order_created_date', array(\n 'header' => Mage::helper('sales')->__('Order Date'),\n 'index' => 'order_created_date',\n 'filter_index' =>'o.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('total_qty', array(\n 'header' => Mage::helper('sales')->__('Total Qty'),\n 'index' => 'total_qty',\n 'type' => 'number',\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('sales')->__('Action'),\n 'width' => '50px',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('sales')->__('View'),\n 'url' => array('base'=>'*/sales_shipment/view'),\n 'field' => 'shipment_id'\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'is_system' => true\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));\n $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));\n\n return parent::_prepareColumns();\n }", "function information_for_each_column($col,$res){\r\n\t$res_info = array();\r\n\tfor($i = 0; $i < count($col); $i++){\r\n\t\t\r\n\t\t//the length of each column\r\n\t\t$len_each_column = count($col[$i]);\r\n\t\t//calculate individual elements\r\n\t\t$calc_current_elem = array_count_values($col[$i]);\r\n\t\t$keys = array_keys($calc_current_elem);\r\n\t\t$info = 0;\r\n\t\t\r\n\t\tfor ($j = 0; $j < count($keys); $j++){\r\n\t\t\t$temp = array();\r\n\t\t\t$key1 = array_keys($res[$i]);\r\n\t\t\t\r\n\t\t\tfor ($k = 0; $k < count($key1); $k++){\r\n\t\t\t\tif ($keys[$j] == explode('=>', $key1[$k])[0]){\r\n\t\t\t\t\tarray_push($temp,$res[$i][$key1[$k]]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$info += $calc_current_elem[$keys[$j]]/$len_each_column * entropy($temp,$calc_current_elem[$keys[$j]]);\r\n\t\t}\r\n\t\tarray_push($res_info,$info);\r\n\t}\r\n\t\r\n\treturn $res_info;\r\n}", "function s_m_put_txt_data_order_rows($rows, $width){\r\n // $width is containing the width for eacht column\r\n if(count($rows) == 0){\r\n echo \"Error, no rows\";\r\n die();\r\n }\r\n // add space\r\n $rows_new = array();\r\n for($r = 0; $r < count($rows); $r++){\r\n $k = 0;\r\n foreach ($rows[$r] as $key => $value) {\r\n $rows_new[$r][$key] = $rows[$r][$key] . str_repeat(\" \", $width[$k] - strlen($rows[$r][$key]));\r\n $k++;\r\n }\r\n }\r\n return $rows_new;\r\n}", "private function pad_grid() \n\t{\n\t\t// If more rows than cols we add columns to all rows\n\t\t// TODO: Has to be a better way to do this\n\t\t$numRows = count($this->clonedGrid);\n\t\t$numCols = count($this->clonedGrid[0]);\n\t\t\n\t\tif ($numRows > $numCols) \n\t\t{ \n\t\t\tfor ($i = 0; $i < $numRows; $i++) \n\t\t\t{\n\t\t\t\t$this->clonedGrid[$i] = array_pad($this->clonedGrid[$i], $numRows, 0);\n\t\t\t\t\n\t\t\t}\n\t\t} \n\t\telseif ($numCols > $numRows) { \n\t\t\t// If not check if COLS are > then rows, if so then add new rows.\n\t\t\tfor ($i = count($this->clonedGrid); $i < $numCols; $i++) \n\t\t\t{\n\t\t\t\t$this->clonedGrid[$i] = array_pad(array(), $numCols, 0);\n\t\t\t}\n\t\t}\n\t}", "abstract public function getColsFields();", "public function columnOffset();", "public function addColumns()\n {\n add_filter( 'manage_edit-' . $this->post_type . '_columns', array($this, 'editColumns') ) ; // Add or Remove a Column\n add_action( 'manage_' . $this->post_type . '_posts_custom_column', array($this, 'manageColumns') ); //Show and Modify Column Data\n add_filter( 'manage_edit-' . $this->post_type . '_sortable_columns', array($this, 'sortableColumns') ); // Flags sortable Columns\n add_action( 'load-edit.php', array($this, 'loadSortColumns') );\n }", "private function buildGrossTotalsRow(View\\SaleView $view, array &$rows): void\n {\n $offset = $view->vars['columns_count']\n - ($view->vars['show_discounts'] ? 4 : 1)\n + ($view->vars['show_availability'] ? 1 : 0);\n\n $row = array_fill(0, $offset, null);\n\n if ($view->vars['show_discounts']) {\n $row[] = $view->getGross()->getBase();\n $row[] = $view->getGross()->getAdjustment();\n }\n\n $row[] = $view->getGross()->getTotal();\n\n $rows[] = $row;\n }", "public function getRow() {}", "function gttn_tpps_parse_file_column_helper($row, &$options) {\n $options['content'][] = $row[current($options['columns'])];\n}", "public function previewColumns();", "public function get_inter_state_total_fun($highestColumn_row, $i, $object) {\n $tax_inter_state = array();\n $data_arr1 = array();\n $highest_value_without_GT = $highestColumn_row; // got last value here for if\n\n $char = 'G';\n while ($char !== $highest_value_without_GT) {\n $values[] = $object->getActiveSheet()->getCell($char . $i)->getValue();\n $char++;\n }\n $cnt = count($values);\n\n//For getting the value for tax inter state \n $data_arr_inter = array();\n\n for ($a_dr = 0; $a_dr < $cnt; $a_dr++) {\n $Dr_values = $values[$a_dr];\n $data_arr_inter[] = $values[$a_dr];\n }\n $aa1 = array();\n for ($a_dr = 1; $a_dr < sizeof($values); $a_dr++) {\n\n if ($a_dr % 2 != 0) {\n\n $aa1[] = $values[$a_dr];\n }\n }\n// var_dump($aa1);\n\n $a1 = (sizeof($aa1));\n $a2 = $a1 % 1;\n $a3 = $a1 - $a2;\n for ($k = 0; $k < ($a3); $k = $k + 2) {\n $tax_inter_state[] = $aa1[$k] + $aa1[$k + 1];\n }\n// $cnt = count($values);\n\n for ($aa = 0; $aa < $cnt; $aa++) {\n// $data1 = $values[$aa];\n $data_arr1[] = $values[$aa];\n $aa = ($aa * 1 + 3);\n }\n// return $tax_inter_state;\n return array($data_arr1, $tax_inter_state);\n }", "public function getRowTotal($module,$m,$d,$y,$m1,$d1,$y1) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT branch from branch order by branch asc \");\n\nwhile($row = mysqli_fetch_array($result))\n {\necho \"<td>&nbsp;\".number_format($this->getTotalEachBranch_All($row['branch'],$module,$m,$d,$y,$m1,$d1,$y1) + $this->getPaidBalance_allBranch($row['branch'],$module,$m,$d,$y,$m1,$d1,$y1),2).\"&nbsp;</td>\";\n }\n\n}", "public function set_columns($cols) { $this->cols = $cols + 0; }", "function buildRows(&$rows ) {\n require_once 'CRM/Utils/HilreportsUtils.php';\n $this->modifyColumnHeaders( );\n $this->calculateAantalContacts();\n $this->setCustomGroupIdExtraGegevens();\n $rowNumber = 0;\n /*\n * eerste rij met totalen\n */\n $rows[$rowNumber]['label'] = \"<strong>TOTAAL:</strong>\";\n $rows[$rowNumber]['aantal'] = $this->_aantalContacts;\n $rows[$rowNumber]['percentage'] = \"100%\";\n $rowNumber++;\n $this->_aantalRijen++;\n /*\n * build rows for land van herkomst\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Land van herkomst:\");\n $this->addRowsLandVanHerkomst($rows, $rowNumber);\n /*\n * build rows for economische status\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Economische status\");\n $this->addRowsOptionValue($rows, $rowNumber, \"Economische status\", \"econ_status\");\n /*\n * build rows for burgerlijke staat\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Burgerlijke staat\");\n $this->addRowsOptionValue($rows, $rowNumber, \"Burgerlijke staat\", \"burg_staat\");\n /*\n * build rows for ethnisch culturele achtergrond\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Ethnisch/culturele achtergrond\");\n $this->addRowsOptionValue($rows, $rowNumber, \"Ethnisch/culturele achtergrond\", \"cult_ethn\");\n /*\n * build rows for nationaliteit\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Nationaliteit\");\n $this->addRowsText($rows, $rowNumber, \"nationaliteit\");\n /*\n * build rows for geslacht\n */\n $this->_optionGroupId = 3;\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Geslacht:\");\n $this->addRowsOptionValue($rows, $rowNumber, \"\", \"geslacht\");\n }", "function build_row($row)\n{\n\t$name = $row->getColumnVal('Name');\n\t$id = $row->getColumnVal('Id');\n\n\t// Setup the columns you want to work with\n\t$idCol = $row->getCol('Id');\n\t$nameCol = $row->getCol('Name');\n\t$actionCol = $row->getCol('Action');\n\t$typeCol = $row->getCol('Type');\n\n\t// Set some HTML properties on the give column\n\t$idCol->setProp('width','50');\n\t$typeCol->setProp('width','50');\n\t$typeCol->addClass('center');\n\n\t// Add some CSS classes to the action column\n\t$actionCol\n\t\t-> addClass('center')\n\t\t-> addClass('btn');\n\n\t// Add an action link to the Action column\n\t$row->addLink('Action', \"examples.php?id=$id\", '[edit]', \"\", \"no-un\");\n\t$row->addLink('Action', \"examples.php?id=$id\", '[delete]', \"\", \"no-un\");\n\n\t// Set an ID on the row\n\t$row->setProp('id', \"tr_$id\");\n\n\t// set the background of the strawberry column to black\n\tif($name == \"Strawberry\")\n\t{\n\t\t// get an instance of the column and set a css class\n\t\t$nameCol->addClass('strawberry');\n\t}\n\n\t// set the background of the entire shoe row to red\n\tif($name == \"Chocolate\")\t\n\t{\n\t\t$row->addClass('chocolate');\n\t}\n\n\t// change one of the cell values\n\tif($name == \"Banana\")\t\n\t{\n\t\t$row->setVal('Name', $name . \" (favorite) <img src='https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcROTNegrNoPzMFMcpQ4pl7tko9LMwgoXuZyjTmX8vpUuPS_RfZr' />\");\n\t}\n\n\treturn $row;\n}", "function add_col($col,$header,$width,$html,$op='init_data'){\r\n\r\n\t\tif($op=='init_data')\r\n\t\t\t$this->extra_cols[]=array($col,$header,$width,$html);\r\n\r\n\t\tif(strpos($op,'init')!==false){\r\n\r\n\t\t\t// adds the new header\r\n\t\t\t$arr_header=explode(',',$this->header);\r\n\r\n\t\t\tif($col>count($arr_header)+1)\r\n\t\t\t\t$col=count($arr_header)+1;\r\n\r\n\t\t\tarray_splice($arr_header, $col-1, 0, $header);\r\n\t\t\t$this->header=implode(',',$arr_header);\r\n\r\n\t\t\t// adds the new column width\r\n\t\t\t$arr_width=explode(',',$this->width);\r\n\t\t\tarray_splice($arr_width, $col-1, 0, $width);\r\n\t\t\t$this->width=implode(',',$arr_width);\r\n\r\n\t\t\t// rearrange the sort string\r\n\t\t\tif($this->sort_init===true){\r\n\t\t\t\t$this->sort_init=str_repeat('t',count($arr_header));\r\n\t\t\t\t$this->sort_init[$col-1]='f';\r\n\t\t\t}else if($this->sort_init!==true and $this->sort_init!==false){\r\n\t\t\t\t$this->sort_init=substr_replace($this->sort_init,'f',$col-1,0);\r\n\t\t\t}\r\n\r\n\t\t\t// rearrange the search_init string\r\n\t\t\tif($this->search_init===true){\r\n\t\t\t\t$this->search_init=str_repeat('t',count($arr_header));\r\n\t\t\t\t$this->search_init[$col-1]='f';\r\n\t\t\t}elseif($this->search_init!==true and $this->search_init!==false){\r\n\t\t\t\t$this->search_init=substr_replace($this->search_init,'f',$col-1,0);\r\n\t\t\t}\r\n\r\n\t\t\t// rearrange the multiple_search_init string\r\n\t\t\tif($this->multiple_search_init===true){\r\n\t\t\t\t$this->multiple_search_init=str_repeat('t',count($arr_header));\r\n\t\t\t\t$this->multiple_search_init[$col-1]='f';\r\n\t\t\t}else if($this->multiple_search_init=='hide'){\r\n\t\t\t\t$this->multiple_search_init=str_repeat('t',count($arr_header));\r\n\t\t\t\t$this->multiple_search_init[$col-1]='f';\r\n\t\t\t\t$this->multiple_search_init.='hide';\r\n\t\t\t}else if($this->multiple_search_init!==true and $this->multiple_search_init!==false){\r\n\t\t\t\t$this->multiple_search_init=substr_replace($this->multiple_search_init,'f',$col-1,0);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(strpos($op,'data')!==false){\r\n\r\n\t\t\t// add the new column in all rows\r\n\t\t\tif($this->total_items>0){\r\n\t\t\t\tfor($i=0; $i<count($this->data); $i++){\r\n\t\t\t\t\tarray_splice($this->data[$i], $col-1, 0, array($html));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "abstract public function getColumnsCount();", "public function getBatchColumns();", "protected function _prepareColumns()\n {\n $this->addColumn('solutionpartner_id', array(\n 'header' => Mage::helper('solutionpartner')->__('ID'),\n 'align' =>'right',\n 'width' => '50px',\n 'index' => 'solutionpartner_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('solutionpartner')->__('Name'),\n 'align' =>'left',\n 'index' => 'name',\n ));\n\n $this->addColumn('email', array(\n 'header' => Mage::helper('solutionpartner')->__('Email'),\n 'align' =>'left',\n 'index' => 'email',\n 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_customer',\n ));\n\n $this->addColumn('website', array(\n 'header' => Mage::helper('solutionpartner')->__('Website'),\n 'align' => 'left',\n 'index' => 'website',\n 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_website',\n ));\n\n $this->addColumn('country', array(\n 'header' => Mage::helper('solutionpartner')->__('Country'),\n 'align' => 'left',\n 'index' => 'country',\n 'type' => 'options',\n 'options' => Mage::helper('solutionpartner')->getCountryList(),\n ));\n\n $this->addColumn('number_qtys', array(\n 'header' => Mage::helper('solutionpartner')->__('Order Qty'),\n 'align' => 'center',\n 'index' => 'number_qtys',\n 'filter_index' => 'count(order.entity_id)',\n 'type' => 'number',\n 'filter_condition_callback' => array($this, '_filterTotalProductsCallback'),\n // 'renderer' => 'partner/adminhtml_partner_renderer_orderquantity',\n ));\n\n// $this->addColumn('cumulative_amount', array(\n// 'header' => Mage::helper('solutionpartner')->__('Accumulated Revenue'),\n// 'type' => 'price',\n// 'index' => 'cumulative_amount',\n// 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n// ));\n//\n// $this->addColumn('cumulative_amount_history', array(\n// 'header' => Mage::helper('solutionpartner')->__('Revenue History'),\n// 'type' => 'price',\n// 'index' => 'cumulative_amount_history',\n// 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n// ));\n\n $this->addColumn('registered_date', array(\n 'header' => Mage::helper('solutionpartner')->__('Registered Date'),\n 'align' => 'left',\n 'index' => 'registered_date',\n 'type' => 'datetime'\n ));\n\n $this->addColumn('status', array(\n 'header' => Mage::helper('solutionpartner')->__('Status'),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'status',\n 'type' => 'options',\n 'options' => array(\n 1 => 'Enabled',\n 2 => 'Disabled',\n ),\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('solutionpartner')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('solutionpartner')->__('Edit'),\n 'url' => array('base'=> '*/*/edit'),\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('solutionpartner')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('solutionpartner')->__('XML'));\n\n return parent::_prepareColumns();\n }", "protected function addVirtualColumns()\n {\n \n }", "function RenderRow() {\n\t\tglobal $Security, $Language, $gsLanguage;\n\n\t\t// Initialize URLs\n\t\t// Convert decimal values if posted back\n\n\t\tif ($this->total_gross->FormValue == $this->total_gross->CurrentValue && is_numeric(ew_StrToFloat($this->total_gross->CurrentValue)))\n\t\t\t$this->total_gross->CurrentValue = ew_StrToFloat($this->total_gross->CurrentValue);\n\n\t\t// Call Row_Rendering event\n\t\t$this->Row_Rendering();\n\n\t\t// Common render codes for all row types\n\t\t// row_id\n\n\t\t$this->row_id->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// auc_date\n\t\t$this->auc_date->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// auc_number\n\t\t$this->auc_number->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// auc_place\n\t\t$this->auc_place->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// start_bid\n\t\t$this->start_bid->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// close_bid\n\t\t$this->close_bid->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// auc_notes\n\t\t// total_sack\n\n\t\t$this->total_sack->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// total_netto\n\t\t$this->total_netto->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// total_gross\n\t\t$this->total_gross->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// auc_status\n\t\t$this->auc_status->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// rate\n\t\tif ($this->RowType == EW_ROWTYPE_VIEW) { // View row\n\n\t\t// auc_date\n\t\t$this->auc_date->ViewValue = $this->auc_date->CurrentValue;\n\t\t$this->auc_date->ViewValue = ew_FormatDateTime($this->auc_date->ViewValue, 7);\n\t\t$this->auc_date->CellCssStyle .= \"text-align: center;\";\n\t\t$this->auc_date->ViewCustomAttributes = \"\";\n\n\t\t// auc_number\n\t\t$this->auc_number->ViewValue = $this->auc_number->CurrentValue;\n\t\t$this->auc_number->CellCssStyle .= \"text-align: center;\";\n\t\t$this->auc_number->ViewCustomAttributes = \"\";\n\n\t\t// auc_place\n\t\t$this->auc_place->ViewValue = $this->auc_place->CurrentValue;\n\t\t$this->auc_place->ViewCustomAttributes = \"\";\n\n\t\t// start_bid\n\t\t$this->start_bid->ViewValue = $this->start_bid->CurrentValue;\n\t\t$this->start_bid->ViewValue = ew_FormatDateTime($this->start_bid->ViewValue, 11);\n\t\t$this->start_bid->CellCssStyle .= \"text-align: center;\";\n\t\t$this->start_bid->ViewCustomAttributes = \"\";\n\n\t\t// close_bid\n\t\t$this->close_bid->ViewValue = $this->close_bid->CurrentValue;\n\t\t$this->close_bid->ViewValue = ew_FormatDateTime($this->close_bid->ViewValue, 11);\n\t\t$this->close_bid->CellCssStyle .= \"text-align: center;\";\n\t\t$this->close_bid->ViewCustomAttributes = \"\";\n\n\t\t// auc_notes\n\t\t$this->auc_notes->ViewValue = $this->auc_notes->CurrentValue;\n\t\t$this->auc_notes->ViewCustomAttributes = \"\";\n\n\t\t// total_sack\n\t\t$this->total_sack->ViewValue = $this->total_sack->CurrentValue;\n\t\t$this->total_sack->ViewValue = ew_FormatNumber($this->total_sack->ViewValue, 0, -2, -2, -2);\n\t\t$this->total_sack->CellCssStyle .= \"text-align: right;\";\n\t\t$this->total_sack->ViewCustomAttributes = \"\";\n\n\t\t// total_netto\n\t\t$this->total_netto->ViewValue = $this->total_netto->CurrentValue;\n\t\t$this->total_netto->ViewValue = ew_FormatNumber($this->total_netto->ViewValue, 0, -2, -2, -2);\n\t\t$this->total_netto->CellCssStyle .= \"text-align: right;\";\n\t\t$this->total_netto->ViewCustomAttributes = \"\";\n\n\t\t// total_gross\n\t\t$this->total_gross->ViewValue = $this->total_gross->CurrentValue;\n\t\t$this->total_gross->ViewValue = ew_FormatNumber($this->total_gross->ViewValue, 0, -2, -2, -2);\n\t\t$this->total_gross->CellCssStyle .= \"text-align: right;\";\n\t\t$this->total_gross->ViewCustomAttributes = \"\";\n\n\t\t// auc_status\n\t\tif (strval($this->auc_status->CurrentValue) <> \"\") {\n\t\t\t$this->auc_status->ViewValue = $this->auc_status->OptionCaption($this->auc_status->CurrentValue);\n\t\t} else {\n\t\t\t$this->auc_status->ViewValue = NULL;\n\t\t}\n\t\t$this->auc_status->CellCssStyle .= \"text-align: center;\";\n\t\t$this->auc_status->ViewCustomAttributes = \"\";\n\n\t\t// rate\n\t\t$this->rate->ViewValue = $this->rate->CurrentValue;\n\t\t$this->rate->ViewCustomAttributes = \"\";\n\n\t\t\t// auc_number\n\t\t\t$this->auc_number->LinkCustomAttributes = \"\";\n\t\t\t$this->auc_number->HrefValue = \"\";\n\t\t\t$this->auc_number->TooltipValue = \"\";\n\n\t\t\t// auc_place\n\t\t\t$this->auc_place->LinkCustomAttributes = \"\";\n\t\t\t$this->auc_place->HrefValue = \"\";\n\t\t\t$this->auc_place->TooltipValue = \"\";\n\n\t\t\t// start_bid\n\t\t\t$this->start_bid->LinkCustomAttributes = \"\";\n\t\t\t$this->start_bid->HrefValue = \"\";\n\t\t\t$this->start_bid->TooltipValue = \"\";\n\n\t\t\t// close_bid\n\t\t\t$this->close_bid->LinkCustomAttributes = \"\";\n\t\t\t$this->close_bid->HrefValue = \"\";\n\t\t\t$this->close_bid->TooltipValue = \"\";\n\n\t\t\t// auc_notes\n\t\t\t$this->auc_notes->LinkCustomAttributes = \"\";\n\t\t\t$this->auc_notes->HrefValue = \"\";\n\t\t\t$this->auc_notes->TooltipValue = \"\";\n\n\t\t\t// total_sack\n\t\t\t$this->total_sack->LinkCustomAttributes = \"\";\n\t\t\t$this->total_sack->HrefValue = \"\";\n\t\t\t$this->total_sack->TooltipValue = \"\";\n\n\t\t\t// total_gross\n\t\t\t$this->total_gross->LinkCustomAttributes = \"\";\n\t\t\t$this->total_gross->HrefValue = \"\";\n\t\t\t$this->total_gross->TooltipValue = \"\";\n\n\t\t\t// auc_status\n\t\t\t$this->auc_status->LinkCustomAttributes = \"\";\n\t\t\t$this->auc_status->HrefValue = \"\";\n\t\t\t$this->auc_status->TooltipValue = \"\";\n\t\t}\n\n\t\t// Call Row Rendered event\n\t\tif ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT)\n\t\t\t$this->Row_Rendered();\n\t}", "public function getSumRowsOfTable ($field,$tableName);", "protected function _prepareColumns()\n {\n $this->addColumn('ID',\n array(\n 'header'=> $this->__('ID'),\n 'width' => '50px',\n 'index' => 'ID'\n )\n );\n\n\n $this->addColumn('browser',\n array(\n 'header'=> $this->__('Browser Data'),\n 'width' => '50px',\n 'index' => 'browser',\n 'renderer' => 'Mage_Osc_Block_Renderers_Browser'\n )\n );\n\n\n $this->addColumn('quote_id',\n array(\n 'header'=> $this->__('ID do Carrinho'),\n 'width' => '50px',\n 'index' => 'quote_id'\n )\n );\n\n\n $this->addColumn('order_id',\n array(\n 'header'=> $this->__('ID do Pedido'),\n 'width' => '50px',\n 'index' => 'order_id',\n 'renderer' => 'Mage_Osc_Block_Renderers_Order'\n )\n );\n\n\n $this->addColumn('customer_id',\n array(\n 'header'=> $this->__('Cliente'),\n 'width' => '50px',\n 'index' => 'customer_id',\n 'renderer' => 'Mage_Osc_Block_Renderers_Customer'\n )\n );\n\n\n $this->addColumn('clickedfo',\n array(\n 'header'=> $this->__('Quantidade de Cliques'),\n 'width' => '50px',\n 'index' => 'clickedfo'\n )\n );\n\n\n $this->addColumn('payment_method',\n array(\n 'header'=> $this->__('Método de Pagamento'),\n 'width' => '50px',\n 'index' => 'payment_method'\n )\n );\n\n\n return parent::_prepareColumns();\n }", "public function getColumns(){\n $rows = array();\n return $rows; \n }", "public function total_rows();", "public function loop_columns() {\n\t\treturn apply_filters( 'setwood_loop_columns', 3 ); // 3 products per row\n\t}", "private function extractRows()\n {\n $this->setHeader($this->temp);\n $this->setRows($this->temp);\n }", "protected function addExcelColumns(\\MUtil_Model_ModelAbstract $model) {}", "public function addColumns($columns) {\n $this->columns = array_values(array_unique(array_merge($this->columns,$columns)));\n return $this;\n }", "public function aggregateListRowValues()\n\t{\n\t}", "public function aggregateListRowValues()\n\t{\n\t}", "public function set_vars_SQL($row){\n\t\t//0back\n\t\t$this->avg_reaction_time_m_no_faces = $row['avg_reaction_time_m_no_faces'];\n\t\t$this->accuracy_m_no_faces = $row['accuracy_m_no_faces'];\n\t\t$this->avg_reaction_time_m_faces = $row['avg_reaction_time_m_faces'];\n\t\t$this->accuracy_m_faces = $row['accuracy_m_faces'];\n\n\t\t//2back\n\t\t$this->avg_reaction_time_aba_no_faces = $row['avg_reaction_time_aba_no_faces'];\n\t\t$this->accuracy_aba_no_faces = $row['accuracy_aba_no_faces'];\n\t\t$this->avg_reaction_time_aba_faces = $row['avg_reaction_time_aba_faces'];\n\t\t$this->accuracy_aba_faces = $row['accuracy_aba_faces'];\n\n\t\t//faces-noFaces\n\t\t$this->avg_reaction_time_faces = $row['avg_reaction_time_faces'];\n\t\t$this->accuracy_faces = $row['accuracy_faces'];\n\t\t$this->avg_reaction_time_no_faces = $row['avg_reaction_time_no_faces'];\n\t\t$this->accuracy_no_faces = $row['accuracy_no_faces'];\n\t}", "public function addRow(TableRow $row);", "protected function _prepareColumns()\n {\n $this->addColumn('recipetype_id', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('ID'),\n 'width' => '50px',\n 'index' => 'recipetype_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Nombre Clasificación'),\n 'index' => 'name',\n ));\n\n return parent::_prepareColumns();\n }", "function _tableColumnWidth(&$table){\r\n//! @return void\r\n\t$cs = &$table['cells'];\r\n\t$mw = $this->getStringWidth('W');\r\n\t$nc = $table['nc'];\r\n\t$nr = $table['nr'];\r\n\t$listspan = array();\r\n\t//Xac dinh do rong cua cac cell va cac cot tuong ung\r\n\tfor ($j=0;$j<$nc;$j++){\r\n\t\t$wc = &$table['wc'][$j];\r\n\t\tfor ($i=0;$i<$nr;$i++){\r\n\t\t\tif (isset($cs[$i][$j]) && $cs[$i][$j]){\r\n\t\t\t\t$c = &$cs[$i][$j];\r\n\t\t\t\t$miw = $mw;\r\n\t\t\t\t$c['maw']\t= $c['s'];\r\n\t\t\t\tif (isset($c['nowrap']))\t\t\t$miw = $c['maw'];\r\n\t\t\t\tif (isset($c['w'])){\r\n\t\t\t\t\tif ($miw<$c['w'])\t$c['miw'] = $c['w'];\r\n\t\t\t\t\tif ($miw>$c['w'])\t$c['miw'] = $c['w']\t = $miw;\r\n\t\t\t\t\tif (!isset($wc['w'])) $wc['w'] = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$c['miw'] = $miw;\r\n\t\t\t\t}\r\n\t\t\t\tif ($c['maw'] < $c['miw'])\t\t\t$c['maw'] = $c['miw'];\r\n\t\t\t\tif (!isset($c['colspan'])){\r\n\t\t\t\t\tif ($wc['miw'] < $c['miw'])\t\t$wc['miw']\t= $c['miw'];\r\n\t\t\t\t\tif ($wc['maw'] < $c['maw'])\t\t$wc['maw']\t= $c['maw'];\r\n\t\t\t\t}else $listspan[] = array($i,$j);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t//Xac dinh su anh huong cua cac cell colspan len cac cot va nguoc lai\r\n\t$wc = &$table['wc'];\r\n\tforeach ($listspan as $span){\r\n\t\tlist($i,$j) = $span;\r\n\t\t$c = &$cs[$i][$j];\r\n\t\t$lc = $j + $c['colspan'];\r\n\t\tif ($lc > $nc) $lc = $nc;\r\n\t\t\r\n\t\t$wis = $wisa = 0;\r\n\t\t$was = $wasa = 0;\r\n\t\t$list = array();\r\n\t\tfor($k=$j;$k<$lc;$k++){\r\n\t\t\t$wis += $wc[$k]['miw'];\r\n\t\t\t$was += $wc[$k]['maw'];\r\n\t\t\tif (!isset($c['w'])){\r\n\t\t\t\t$list[] = $k;\r\n\t\t\t\t$wisa += $wc[$k]['miw'];\r\n\t\t\t\t$wasa += $wc[$k]['maw'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($c['miw'] > $wis){\r\n\t\t\tif (!$wis){//Cac cot chua co kich thuoc => chia deu\r\n\t\t\t\tfor($k=$j;$k<$lc;$k++) $wc[$k]['miw'] = $c['miw']/$c['colspan'];\r\n\t\t\t}elseif (!count($list)){//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca\r\n\t\t\t\t$wi = $c['miw'] - $wis;\r\n\t\t\t\tfor($k=$j;$k<$lc;$k++) \r\n\t\t\t\t\t$wc[$k]['miw'] += ($wc[$k]['miw']/$wis)*$wi;\r\n\t\t\t}else{//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto\r\n\t\t\t\t$wi = $c['miw'] - $wis;\r\n\t\t\t\tforeach ($list as $k)\r\n\t\t\t\t\t$wc[$k]['miw'] += ($wc[$k]['miw']/$wisa)*$wi;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($c['maw'] > $was){\r\n\t\t\tif (!$wis){//Cac cot chua co kich thuoc => chia deu\r\n\t\t\t\tfor($k=$j;$k<$lc;$k++) $wc[$k]['maw'] = $c['maw']/$c['colspan'];\r\n\t\t\t}elseif (!count($list)){//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca\r\n\t\t\t\t$wi = $c['maw'] - $was;\r\n\t\t\t\tfor($k=$j;$k<$lc;$k++) \r\n\t\t\t\t\t$wc[$k]['maw'] += ($wc[$k]['maw']/$was)*$wi;\r\n\t\t\t}else{//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto\r\n\t\t\t\t$wi = $c['maw'] - $was;\r\n\t\t\t\tforeach ($list as $k)\r\n\t\t\t\t\t$wc[$k]['maw'] += ($wc[$k]['maw']/$wasa)*$wi;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "abstract protected function getColumns(): array;" ]
[ "0.6973751", "0.6672808", "0.65247077", "0.61085564", "0.6083167", "0.6054141", "0.58244914", "0.58058816", "0.5688073", "0.56362253", "0.55681545", "0.5509784", "0.54949915", "0.5486088", "0.54698646", "0.5420478", "0.5348129", "0.5343558", "0.5299458", "0.5299319", "0.52809554", "0.52495074", "0.52297336", "0.52089715", "0.5192613", "0.5188974", "0.5165155", "0.51497716", "0.5149553", "0.51471454", "0.51346064", "0.5125631", "0.51227206", "0.5107669", "0.5105029", "0.5103536", "0.5095278", "0.50782347", "0.50706744", "0.506841", "0.50611556", "0.50586516", "0.5037042", "0.5037042", "0.5037042", "0.5037042", "0.5037042", "0.5037042", "0.5037042", "0.5017098", "0.50148684", "0.50124675", "0.5009221", "0.49810645", "0.49646342", "0.49646342", "0.49646342", "0.49646342", "0.49489596", "0.49256828", "0.49208692", "0.49183097", "0.49159953", "0.4914148", "0.49001804", "0.48939845", "0.48920888", "0.48722565", "0.4871223", "0.4869244", "0.48641443", "0.48605537", "0.48577", "0.48553333", "0.48514786", "0.48503464", "0.4849473", "0.4847486", "0.4837477", "0.48302475", "0.48239002", "0.48139134", "0.48072034", "0.47933874", "0.47906443", "0.47848335", "0.47826517", "0.47821125", "0.47820997", "0.47806346", "0.47795638", "0.47785562", "0.47735953", "0.4768694", "0.47684434", "0.47684434", "0.47661424", "0.4760919", "0.47595662", "0.4751469", "0.47495154" ]
0.0
-1
Not very robust honestly...
static function getIntFromString($string){ $currencyUsedIndex = self::isCurrency( $string ); if($currencyUsedIndex !== false){ $int = self::stripCurrencySymbol($string, $currencyUsedIndex); }else{$int = (float) $string;} // echo "getIntFromString returning " . var_dump($int); return $int; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fix() ;", "function broken() { }", "private function _i() {\n }", "function broken() { return TRUE; }", "function initialBasicFixes()\r\n{\r\n /**\r\n * bypass date & timezone-related warnings with php 5.1\r\n */\r\n if (function_exists('date_default_timezone_set')) {\r\n $tz= @date_default_timezone_get();\r\n date_default_timezone_set($tz);\r\n }\r\n\r\n ini_set('zend.ze1_compatibility_mode', 0);\r\n ini_set(\"pcre.backtrack_limit\", -1); # fix 5.2.0 prce bug with render_wiki\r\n if(function_exists('mb_internal_encoding')) {\r\n mb_internal_encoding(\"UTF-8\");\r\n }\r\n #ini_set(\"mbstring.func_overload\", 2);\r\n\r\n /**\r\n * add rough php-version check to at least avoid parsing errors.\r\n * fine version-check follows further down\r\n */\r\n if(phpversion() < \"5.0.0\") {\r\n echo \"Sorry, but Streber requires php5 or higher.\";\r\n exit();\r\n }\r\n}", "protected function checkLibXmlBug() {}", "protected function _refine() {\n\n\t}", "protected function fixSelf() {}", "protected function fixSelf() {}", "function yy_r66(){ $this->_retvalue = str_replace(array('.\"\".','\"\".','.\"\"'),array('.','',''),'\"'.$this->yystack[$this->yyidx + -1]->minor.'\"'); }", "protected function _findStartOffset() {}", "public function testPreprocessingUnrotate()\n {\n }", "public function testPreprocessingBinarize()\n {\n }", "abstract protected function external();", "abstract protected function _preProcess();", "abstract protected function mini(): string;", "public function native();", "public function testPreprocessingBinarizeAdvanced()\n {\n }", "public function testRegistrationValuesTooShort(): void { }", "private function _optimize() {}", "function yy_r74(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.'::$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r42(){ $this->_retvalue = 'UNIQUE'; }", "function triggerUAF(&$r, $newAddr) {\n exif_read_data($r); // trigger an early-free on $r's value by providing an invalid handle (from line 24)\n\n/*\nThis is where the early-free happens: \nsnippet from: ext/exif/exif.c\n------------------------------------------------------------\n// 4310 static int exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)\n// 4311 {\n// .... more code .....\n// 4325 if ((st.st_mode & S_IFMT) != S_IFREG) {\n// 4326 exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, \"Not a file\");\n// 4327 php_stream_close(ImageInfo->infile); // <----- this is where the memory pointed by $r is free'd\n// 4328 return FALSE;\n// 4329 }\n------------------------------------------------------------\n\n\nAt this point, $r->value->res points to a free'd memory chunk(or, in UAF terms: it's a \"dangling pointer\")\nThe next thing we will do is to \"catch\" this free memory chunk with a \ndifferent/new allocation:\n*/\n $s = str_repeat($newAddr, 1); // allocating a new zend_string on the heap, this will\n // make the address of $s to be the same as where $r points to\n // Q: \"Why did you choose zend_string?\" \n // A: Because we're trying to implement a first-fit technique and \n // those structures have a very similar size, hence, they will land\n // on the same bin:\n // gdb-peda$ call sizeof(zend_resource)\n // 20\n // gdb-peda$ call sizeof(zend_string)\n // 20\n\n\n/*\nBecause those two structures have a similar layout in memory, and the \"ptr\" property(from zend_resource)\nshare the same offset as \"val\" property (from zend_string) containing our malicious string, it means that\nthe string inside $s lands exactly on the \"ptr\" property! \n\nThis is how the two variables look like now (internally):\n\ngdb-peda$ print (zend_string)*0xb5a01408 \n$4 = {\n gc = {\n refcount = 1, \n u = {\n v = {\n type = 6 '\\006', \n flags = 0 '\\000',\n gc_info = 0\n },\n type_info = 6\n }\n },\n h = 0,\n len = 3, \n val = \"AAA\" <---- our allocated string\n}\n```\n\nAnd this is how PHP sees ``$r``:\n```\ngdb-peda$ print (zend_resource)*0xb5a01408 <---- same address, different struct representation\n$5 = {\n gc = {\n refcount = 1,\n u = {\n v = {\n type = 6 '\\006',\n flags = 0 '\\000',\n gc_info = 0\n },\n type_info = 6\n }\n },\n handle = 0,\n type = 3,\n ptr = 0x414141 <------ what??\n}\n\n*/\n}", "function yy_r72(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r104(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }", "abstract protected function safetyCheck() : self;", "public function testRegistrationValuesTooLong(): void { }", "function yy_r68(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r73(){ $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.'::$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "public function fix() {}", "public function fix() {}", "abstract protected function _process();", "abstract protected function _process();", "public function testPreprocessingGetPageAngle()\n {\n }", "function is_usefull($text) //good\r\n { \r\n $text=trim($text);\r\n $value = preg_replace('#\\s\\s#' , \" \" , $text);\r\n $value = preg_replace('#\\s+,#' , \", \" , $text);\r\n $value = preg_replace('#,\\s+#' , \",\" , $text);\r\n $value = preg_replace('#\\s+\\'#' , \"'\" , $text);\r\n $value = preg_replace('#\\'\\s+#' , \"'\" , $text);\r\n $value = preg_replace('#\\s+\\.#' , \".\" , $text);\r\n $value = preg_replace('#\\.\\s+#' , \" \" , $text);\r\n $value = preg_replace('#\\.[a-z]{1}#' , \".strtouppe[a-z]{1}\" , $text);\r\n $value = preg_replace('#\\s\\)#' , \")\" , $text);\r\n $value = preg_replace('#\\)\\s#' , \")\" , $text);\r\n $value = preg_replace('#\\(\\s#' , \"(\" , $text);\r\n $value = preg_replace('#\\s\\(#' , \"(\" , $text);\r\n $value = preg_replace('#;\\s+#' , \"; \" , $text);\r\n $value = preg_replace('#s+\\;#' , \"; \" , $text);\r\n $value = preg_replace('#s+\\:#' , \" :\" , $text);\r\n return $text;\r\n is_usefull(\"$text\");\r\n }", "public function testFindSignatures()\n {\n\n }", "function buildValidMySQLTableNameFrom($text)\n{\n $text = preg_replace('/[^a-zA-Z0-9_]/','_',$text);\n return utf8_substr($text,0,55);\n //there is a MySQL upper limit for length of a table name\n}", "public static function Parse837()\n\t{\n\n\t}", "public function helper()\n\t{\n\t\n\t}", "public function testValidateDocumentGZipValidation()\n {\n }", "function mb_locations()\n {\n }", "function _prepare() {}", "public function testFileRefs() {}", "public function testProfilePrototypeFindByIdAccessTokens()\n {\n\n }", "function yy_r106(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r154(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; }", "public function testProfilePrototypeCountQuarantines()\n {\n\n }", "function tideways_last_detected_exception()\n{\n}", "public static function dummy() {}", "function findexts($filename) { \n$filename \t= strtolower($filename) ; \n$exts \t\t= split(\"[/\\\\.]\", $filename) ; \n$n \t\t\t= count($exts)-1; \n$exts \t\t= $exts[$n]; \nreturn $exts; \n}", "public function test_FName__Weirdos(): void\n {\n $filename = '..';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing(['','..','','..'], [$f->path, $f->body, $f->ext, $f->filename]);\n\n //single dot is a filename without extension (body only)\n $filename = '.';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing(['','.','','.'], [$f->path, $f->body, $f->ext, $f->filename]);\n\n //lots of dots is still considered a filename without extension (body only)\n $filename = '......';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing(['','......','','......'], [$f->path, $f->body, $f->ext, $f->filename]);\n\n //lots of dots as body with an added extension - last dot is always consumed when separating the extension\n $filename = '......ext';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing(['','.....','ext','......ext'], [$f->path, $f->body, $f->ext, $f->filename]);\n\n //Multiple dots in filename\n $filename = '/var/www/whatever/manci...neni.meg.a.madarak...ext';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing\n (\n ['/var/www/whatever/','manci...neni.meg.a.madarak..','ext','manci...neni.meg.a.madarak...ext'],\n [$f->path, $f->body, $f->ext, $f->filename]\n );\n\n //Unicode madness...\n $filename = '/var/w™ww/whateverḊḋḞ/very😎😏...ne🌎🌏ni.meg.a.mУФХadarak...ぴふべ';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing\n (\n ['/var/w™ww/whateverḊḋḞ/','very😎😏...ne🌎🌏ni.meg.a.mУФХadarak..','ぴふべ','very😎😏...ne🌎🌏ni.meg.a.mУФХadarak...ぴふべ'],\n [$f->path, $f->body, $f->ext, $f->filename]\n );\n }", "public function testValidateDocumentJpgValidation()\n {\n }", "function testBug_rolfhub_2007_02_07_2() \n {\n $sText = <<<SCRIPT\n<?php\necho (1.0 . \" \" . 2 . 3);\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\necho (1.0 . \" \" . 2 . 3);\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "function yy_r70(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.'::'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r109(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.\",\".$this->yystack[$this->yyidx + 0]->minor; }", "function isCompilable() ;", "abstract protected function doEvil();", "public function inOriginal();", "function yy_r113()\n {\n return;\n }", "public function testProfilePrototypeCountAccessTokens()\n {\n\n }", "public function testValidateDocumentTarValidation()\n {\n }", "public function temporality();", "abstract function fromexp();", "function checkSourceFormat()\r\n\t{\r\n\t\treturn true;\r\n\t}", "function yy_r96(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; }", "function upgrade_290()\n {\n }", "function yy_r116(){ \n $this->_retvalue[implode(\" \", $this->yystack[$this->yyidx + -2]->minor)] = $this->yystack[$this->yyidx + 0]->minor->getMember(0); \n }", "protected function test9() {\n\n }", "public function testValidateDocumentXmlXxeThreatValidation()\n {\n }", "final private function __construct() {}", "final private function __construct() {}", "public function testProfilePrototypeGetImage()\n {\n\n }", "public function testGetLowStockFiles()\n {\n }", "function yy_r60(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; }", "public function testPingTreeGetItem()\n {\n }", "function yy_r54(){ $this->_retvalue = array(); }", "function findexts ($filename) {\r\n\t \t$filename=strtolower($filename);\r\n\t \t$exts=split(\"[/\\\\.]\", $filename);\r\n\t \t$n=count($exts)-1;\r\n\t \t$exts=$exts[$n];\r\n\t \treturn $exts;\r\n\t }", "private function __construct()\t{}", "abstract protected function _prepare();", "function yy_r103(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }", "function findexts ($filename) \n{ \n\t$filename = strtolower($filename) ; \n\t$exts = split(\"[/\\\\.]\", $filename) ; \n\t$n = count($exts)-1; \n\n\t// Write any scripts that check for unwanted extensions here!\n\tif ($n > 1) // Check for evil double-barreled extensions like \"yourfile.php.jpg\" or \"yourfile.exe.jpg\" and eliminate extensions you don't allow.\n\t{\n\t\techo \"Double-Barreled file extension(s) are not allowed.<br>\";\n\t\t$ok=0;\n\t}\n\t$exts = $exts[$n]; \n\treturn $exts; \n}", "public function testValidateDocumentExecutableValidation()\n {\n }", "function yy_r102(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "public function testPingTreeGetReferences()\n {\n }", "public function testPreprocessingUnskew()\n {\n }", "function upgrade_340()\n {\n }", "function upgrade_372()\n {\n }", "private function j() {\n }", "public function testAddLowStockFile()\n {\n }", "function yy_r153(){ return; }", "function yy_r88(){ $this->_retvalue = \"['\". $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor .\"']\"; }", "public function testProfilePrototypeGetQuarantines()\n {\n\n }", "function yy_r23(){ $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; }", "function testStartsWith4 ()\n\t{\n\t\t\t$input1 = 'Barry';\n\t\t\t$input2 = null;\n\t\t\t$this->assertFalse (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}", "public function testAddLowStockFileByURL()\n {\n }", "function yy_r105(){ $this->_retvalue = '->{\\''.$this->yystack[$this->yyidx + -4]->minor.'\\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }", "function yy_r67(){ $this->_retvalue = \"''\"; }", "abstract protected function determineRootline() ;", "function mb_internal_encoding($charset='')\n {\n }", "function upgrade_420()\n {\n }", "function __return_null()\n {\n }" ]
[ "0.5151072", "0.51348317", "0.5059398", "0.50500053", "0.50242794", "0.49902633", "0.49855116", "0.49151337", "0.49151337", "0.4874484", "0.4848878", "0.4847778", "0.48302767", "0.48212188", "0.48041454", "0.4727504", "0.47188863", "0.46942562", "0.46921372", "0.46861136", "0.4679924", "0.4678561", "0.46718964", "0.4667317", "0.46576345", "0.46476433", "0.46406412", "0.46347937", "0.46310434", "0.46306962", "0.46306235", "0.46230707", "0.46230707", "0.46120322", "0.46009472", "0.45996144", "0.45991185", "0.45984694", "0.45812774", "0.4575385", "0.45722184", "0.45600334", "0.45513225", "0.45508435", "0.45412222", "0.4534312", "0.45330837", "0.45329803", "0.45303202", "0.45301098", "0.45289674", "0.4527548", "0.45262352", "0.4524505", "0.4522619", "0.45220318", "0.45170072", "0.4512538", "0.4508546", "0.45012754", "0.4501267", "0.44966727", "0.44963437", "0.44935453", "0.44918522", "0.44905365", "0.4483968", "0.44798696", "0.4479807", "0.44767153", "0.44767153", "0.44757003", "0.44721466", "0.44591147", "0.44586554", "0.445844", "0.4457141", "0.4455061", "0.44505396", "0.44452143", "0.44446722", "0.44428664", "0.4439592", "0.44378963", "0.4436537", "0.44293222", "0.44285542", "0.44285408", "0.44284242", "0.44255328", "0.4425396", "0.4418564", "0.4416603", "0.4415719", "0.4408125", "0.44037065", "0.4403238", "0.44025168", "0.44023538", "0.44008204", "0.44007018" ]
0.0
-1
Not looking for many currencies at the moment
static function isCurrency($string){ $currencySymbols = ["$", "¥", "€"]; if(filter_var($string, FILTER_SANITIZE_NUMBER_INT) === false){echo "IS NOT CURRENCY <br />";return false;} for($i=0;$i < count($currencySymbols); $i++){ // echo "looking for currency symbol : " . $currencySymbols[$i] . " in string $string"; $symbolPos = strpos($string, $currencySymbols[$i]); // var_dump($symbolPos); if($symbolPos !== false){ // echo "currency symbol found, returning : $symbolPos"; return $symbolPos; } } // echo "currency symbol NOT found, returning : $symbolPos"; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCurrencies();", "abstract protected function getSupportedCurrencies();", "public function getCurrency();", "public function getCurrency();", "public function getCurrencies() {\n\t\treturn array(\"CNY\");\n\t}", "public function getCurrencies()\n {\n return array(\"PLN\");\n }", "public function getCurrency(): string;", "public function getCurrency(): string;", "public static function no_decimal_currencies() {\n\t\treturn array(\n\t\t\t'bif', // Burundian Franc\n\t\t\t'djf', // Djiboutian Franc\n\t\t\t'jpy', // Japanese Yen\n\t\t\t'krw', // South Korean Won\n\t\t\t'pyg', // Paraguayan Guaraní\n\t\t\t'vnd', // Vietnamese Đồng\n\t\t\t'xaf', // Central African Cfa Franc\n\t\t\t'xpf', // Cfp Franc\n\t\t\t'clp', // Chilean Peso\n\t\t\t'gnf', // Guinean Franc\n\t\t\t'kmf', // Comorian Franc\n\t\t\t'mga', // Malagasy Ariary\n\t\t\t'rwf', // Rwandan Franc\n\t\t\t'vuv', // Vanuatu Vatu\n\t\t\t'xof', // West African Cfa Franc\n\t\t);\n\t}", "function GetCurrencies()\n\t{\n\t\t$result = $this->sendRequest(\"GetCurrencies\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public static function getCurrencies(): array\n {\n return [\n 'USD', 'EUR', 'GBP', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', \n 'ARS', 'AUD', 'AWG', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BIF', \n 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BWP', 'BZD', 'CAD', 'CDF', \n 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CVE', 'CZK', 'DJF', 'DKK', \n 'DOP', 'DZD', 'EGP', 'ETB', 'FJD', 'FKP', 'GEL', 'GIP', 'GMD', \n 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', \n 'ILS', 'INR', 'ISK', 'JMD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', \n 'KRW', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'MAD', \n 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', \n 'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', \n 'NZD', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', \n 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SEK', 'SGD', \n 'SHP', 'SLL', 'SOS', 'SRD', 'STD', 'SZL', 'THB', 'TJS', 'TOP', \n 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', 'UYU', 'UZS', 'VND', \n 'VUV', 'WST', 'XAF', 'XCD', 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW'\n ];\n }", "public static function getAllCurrencies(){\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$query = ' SELECT\r\n\t\t\t\t\th.*\r\n\t\t\t\t\tFROM #__hotelreservation_currencies h\r\n\t\t\t\t\tORDER BY description asc';\r\n\t\t$db->setQuery( $query );\r\n\t\treturn $db->loadObjectList();\r\n\t}", "function get_carton_currencies() {\n\treturn array_unique(\n\t\tapply_filters( 'carton_currencies',\n\t\t\tarray(\n\t\t\t\t'RUB' => __( 'Russian Rubles (RUB, new currency code 643, since 2001)', 'carton' ),\n\t\t\t\t'RUR' => __( 'Russian Rubles (RUR, old currency code 810, before 2001)', 'carton' ),\n\t\t\t\t'AUD' => __( 'Australian Dollars', 'carton' ),\n\t\t\t\t'BRL' => __( 'Brazilian Real', 'carton' ),\n\t\t\t\t'CAD' => __( 'Canadian Dollars', 'carton' ),\n\t\t\t\t'RMB' => __( 'Chinese Yuan', 'carton' ),\n\t\t\t\t'CZK' => __( 'Czech Koruna', 'carton' ),\n\t\t\t\t'DKK' => __( 'Danish Krone', 'carton' ),\n\t\t\t\t'EUR' => __( 'Euros', 'carton' ),\n\t\t\t\t'HKD' => __( 'Hong Kong Dollar', 'carton' ),\n\t\t\t\t'HUF' => __( 'Hungarian Forint', 'carton' ),\n\t\t\t\t'IDR' => __( 'Indonesia Rupiah', 'carton' ),\n\t\t\t\t'INR' => __( 'Indian Rupee', 'carton' ),\n\t\t\t\t'ILS' => __( 'Israeli Shekel', 'carton' ),\n\t\t\t\t'JPY' => __( 'Japanese Yen', 'carton' ),\n\t\t\t\t'KRW' => __( 'South Korean Won', 'carton' ),\n\t\t\t\t'MYR' => __( 'Malaysian Ringgits', 'carton' ),\n\t\t\t\t'MXN' => __( 'Mexican Peso', 'carton' ),\n\t\t\t\t'NOK' => __( 'Norwegian Krone', 'carton' ),\n\t\t\t\t'NZD' => __( 'New Zealand Dollar', 'carton' ),\n\t\t\t\t'PHP' => __( 'Philippine Pesos', 'carton' ),\n\t\t\t\t'PLN' => __( 'Polish Zloty', 'carton' ),\n\t\t\t\t'GBP' => __( 'Pounds Sterling', 'carton' ),\n\t\t\t\t'RON' => __( 'Romanian Leu', 'carton' ),\n\t\t\t\t'SGD' => __( 'Singapore Dollar', 'carton' ),\n\t\t\t\t'ZAR' => __( 'South African rand', 'carton' ),\n\t\t\t\t'SEK' => __( 'Swedish Krona', 'carton' ),\n\t\t\t\t'CHF' => __( 'Swiss Franc', 'carton' ),\n\t\t\t\t'TWD' => __( 'Taiwan New Dollars', 'carton' ),\n\t\t\t\t'THB' => __( 'Thai Baht', 'carton' ),\n\t\t\t\t'TRY' => __( 'Turkish Lira', 'carton' ),\n\t\t\t\t'USD' => __( 'US Dollars', 'carton' ),\n\t\t\t)\n\t\t)\n\t);\n}", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getSourceCurrency();", "function erp_get_currencies() {\n return apply_filters( 'erp_currencies', [\n 'AFN' => __( 'Afghan Afghani', 'erp' ),\n 'ALL' => __( 'Albanian Lek', 'erp' ),\n 'DZD' => __( 'Algerian Dinar', 'erp' ),\n 'ADP' => __( 'Andorran Peseta', 'erp' ),\n 'AOA' => __( 'Angolan Kwanza', 'erp' ),\n 'ARA' => __( 'Argentine Austral', 'erp' ),\n 'ARS' => __( 'Argentine Peso', 'erp' ),\n 'AMD' => __( 'Armenian Dram', 'erp' ),\n 'AWG' => __( 'Aruban Florin', 'erp' ),\n 'AUD' => __( 'Australian Dollar', 'erp' ),\n 'ATS' => __( 'Austrian Schilling', 'erp' ),\n 'AZN' => __( 'Azerbaijani Manat', 'erp' ),\n 'BSD' => __( 'Bahamian Dollar', 'erp' ),\n 'BHD' => __( 'Bahraini Dinar', 'erp' ),\n 'BDT' => __( 'Bangladeshi Taka', 'erp' ),\n 'BBD' => __( 'Barbadian Dollar', 'erp' ),\n 'BYR' => __( 'Belarusian Ruble', 'erp' ),\n 'BEF' => __( 'Belgian Franc', 'erp' ),\n 'BZD' => __( 'Belize Dollar', 'erp' ),\n 'BMD' => __( 'Bermudan Dollar', 'erp' ),\n 'BTN' => __( 'Bhutanese Ngultrum', 'erp' ),\n 'BOB' => __( 'Bolivian Boliviano', 'erp' ),\n 'BOV' => __( 'Bolivian Mvdol', 'erp' ),\n 'BOP' => __( 'Bolivian Peso', 'erp' ),\n 'BAM' => __( 'Bosnia-Herzegovina Convertible Mark', 'erp' ),\n 'BWP' => __( 'Botswanan Pula', 'erp' ),\n 'BRL' => __( 'Brazilian Real', 'erp' ),\n 'GBP' => __( 'British Pound Sterling', 'erp' ),\n 'BND' => __( 'Brunei Dollar', 'erp' ),\n 'BGN' => __( 'Bulgarian Lev', 'erp' ),\n 'BUK' => __( 'Burmese Kyat', 'erp' ),\n 'BIF' => __( 'Burundian Franc', 'erp' ),\n 'KHR' => __( 'Cambodian Riel', 'erp' ),\n 'CAD' => __( 'Canadian Dollar', 'erp' ),\n 'CVE' => __( 'Cape Verdean Escudo', 'erp' ),\n 'KYD' => __( 'Cayman Islands Dollar', 'erp' ),\n 'XOF' => __( 'CFA Franc BCEAO', 'erp' ),\n 'XAF' => __( 'CFA Franc BEAC', 'erp' ),\n 'XPF' => __( 'CFP Franc', 'erp' ),\n 'CLP' => __( 'Chilean Peso', 'erp' ),\n 'CNY' => __( 'Chinese Yuan', 'erp' ),\n 'COP' => __( 'Colombian Peso', 'erp' ),\n 'KMF' => __( 'Comorian Franc', 'erp' ),\n 'CDF' => __( 'Congolese Franc', 'erp' ),\n 'CRC' => __( 'Costa Rican Colón', 'erp' ),\n 'HRK' => __( 'Croatian Kuna', 'erp' ),\n 'CUP' => __( 'Cuban Peso', 'erp' ),\n 'CYP' => __( 'Cypriot Pound', 'erp' ),\n 'CZK' => __( 'Czech Republic Koruna', 'erp' ),\n 'DKK' => __( 'Danish Krone', 'erp' ),\n 'DJF' => __( 'Djiboutian Franc', 'erp' ),\n 'DOP' => __( 'Dominican Peso', 'erp' ),\n 'NLG' => __( 'Dutch Guilder', 'erp' ),\n 'XCD' => __( 'East Caribbean Dollar', 'erp' ),\n 'ECS' => __( 'Ecuadorian Sucre', 'erp' ),\n 'EGP' => __( 'Egyptian Pound', 'erp' ),\n 'GQE' => __( 'Equatorial Guinean Ekwele', 'erp' ),\n 'ERN' => __( 'Eritrean Nakfa', 'erp' ),\n 'EEK' => __( 'Estonian Kroon', 'erp' ),\n 'ETB' => __( 'Ethiopian Birr', 'erp' ),\n 'EUR' => __( 'Euro', 'erp' ),\n 'FKP' => __( 'Falkland Islands Pound', 'erp' ),\n 'FJD' => __( 'Fijian Dollar', 'erp' ),\n 'FIM' => __( 'Finnish Markka', 'erp' ),\n 'FRF' => __( 'French Franc', 'erp' ),\n 'GMD' => __( 'Gambian Dalasi', 'erp' ),\n 'GEL' => __( 'Georgian Lari', 'erp' ),\n 'DEM' => __( 'German Mark', 'erp' ),\n 'GHS' => __( 'Ghanaian Cedi', 'erp' ),\n 'GIP' => __( 'Gibraltar Pound', 'erp' ),\n 'GRD' => __( 'Greek Drachma', 'erp' ),\n 'GTQ' => __( 'Guatemalan Quetzal', 'erp' ),\n 'GWP' => __( 'Guinea-Bissau Peso', 'erp' ),\n 'GNF' => __( 'Guinean Franc', 'erp' ),\n 'GYD' => __( 'Guyanaese Dollar', 'erp' ),\n 'HTG' => __( 'Haitian Gourde', 'erp' ),\n 'HNL' => __( 'Honduran Lempira', 'erp' ),\n 'HKD' => __( 'Hong Kong Dollar', 'erp' ),\n 'HUF' => __( 'Hungarian Forint', 'erp' ),\n 'ISK' => __( 'Icelandic Króna', 'erp' ),\n 'INR' => __( 'Indian Rupee', 'erp' ),\n 'IDR' => __( 'Indonesian Rupiah', 'erp' ),\n 'IRR' => __( 'Iranian Rial', 'erp' ),\n 'IQD' => __( 'Iraqi Dinar', 'erp' ),\n 'IEP' => __( 'Irish Pound', 'erp' ),\n 'ILS' => __( 'Israeli New Sheqel', 'erp' ),\n 'ITL' => __( 'Italian Lira', 'erp' ),\n 'JMD' => __( 'Jamaican Dollar', 'erp' ),\n 'JPY' => __( 'Japanese Yen', 'erp' ),\n 'JOD' => __( 'Jordanian Dinar', 'erp' ),\n 'KZT' => __( 'Kazakhstani Tenge', 'erp' ),\n 'KES' => __( 'Kenyan Shilling', 'erp' ),\n 'KWD' => __( 'Kuwaiti Dinar', 'erp' ),\n 'KGS' => __( 'Kyrgystani Som', 'erp' ),\n 'LAK' => __( 'Laotian Kip', 'erp' ),\n 'LVL' => __( 'Latvian Lats', 'erp' ),\n 'LBP' => __( 'Lebanese Pound', 'erp' ),\n 'LSL' => __( 'Lesotho Loti', 'erp' ),\n 'LRD' => __( 'Liberian Dollar', 'erp' ),\n 'LYD' => __( 'Libyan Dinar', 'erp' ),\n 'LTL' => __( 'Lithuanian Litas', 'erp' ),\n 'LTT' => __( 'Lithuanian Talonas', 'erp' ),\n 'LUF' => __( 'Luxembourgian Franc', 'erp' ),\n 'MOP' => __( 'Macanese Pataca', 'erp' ),\n 'MKD' => __( 'Macedonian Denar', 'erp' ),\n 'MGA' => __( 'Malagasy Ariary', 'erp' ),\n 'MWK' => __( 'Malawian Kwacha', 'erp' ),\n 'MYR' => __( 'Malaysian Ringgit', 'erp' ),\n 'MVR' => __( 'Maldivian Rufiyaa', 'erp' ),\n 'MLF' => __( 'Malian Franc', 'erp' ),\n 'MTL' => __( 'Maltese Lira', 'erp' ),\n 'MRO' => __( 'Mauritanian Ouguiya', 'erp' ),\n 'MUR' => __( 'Mauritian Rupee', 'erp' ),\n 'MXN' => __( 'Mexican Peso', 'erp' ),\n 'MDL' => __( 'Moldovan Leu', 'erp' ),\n 'MCF' => __( 'Monegasque Franc', 'erp' ),\n 'MNT' => __( 'Mongolian Tugrik', 'erp' ),\n 'MAD' => __( 'Moroccan Dirham', 'erp' ),\n 'MZN' => __( 'Mozambican Metical', 'erp' ),\n 'MMK' => __( 'Myanmar Kyat', 'erp' ),\n 'NAD' => __( 'Namibian Dollar', 'erp' ),\n 'NPR' => __( 'Nepalese Rupee', 'erp' ),\n 'ANG' => __( 'Netherlands Antillean Guilder', 'erp' ),\n 'TWD' => __( 'New Taiwan Dollar', 'erp' ),\n 'NZD' => __( 'New Zealand Dollar', 'erp' ),\n 'NIO' => __( 'Nicaraguan Córdoba', 'erp' ),\n 'NGN' => __( 'Nigerian Naira', 'erp' ),\n 'KPW' => __( 'North Korean Won', 'erp' ),\n 'NOK' => __( 'Norwegian Krone', 'erp' ),\n 'OMR' => __( 'Omani Rial', 'erp' ),\n 'PKR' => __( 'Pakistani Rupee', 'erp' ),\n 'PAB' => __( 'Panamanian Balboa', 'erp' ),\n 'PGK' => __( 'Papua New Guinean Kina', 'erp' ),\n 'PYG' => __( 'Paraguayan Guarani', 'erp' ),\n 'PEI' => __( 'Peruvian Inti', 'erp' ),\n 'PHP' => __( 'Philippine Peso', 'erp' ),\n 'PLN' => __( 'Polish Zloty', 'erp' ),\n 'PTE' => __( 'Portuguese Escudo', 'erp' ),\n 'QAR' => __( 'Qatari Rial', 'erp' ),\n 'RHD' => __( 'Rhodesian Dollar', 'erp' ),\n 'RON' => __( 'Romanian Leu', 'erp' ),\n 'RUB' => __( 'Russian Ruble', 'erp' ),\n 'RWF' => __( 'Rwandan Franc', 'erp' ),\n 'SVC' => __( 'Salvadoran Colón', 'erp' ),\n 'WST' => __( 'Samoan Tala', 'erp' ),\n 'STD' => __( 'São Tomé & Príncipe Dobra', 'erp' ),\n 'SAR' => __( 'Saudi Riyal', 'erp' ),\n 'RSD' => __( 'Serbian Dinar', 'erp' ),\n 'SCR' => __( 'Seychellois Rupee', 'erp' ),\n 'SLL' => __( 'Sierra Leonean Leone', 'erp' ),\n 'SGD' => __( 'Singapore Dollar', 'erp' ),\n 'SKK' => __( 'Slovak Koruna', 'erp' ),\n 'SIT' => __( 'Slovenian Tolar', 'erp' ),\n 'SBD' => __( 'Solomon Islands Dollar', 'erp' ),\n 'SOS' => __( 'Somali Shilling', 'erp' ),\n 'ZAR' => __( 'South African Rand', 'erp' ),\n 'KRW' => __( 'South Korean Won', 'erp' ),\n 'SSP' => __( 'South Sudanese Pound', 'erp' ),\n 'ESP' => __( 'Spanish Peseta', 'erp' ),\n 'LKR' => __( 'Sri Lankan Rupee', 'erp' ),\n 'SHP' => __( 'St. Helena Pound', 'erp' ),\n 'SDG' => __( 'Sudanese Pound', 'erp' ),\n 'SRD' => __( 'Surinamese Dollar', 'erp' ),\n 'SZL' => __( 'Swazi Lilangeni', 'erp' ),\n 'SEK' => __( 'Swedish Krona', 'erp' ),\n 'CHF' => __( 'Swiss Franc', 'erp' ),\n 'SYP' => __( 'Syrian Pound', 'erp' ),\n 'TJS' => __( 'Tajikistani Somoni', 'erp' ),\n 'TZS' => __( 'Tanzanian Shilling', 'erp' ),\n 'THB' => __( 'Thai Baht', 'erp' ),\n 'TPE' => __( 'Timorese Escudo', 'erp' ),\n 'TOP' => __( 'Tongan Paʻanga', 'erp' ),\n 'TTD' => __( 'Trinidad & Tobago Dollar', 'erp' ),\n 'TND' => __( 'Tunisian Dinar', 'erp' ),\n 'TRY' => __( 'Turkish Lira', 'erp' ),\n 'TMT' => __( 'Turkmenistani Manat', 'erp' ),\n 'UGX' => __( 'Ugandan Shilling', 'erp' ),\n 'UAH' => __( 'Ukrainian Hryvnia', 'erp' ),\n 'AED' => __( 'United Arab Emirates Dirham', 'erp' ),\n 'UYU' => __( 'Uruguayan Peso', 'erp' ),\n 'USD' => __( 'US Dollar', 'erp' ),\n 'UZS' => __( 'Uzbekistan Som', 'erp' ),\n 'VUV' => __( 'Vanuatu Vatu', 'erp' ),\n 'VEF' => __( 'Venezuelan Bolívar', 'erp' ),\n 'VND' => __( 'Vietnamese Dong', 'erp' ),\n 'YER' => __( 'Yemeni Rial', 'erp' ),\n 'ZMW' => __( 'Zambian Kwacha', 'erp' ),\n 'ZWL' => __( 'Zimbabwean Dollar', 'erp' ),\n ] );\n}", "public function getCurrency(): Currency;", "public function getGlobalCurrencyCode();", "public function getBaseCurrencyCode();", "function pms_get_currencies() {\r\n\r\n $currencies = array(\r\n 'USD' => __( 'US Dollar', 'paid-member-subscriptions' ),\r\n 'EUR' => __( 'Euro', 'paid-member-subscriptions' ),\r\n 'GBP' => __( 'Pound Sterling', 'paid-member-subscriptions' ),\r\n 'CAD' => __( 'Canadian Dollar', 'paid-member-subscriptions' ),\r\n 'AUD' => __( 'Australian Dollar', 'paid-member-subscriptions' ),\r\n 'BRL' => __( 'Brazilian Real', 'paid-member-subscriptions' ),\r\n 'CZK' => __( 'Czech Koruna', 'paid-member-subscriptions' ),\r\n 'DKK' => __( 'Danish Krone', 'paid-member-subscriptions' ),\r\n 'HKD' => __( 'Hong Kong Dollar', 'paid-member-subscriptions' ),\r\n 'HUF' => __( 'Hungarian Forint', 'paid-member-subscriptions' ),\r\n 'ILS' => __( 'Israeli New Sheqel', 'paid-member-subscriptions' ),\r\n 'JPY' => __( 'Japanese Yen', 'paid-member-subscriptions' ),\r\n 'MYR' => __( 'Malaysian Ringgit', 'paid-member-subscriptions' ),\r\n 'MXN' => __( 'Mexican Peso', 'paid-member-subscriptions' ),\r\n 'NOK' => __( 'Norwegian Krone', 'paid-member-subscriptions' ),\r\n 'NZD' => __( 'New Zealand Dollar', 'paid-member-subscriptions' ),\r\n 'PHP' => __( 'Philippine Peso', 'paid-member-subscriptions' ),\r\n 'PLN' => __( 'Polish Zloty', 'paid-member-subscriptions' ),\r\n 'RUB' => __( 'Russian Ruble', 'paid-member-subscriptions' ),\r\n 'SGD' => __( 'Singapore Dollar', 'paid-member-subscriptions' ),\r\n 'SEK' => __( 'Swedish Krona', 'paid-member-subscriptions' ),\r\n 'CHF' => __( 'Swiss Franc', 'paid-member-subscriptions' ),\r\n 'TWD' => __( 'Taiwan New Dollar', 'paid-member-subscriptions' ),\r\n 'THB' => __( 'Thai Baht', 'paid-member-subscriptions' ),\r\n 'TRY' => __( 'Turkish Lira', 'paid-member-subscriptions' )\r\n );\r\n\r\n return apply_filters( 'pms_currencies', $currencies );\r\n\r\n }", "public function currencies()\n {\n return $this->_call('public/getcurrencies', [], false);\n }", "static function getCurrencies() {\n\t\t$currencies = array(\n\t\t\t'USD', // U.S. Dollar\n\t\t\t'GBP', // British Pound\n\t\t\t'EUR', // Euro\n\t\t\t'AUD', // Australian Dollar\n\t\t\t'CAD', // Canadian Dollar\n\t\t\t'JPY', // Japanese Yen\n\t\t);\n\t\treturn $currencies;\n\t}", "public static function get_supported_currencies() {\r\n\r\n\t\treturn array(\r\n\t\t\t'AED' => array( 'United Arab Emirates Dirham', '62F, 2E ,625' ),\r\n\t\t\t'AFN' => array( 'Afghan Afghani', '60b' ),\r\n\t\t\t'ALL' => array( 'Albanian Lek', '4c, 65, 6b' ),\r\n\t\t\t'AMD' => array( 'Armenian Dram', '58F' ),\r\n\t\t\t'ANG' => array( 'Netherlands Antillean Gulden', '192' ),\r\n\t\t\t'AOA' => array( 'Angolan Kwanza', '4B, 7A' ),\r\n\t\t\t'ARS' => array( 'Argentine Peso', '24' ),\r\n\t\t\t'AUD' => array( 'Australian Dollar', '24' ),\r\n\t\t\t'AWG' => array( 'Aruban Florin', '192' ),\r\n\t\t\t'AZN' => array( 'Azerbaijani Manat', '43c, 430, 43d' ),\r\n\t\t\t'BAM' => array( 'Bosnia & Herzegovina Convertible Mark', '4b, 4d' ),\r\n\t\t\t'BBD' => array( 'Barbadian Dollar', '24' ),\r\n\t\t\t'BDT' => array( 'Bangladeshi Taka', '09F3' ),\r\n\t\t\t'BGN' => array( 'Bulgarian Lev', '43b, 432' ),\r\n\t\t\t'BIF' => array( 'Burundian Franc', '46, 42, 75' ),\r\n\t\t\t'BMD' => array( 'Bermudian Dollar', '24' ),\r\n\t\t\t'BND' => array( 'Brunei Dollar', '24' ),\r\n\t\t\t'BOB' => array( 'Bolivian Boliviano', '24, 62' ),\r\n\t\t\t'BRL' => array( 'Brazilian Real', '52, 24' ),\r\n\t\t\t'BSD' => array( 'Bahamian Dollar', '24' ),\r\n\t\t\t'BWP' => array( 'Botswana Pula', '50' ),\r\n\t\t\t'BZD' => array( 'Belize Dollar', '42, 5a, 24' ),\r\n\t\t\t'CAD' => array( 'Canadian Dollar', '24' ),\r\n\t\t\t'CDF' => array( 'Congolese Franc', '46, 43' ),\r\n\t\t\t'CHF' => array( 'Swiss Franc', '43, 48, 46' ),\r\n\t\t\t'CLP' => array( 'Chilean Peso', '24' ),\r\n\t\t\t'CNY' => array( 'Chinese Renminbi Yuan', 'a5' ),\r\n\t\t\t'COP' => array( 'Colombian Peso', '24' ),\r\n\t\t\t'CRC' => array( 'Costa Rican Colón', '20a1' ),\r\n\t\t\t'CVE' => array( 'Cape Verdean Escudo', '24' ),\r\n\t\t\t'CZK' => array( 'Czech Koruna', '4b, 10d' ),\r\n\t\t\t'DJF' => array( 'Djiboutian Franc', '46, 64, 6A' ),\r\n\t\t\t'DKK' => array( 'Danish Krone', '6b, 72' ),\r\n\t\t\t'DOP' => array( 'Dominican Peso', '52, 44, 24' ),\r\n\t\t\t'DZD' => array( 'Algerian Dinar', '62F, 62C' ),\r\n\t\t\t'EEK' => array( 'Estonian Kroon', '6b, 72' ),\r\n\t\t\t'EGP' => array( 'Egyptian Pound', 'a3' ),\r\n\t\t\t'ETB' => array( 'Ethiopian Birr', '1265, 122D' ),\r\n\t\t\t'EUR' => array( 'Euro', '20ac' ),\r\n\t\t\t'FJD' => array( 'Fijian Dollar', '24' ),\r\n\t\t\t'FKP' => array( 'Falkland Islands Pound', 'a3' ),\r\n\t\t\t'GBP' => array( 'British Pound', 'a3' ),\r\n\t\t\t'GEL' => array( 'Georgian Lari', '10DA' ),\r\n\t\t\t'GIP' => array( 'Gibraltar Pound', 'a3' ),\r\n\t\t\t'GMD' => array( 'Gambian Dalasi', '44' ),\r\n\t\t\t'GNF' => array( 'Guinean Franc', '46, 47' ),\r\n\t\t\t'GTQ' => array( 'Guatemalan Quetzal', '51' ),\r\n\t\t\t'GYD' => array( 'Guyanese Dollar', '24' ),\r\n\t\t\t'HKD' => array( 'Hong Kong Dollar', '24' ),\r\n\t\t\t'HNL' => array( 'Honduran Lempira', '4c' ),\r\n\t\t\t'HRK' => array( 'Croatian Kuna', '6b, 6e' ),\r\n\t\t\t'HTG' => array( 'Haitian Gourde', '47' ),\r\n\t\t\t'HUF' => array( 'Hungarian Forint', '46, 74' ),\r\n\t\t\t'IDR' => array( 'Indonesian Rupiah', '52, 70' ),\r\n\t\t\t'ILS' => array( 'Israeli New Sheqel', '20aa' ),\r\n\t\t\t'INR' => array( 'Indian Rupee', '20B9' ),\r\n\t\t\t'ISK' => array( 'Icelandic Króna', '6b, 72' ),\r\n\t\t\t'JMD' => array( 'Jamaican Dollar', '4a, 24' ),\r\n\t\t\t'JPY' => array( 'Japanese Yen', 'a5' ),\r\n\t\t\t'KES' => array( 'Kenyan Shilling', '4B, 53, 68' ),\r\n\t\t\t'KGS' => array( 'Kyrgyzstani Som', '43b, 432' ),\r\n\t\t\t'KHR' => array( 'Cambodian Riel', '17db' ),\r\n\t\t\t'KMF' => array( 'Comorian Franc', '43, 46' ),\r\n\t\t\t'KRW' => array( 'South Korean Won', '20a9' ),\r\n\t\t\t'KYD' => array( 'Cayman Islands Dollar', '24' ),\r\n\t\t\t'KZT' => array( 'Kazakhstani Tenge', '43b, 432' ),\r\n\t\t\t'LAK' => array( 'Lao Kip', '20ad' ),\r\n\t\t\t'LBP' => array( 'Lebanese Pound', 'a3' ),\r\n\t\t\t'LKR' => array( 'Sri Lankan Rupee', '20a8' ),\r\n\t\t\t'LRD' => array( 'Liberian Dollar', '24' ),\r\n\t\t\t'LSL' => array( 'Lesotho Loti', '4C' ),\r\n\t\t\t'LTL' => array( 'Lithuanian Litas', '4c, 74' ),\r\n\t\t\t'LVL' => array( 'Latvian Lats', '4c, 73' ),\r\n\t\t\t'MAD' => array( 'Moroccan Dirham', '62F, 2E, 645, 2E' ),\r\n\t\t\t'MDL' => array( 'Moldovan Leu', '6C, 65, 69' ),\r\n\t\t\t'MGA' => array( 'Malagasy Ariary', '41, 72' ),\r\n\t\t\t'MKD' => array( 'Macedonian Denar', '434, 435, 43d' ),\r\n\t\t\t'MNT' => array( 'Mongolian Tögrög', '20ae' ),\r\n\t\t\t'MOP' => array( 'Macanese Pataca', '4D, 4F, 50, 24' ),\r\n\t\t\t'MRO' => array( 'Mauritanian Ouguiya', '55, 4D' ),\r\n\t\t\t'MUR' => array( 'Mauritian Rupee', '20a8' ),\r\n\t\t\t'MVR' => array( 'Maldivian Rufiyaa', '52, 66' ),\r\n\t\t\t'MWK' => array( 'Malawian Kwacha', '4D, 4B' ),\r\n\t\t\t'MXN' => array( 'Mexican Peso', '24' ),\r\n\t\t\t'MYR' => array( 'Malaysian Ringgit', '52, 4d' ),\r\n\t\t\t'MZN' => array( 'Mozambican Metical', '4d, 54' ),\r\n\t\t\t'NAD' => array( 'Namibian Dollar', '24' ),\r\n\t\t\t'NGN' => array( 'Nigerian Naira', '20a6' ),\r\n\t\t\t'NIO' => array( 'Nicaraguan Córdoba', '43, 24' ),\r\n\t\t\t'NOK' => array( 'Norwegian Krone', '6b, 72' ),\r\n\t\t\t'NPR' => array( 'Nepalese Rupee', '20a8' ),\r\n\t\t\t'NZD' => array( 'New Zealand Dollar', '24' ),\r\n\t\t\t'PAB' => array( 'Panamanian Balboa', '42, 2f, 2e' ),\r\n\t\t\t'PEN' => array( 'Peruvian Nuevo Sol', '53, 2f, 2e' ),\r\n\t\t\t'PGK' => array( 'Papua New Guinean Kina', '4B' ),\r\n\t\t\t'PHP' => array( 'Philippine Peso', '20b1' ),\r\n\t\t\t'PKR' => array( 'Pakistani Rupee', '20a8' ),\r\n\t\t\t'PLN' => array( 'Polish Złoty', '7a, 142' ),\r\n\t\t\t'PYG' => array( 'Paraguayan Guaraní', '47, 73' ),\r\n\t\t\t'QAR' => array( 'Qatari Riyal', 'fdfc' ),\r\n\t\t\t'RON' => array( 'Romanian Leu', '6c, 65, 69' ),\r\n\t\t\t'RSD' => array( 'Serbian Dinar', '414, 438, 43d, 2e' ),\r\n\t\t\t'RUB' => array( 'Russian Ruble', '440, 443, 431' ),\r\n\t\t\t'RWF' => array( 'Rwandan Franc', '52, 20A3' ),\r\n\t\t\t'SAR' => array( 'Saudi Riyal', 'fdfc' ),\r\n\t\t\t'SBD' => array( 'Solomon Islands Dollar', '24' ),\r\n\t\t\t'SCR' => array( 'Seychellois Rupee', '20a8' ),\r\n\t\t\t'SEK' => array( 'Swedish Krona', '6b, 72' ),\r\n\t\t\t'SGD' => array( 'Singapore Dollar', '24' ),\r\n\t\t\t'SHP' => array( 'Saint Helenian Pound', 'a3' ),\r\n\t\t\t'SLL' => array( 'Sierra Leonean Leone', '4C, 65' ),\r\n\t\t\t'SOS' => array( 'Somali Shilling', '53' ),\r\n\t\t\t'SRD' => array( 'Surinamese Dollar', '24' ),\r\n\t\t\t'STD' => array( 'São Tomé and Príncipe Dobra', '44, 62' ),\r\n\t\t\t'SVC' => array( 'Salvadoran Colón', '24' ),\r\n\t\t\t'SZL' => array( 'Swazi Lilangeni', '45' ),\r\n\t\t\t'THB' => array( 'Thai Baht', 'e3f' ),\r\n\t\t\t'TJS' => array( 'Tajikistani Somoni', '73, 6F, 6D, 6F, 6E, 69' ),\r\n\t\t\t'TOP' => array( 'Tongan Paʻanga', '54, 24' ),\r\n\t\t\t'TRY' => array( 'Turkish Lira', '20BA' ),\r\n\t\t\t'TTD' => array( 'Trinidad and Tobago Dollar', '54, 54, 24' ),\r\n\t\t\t'TWD' => array( 'New Taiwan Dollar', '4e, 54, 24' ),\r\n\t\t\t'TZS' => array( 'Tanzanian Shilling', '78, 2F, 79' ),\r\n\t\t\t'UAH' => array( 'Ukrainian Hryvnia', '20b4' ),\r\n\t\t\t'UGX' => array( 'Ugandan Shilling', '55, 53, 68' ),\r\n\t\t\t'USD' => array( 'United States Dollar', '24' ),\r\n\t\t\t'UYU' => array( 'Uruguayan Peso', '24, 55' ),\r\n\t\t\t'UZS' => array( 'Uzbekistani Som', '43b, 432' ),\r\n\t\t\t'VND' => array( 'Vietnamese Đồng', '20ab' ),\r\n\t\t\t'VUV' => array( 'Vanuatu Vatu', '56, 54' ),\r\n\t\t\t'WST' => array( 'Samoan Tala', '24' ),\r\n\t\t\t'XAF' => array( 'Central African Cfa Franc', '46, 43, 46, 41' ),\r\n\t\t\t'XCD' => array( 'East Caribbean Dollar', '24' ),\r\n\t\t\t'XOF' => array( 'West African Cfa Franc', '43, 46, 41' ),\r\n\t\t\t'XPF' => array( 'Cfp Franc', '46' ),\r\n\t\t\t'YER' => array( 'Yemeni Rial', 'fdfc' ),\r\n\t\t\t'ZAR' => array( 'South African Rand', '52' ),\r\n\t\t\t'ZMW' => array( 'Zambian Kwacha', '4B' ),\r\n\t\t);\r\n\t}", "public function getStoreCurrencyCode();", "function getExchangeRate($currency);", "function erp_get_currency_list_with_symbol() {\n $currencies = erp_get_currencies();\n $currency_symbols = erp_get_currency_symbol();\n $currency_list = [];\n\n foreach ( $currencies as $iso => $currency ) {\n $symbol = isset( $currency_symbols[ $iso ] ) ? $currency_symbols[ $iso ] : $iso;\n\n $currency_list[ $iso ] = sprintf( '%1$s (%2$s)', $currency, $symbol );\n }\n\n return $currency_list;\n}", "public function getCurrencies ()\n\t{\n\t\treturn $this->call ('public/getcurrencies');\n\t}", "function getCurrencyRates() {\n\t// If you change these, make sure to also update any JS validation scripts\n\t// For now I'm not rounding numbers under 1 because I don't think that's a big issue and could cause issues with the max check.\n\t$currencyRates = array(\n\t\t'AED' => '4',\n\t\t'ARS' => '4',\n\t\t'AUD' => '1',\n\t\t'BBD' => '2',\n\t\t'BDT' => '76',\n\t\t'BGN' => '1',\n\t\t'BHD' => '0.4',\n\t\t'BMD' => '1',\n\t\t'BND' => '1',\n\t\t'BOB' => '7',\n\t\t'BRL' => '2',\n\t\t'BSD' => '1',\n\t\t'BZD' => '2',\n\t\t'CAD' => '1',\n\t\t'CHF' => '0.9',\n\t\t'CLP' => '494',\n\t\t'CNY' => '6',\n\t\t'COP' => '1910',\n\t\t'CRC' => '512',\n\t\t'CZK' => '18',\n\t\t'DKK' => '5',\n\t\t'DOP' => '38',\n\t\t'DZD' => '73',\n\t\t'EEK' => '11',\n\t\t'EGP' => '6',\n\t\t'EUR' => '0.7',\n\t\t'GBP' => '0.6',\n\t\t'GTQ' => '8',\n\t\t'HKD' => '8',\n\t\t'HNL' => '19',\n\t\t'HRK' => '5',\n\t\t'HUF' => '219',\n\t\t'IDR' => '8960',\n\t\t'ILS' => '4',\n\t\t'INR' => '49',\n\t\t'JMD' => '85',\n\t\t'JOD' => '0.7',\n\t\t'JPY' => '78',\n\t\t'KES' => '97',\n\t\t'KRW' => '1127',\n\t\t'KYD' => '0.8',\n\t\t'KZT' => '147',\n\t\t'LBP' => '1500',\n\t\t'LKR' => '110',\n\t\t'LTL' => '2',\n\t\t'LVL' => '0.5',\n\t\t'MAD' => '8',\n\t\t'MKD' => '45',\n\t\t'MUR' => '29',\n\t\t'MVR' => '15',\n\t\t'MXN' => '13',\n\t\t'MYR' => '3',\n\t\t'NOK' => '5',\n\t\t'NZD' => '1',\n\t\t'OMR' => '0.3',\n\t\t'PAB' => '1',\n\t\t'PEN' => '3',\n\t\t'PHP' => '43',\n\t\t'PKR' => '86',\n\t\t'PLN' => '3',\n\t\t'PYG' => '4190',\n\t\t'QAR' => '4',\n\t\t'RON' => '3',\n\t\t'RUB' => '30',\n\t\t'SAR' => '4',\n\t\t'SEK' => '6',\n\t\t'SGD' => '1',\n\t\t'SVC' => '9',\n\t\t'THB' => '30',\n\t\t'TJS' => '5',\n\t\t'TND' => '1',\n\t\t'TRY' => '2',\n\t\t'TTD' => '6',\n\t\t'TWD' => '30',\n\t\t'UAH' => '8',\n\t\t'USD' => '1',\n\t\t'UYU' => '19',\n\t\t'UZS' => '1760',\n\t\t'VND' => '21000',\n\t\t'XAF' => '470',\n\t\t'XCD' => '3',\n\t\t'XOF' => '476',\n\t\t'ZAR' => '8',\n\t);\n\t\n\treturn $currencyRates;\n}", "public static function usesCurrency()\n {\n return static::$currency;\n }", "public function getCurrencies()\n {\n return $this->_currencies;\n }", "public function getCurrencies() {\n\n $currencies= array();\n $date = '';\n \n $client = \\Drupal::httpClient();\n $request = $client->get(self::LESSON3_RATES_SERVICE);\n $responseXML = $request->getBody();\n\n\n if (!empty($request) && isset($responseXML)) {\n\n $data = new \\SimpleXMLElement($responseXML);\n foreach ($data->Currency as $value) {\n $currencies[] = array(\n 'CharCode' => (string)$value->CharCode,\n 'Name' => (string)$value->Name,\n 'Rate' => (string)$value->Rate,\n );\n }\n\n foreach ($data->attributes() as $key => $val) {\n $date .= (string) $val;\n }\n \n \\Drupal::configFactory()\n ->getEditable('lesson3.settings')\n ->set('lesson3.currencies', $currencies)\n ->set('lesson3.date', $date)\n ->save();\n } \n\n return $currencies;\n }", "function GetOurCurrency()\n\t{\n\t\t$result = $this->sendRequest(\"GetOurCurrency\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function is_currency( $v,$round=0 )\r\n{\r\n$v = preg_replace(\"/[^0-9.]+/\",\"\",$v);\r\nreturn round($v,$round);\r\n}", "public static function getInfoForCurrenciesWithoutCurrencyCode(): array\n {\n if (null !== self::$currenciesNoIsoCode) {\n self::$currenciesNoIsoCode;\n }\n\n return self::$currenciesNoIsoCode = self::loadCurrenciesDefinition('noisocode');\n }", "public function getAllowedCurrencies() {\r\n\t\treturn $this->_storeManager->getStore()->getAllowedCurrencies();\r\n\t}", "function pms_get_currency_symbol( $currency_code ) {\r\n\r\n $currencies = apply_filters('pms_currency_symbols',\r\n array(\r\n 'AED' => '&#1583;.&#1573;', // ?\r\n 'AFN' => '&#65;&#102;',\r\n 'ALL' => '&#76;&#101;&#107;',\r\n 'AMD' => '',\r\n 'ANG' => '&#402;',\r\n 'AOA' => '&#75;&#122;', // ?\r\n 'ARS' => '&#36;',\r\n 'AUD' => '&#36;',\r\n 'AWG' => '&#402;',\r\n 'AZN' => '&#1084;&#1072;&#1085;',\r\n 'BAM' => '&#75;&#77;',\r\n 'BBD' => '&#36;',\r\n 'BDT' => '&#2547;', // ?\r\n 'BGN' => '&#1083;&#1074;',\r\n 'BHD' => '.&#1583;.&#1576;', // ?\r\n 'BIF' => '&#70;&#66;&#117;', // ?\r\n 'BMD' => '&#36;',\r\n 'BND' => '&#36;',\r\n 'BOB' => '&#36;&#98;',\r\n 'BRL' => '&#82;&#36;',\r\n 'BSD' => '&#36;',\r\n 'BTN' => '&#78;&#117;&#46;', // ?\r\n 'BWP' => '&#80;',\r\n 'BYR' => '&#112;&#46;',\r\n 'BZD' => '&#66;&#90;&#36;',\r\n 'CAD' => '&#36;',\r\n 'CDF' => '&#70;&#67;',\r\n 'CHF' => '&#67;&#72;&#70;',\r\n 'CLF' => '', // ?\r\n 'CLP' => '&#36;',\r\n 'CNY' => '&#165;',\r\n 'COP' => '&#36;',\r\n 'CRC' => '&#8353;',\r\n 'CUP' => '&#8396;',\r\n 'CVE' => '&#36;', // ?\r\n 'CZK' => '&#75;&#269;',\r\n 'DJF' => '&#70;&#100;&#106;', // ?\r\n 'DKK' => '&#107;&#114;',\r\n 'DOP' => '&#82;&#68;&#36;',\r\n 'DZD' => '&#1583;&#1580;', // ?\r\n 'EGP' => '&#163;',\r\n 'ETB' => '&#66;&#114;',\r\n 'EUR' => '&#8364;',\r\n 'FJD' => '&#36;',\r\n 'FKP' => '&#163;',\r\n 'GBP' => '&#163;',\r\n 'GEL' => '&#4314;', // ?\r\n 'GHS' => '&#162;',\r\n 'GIP' => '&#163;',\r\n 'GMD' => '&#68;', // ?\r\n 'GNF' => '&#70;&#71;', // ?\r\n 'GTQ' => '&#81;',\r\n 'GYD' => '&#36;',\r\n 'HKD' => '&#36;',\r\n 'HNL' => '&#76;',\r\n 'HRK' => '&#107;&#110;',\r\n 'HTG' => '&#71;', // ?\r\n 'HUF' => '&#70;&#116;',\r\n 'IDR' => '&#82;&#112;',\r\n 'ILS' => '&#8362;',\r\n 'INR' => '&#8377;',\r\n 'IQD' => '&#1593;.&#1583;', // ?\r\n 'IRR' => '&#65020;',\r\n 'ISK' => '&#107;&#114;',\r\n 'JEP' => '&#163;',\r\n 'JMD' => '&#74;&#36;',\r\n 'JOD' => '&#74;&#68;', // ?\r\n 'JPY' => '&#165;',\r\n 'KES' => '&#75;&#83;&#104;', // ?\r\n 'KGS' => '&#1083;&#1074;',\r\n 'KHR' => '&#6107;',\r\n 'KMF' => '&#67;&#70;', // ?\r\n 'KPW' => '&#8361;',\r\n 'KRW' => '&#8361;',\r\n 'KWD' => '&#1583;.&#1603;', // ?\r\n 'KYD' => '&#36;',\r\n 'KZT' => '&#1083;&#1074;',\r\n 'LAK' => '&#8365;',\r\n 'LBP' => '&#163;',\r\n 'LKR' => '&#8360;',\r\n 'LRD' => '&#36;',\r\n 'LSL' => '&#76;', // ?\r\n 'LTL' => '&#76;&#116;',\r\n 'LVL' => '&#76;&#115;',\r\n 'LYD' => '&#1604;.&#1583;', // ?\r\n 'MAD' => '&#1583;.&#1605;.', //?\r\n 'MDL' => '&#76;',\r\n 'MGA' => '&#65;&#114;', // ?\r\n 'MKD' => '&#1076;&#1077;&#1085;',\r\n 'MMK' => '&#75;',\r\n 'MNT' => '&#8366;',\r\n 'MOP' => '&#77;&#79;&#80;&#36;', // ?\r\n 'MRO' => '&#85;&#77;', // ?\r\n 'MUR' => '&#8360;', // ?\r\n 'MVR' => '.&#1923;', // ?\r\n 'MWK' => '&#77;&#75;',\r\n 'MXN' => '&#36;',\r\n 'MYR' => '&#82;&#77;',\r\n 'MZN' => '&#77;&#84;',\r\n 'NAD' => '&#36;',\r\n 'NGN' => '&#8358;',\r\n 'NIO' => '&#67;&#36;',\r\n 'NOK' => '&#107;&#114;',\r\n 'NPR' => '&#8360;',\r\n 'NZD' => '&#36;',\r\n 'OMR' => '&#65020;',\r\n 'PAB' => '&#66;&#47;&#46;',\r\n 'PEN' => '&#83;&#47;&#46;',\r\n 'PGK' => '&#75;', // ?\r\n 'PHP' => '&#8369;',\r\n 'PKR' => '&#8360;',\r\n 'PLN' => '&#122;&#322;',\r\n 'PYG' => '&#71;&#115;',\r\n 'QAR' => '&#65020;',\r\n 'RON' => '&#108;&#101;&#105;',\r\n 'RSD' => '&#1044;&#1080;&#1085;&#46;',\r\n 'RUB' => '&#1088;&#1091;&#1073;',\r\n 'RWF' => '&#1585;.&#1587;',\r\n 'SAR' => '&#65020;',\r\n 'SBD' => '&#36;',\r\n 'SCR' => '&#8360;',\r\n 'SDG' => '&#163;', // ?\r\n 'SEK' => '&#107;&#114;',\r\n 'SGD' => '&#36;',\r\n 'SHP' => '&#163;',\r\n 'SLL' => '&#76;&#101;', // ?\r\n 'SOS' => '&#83;',\r\n 'SRD' => '&#36;',\r\n 'STD' => '&#68;&#98;', // ?\r\n 'SVC' => '&#36;',\r\n 'SYP' => '&#163;',\r\n 'SZL' => '&#76;', // ?\r\n 'THB' => '&#3647;',\r\n 'TJS' => '&#84;&#74;&#83;', // ? TJS (guess)\r\n 'TMT' => '&#109;',\r\n 'TND' => '&#1583;.&#1578;',\r\n 'TOP' => '&#84;&#36;',\r\n 'TRY' => '&#8356;', // New Turkey Lira (old symbol used)\r\n 'TTD' => '&#36;',\r\n 'TWD' => '&#78;&#84;&#36;',\r\n 'TZS' => '',\r\n 'UAH' => '&#8372;',\r\n 'UGX' => '&#85;&#83;&#104;',\r\n 'USD' => '&#36;',\r\n 'UYU' => '&#36;&#85;',\r\n 'UZS' => '&#1083;&#1074;',\r\n 'VEF' => '&#66;&#115;',\r\n 'VND' => '&#8363;',\r\n 'VUV' => '&#86;&#84;',\r\n 'WST' => '&#87;&#83;&#36;',\r\n 'XAF' => '&#70;&#67;&#70;&#65;',\r\n 'XCD' => '&#36;',\r\n 'XDR' => '',\r\n 'XOF' => '',\r\n 'XPF' => '&#70;',\r\n 'YER' => '&#65020;',\r\n 'ZAR' => '&#82;',\r\n 'ZMK' => '&#90;&#75;', // ?\r\n 'ZWL' => '&#90;&#36;',\r\n )\r\n );\r\n\r\n $currency_symbol = ( isset( $currencies[$currency_code] ) ? $currencies[$currency_code] : $currency_code );\r\n\r\n return $currency_symbol;\r\n\r\n }", "public function getTargetCurrency();", "public function getCurrencies() {\n return $this->public([\n 'command' => 'returnCurrencies',\n ]);\n }", "public function getOrderCurrencyCode();", "public function getListCurrency()\n\t{\n\t\t$params = [\n\t\t\t'verify' => false,\n\t\t\t'query' => [\n\t\t\t\t'output' => Config::get( 'response.format' )\n\t\t\t]\n\t\t];\n\n\t\t$baseUrl = sprintf( Config::get( 'endpoints.base_url' ), Config::get( 'settings.api' ) ) . Config::get( 'endpoints.general_list_currency' );\n\n\t\ttry {\n\t\t\t$response = parent::send( 'GET', $baseUrl, $params );\n\t\t} catch (TiketException $e) {\n\t\t\tthrow parent::convertException( $e );\n\t\t}\n\n\t\treturn $response;\n\t}", "public function getCurrencyAllowableValues()\n {\n return [\n self::CURRENCY_EUR,\n self::CURRENCY_USD,\n self::CURRENCY_GBP,\n self::CURRENCY_CAD,\n self::CURRENCY_AUD,\n self::CURRENCY_DJF,\n self::CURRENCY_ZAR,\n self::CURRENCY_ETB,\n self::CURRENCY_AED,\n self::CURRENCY_BHD,\n self::CURRENCY_DZD,\n self::CURRENCY_EGP,\n self::CURRENCY_IQD,\n self::CURRENCY_JOD,\n self::CURRENCY_KWD,\n self::CURRENCY_LBP,\n self::CURRENCY_LYD,\n self::CURRENCY_MAD,\n self::CURRENCY_OMR,\n self::CURRENCY_QAR,\n self::CURRENCY_SAR,\n self::CURRENCY_SYP,\n self::CURRENCY_TND,\n self::CURRENCY_YER,\n self::CURRENCY_CLP,\n self::CURRENCY_INR,\n self::CURRENCY_AZN,\n self::CURRENCY_RUB,\n self::CURRENCY_BYN,\n self::CURRENCY_BGN,\n self::CURRENCY_NGN,\n self::CURRENCY_BDT,\n self::CURRENCY_CNY,\n self::CURRENCY_BAM,\n self::CURRENCY_CZK,\n self::CURRENCY_DKK,\n self::CURRENCY_CHF,\n self::CURRENCY_MVR,\n self::CURRENCY_BTN,\n self::CURRENCY_XCD,\n self::CURRENCY_BZD,\n self::CURRENCY_HKD,\n self::CURRENCY_IDR,\n self::CURRENCY_JMD,\n self::CURRENCY_MYR,\n self::CURRENCY_NZD,\n self::CURRENCY_PHP,\n self::CURRENCY_SGD,\n self::CURRENCY_TTD,\n self::CURRENCY_XDR,\n self::CURRENCY_ARS,\n self::CURRENCY_BOB,\n self::CURRENCY_COP,\n self::CURRENCY_CRC,\n self::CURRENCY_CUP,\n self::CURRENCY_DOP,\n self::CURRENCY_GTQ,\n self::CURRENCY_HNL,\n self::CURRENCY_MXN,\n self::CURRENCY_NIO,\n self::CURRENCY_PAB,\n self::CURRENCY_PEN,\n self::CURRENCY_PYG,\n self::CURRENCY_UYU,\n self::CURRENCY_VEF,\n self::CURRENCY_IRR,\n self::CURRENCY_XOF,\n self::CURRENCY_CDF,\n self::CURRENCY_XAF,\n self::CURRENCY_HTG,\n self::CURRENCY_ILS,\n self::CURRENCY_HRK,\n self::CURRENCY_HUF,\n self::CURRENCY_AMD,\n self::CURRENCY_ISK,\n self::CURRENCY_JPY,\n self::CURRENCY_GEL,\n self::CURRENCY_KZT,\n self::CURRENCY_KHR,\n self::CURRENCY_KRW,\n self::CURRENCY_KGS,\n self::CURRENCY_LAK,\n self::CURRENCY_MKD,\n self::CURRENCY_MNT,\n self::CURRENCY_BND,\n self::CURRENCY_MMK,\n self::CURRENCY_NOK,\n self::CURRENCY_NPR,\n self::CURRENCY_PKR,\n self::CURRENCY_PLN,\n self::CURRENCY_AFN,\n self::CURRENCY_BRL,\n self::CURRENCY_MDL,\n self::CURRENCY_RON,\n self::CURRENCY_RWF,\n self::CURRENCY_SEK,\n self::CURRENCY_LKR,\n self::CURRENCY_SOS,\n self::CURRENCY_ALL,\n self::CURRENCY_RSD,\n self::CURRENCY_KES,\n self::CURRENCY_TJS,\n self::CURRENCY_THB,\n self::CURRENCY_ERN,\n self::CURRENCY_TMT,\n self::CURRENCY_BWP,\n self::CURRENCY__TRY,\n self::CURRENCY_UAH,\n self::CURRENCY_UZS,\n self::CURRENCY_VND,\n self::CURRENCY_MOP,\n self::CURRENCY_TWD,\n self::CURRENCY_BMD,\n ];\n }", "public function getCurrencies0()\n {\n return $this->hasMany(Currency::className(), ['ap_disc_gl_acc_id' => 'account_id']);\n }", "function is_valid_for_use() {\n\t\t\tif ( ! in_array( get_woocommerce_currency(), apply_filters( 'woocommerce_esewa_supported_currencies', array( 'NPR' ) ) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "public function getSupportedCurrencies()\n {\n return response()->json(Currency::all());\n }", "private function updateCurrency() {\n Yii::import('application.modules.shop.models.*');\n Yii::log('updateCurrency()', 'info', 'console');\n $result = true;\n $currencyArray = ShopCurrency::model()->findAll();\n Yii::log('ShopCurrency', 'info', 'console');\n foreach ($currencyArray as $currency) {\n if ($currency->id != 1) { // skip UAH\n echo \"processing \" . $currency->iso . \": \";\n Yii::log('processing '.$currency->iso, 'info', 'console');\n $key = array_search($currency->iso, $this->_matches[2]); // find currency ID\n if ($key) {\n $currency->rate = (float) $this->_matches[5][$key] / (float) $this->_matches[3][$key];\n $result = $result && ($currency->save(false,false));\n if ($result)\n Yii::log('Refreshed', 'info', 'console');\n }\n else\n Yii::log('Currency not found', 'info', 'console');\n }\n }\n return $result;\n }", "public function getSupportedCurrencies()\n\t{\n\t\treturn array('RUB');\n\t}", "public function getCurrency(){\n return $this->currency;\n }", "public function getPrices(Collection $currencies)\n {\n $currencies = $currencies\n ->pluck('id', 'currency_code')\n ->map(function($id){\n return [\n 'id' => $id,\n 'currency_id' => null\n ];\n })->toArray();\n\n // add currencyIds\n foreach($this->currencyIds() as $currencyCode => $currencyID){\n if($currencies[$currencyCode]) {\n $currencies[$currencyCode]['currency_id'] = $currencyID;\n }\n }\n\n\n // exchangeRate\n $exchangeRate = $this->getExchangeRate();\n\n\n // make api call\n $version = '';\n $url = $this->apiBase . $version . '/public/ticker/ALL';\n $res = null;\n\n try{\n $res = Http::request(Http::GET, $url);\n }\n catch (\\Exception $e){\n // Error handling\n echo($e->getMessage());\n exit();\n }\n\n\n // data from API\n $data = [];\n $dataOriginal = json_decode($res->content, true);\n $data = $dataOriginal['data'];\n\n\n // Finalize data. [id, currency_id, price]\n $currencies = array_map(function($currency) use($data, $exchangeRate){\n $dataAvailable = true;\n if(is_array($currency['currency_id'])){\n foreach($currency['currency_id'] as $i){\n if(!isset($data[$i])){\n $dataAvailable = false;\n }\n }\n } else {\n $dataAvailable = isset($data[$currency['currency_id']]);\n }\n\n\n if($dataAvailable){\n if(is_array($currency['currency_id'])){ // 2 step\n $level1 = doubleval($data[$currency['currency_id'][0]]['closing_price']) / $exchangeRate;\n $level2 = doubleval($data[$currency['currency_id'][1]]['closing_price']) / $exchangeRate;\n $currency['price'] = $level1 * $level2;\n }\n else { // 1 step: string\n $currency['price'] = doubleval($data[$currency['currency_id']]['closing_price']) / $exchangeRate;\n }\n\n }\n else {\n $currency['price'] = null;\n }\n\n return $currency;\n\n }, $currencies);\n\n\n return $currencies;\n\n\n }", "public function getCurrencySymbolAttribute()\n {\n $trips= Trips::where('request_id',$this->attributes['id']);\n if($trips->count())\n {\n $code = @$trips->get()->first()->currency_code;\n\n return Currency::where('code',$code)->first()->symbol;\n }\n else\n {\n return \"$\";\n }\n }", "function fetch_currency_with_symbol($amount,$currency = '')\r\n{\r\n\t$amt_display = '';\r\n\tif($amount==''){ $amount =0; }\r\n\t$decimals=get_option('tmpl_price_num_decimals');\r\n\t$decimals=($decimals!='')?$decimals:2;\r\n\tif($amount >=0 )\r\n\t{\r\n\t\tif(@$amount !='')\r\n\t\t\t$amount = $amount;\r\n\t\t\t$currency = get_option('currency_symbol');\r\n\t\t\t$position = get_option('currency_pos');\r\n\t\tif($position == '1')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.$amount;\r\n\t\t}\r\n\t\telse if($position == '2')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.' '.$amount;\r\n\t\t}\r\n\t\telse if($position == '3')\r\n\t\t{\r\n\t\t\t$amt_display = $amount.$currency;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$amt_display = $amount.' '.$currency;\r\n\t\t}\r\n\t\treturn apply_filters('tmpl_price_format',$amt_display,$amount,$currency);\r\n\t}\r\n}", "function calculateCurrency($prijs, $country)\r\n {\r\n }", "public function obtainCurrency()\r\n {\r\n return $this->performRequest('GET', '/currency');\r\n }", "function tmpl_fetch_currency(){\r\n\t$currency = get_option('currency_symbol');\r\n\tif($currency){\r\n\t\treturn $currency;\r\n\t}else{\r\n\t\treturn '$';\r\n\t}\t\r\n}", "function getCurrency()\r\n\t{\r\n\t\treturn $this->call_API('getCurrency');\r\n\t}", "function getISOCurrency($curr) {\n $out = \"\";\n if(ctype_digit($curr) || is_int($curr)) {\n $numCurr = $curr + 0;\n if($numCurr < 10) {\n $out = \"00\" . $numCurr;\n } else if ($numCurr < 100) {\n $out = \"0\" . $numCurr;\n } else {\n //Assume 3 digits (if greater let MAPs handle error)\n $out = \"\" . $numCurr;\n }\n } else {\n // Convert char to digit (if no convertion exists let MAPs handle error)\n\n $curCode = Array();\n $curCode[\"ADP\"]=\"020\";\n $curCode[\"AED\"]=\"784\";\n $curCode[\"AFA\"]=\"004\";\n $curCode[\"ALL\"]=\"008\";\n $curCode[\"AMD\"]=\"051\";\n $curCode[\"ANG\"]=\"532\";\n $curCode[\"AON\"]=\"024\";\n $curCode[\"ARS\"]=\"032\";\n $curCode[\"ATS\"]=\"040\";\n $curCode[\"AUD\"]=\"036\";\n $curCode[\"AWG\"]=\"533\";\n $curCode[\"AZM\"]=\"031\";\n $curCode[\"BAM\"]=\"977\";\n $curCode[\"BBD\"]=\"052\";\n $curCode[\"BDT\"]=\"050\";\n $curCode[\"BEF\"]=\"056\";\n $curCode[\"BGL\"]=\"100\";\n $curCode[\"BHD\"]=\"048\";\n $curCode[\"BIF\"]=\"108\";\n $curCode[\"BMD\"]=\"060\";\n $curCode[\"BND\"]=\"096\";\n $curCode[\"BOB\"]=\"068\";\n $curCode[\"BRL\"]=\"986\";\n $curCode[\"BSD\"]=\"044\";\n $curCode[\"BTN\"]=\"064\";\n $curCode[\"BWP\"]=\"072\";\n $curCode[\"BYR\"]=\"974\";\n $curCode[\"BZD\"]=\"084\";\n $curCode[\"CAD\"]=\"124\";\n $curCode[\"CDF\"]=\"976\";\n $curCode[\"CHF\"]=\"756\";\n $curCode[\"CLP\"]=\"152\";\n $curCode[\"CNY\"]=\"156\";\n $curCode[\"COP\"]=\"170\";\n $curCode[\"CRC\"]=\"188\";\n $curCode[\"CUP\"]=\"192\";\n $curCode[\"CVE\"]=\"132\";\n $curCode[\"CYP\"]=\"196\";\n $curCode[\"CZK\"]=\"203\";\n $curCode[\"DEM\"]=\"276\";\n $curCode[\"DJF\"]=\"262\";\n $curCode[\"DKK\"]=\"208\";\n $curCode[\"DOP\"]=\"214\";\n $curCode[\"DZD\"]=\"012\";\n $curCode[\"EEK\"]=\"233\";\n $curCode[\"EGP\"]=\"818\";\n $curCode[\"ERN\"]=\"232\";\n $curCode[\"ETB\"]=\"230\";\n $curCode[\"EUR\"]=\"978\";\n $curCode[\"FIM\"]=\"246\";\n $curCode[\"FJD\"]=\"242\";\n $curCode[\"FKP\"]=\"238\";\n $curCode[\"FRF\"]=\"250\";\n $curCode[\"GBP\"]=\"826\";\n $curCode[\"GEL\"]=\"981\";\n $curCode[\"GHC\"]=\"288\";\n $curCode[\"GIP\"]=\"292\";\n $curCode[\"GMD\"]=\"270\";\n $curCode[\"GNF\"]=\"324\";\n $curCode[\"GTQ\"]=\"320\";\n $curCode[\"GWP\"]=\"624\";\n $curCode[\"GYD\"]=\"328\";\n $curCode[\"HKD\"]=\"344\";\n $curCode[\"HNL\"]=\"340\";\n $curCode[\"HRK\"]=\"191\";\n $curCode[\"HTG\"]=\"332\";\n $curCode[\"HUF\"]=\"348\";\n $curCode[\"IDR\"]=\"360\";\n $curCode[\"IEP\"]=\"372\";\n $curCode[\"ILS\"]=\"376\";\n $curCode[\"INR\"]=\"356\";\n $curCode[\"IQD\"]=\"368\";\n $curCode[\"IRR\"]=\"364\";\n $curCode[\"ISK\"]=\"352\";\n $curCode[\"ITL\"]=\"380\";\n $curCode[\"JMD\"]=\"388\";\n $curCode[\"JOD\"]=\"400\";\n $curCode[\"JPY\"]=\"392\";\n $curCode[\"KES\"]=\"404\";\n $curCode[\"KGS\"]=\"417\";\n $curCode[\"KHR\"]=\"116\";\n $curCode[\"KMF\"]=\"174\";\n $curCode[\"KPW\"]=\"408\";\n $curCode[\"KRW\"]=\"410\";\n $curCode[\"KWD\"]=\"414\";\n $curCode[\"KYD\"]=\"136\";\n $curCode[\"KZT\"]=\"398\";\n $curCode[\"LAK\"]=\"418\";\n $curCode[\"LBP\"]=\"422\";\n $curCode[\"LKR\"]=\"144\";\n $curCode[\"LRD\"]=\"430\";\n $curCode[\"LSL\"]=\"426\";\n $curCode[\"LTL\"]=\"440\";\n $curCode[\"LUF\"]=\"442\";\n $curCode[\"LVL\"]=\"428\";\n $curCode[\"LYD\"]=\"434\";\n $curCode[\"MAD\"]=\"504\";\n $curCode[\"MDL\"]=\"498\";\n $curCode[\"MGF\"]=\"450\";\n $curCode[\"MKD\"]=\"807\";\n $curCode[\"MMK\"]=\"104\";\n $curCode[\"MNT\"]=\"496\";\n $curCode[\"MOP\"]=\"446\";\n $curCode[\"MRO\"]=\"478\";\n $curCode[\"MTL\"]=\"470\";\n $curCode[\"MUR\"]=\"480\";\n $curCode[\"MVR\"]=\"462\";\n $curCode[\"MWK\"]=\"454\";\n $curCode[\"MXN\"]=\"484\";\n $curCode[\"MYR\"]=\"458\";\n $curCode[\"MZM\"]=\"508\";\n $curCode[\"NAD\"]=\"516\";\n $curCode[\"NGN\"]=\"566\";\n $curCode[\"NIO\"]=\"558\";\n $curCode[\"NLG\"]=\"528\";\n $curCode[\"NOK\"]=\"578\";\n $curCode[\"NPR\"]=\"524\";\n $curCode[\"NZD\"]=\"554\";\n $curCode[\"OMR\"]=\"512\";\n $curCode[\"PAB\"]=\"590\";\n $curCode[\"PEN\"]=\"604\";\n $curCode[\"PGK\"]=\"598\";\n $curCode[\"PHP\"]=\"608\";\n $curCode[\"PKR\"]=\"586\";\n $curCode[\"PLN\"]=\"985\";\n $curCode[\"PTE\"]=\"620\";\n $curCode[\"PYG\"]=\"600\";\n $curCode[\"QAR\"]=\"634\";\n $curCode[\"ROL\"]=\"642\";\n $curCode[\"RUB\"]=\"643\";\n $curCode[\"RUR\"]=\"810\";\n $curCode[\"RWF\"]=\"646\";\n $curCode[\"SAR\"]=\"682\";\n $curCode[\"SBD\"]=\"090\";\n $curCode[\"SCR\"]=\"690\";\n $curCode[\"SDD\"]=\"736\";\n $curCode[\"SEK\"]=\"752\";\n $curCode[\"SGD\"]=\"702\";\n $curCode[\"SHP\"]=\"654\";\n $curCode[\"SIT\"]=\"705\";\n $curCode[\"SKK\"]=\"703\";\n $curCode[\"SLL\"]=\"694\";\n $curCode[\"SOS\"]=\"706\";\n $curCode[\"SRG\"]=\"740\";\n $curCode[\"STD\"]=\"678\";\n $curCode[\"SVC\"]=\"222\";\n $curCode[\"SYP\"]=\"760\";\n $curCode[\"SZL\"]=\"748\";\n $curCode[\"THB\"]=\"764\";\n $curCode[\"TJS\"]=\"972\";\n $curCode[\"TMM\"]=\"795\";\n $curCode[\"TND\"]=\"788\";\n $curCode[\"TOP\"]=\"776\";\n $curCode[\"TPE\"]=\"626\";\n $curCode[\"TRL\"]=\"792\";\n $curCode[\"TTD\"]=\"780\";\n $curCode[\"TWD\"]=\"901\";\n $curCode[\"TZS\"]=\"834\";\n $curCode[\"UAH\"]=\"980\";\n $curCode[\"UGX\"]=\"800\";\n $curCode[\"USD\"]=\"840\";\n $curCode[\"UYU\"]=\"858\";\n $curCode[\"UZS\"]=\"860\";\n $curCode[\"VEB\"]=\"862\";\n $curCode[\"VND\"]=\"704\";\n $curCode[\"VUV\"]=\"548\";\n $curCode[\"WST\"]=\"882\";\n $curCode[\"XAF\"]=\"950\";\n $curCode[\"XCD\"]=\"951\";\n $curCode[\"XOF\"]=\"952\";\n $curCode[\"XPF\"]=\"953\";\n $curCode[\"YER\"]=\"886\";\n $curCode[\"YUM\"]=\"891\";\n $curCode[\"ZAR\"]=\"710\";\n $curCode[\"ZMK\"]=\"894\";\n $curCode[\"ZWD\"]=\"716\";\n\n $out = $curCode[$curr];\n }\n\n return $out;\n }", "function get_ffd_currencies() {\r\n\tstatic $currencies;\r\n\r\n\tif ( ! isset( $currencies ) ) {\r\n\t\t$currencies = array_unique(\r\n\t\t\tapply_filters(\r\n\t\t\t\t'ffd_currencies',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'AED' => __( 'United Arab Emirates dirham', 'ffd-integration' ),\r\n\t\t\t\t\t'AFN' => __( 'Afghan afghani', 'ffd-integration' ),\r\n\t\t\t\t\t'ALL' => __( 'Albanian lek', 'ffd-integration' ),\r\n\t\t\t\t\t'AMD' => __( 'Armenian dram', 'ffd-integration' ),\r\n\t\t\t\t\t'ANG' => __( 'Netherlands Antillean guilder', 'ffd-integration' ),\r\n\t\t\t\t\t'AOA' => __( 'Angolan kwanza', 'ffd-integration' ),\r\n\t\t\t\t\t'ARS' => __( 'Argentine peso', 'ffd-integration' ),\r\n\t\t\t\t\t'AUD' => __( 'Australian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'AWG' => __( 'Aruban florin', 'ffd-integration' ),\r\n\t\t\t\t\t'AZN' => __( 'Azerbaijani manat', 'ffd-integration' ),\r\n\t\t\t\t\t'BAM' => __( 'Bosnia and Herzegovina convertible mark', 'ffd-integration' ),\r\n\t\t\t\t\t'BBD' => __( 'Barbadian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BDT' => __( 'Bangladeshi taka', 'ffd-integration' ),\r\n\t\t\t\t\t'BGN' => __( 'Bulgarian lev', 'ffd-integration' ),\r\n\t\t\t\t\t'BHD' => __( 'Bahraini dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'BIF' => __( 'Burundian franc', 'ffd-integration' ),\r\n\t\t\t\t\t'BMD' => __( 'Bermudian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BND' => __( 'Brunei dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BOB' => __( 'Bolivian boliviano', 'ffd-integration' ),\r\n\t\t\t\t\t'BRL' => __( 'Brazilian real', 'ffd-integration' ),\r\n\t\t\t\t\t'BSD' => __( 'Bahamian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BTC' => __( 'Bitcoin', 'ffd-integration' ),\r\n\t\t\t\t\t'BTN' => __( 'Bhutanese ngultrum', 'ffd-integration' ),\r\n\t\t\t\t\t'BWP' => __( 'Botswana pula', 'ffd-integration' ),\r\n\t\t\t\t\t'BYR' => __( 'Belarusian ruble (old)', 'ffd-integration' ),\r\n\t\t\t\t\t'BYN' => __( 'Belarusian ruble', 'ffd-integration' ),\r\n\t\t\t\t\t'BZD' => __( 'Belize dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'CAD' => __( 'Canadian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'CDF' => __( 'Congolese franc', 'ffd-integration' ),\r\n\t\t\t\t\t'CHF' => __( 'Swiss franc', 'ffd-integration' ),\r\n\t\t\t\t\t'CLP' => __( 'Chilean peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CNY' => __( 'Chinese yuan', 'ffd-integration' ),\r\n\t\t\t\t\t'COP' => __( 'Colombian peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CRC' => __( 'Costa Rican col&oacute;n', 'ffd-integration' ),\r\n\t\t\t\t\t'CUC' => __( 'Cuban convertible peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CUP' => __( 'Cuban peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CVE' => __( 'Cape Verdean escudo', 'ffd-integration' ),\r\n\t\t\t\t\t'CZK' => __( 'Czech koruna', 'ffd-integration' ),\r\n\t\t\t\t\t'DJF' => __( 'Djiboutian franc', 'ffd-integration' ),\r\n\t\t\t\t\t'DKK' => __( 'Danish krone', 'ffd-integration' ),\r\n\t\t\t\t\t'DOP' => __( 'Dominican peso', 'ffd-integration' ),\r\n\t\t\t\t\t'DZD' => __( 'Algerian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'EGP' => __( 'Egyptian pound', 'ffd-integration' ),\r\n\t\t\t\t\t'ERN' => __( 'Eritrean nakfa', 'ffd-integration' ),\r\n\t\t\t\t\t'ETB' => __( 'Ethiopian birr', 'ffd-integration' ),\r\n\t\t\t\t\t'EUR' => __( 'Euro', 'ffd-integration' ),\r\n\t\t\t\t\t'FJD' => __( 'Fijian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'FKP' => __( 'Falkland Islands pound', 'ffd-integration' ),\r\n\t\t\t\t\t'GBP' => __( 'Pound sterling', 'ffd-integration' ),\r\n\t\t\t\t\t'GEL' => __( 'Georgian lari', 'ffd-integration' ),\r\n\t\t\t\t\t'GGP' => __( 'Guernsey pound', 'ffd-integration' ),\r\n\t\t\t\t\t'GHS' => __( 'Ghana cedi', 'ffd-integration' ),\r\n\t\t\t\t\t'GIP' => __( 'Gibraltar pound', 'ffd-integration' ),\r\n\t\t\t\t\t'GMD' => __( 'Gambian dalasi', 'ffd-integration' ),\r\n\t\t\t\t\t'GNF' => __( 'Guinean franc', 'ffd-integration' ),\r\n\t\t\t\t\t'GTQ' => __( 'Guatemalan quetzal', 'ffd-integration' ),\r\n\t\t\t\t\t'GYD' => __( 'Guyanese dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'HKD' => __( 'Hong Kong dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'HNL' => __( 'Honduran lempira', 'ffd-integration' ),\r\n\t\t\t\t\t'HRK' => __( 'Croatian kuna', 'ffd-integration' ),\r\n\t\t\t\t\t'HTG' => __( 'Haitian gourde', 'ffd-integration' ),\r\n\t\t\t\t\t'HUF' => __( 'Hungarian forint', 'ffd-integration' ),\r\n\t\t\t\t\t'IDR' => __( 'Indonesian rupiah', 'ffd-integration' ),\r\n\t\t\t\t\t'ILS' => __( 'Israeli new shekel', 'ffd-integration' ),\r\n\t\t\t\t\t'IMP' => __( 'Manx pound', 'ffd-integration' ),\r\n\t\t\t\t\t'INR' => __( 'Indian rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'IQD' => __( 'Iraqi dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'IRR' => __( 'Iranian rial', 'ffd-integration' ),\r\n\t\t\t\t\t'IRT' => __( 'Iranian toman', 'ffd-integration' ),\r\n\t\t\t\t\t'ISK' => __( 'Icelandic kr&oacute;na', 'ffd-integration' ),\r\n\t\t\t\t\t'JEP' => __( 'Jersey pound', 'ffd-integration' ),\r\n\t\t\t\t\t'JMD' => __( 'Jamaican dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'JOD' => __( 'Jordanian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'JPY' => __( 'Japanese yen', 'ffd-integration' ),\r\n\t\t\t\t\t'KES' => __( 'Kenyan shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'KGS' => __( 'Kyrgyzstani som', 'ffd-integration' ),\r\n\t\t\t\t\t'KHR' => __( 'Cambodian riel', 'ffd-integration' ),\r\n\t\t\t\t\t'KMF' => __( 'Comorian franc', 'ffd-integration' ),\r\n\t\t\t\t\t'KPW' => __( 'North Korean won', 'ffd-integration' ),\r\n\t\t\t\t\t'KRW' => __( 'South Korean won', 'ffd-integration' ),\r\n\t\t\t\t\t'KWD' => __( 'Kuwaiti dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'KYD' => __( 'Cayman Islands dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'KZT' => __( 'Kazakhstani tenge', 'ffd-integration' ),\r\n\t\t\t\t\t'LAK' => __( 'Lao kip', 'ffd-integration' ),\r\n\t\t\t\t\t'LBP' => __( 'Lebanese pound', 'ffd-integration' ),\r\n\t\t\t\t\t'LKR' => __( 'Sri Lankan rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'LRD' => __( 'Liberian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'LSL' => __( 'Lesotho loti', 'ffd-integration' ),\r\n\t\t\t\t\t'LYD' => __( 'Libyan dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'MAD' => __( 'Moroccan dirham', 'ffd-integration' ),\r\n\t\t\t\t\t'MDL' => __( 'Moldovan leu', 'ffd-integration' ),\r\n\t\t\t\t\t'MGA' => __( 'Malagasy ariary', 'ffd-integration' ),\r\n\t\t\t\t\t'MKD' => __( 'Macedonian denar', 'ffd-integration' ),\r\n\t\t\t\t\t'MMK' => __( 'Burmese kyat', 'ffd-integration' ),\r\n\t\t\t\t\t'MNT' => __( 'Mongolian t&ouml;gr&ouml;g', 'ffd-integration' ),\r\n\t\t\t\t\t'MOP' => __( 'Macanese pataca', 'ffd-integration' ),\r\n\t\t\t\t\t'MRO' => __( 'Mauritanian ouguiya', 'ffd-integration' ),\r\n\t\t\t\t\t'MUR' => __( 'Mauritian rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'MVR' => __( 'Maldivian rufiyaa', 'ffd-integration' ),\r\n\t\t\t\t\t'MWK' => __( 'Malawian kwacha', 'ffd-integration' ),\r\n\t\t\t\t\t'MXN' => __( 'Mexican peso', 'ffd-integration' ),\r\n\t\t\t\t\t'MYR' => __( 'Malaysian ringgit', 'ffd-integration' ),\r\n\t\t\t\t\t'MZN' => __( 'Mozambican metical', 'ffd-integration' ),\r\n\t\t\t\t\t'NAD' => __( 'Namibian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'NGN' => __( 'Nigerian naira', 'ffd-integration' ),\r\n\t\t\t\t\t'NIO' => __( 'Nicaraguan c&oacute;rdoba', 'ffd-integration' ),\r\n\t\t\t\t\t'NOK' => __( 'Norwegian krone', 'ffd-integration' ),\r\n\t\t\t\t\t'NPR' => __( 'Nepalese rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'NZD' => __( 'New Zealand dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'OMR' => __( 'Omani rial', 'ffd-integration' ),\r\n\t\t\t\t\t'PAB' => __( 'Panamanian balboa', 'ffd-integration' ),\r\n\t\t\t\t\t'PEN' => __( 'Peruvian nuevo sol', 'ffd-integration' ),\r\n\t\t\t\t\t'PGK' => __( 'Papua New Guinean kina', 'ffd-integration' ),\r\n\t\t\t\t\t'PHP' => __( 'Philippine peso', 'ffd-integration' ),\r\n\t\t\t\t\t'PKR' => __( 'Pakistani rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'PLN' => __( 'Polish z&#x142;oty', 'ffd-integration' ),\r\n\t\t\t\t\t'PRB' => __( 'Transnistrian ruble', 'ffd-integration' ),\r\n\t\t\t\t\t'PYG' => __( 'Paraguayan guaran&iacute;', 'ffd-integration' ),\r\n\t\t\t\t\t'QAR' => __( 'Qatari riyal', 'ffd-integration' ),\r\n\t\t\t\t\t'RON' => __( 'Romanian leu', 'ffd-integration' ),\r\n\t\t\t\t\t'RSD' => __( 'Serbian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'RUB' => __( 'Russian ruble', 'ffd-integration' ),\r\n\t\t\t\t\t'RWF' => __( 'Rwandan franc', 'ffd-integration' ),\r\n\t\t\t\t\t'SAR' => __( 'Saudi riyal', 'ffd-integration' ),\r\n\t\t\t\t\t'SBD' => __( 'Solomon Islands dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'SCR' => __( 'Seychellois rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'SDG' => __( 'Sudanese pound', 'ffd-integration' ),\r\n\t\t\t\t\t'SEK' => __( 'Swedish krona', 'ffd-integration' ),\r\n\t\t\t\t\t'SGD' => __( 'Singapore dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'SHP' => __( 'Saint Helena pound', 'ffd-integration' ),\r\n\t\t\t\t\t'SLL' => __( 'Sierra Leonean leone', 'ffd-integration' ),\r\n\t\t\t\t\t'SOS' => __( 'Somali shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'SRD' => __( 'Surinamese dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'SSP' => __( 'South Sudanese pound', 'ffd-integration' ),\r\n\t\t\t\t\t'STD' => __( 'S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra', 'ffd-integration' ),\r\n\t\t\t\t\t'SYP' => __( 'Syrian pound', 'ffd-integration' ),\r\n\t\t\t\t\t'SZL' => __( 'Swazi lilangeni', 'ffd-integration' ),\r\n\t\t\t\t\t'THB' => __( 'Thai baht', 'ffd-integration' ),\r\n\t\t\t\t\t'TJS' => __( 'Tajikistani somoni', 'ffd-integration' ),\r\n\t\t\t\t\t'TMT' => __( 'Turkmenistan manat', 'ffd-integration' ),\r\n\t\t\t\t\t'TND' => __( 'Tunisian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'TOP' => __( 'Tongan pa&#x2bb;anga', 'ffd-integration' ),\r\n\t\t\t\t\t'TRY' => __( 'Turkish lira', 'ffd-integration' ),\r\n\t\t\t\t\t'TTD' => __( 'Trinidad and Tobago dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'TWD' => __( 'New Taiwan dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'TZS' => __( 'Tanzanian shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'UAH' => __( 'Ukrainian hryvnia', 'ffd-integration' ),\r\n\t\t\t\t\t'UGX' => __( 'Ugandan shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'USD' => __( 'United States (US) dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'UYU' => __( 'Uruguayan peso', 'ffd-integration' ),\r\n\t\t\t\t\t'UZS' => __( 'Uzbekistani som', 'ffd-integration' ),\r\n\t\t\t\t\t'VEF' => __( 'Venezuelan bol&iacute;var', 'ffd-integration' ),\r\n\t\t\t\t\t'VND' => __( 'Vietnamese &#x111;&#x1ed3;ng', 'ffd-integration' ),\r\n\t\t\t\t\t'VUV' => __( 'Vanuatu vatu', 'ffd-integration' ),\r\n\t\t\t\t\t'WST' => __( 'Samoan t&#x101;l&#x101;', 'ffd-integration' ),\r\n\t\t\t\t\t'XAF' => __( 'Central African CFA franc', 'ffd-integration' ),\r\n\t\t\t\t\t'XCD' => __( 'East Caribbean dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'XOF' => __( 'West African CFA franc', 'ffd-integration' ),\r\n\t\t\t\t\t'XPF' => __( 'CFP franc', 'ffd-integration' ),\r\n\t\t\t\t\t'YER' => __( 'Yemeni rial', 'ffd-integration' ),\r\n\t\t\t\t\t'ZAR' => __( 'South African rand', 'ffd-integration' ),\r\n\t\t\t\t\t'ZMW' => __( 'Zambian kwacha', 'ffd-integration' ),\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\treturn $currencies;\r\n}", "function GetBaseCurrency()\n\t{\n\t\t$result = $this->sendRequest(\"GetBaseCurrency\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function getIsoCurrCode($magento_currency_code) {\r\n\tswitch($magento_currency_code){\r\n\tcase 'HKD':\r\n\t\t$cur = '344';\r\n\t\tbreak;\r\n\tcase 'USD':\r\n\t\t$cur = '840';\r\n\t\tbreak;\r\n\tcase 'SGD':\r\n\t\t$cur = '702';\r\n\t\tbreak;\r\n\tcase 'CNY':\r\n\t\t$cur = '156';\r\n\t\tbreak;\r\n\tcase 'JPY':\r\n\t\t$cur = '392';\r\n\t\tbreak;\t\t\r\n\tcase 'TWD':\r\n\t\t$cur = '901';\r\n\t\tbreak;\r\n\tcase 'AUD':\r\n\t\t$cur = '036';\r\n\t\tbreak;\r\n\tcase 'EUR':\r\n\t\t$cur = '978';\r\n\t\tbreak;\r\n\tcase 'GBP':\r\n\t\t$cur = '826';\r\n\t\tbreak;\r\n\tcase 'CAD':\r\n\t\t$cur = '124';\r\n\t\tbreak;\r\n\tcase 'MOP':\r\n\t\t$cur = '446';\r\n\t\tbreak;\r\n\tcase 'PHP':\r\n\t\t$cur = '608';\r\n\t\tbreak;\r\n\tcase 'THB':\r\n\t\t$cur = '764';\r\n\t\tbreak;\r\n\tcase 'MYR':\r\n\t\t$cur = '458';\r\n\t\tbreak;\r\n\tcase 'IDR':\r\n\t\t$cur = '360';\r\n\t\tbreak;\r\n\tcase 'KRW':\r\n\t\t$cur = '410';\r\n\t\tbreak;\r\n\tcase 'SAR':\r\n\t\t$cur = '682';\r\n\t\tbreak;\r\n\tcase 'NZD':\r\n\t\t$cur = '554';\r\n\t\tbreak;\r\n\tcase 'AED':\r\n\t\t$cur = '784';\r\n\t\tbreak;\r\n\tcase 'BND':\r\n\t\t$cur = '096';\r\n\t\tbreak;\r\n\tcase 'VND':\r\n\t\t$cur = '704';\r\n\t\tbreak;\r\n\tcase 'INR':\r\n\t\t$cur = '356';\r\n\t\tbreak;\r\n\tdefault:\r\n\t\t$cur = '344';\r\n\t}\t\r\n\treturn $cur;\r\n}", "public function getUseExchangeRates();", "private function _update_currency_conversion_rate(){\n\t\t\t$query = \"SELECT `serial_num`, `\".$this->table_fields['currency_iso_code'].\"` as 'currency_iso_code' FROM `\" . $this->class_settings['database_name'] . \"`.`\".$this->table_name.\"` where `record_status`='1' AND `modification_date` < \".(date(\"U\") - (3600*24));\n\t\t\t$query_settings = array(\n\t\t\t\t'database' => $this->class_settings['database_name'] ,\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'SELECT',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n \n //get exchange rate\n $all_country_list = execute_sql_query($query_settings);\n\t\t\t$return = array();\n \n\t\t\tif( is_array( $all_country_list ) && ! empty( $all_country_list ) ){\n\t\t\t\t$query_settings['query_type'] = 'UPDATE';\n \n $first = true;\n foreach( $all_country_list as $val ){\n\t\t\t\t\tif( $val['currency_iso_code'] ){\n $json = file_get_contents('http://rate-exchange.appspot.com/currency?from=USD&to='.strtoupper($val['currency_iso_code']) );\n if($json)$cur = json_decode($json, true);\n if( isset( $cur['rate'] ) && $cur['rate'] ){\n $return[] = $cur;\n \n $query_settings['query'] = \"UPDATE `\" . $this->class_settings['database_name'] . \"`.`\".$this->table_name.\"` SET `\".$this->table_fields['conversion_rate'].\"`= '\".$cur['rate'].\"' WHERE `serial_num`='\".$val['serial_num'].\"' \";\n \n execute_sql_query($query_settings);\n \n if( $first ){\n $query_settings['tables'] = array();\n $query_settings['set_memcache'] = 0;\n $first = false;\n }\n }\n }\n\t\t\t\t}\n \n $this->class_settings[ 'do_not_check_cache' ] = 1;\n $this->_get_country_list();\n }\n \n return $return;\n }", "function eZProductCurrency( $id=-1 )\r\n {\r\n if ( $id != -1 )\r\n {\r\n $this->ID = $id;\r\n $this->get( $this->ID );\r\n }\r\n }", "function tep_currency_exists($code) {\n $code = tep_db_prepare_input($code);\n\n $currency_code = tep_db_query(\"select currencies_id from \" . TABLE_CURRENCIES . \" where code = '\" . tep_db_input($code) . \"'\");\n if (tep_db_num_rows($currency_code)) {\n return $code;\n } else {\n return false;\n }\n }", "public function getCurrencyAndSymbol()\n {\n if($this->custom_checkbox1 == 'y'){\n return array('currency' => 'USD', 'symbol' => '$');\n }\n else if($this->location_1){\n return DBQuery::execute(function(){\n $main = DBConnection::getInstance()->getMain();\n $sql = $main->prepare(\"SELECT currency, symbol FROM Location_1 \"\n . \"WHERE id=:id\");\n $sql->bindParam(':id', $this->location_1);\n $sql->execute();\n return $sql->fetch(\\PDO::FETCH_BOTH);\n });\n }\n else{\n return array('currency' => 'USD', 'symbol' => '$');\n } \n }", "public function getCurrencies() {\n\t\t\t$currencies = CurrencyDenomination::all();\n\t\t\treturn response($currencies);\n\t\t}", "function get_currency($bank_name) {\n $currency_link = 'http://resources.finance.ua/ua/public/currency-cash.json';\n $currency_json = file_get_contents($currency_link);\n $file_content = json_decode($currency_json);\n $banks = $file_content -> organizations;\n\n foreach ($banks as $value) {\n $bank = $value->title;\n if ($bank == $bank_name) {\n $eur_usd_rub = $value->currencies;\n $USD = $eur_usd_rub->USD;\n $EUR = $eur_usd_rub->EUR;\n $RUB = $eur_usd_rub->RUB;\n\n $result = array('eur' => $EUR->ask, 'usd' => $USD->ask, 'rub'=>$RUB->ask,);\n\n return $result;\n }\n }\n}", "public function getBtncurrencyInGrivnas(){\n $data = json_decode(file_get_contents($this->url));\n $bitcoin = 0;\n foreach( $data as $obj ){\n if( $obj->code=='USD' )$bitcoin=$obj->rate;\n }\n\n\n $xml = simplexml_load_file(\"https://api.privatbank.ua/p24api/pubinfo?exchange&coursid=5\");\n $m = $xml->xpath('//exchangerate[@ccy=\"USD\"]');\n $exrate = (string)$m[0]['buy'];\n\n $uah = $bitcoin * $exrate;\n\n return '1 BTC = ' . $uah . ' UAH.';\n }", "function is_valid_for_use() {\n if ( ! in_array( get_woocommerce_currency(), apply_filters( 'woocommerce_payu_supported_currencies', array( 'USD', 'UAH', 'RUB', 'TRY', 'EUR' ) ) ) ) return false;\n return true;\n }", "public function getCurrencyPerCountry()\n {\n return [\n self::SWEDEN => 'SEK',\n self::NORWAY => 'NOK',\n self::FINLAND => 'EUR',\n self::DENMARK => 'DKK',\n self::GERMANY => 'EUR'\n ];\n }", "function verusPrice( $currency ) {\n global $phpextconfig;\n $currency = strtoupper($currency);\n\n if ( $currency == 'VRSC' | $currency == 'VERUS' ) {\n $results = json_decode( curlRequest( $phpextconfig['fiat_api'] . 'rawpricedata.php', curl_init(), null ), true );\n return $results['data']['avg_btc'];\n }\n else {\n return curlRequest( $phpextconfig['fiat_api'] . '?currency=' . $currency, curl_init(), null );\n } \n}", "public function getAllCurrencies()\n {\n $currencies = $this->repository->supplemental['codeMappings'];\n $datas = array();\n foreach (array_keys($currencies) as $currency_code) {\n if ($currency_code === 'XTS' || strlen($currency_code) !== 3) {\n continue;\n }\n $currency = $this->getCurrency($currency_code);\n $datas[] = array(\n 'name' => ucfirst($currency['name']).' ('.$currency_code.')',\n 'code' => $currency_code,\n 'iso_code' => $currency['iso_code']\n );\n }\n\n //sort array naturally\n uasort($datas, function ($x, $y) {\n return strnatcmp($x[\"name\"], $y[\"name\"]);\n });\n\n return $datas;\n }", "public function getAllInactiveCurrencies()\n {\n $queryBuilder = $this->createQueryBuilder('c');\n\n $currencies = $queryBuilder->leftJoin('c.active_currency', 'ac')\n ->innerJoin('c.translations', 'ct')\n ->andWhere('ct.code = :code')\n ->andWhere('ac.active_currency_id IS NULL')\n ->orderBy('ct.name', 'ASC')\n ->setParameter('code', \\XLite\\Core\\Session::getInstance()->getLanguage()->getCode())\n ->getResult();\n\n return $currencies;\n }", "public static function getUSDCurrencyExchangeRates()\n { \n $ch = curl_init(_URL_YAHOOAPI);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\n $html = curl_exec($ch);\n curl_close($ch);\n \n return json_decode($html);\n }", "public function getCurrenciesAction()\n {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Shop\\Currency');\n\n $builder = $repository->createQueryBuilder('c');\n $builder->select(\n [\n 'c.id as id',\n 'c.name as name',\n 'c.currency as currency',\n 'c.symbol as symbol',\n 'c.factor as factor',\n 'c.default as default'\n ]\n );\n\n $query = $builder->getQuery();\n\n $total = Shopware()->Models()->getQueryCount($query);\n\n $data = $query->getArrayResult();\n\n $this->View()->assign(\n [\n 'success' => true,\n 'data' => $data,\n 'total' => $total\n ]\n );\n }", "function getRates($currencies){\n $response=array();\n $json = file_get_contents('https://blockchain.info/ticker');\n $result = json_decode($json, true);\n foreach ($currencies as $currency) {\n $response[$currency]=$result[$currency]['last'];\n }\n return $response;\n}", "function _wpsc_fix_latvia_currency() {\n\t$country = new WPSC_Country( array(\n\t\t'isocode' => 'LV',\n\t\t'currency' => __( 'Euro', 'wpsc' ),\n\t\t'symbol' => __( '€', 'wpsc' ),\n\t\t'symbol_html' => __( '&#8364;', 'wpsc' ),\n\t\t'code' => __( 'EUR', 'wpsc' )\n\t) );\n\n}", "public function getCurrencies()\n {\n return $this->hasMany(Currency::className(), ['ap_gl_acc_id' => 'account_id']);\n }", "public function getCurrentBaseCurrency() {\n $currencysymbol = $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' );\n\n return $currencysymbol->getStore ()->getCurrentCurrencyCode ();\n }", "function is_valid_for_use()\n {\n if (!in_array(get_option('woocommerce_currency'), array('RUB', 'USD'))) {\n return false;\n }\n\n return true;\n }", "public function getConfigAllowCurrencies()\n {\n $allowedCurrencies = $this->_getResource()->getConfigCurrencies($this, self::XML_PATH_CURRENCY_ALLOW);\n $appBaseCurrencyCode = Mage::app()->getBaseCurrencyCode();\n if (!in_array($appBaseCurrencyCode, $allowedCurrencies)) {\n $allowedCurrencies[] = $appBaseCurrencyCode;\n }\n foreach (Mage::app()->getStores() as $store) {\n $code = $store->getBaseCurrencyCode();\n if (!in_array($code, $allowedCurrencies)) {\n $allowedCurrencies[] = $code;\n }\n }\n\n return $allowedCurrencies;\n }", "public function getAllCurrenciesToParse() {\n $currencies = $this->database->queryToSelect(\n \"SELECT cryptocurrency_info.id AS info_id, cryptocurrency_info.value_to_usd, cryptocurrency_info.value_to_btc, cryptocurrency_info.currency_symbol, all_cryptocurrency.id AS currency_id, all_cryptocurrency.name AS currency_name, all_cryptocurrency.code AS currency_code, burse.id AS burse_id, burse.name AS burse_name, burse.code AS burse_code\n FROM cryptocurrency_info\n LEFT JOIN all_cryptocurrency ON cryptocurrency_info.currency_id = all_cryptocurrency.id\n LEFT JOIN burse ON cryptocurrency_info.burse_id = burse.id\"\n );\n $currencies_to_parse = [];\n foreach ($currencies as $currency) {\n $currencies_to_parse[$currency['burse_code']][$currency['currency_symbol']] = $currency;\n }\n return $currencies_to_parse;\n }", "function paysto_rub_currency_symbol($currency_symbol, $currency)\n{\n if ($currency == \"RUB\") {\n $currency_symbol = 'р.';\n }\n\n if ($currency == \"USD\") {\n $currency_symbol = '$';\n }\n\n return $currency_symbol;\n}", "private function third_party_rate($currency)\n {\n\n // get all 3 rates from api\n $guzzle_client = new Client(['base_uri' => 'http://data.fixer.io/api']);\n $response = $guzzle_client->get('/latest', ['query' => ['access_key' => 'd6d3c2c6ad64e7615e26626ed3e12759', 'symbols' => \"gbp, eur, usd\"]]);\n $json_response = json_decode($response->getBody());\n\n // base currency fixed at euro by fixer\n switch ($currency) {\n case \"gbp\":\n $this->exchange_rate = 1;\n break;\n case \"usd\":\n // divide by eur -> gbp rate then multiply by eur -> usd\n $this->exchange_rate = round($json_response->rates->USD / $json_response->rates->GBP, 2);\n break;\n case \"eur\":\n // divide by eur -> gbp rate\n $this->exchange_rate = round(1.0 / $json_response->rates->GBP, 2);\n break;\n }\n }", "public function isBaseCurrency(){\n $store = $this->_storeManager->getStore();\n return $store->getCurrentCurrency()->getCurrencyCode() == $store->getBaseCurrency()->getCurrencyCode();\n }", "public function getFromCurrency()\n {\n return $this->fromCurrency;\n }", "function &getAll()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n \r\n $return_array = array();\r\n $currency_array = array();\r\n \r\n $db->array_query( $currency_array, \"SELECT ID FROM eZTrade_AlternativeCurrency ORDER BY Created\" );\r\n \r\n for ( $i=0; $i < count($currency_array); $i++ )\r\n {\r\n $return_array[$i] = new eZProductCurrency( $currency_array[$i][$db->fieldName( \"ID\" )], 0 );\r\n }\r\n \r\n return $return_array;\r\n }", "public function getCurrency()\n {\n return \"/V1/directory/currency\";\n }", "public function CurrencyCode()\n {\n return [\n 'AUD' => ' Australia Dollar',\n 'BND' => 'Bruneian Dollar',\n 'CAD' => 'Canadian Dollar',\n 'CHF' => 'Francs',\n 'CNY' => 'China Yuan',\n 'DKK' => 'Danish Krone',\n 'EUR' => 'Euro',\n 'GBP' => 'Great Britain Poundsterling',\n 'HKD' => 'Hongkong Dollar',\n 'JPY' => 'Japan Yen',\n 'KRW' => 'Korea Won',\n 'NOK' => 'Norwegian Krone',\n 'NZD' => 'New Zealand Dollar',\n 'PHP' => 'Phillipine Peso',\n 'SAR' => 'Saudi Riyal',\n 'SEK' => 'Swedish Krona',\n 'SGD' => 'Singapore Dollar',\n 'THB' => 'Thailand Baht',\n 'TWD' => 'Taiwan Dollar',\n 'USD' => 'US Dollar',\n ];\n }", "public static function getCurrencies()\n {\n $currencies = [];\n\n foreach (static::$currencies as $currency)\n {\n $currencies[$currency] = $currency;\n }\n\n return $currencies;\n }", "public function listCurrenciesWithExchangeRate()\n {\n $service_response = $this->exchange_service\n ->getCurrenciesWithExchangeRate(\n auth()->user(),\n );\n return $service_response->success\n ? Responser::send(200, $service_response->data, $service_response->message)\n : Responser::sendError(400, $service_response->message, $service_response->message);\n }", "function acadp_payment_currency_filter( $price = '' ) {\n\n\treturn acadp_currency_filter( $price, acadp_get_payment_currency_settings() );\n\n}", "function _wpsc_db_upgrade_14() {\n\t_wpsc_fix_latvia_currency();\n}", "private function __getCurrency()\n\t{\n\t\tif($this->currency == null)\n\t\t$this->currency = 1;\n\t\treturn $this->currency;\n\t}", "function is_currency($currency)\n{\n\tif (preg_replace(\"/^[-+]?\\d*(\\.(\\d{2}))?$/\", '', $currency) == '')\n\t{\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\n}", "public function getCurrencies1()\n {\n return $this->hasMany(Currency::className(), ['ap_dp_gl_acc_id' => 'account_id']);\n }", "public function checkCurrency()\n {\n $idCurrency = $this->context->cart->id_currency;\n\n $currency = new Currency($idCurrency);\n $moduleCurrencies = $this->getCurrency($idCurrency);\n\n if (is_array($moduleCurrencies)) {\n foreach ($moduleCurrencies as $moduleCurrency) {\n if ($currency->id == $moduleCurrency['id_currency']) {\n return true;\n }\n }\n }\n\n return false;\n }", "public function testCurrencyCode(): void\n {\n $cur = StringHelper::getCurrencyCode();\n StringHelper::setCurrencyCode('€');\n $fmt1 = '#,##0.000\\ [$]';\n $rslt = NumberFormat::toFormattedString(12345.679, $fmt1);\n self::assertEquals($rslt, '12,345.679 €');\n $fmt2 = '$ #,##0.000';\n $rslt = NumberFormat::toFormattedString(12345.679, $fmt2);\n self::assertEquals($rslt, '$ 12,345.679');\n StringHelper::setCurrencyCode($cur);\n }", "public function getConfigBaseCurrencies()\n {\n $defaultCurrencies = $this->_getResource()->getConfigCurrencies($this, self::XML_PATH_CURRENCY_BASE);\n return $defaultCurrencies;\n }", "function GetDB_CurrencyList($order_asc = false) {\n $query = \"SELECT * FROM conversion_rates \".(($order_asc) ? \"ORDER BY currency ASC\" : \"\").\";\";\n $result = $GLOBALS['conn']->query($query);\n $rows = [];\n while($row = mysqli_fetch_array($result)) {\n $rows[] = $row;\n }\n return $rows;\n }", "public function preferredCurrencyCode()\n {\n return CulqiCashier::usesCurrency();\n }" ]
[ "0.76610744", "0.76505214", "0.69557923", "0.69557923", "0.67915344", "0.6761663", "0.6749245", "0.6749245", "0.67313373", "0.6673975", "0.6667657", "0.66076756", "0.6601238", "0.65640396", "0.65640396", "0.65640396", "0.6554611", "0.64844424", "0.6467971", "0.6464784", "0.64176416", "0.6412711", "0.6392244", "0.6369476", "0.63528883", "0.631558", "0.6298437", "0.6298285", "0.6297352", "0.6292304", "0.6259188", "0.62547666", "0.62459475", "0.6238779", "0.6235754", "0.6207961", "0.6198915", "0.61987805", "0.6197638", "0.61913776", "0.6178062", "0.61517483", "0.61166054", "0.6111559", "0.61043227", "0.6103196", "0.60936624", "0.6075437", "0.60715854", "0.60686", "0.6063778", "0.6058679", "0.6054446", "0.6044947", "0.60376257", "0.60280067", "0.5999606", "0.5997083", "0.59910786", "0.59890276", "0.59842336", "0.5963583", "0.5935834", "0.59348476", "0.59232324", "0.5917025", "0.5915876", "0.5915677", "0.58972937", "0.58950025", "0.58894336", "0.58834076", "0.5876833", "0.5875114", "0.58748126", "0.5870217", "0.5864694", "0.5863777", "0.5850704", "0.584337", "0.58292794", "0.5815859", "0.58075714", "0.5803815", "0.5799136", "0.5773842", "0.5768047", "0.5766875", "0.57565343", "0.57434285", "0.5740923", "0.574065", "0.57384837", "0.57341427", "0.57261926", "0.57254004", "0.57106", "0.5701283", "0.5700388", "0.5700286", "0.5698775" ]
0.0
-1
forget password email send otp get and set new password
public function forgetpassword(){ return view('forgetpassword'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function forgetpassword()\n \t{\n \t\t$this->data['title'] = 'Forgot Password';\n\t\t$this->show_viewFrontInner('forget-password', $this->data);\n \t}", "public function forgetPass($email){\n \n if($email!=''){\n $password_token = str_random(10);\n $fake_token_one = str_random(2);\n $fake_token_two = str_random(3);\n\n $update_user_data = DB::table('users')->where('email',$email)->where('user_type','W')\n ->update(array('forget_token' => $password_token));\n\n $useremail = DB::table('users')\n ->where('email', $email)->where('user_type','W')\n ->select('*')->first();\n if(!$useremail){\n Session::flash('message','Please Enter Valid Email');\n return redirect('forgetPassword');\n }else if($useremail->login_type == 'F' || $useremail->login_type == 'G'){\n \n Session::flash('message','Sorry This Account has been linked through Social Media');\n return redirect('forgetPassword');\n }else{\n $userid = $useremail->id;\n $base_url = url('/'); \n $content =\"<p>We have received your request for change password.</p>\n <p>Please <a href='\".$base_url.\"/resetPasswordForm/$fake_token_one-$fake_token_two-$userid-$password_token'>\n Click here </a> to change your password.</p><br/><br/>Thanks<br/>Active Distribution\";\n \n\n Mail::send(array(), array(), function ($message) use ($content,$email) {\n $from = '[email protected]';\n $message->to($email ,'Forgot Password')\n ->subject('Request for change password')\n ->setBody($content, 'text/html');\n });\n\n Session::flash('message','Please check your mail address to reset your password');\n return redirect('forgetPassword');\n }\n }else{\n Session::flash('message','Please Enter Email Address');\n return redirect('forgetPassword');\n }\n }", "public function forgetpasswordAction() {\n \n $modelPlugin = $this->modelplugin();\n $dynamicPath = $modelPlugin->dynamicPath();\n $phpprenevt = $this->phpinjectionpreventplugin(); \n $mailplugin = $this->mailplugin();\n $jsonArray = $modelPlugin->jsondynamic();\n $email = $phpprenevt->stringReplace($_POST['eid']);\n $publisheremailarray = array('email' => $email);\n $chkemail = $modelPlugin->getpublisherTable()->selectEmail($publisheremailarray);\n $currentDatetime = strtotime(date(\"Y-m-d h:i:s\"));\n $restpassallow = 0;\n if ($chkemail[0]['forgetpassTimestamp']) {\n $databaseDatetime = strtotime($chkemail[0]['forgetpassTimestamp']);\n $all = $currentDatetime - $databaseDatetime;\n $day = round(($all % 604800) / 86400);\n $hours = round((($all % 604800) % 86400) / 3600);\n $m = round(((($all % 604800) % 86400) % 3600) / 60);\n\n if ($day <= 0) {\n if ($hours <= 0) {\n if ($m <= 15) {\n $restpassallow = 1;\n $contentone['minutes'] = 15 - $m;\n }\n }\n }\n }\n if (count($chkemail) == 0) {\n $contentone['data'] = 0;\n } else if ($restpassallow == 1) {\n $contentone['data'] = 2;\n } else {\n $id = $chkemail[0][\"publisherId\"];\n $pass1 = password_hash($email, PASSWORD_BCRYPT);\n $arraypass = str_replace('/', '', $pass1);\n $buttonclick = $dynamicPath . \"/Gallery/galleryview/resetpassword/\" . $arraypass;\n $mail_link = \"<a href='\" . $buttonclick . \"' style='background-color: #04ad6a; border: medium none; border-radius: 19px; padding: 12px; color: #fff; text-align: center; text-decoration: none; text-transform: uppercase;'>Click here</a>\";\n $subject = \"[Smartfanpage] Set your password\";\n $from = $jsonArray['sendgridaccount']['addfrom'];\n $keyArray = array('mailCatagory' => 'F_MAIL');\n $getMailStructure = $modelPlugin->getconfirmMailTable()->fetchall($keyArray);\n $getmailbodyFromTable = $getMailStructure[0]['mailTemplate'];\n $mailLinkreplace = str_replace(\"|MAILLINK|\", $mail_link, $getmailbodyFromTable);\n $mailBody = str_replace(\"|DYNAMICPATH|\", $dynamicPath, $mailLinkreplace);\n $fogetPasswordMail = $mailplugin->confirmationmail($email, $from, $subject, $mailBody);\n $keyArray = array('publisherId' => $id);\n $dataForForget = array('forgetpassword' => $arraypass, 'forgetpassTimestamp' => date(\"Y-m-d h:i:s\"));\n $contentone1 = $modelPlugin->getpublisherTable()->updateuser($dataForForget, $keyArray);\n $contentone['data'] = $contentone1;\n $user_session->loginId = ($_SESSION['loginId']);\n $user_session = new \\Zend\\Session\\Container('loginId');\n $user_session->getManager()->destroy();\n }\n echo json_encode($contentone);\n exit;\n }", "public function reset_pass() {\n \t\t$email = $this->input->post('email');\n\n\t $pass = $this->generate_pass(16);\n\t $hash = password_hash($pass, B_CRYPT); // http://php.net/manual/en/function.password-hash.php\n\n\t $this->load->model('users_table');\n\t $this->users_table->update_password($email, $hash);\n\n\t $this->send_email($email, $pass, \"2\");\n \t}", "public function resetpassAction()\n\t{\n\t\t$email='[email protected]';\n\n\t\t$customer = Mage::getModel('customer/customer')\n ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())\n ->loadByEmail($email);\n\t\t$customer->sendPasswordResetConfirmationEmail();\n\t}", "public function forget_password_post()\n {\n $admin = User::where('email', request('email'))->first();\n if(!empty($admin))\n {\n $token = app('auth.password.broker')->createToken($admin);\n $data = DB::table('password_resets')->insert([\n 'email' => $admin->email,\n 'token' => $token,\n 'created_at' => Carbon::now()\n ]);\n\n Mail::to($admin->email)->send(new reset_password(['data' => $admin, 'token' => $token]));\n return back();\n }\n }", "public function forgotPassword()\n {\n if ($this->issetPostSperglobal('email') && !empty($this->getPostSuperglobal('email'))) {\n if ($this->users_manager->resetToken($this->getPostSuperglobal('email'))) {\n $this->session->writeFlash('success', \"Les instructions pour réinitialiser votre mot de passe vous ont été envoyées par email, vous avez 30 minutes pour le faire.\");\n } else {\n $this->session->writeFlash('danger', \"Aucun compte ne correspond à cet adresse mail : {$this->getPostSuperglobal('email')}.\");\n }\n } else {\n $this->session->writeFlash('danger', \"L'adresse mail n'est pas ou est mal renseignée.\");\n }\n $this->render('forgot-password', ['head'=>['title'=>'Mot de passe oublié', 'meta_description'=>'']]);\n }", "public function forget_password_get($email=null){\n\t\tif(!empty($email)){\n\t\t\t$q = $this->db->where('email',$email)->where('verified',1)->get('users')->result();\n\t\t\tif(count($q)>0){\n\t\t\t\t$config = Array(\n\t\t\t\t\t'protocol' => 'smtp',\n\t\t\t\t\t'smtp_host' => 'ssl://smtp.googlemail.com',\n\t\t\t\t\t'smtp_port' => 465,\n\t\t\t\t\t'smtp_user' => '[email protected]',\n\t\t\t\t\t'smtp_pass' => 'lvshagihoagqdmrp',\n\t\t\t\t\t'mailtype' => 'html',\n\t\t\t\t\t'charset' => 'iso-8859-1'\n\t\t\t\t);\n\t\t\t\t$this->load->library('email', $config);\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\n\n\t\t\t\t$this->email->from('[email protected]', 'QN-Center');\n\t\t\t\t$this->email->to($email);\n\n\n\t\t\t\t$this->email->subject('Email Test');\n\t\t\t\t$verification_code = mt_rand(100000, 999999);\n\t\t\t\t$this->email->message($verification_code);\n\n\n\t\t\t\t$result = $this->email->send();\n\t\t\t\t$this->db->where('email',$email)->update('users',array('verification_code' => $verification_code));\n\t\t\t\t$this->response(['OTP Send'], REST_Controller::HTTP_OK);\n\t\t\t}else{\n\t\t\t\t$this->response(['Invaild Email.'], '500');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->response(['Too few arguments'], '500');\n\t\t}\n\t}", "public function actionForgotPassword() {\n //validate webservice\n $requiredParams = ['email'];\n try {\n CommonApiHelper::validateRequestParameters($requiredParams);\n\n $response = [];\n $post = Yii::$app->request->bodyParams;\n $post = array_map('trim', $post);\n //Fetch user details\n $userdata = Users::findOne(['email' => $post['email'], 'status' => '1']);\n if (!empty($userdata)) {\n $userdata->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n if ($userdata->save(false)) {\n Users::sendPasswordResetEmail($userdata);\n }\n return CommonApiHelper::return_success_response(\"Reset Password link has been sent to your registered email id.\", \"\", []);\n } else {\n return CommonApiHelper::return_error_response(\"Failed:\", \"Email id is not registered or User is inactive.\", \"2\");\n }\n } catch (\\Exception $e) {\n return CommonApiHelper::return_error_response(\"Sorry, Please try again.\");\n }\n }", "Public Function resetPassword()\n\t{\n\t\t$Code = $this->generateResetCode();\n\t\t$Email = $this->email;\n\t\t$Subject = 'Reset Password Request from ' . $_SERVER['HTTP_HOST'];\n\t\t$Body = <<<END\nThis is an automatically generated email from $_SERVER[HTTP_HOST] regarding a password reset.<br/>\nIf you did not request a password reset then please disregard this email.<br/>\n<br/>\nOtherwise, follow this link to reset your password:<br/>\n<a href=\"http://$_SERVER[HTTP_HOST]/BevoMedia/Index/ResetPassword.html?EmailCode=$Code&Email=$Email\">http://$_SERVER[HTTP_HOST]/BevoMedia/Index/ResetPassword.html?EmailCode=$Code&Email=$Email</a>\nEND;\n\t\t\n\t\t$this->ClearResetCode();\n\t\t$this->InsertResetCode($Code);\n\t\t$this->SendEmail($Email, $Subject, $Body);\n\t}", "public function forgetPassword() {\n $postdata = file_get_contents(\"php://input\");\n $request = json_decode($postdata, TRUE);\n //print_r($request['email_id']);die();\n\n $result = $this->Adminlogin_model->getAdminInfo($request['email_id']);\n // print_r($result);die();\n if ($result['status'] == 200) {\n echo '<div class=\"alert alert-success\">\n ' . $result['status_message'] . ' \n </div>';\n } elseif ($result['status'] == 412) {\n echo '<div class=\"alert alert-danger\">\n ' . $result['status_message'] . ' \n </div>';\n } else {\n echo '<div class=\"alert alert-danger\">\n ' . $result['status_message'] . ' \n </div>';\n }\n }", "public function resetUserPassword()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('user/password?forgotten=true', Input::only('email'));\t\n\n\t\t# if the call was successful we'll want to give some feedback to the user\n\t\tif(isset($response['success'])) \n\t\t{\n\t\t\tSession::flash('success', $response['success']['data']);\n\t\t}\n\t\t# similarly if it failed, but this time also show the previous form data\n\t\telse {\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('reset-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\t\t}\t\t\n\n\t\t# ... and show the reset form again\n\t\treturn Redirect::to('forgotten-password');\n\t}", "public function post_forgotpassword() {\n try {\n $i = Input::post();\n\n $auth = new \\Craftpip\\OAuth\\Auth();\n $users = $auth->getByUsernameEmail($i['email']);\n if (!$users) {\n throw new \\Craftpip\\Exception('Email/Username not registered with us.');\n }\n\n $mail = new \\Craftpip\\Mail($users['id']);\n $mail->template_forgotpassword();\n $mail->send();\n\n $response = array(\n 'status' => true,\n 'message' => 'asdsa',\n );\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n\n echo json_encode($response);\n }", "public function ResetPassword() {\n\t\t\t$strPassword = strtolower(substr(md5(microtime()), 4, 8));\n\t\t\t$this->SetPassword($strPassword);\n\t\t\t$this->PasswordResetFlag = true;\n\t\t\t$this->Save();\n\n\t\t\t// Setup Token Array\n\t\t\t$strTokenArray = array(\n\t\t\t\t'NAME' => $this->strFirstName . ' ' . $this->strLastName,\n\t\t\t\t'USERNAME' => $this->strUsername,\n\t\t\t\t'PASSWORD' => $strPassword\n\t\t\t);\n\n\t\t\t// Send Message\n\t\t\tQApplication::SendEmailUsingTemplate('forgot_password', 'Qcodo.com Credentials', QCODO_EMAILER,\n\t\t\t\t$this->SmtpEmailAddress, $strTokenArray, true);\n\t\t}", "static function password_forgot() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if (!$hash = data('hash'))\n go('/');\n\n # user hash exists\n $user = $model::first(array(\n 'fields' => 'id, email, name',\n 'where' => \"hash_password_forgot = '$hash'\"\n ));\n\n if (empty($user))\n go('/');\n\n # POST passwords sent\n if ($model::data()) {\n $user->password = $model::data('password');\n $user->password_confirm = $model::data('password_confirm');\n\n # validate passwords\n if ($user->validate()) {\n $user->password = auth_encrypt($user->password);\n $user->hash_password_forgot = '';\n\n $user->edit() ?\n flash('Sua senha foi alterada com sucesso.') :\n flash('Algo ocorreu errado. Entre em contrato com a empresa.', 'error');\n\n go('/');\n }\n }\n\n globals('user', $user);\n }", "public function resetPassword();", "public function do_forgot_password()\n {\n if( Confide::forgotPassword( Input::get( 'email' ) ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_forgot');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_forgot');\n return Redirect::action('UserController@forgot_password')\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }", "public function forget_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n if ($this->input->is_post()) {\n $res = $this->_api('user')->reset_password($this->input->post());\n\n if($res['submit']) {\n redirect('/login/forget_password_complete');\n return;\n }\n $view_data = [\n 'form_errors' => isset($res['invalid_fields']) ? $res['invalid_fields'] : [],\n 'errmsg' => isset($res['errmsg']) ? $res['errmsg'] : null,\n 'post' => $this->input->post()\n ];\n }\n\n $this->_render($view_data);\n }", "public function remind_password($email){\n\t\t $sql=\"SELECT * FROM waf_users WHERE email='\".$this->db->Q($email,1).\"'\";\n\t\t$result=$this->db->ROW_Q($sql);\n\t\tif($result)\n\t\t{\n\t\t $mdkey=md5(rand(10000,time()));\n\t\t \n\t\t \n\t\t $sql1=\"UPDATE waf_users SET rmn_pass='\".$mdkey.\"' WHERE id=\".$this->db->Q($result['id']);\n\t\t $this->db->QUERY($sql1);\n\t\t\n\t\t $link=(isset($_SERVER['HTTPS'] )?'https':'http').\"://\".$_SERVER['SERVER_NAME'].$this->web_root.\"reset_password.php?key=\".$mdkey;\n\t\t $msg=\"Some body try reset your password.\"\n\t\t\t\t\t.\"If you forget password \"\n\t\t\t\t\t.\"<a href='\".$link.\"'>click link</a>\"\n\t\t\t\t\t.\"W.A.F. System\";\n\t\t\n\t\t mail($result['email'],$subject,$msg);\n\t\t header(\"Location:?sended=1\");\n\t\t}else{\n\t\t return 'Guru you never know';\n\t\t}\n\t}", "public function forget_password() {\n $this->layout = 'custom';\n if ($this->request->is('post')) {\n if (empty($this->data['email'])) {\n $errors = 'Please Provide Your Email Adress that You used to Register with Us';\n $this->set('errors', $errors);\n $this->render('/Users/forget_password');\n }\n\n $emails = $this->request->data['email'];\n\n\n // Check if the Email exist\n\n $firstEmail = $this->User->find('first', array(\n 'conditions' => array(\n 'User.email' => $emails,\n ),\n ));\n if (!empty($firstEmail)) {\n \n\n // create the url with the reset function\n $name = $firstEmail['User']['first_name'];\n $id = $firstEmail['User']['id'];\n $hash = base64_encode($id);\n $url = Router::url(array(\n 'controller' => 'users',\n 'action' => 'reset',\n ), true) . '/' . $id;\n \n $dataArry =array('url' => $url,\n 'name' =>$name, );\n // ============Email================//\n\n if ($emails) {\n $Email = new Email();\n $status = $Email->sendEmail($emails, 'forget password', 'reset_password', $dataArry);\n $emailSucces = 'Check Your Email To Reset your password';\n $this->set('successmsg', $emailSucces);\n $this->render('/Users/forget_password');\n } else {\n $errors = 'Please Provide Your Email Adress that You used to Register with Us';\n $this->set('errors', $errors);\n $this->render('/Users/forget_password');\n }\n }\n }\n\n \n $this->render('/Users/forget_password');\n }", "public function postForgotPassword()\n\t{\n\t\t$rules = ['email' => 'required|email'];\n\t\t$validator = Validator::make(Input::only('email'), $rules);\n\t\tif ($validator->fails()) return Redirect::back()->withInput()->withErrors($validator);\n\n\t\tif ( ! PasswordReminder::canSendReminderEmail(Input::get('email')))\n\t\t{\n\t\t\treturn Redirect::back()->withInput()\n\t\t\t\t->withError('A reminder email has already been sent for this email address.');\n\t\t}\n\n\t\tswitch ($response = Password::remind(Input::only('email'), function($message)\n\t\t{\n\t\t\t$message->subject('WebCMS Password Reminder');\n\t\t}))\n\t\t{\n\t\t\tcase Password::REMINDER_SENT:\n\t\t\t\treturn Redirect::back()->withSuccess(Lang::get($response));\n\n\t\t\tdefault:\n\t\t\t\treturn Redirect::back()->withError(Lang::get($response));\n\t\t}\n\t}", "public function lostPassword() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n\n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n $this->user_model->setValue(\n \t'temp_code', $this->generateTempCode());\n $this->user_model->setValue(\n \t'temp_code_valid_until', date('Y-m-d H:i:s', strtotime('+ 2 days')));\n \t\n if (! $this->user_model->updateTempCode()) {\n \t$this->error(400, 'Something went wrong');\n }\n\n\t\t$this->sendEmail(\n\t\t\t$this->input->post('email'), \n\t\t\t'Set New Password', \n\t\t\t$this->getLostPasswordMailBody($this->user_model->getValue('temp_code')));\n\t\t$data['msg'] = 'New password mail for ' . $this->input->post('email') . ' sent.';\n\t\t$this->response($data);\n }", "public function forgotten_password() {\n $email = $this->input->post('email');\n if (!$this->users_model->fields(array('id'))->where('email', $email)->limit(1)->get()) {\n return $this->send_error('NOT_REGISTERED');\n }\n $this->load->helper('string');\n $this->load->library('email');\n $token = random_string('sha1');\n if (!$this->users_model->where('email', $email)->update(array('forgotten_password_code' => $token, 'forgotten_password_time' => time()))) {\n return $this->send_error('ERROR');\n }\n $this->email->from(config_item('email_from'), config_item('email_from_name'))\n ->to($email)\n ->subject('Passwrod reset | Go4Slam app')\n ->message('Hello, <br><br> Press the link below to set a new password. <br><br><a href=\"' . base_url() . 'user/reset_password/' . urlencode($email) . '/' . urlencode($token) . '\">Click here</a>')\n ->set_mailtype('html');\n if (!$this->email->send()) {\n return $this->send_error('UNABLE_TO_SEND_EMAIL');\n }\n return $this->send_success();\n }", "public function forgotPassword()\n { \n $siteUrl = ($this->request->type)?env('WEB_SITE_AUDIO_URL'):env('WEB_SITE_URL');\n $this->setRules([ 'email' => 'required|exists:customers,email' ]);\n $this->setMessages('email.exists', trans('customer::customer.email_not_registered'));\n $this->_validate();\n $newPassword = str_random(8);\n $user = $this->_customer->where('email', $this->request->email)->first();\n $user->forgot_password = $newPassword;\n $user->save();\n if (!empty($user) && count($user->toArray()) > 0) {\n $this->email = $this->email->fetchEmailTemplate('forgot_password');\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace([ '##USERNAME##','##FORGOTPASSWORD##' ], [ $user->name, $siteUrl.'reset-password' . '/' . $user->forgot_password ], $this->email->content);\n $this->notification->email($user, $this->email->subject, $this->email->content);\n }\n return true;\n }", "public function forgotAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $realm = $this->_getParam('realm', null);\n\n if (is_null($realm)) {\n throw new Ot_Exception_Input('msg-error-realmNotFound');\n }\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $form = new Ot_Form_ForgotPassword();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n $account = new Ot_Model_DbTable_Account();\n\n $userAccount = $account->getByUsername($form->getValue('username'), $realm);\n\n if (!is_null($userAccount)) {\n $loginOptions = array();\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n // Generate key\n $text = $userAccount->username . '@' . $userAccount->realm . '-' . time();\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n\n $code = bin2hex(mcrypt_encrypt($cipher, $key, $text, MCRYPT_MODE_CBC, $iv));\n\n $this->_helper->messenger->addSuccess('msg-info-passwordResetRequest');\n\n $loggerOptions = array('attributeName' => 'accountId', 'attributeId' => $userAccount->accountId);\n\n $this->_helper->log(Zend_Log::INFO, 'User ' . $userAccount->username . ' sent a password reset request.', $loggerOptions);\n\n $dt = new Ot_Trigger_Dispatcher();\n $dt->setVariables(array(\n 'firstName' => $userAccount->firstName,\n 'lastName' => $userAccount->lastName,\n 'emailAddress' => $userAccount->emailAddress,\n 'username' => $userAccount->username,\n 'resetUrl' => Zend_Registry::get('siteUrl') . '/login/password-reset/?key=' . $code,\n 'loginMethod' => $userAccount->realm,\n ));\n\n $dt->dispatch('Login_Index_Forgot');\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-userAccountNotFound');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->_helper->pageTitle('ot-login-forgot:title');\n $this->view->assign(array(\n 'form' => $form,\n ));\n }", "public function forget_password($username)\n {\n try\n {\n $stmt = $this->db->prepare(\"SELECT email FROM users WHERE email=:email LIMIT 1\");\n $stmt->execute(array(\n 'email'=> mb_strtolower($username, 'UTF-8')\n ));\n $userRow = $stmt->fetch(PDO::FETCH_ASSOC);\n if($stmt->rowCount() > 0)\n {\n $tokenreset = sha1(uniqid().$username);\n $linkreset = \"http://interminale.fr.nf/forget_password?email=\".$username.\"&token=\".$tokenreset;\n\n $addmdpoublie = $this->db->prepare(\"INSERT INTO forget_password(email,token) VALUES(:email, :token)\");\n $addmdpoublie->execute(array(\n 'email'=> mb_strtolower($username, 'UTF-8'),\n 'token' => $tokenreset\n ));\n\n require $_SERVER['DOCUMENT_ROOT'].'/app/controllers/phpmailer/PHPMailerAutoload.php';\n\n // Retrieve the email template required\n $msg_html = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/app/view/email-forgetpassword.template.html');\n\n // Replace the % with the actual information\n $msg_html = str_replace('%linkreset%', $linkreset, $msg_html);\n\n $mail = new PHPMailer;\n $mail->isSMTP();\n $mail->SMTPDebug = 0;\n $mail->Debugoutput = 'html';\n $mail->Host = 'smtp.gmail.com';\n $mail->Port = 587;\n $mail->SMTPSecure = 'tls';\n $mail->SMTPAuth = true;\n $mail->Username = \"[email protected]\";\n $mail->Password = \"~Py+Ai3j(O5g8!\";\n $mail->isHTML(true);\n $mail->CharSet = 'UTF-8';\n $mail->setFrom('[email protected]', 'Interminale');\n $mail->addReplyTo($username);\n $mail->addAddress($username);\n $mail->Subject = 'Réinitialisation mot de passe - Interminale';\n $mail->Body = $msg_html;\n\n $mail->AltBody = strip_tags($msg_html);\n\n //send the message, check for errors\n if (!$mail->send()) {\n $message = array('status' => 0, 'err' => \"L'email n'a pas pu être envoyé :/ Réessayez.\");\n return $message;\n } else {\n $message = array('status' => 1, 'err' => 'Un mail a été envoyé à '.$username.'.<br />Cliquez sur le lien reçu pour changer le mot de passe');\n return $message;\n }\n }\n else\n {\n $message = array('status' => 0, 'err' => 'L\\'adresse mail ne conrespond à aucun compte :/');\n return $message;\n }\n }\n catch(PDOException $e)\n {\n die('<h1>ERREUR LORS DE LA CONNEXION A LA BASE DE DONNEE. <br />REESAYEZ ULTERIEUREMENT</h1>');\n }\n }", "public function forgotPasswordAction()\n {\n $form = new ForgotPasswordForm();\n\n if ($this->request->isPost())\n {\n if($this->security->checkToken())\n {\n // Send emails only is config value is set to true\n if ($this->getDI()->get('config')->useMail) {\n\n if ($form->isValid($this->request->getPost()) == false) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n\n $user = Users::findFirstByEmail($this->request->getPost('email'));\n if (!$user) {\n $this->flash->success('There is no account associated to this email');\n } else {\n\n $resetPassword = new ResetPasswords();\n $resetPassword->usersId = $user->id;\n if ($resetPassword->save()) {\n // $this->flash->success('Success! Please check your messages for an email reset password');\n $this->flashSess->success(\"Success! Please check your messages for an email reset password\");\n $this->view->disable();\n return $this->response->redirect('');\n } else {\n foreach ($resetPassword->getMessages() as $message) {\n $this->flash->error($message);\n }\n }\n }\n }\n } else {\n $this->flash->warning('Emails are currently disabled. Change config key \"useMail\" to true to enable emails.');\n }\n }\n else {\n $this->flash->error('CSRF Validation is Failed');\n }\n }\n $this->view->form = $form;\n }", "public function postForgotPw(){\n\t\t//find user where email = input email\n\t\t$user = User::where('email','=',Str::lower(Input::get('email')));\n\n\t\t//if user found\n\t\tif($user->count()){\n\n\t\t\t//if match found\n\t\t\t$user \t\t\t\t\t= $user->first();\n\n\t\t\t//generate new activate code and new password\n\t\t\t$code \t\t\t\t\t= str_random(60);\n\t\t\t$password \t\t\t\t= str_random(10);\n\n\t\t\t//update value in db\n\t\t\t$user->activate_code\t= $code;\n\t\t\t$user->password_temp\t= Hash::make($password);\n\n\t\t\t//save to db\n\t\t\tif($user->save()){\n\n\t\t\t\t//send email to user with new password and activate link\n\t\t\t\tMail::send('emails.auth.forgot_mail',array('link' => URL::route('account-recover', $code), 'name' => $user->last_name, 'password'=>$password), function($message) use ($user){\n\t\t\t\t\t$message->to($user->email, $user->last_name)->subject(\"It's ok, it happens. Here is yours...\");\n\t\t\t\t});\t\t\t\t\n\t\t\t\t\n\t\t\t\t//return to forgot-pw page\n\t\t\t\treturn Redirect::route('account-forgot-pw')\n\t\t\t\t\t\t->with('global','<div class=\"alert alert-success\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"glyphicon glyphicon-envelope\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t\tNew password has been sent. Please check your mail.\n\t\t\t\t\t\t\t\t\t\t</div>');\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t//return error msg wrong old password\n\t\t\treturn Redirect::route('account-forgot-pw')\n\t\t\t\t\t->with('global','<div class=\"alert alert-danger\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"glyphicon glyphicon-exclamation-sign\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Error:</span>\n\t\t\t\t\t\t\t\t\t\tIncorrect Email Address. Please try again.\n\t\t\t\t\t\t\t\t\t</div>');\n\t\t}\n\t}", "public function forgotpassword() {\n\n\t\t$login_box_visiblity = '';\n\t\t$forgot_box_visiblity = 'visible';\n\n\t\t$this->JQValidator->addValidation('User', $this->User->validate, 'UserLoginForm');\n\t\t$this->JQValidator->addValidation('ForgotPasswordForm', $this->ForgotPasswordForm->validate, 'ForgotPasswordForm');\n\n\t\t$this->set(compact('login_box_visiblity', 'forgot_box_visiblity'));\n\n\t\tif (array_key_exists('ForgotPasswordForm', $this->data)) {\n\t\t\t$flag = $this->ForgotPassword->sendMail($this->data['ForgotPasswordForm'], 'admin');\n\n\t\t\tif ($flag) {\n\t\t\t\t$this->redirect('login');\n\t\t\t}\n\t\t} else {\n\t\t\t$this->login();\n\t\t}\n\t}", "public function Forgotpassword()\n\t{\n\t\t$login = get_cookie(sha1('besaf'));\n\t\tif ($login) {\n\t\t\t//! cek login\n\t\t\tif ($this->session->userdata('role_id') == 1) {\n\t\t\t\t// user\n\t\t\t\tredirect('user');\n\t\t\t} elseif ($this->session->userdata('role_id') == 2) {\n\t\t\t\t// admin\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t} elseif (!$login) {\n\t\t\t//! cek login\n\t\t\tif ($this->session->userdata('role_id') == 1) {\n\t\t\t\t// user\n\t\t\t\tredirect('user');\n\t\t\t} elseif ($this->session->userdata('role_id') == 2) {\n\t\t\t\t// admin\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\n\t\t$this->session->set_userdata(['reset' => true]);\n\n\t\t$this->load->view('Front/template/header');\n\t\t$this->load->view('Front/Forgot_password');\n\t\t$this->load->view('Front/template/footer');\n\t}", "public function resetAndUpdatePassword() {\n $this->validate ( $this->request, $this->getRules () );\n $user = User::where ( 'email', $this->request->email )->first ();\n \n if (!empty($user) && count ( $user->toArray() ) > 0) {\n $user->password = Hash::make ( (true) ? config()->get('app.user_password'): $this->generatePassword() );\n \n $user->save ();\n $this->email = $this->email->fetchEmailTemplate ( 'admin_forgot' );\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace (['##USERNAME##','##FORGOTPASSWORD##'],[$user->name,'admin123'],$this->email->content );\n $this->notification->email ( $user, $this->email->subject, $this->email->content );\n return true;\n } else {\n return false;\n }\n }", "public function forgot_password() {\n if ($this->Auth->login()) {\n return $this->redirect($this->Auth->redirectUrl());\n }\n $this->layout = 'GtwUsers.users';\n if ($this->request->is('post')) {\n $arrResponse = $this->User->ForgotPasswordEmail($this->request->data['User']['email']);\n if (!empty($arrResponse)) {\n if ($arrResponse['status'] == 'fail') {\n $this->Session->setFlash($arrResponse['message'], 'alert', array(\n 'plugin' => 'BoostCake',\n 'class' => 'alert-danger'\n ));\n } else {\n $this->Session->setFlash($arrResponse['message'], 'alert', array(\n 'plugin' => 'BoostCake',\n 'class' => 'alert-success'\n ));\n return $this->redirect($this->Auth->redirectUrl());\n }\n }\n }\n }", "private function forgotPassword()\n {\n try\n {\n $request = $_POST;\n\n if( !isset($request['username']) || $request['username']==\"\" )\n throw_error_msg(\"user name not provided\");\n\n global $userquery; \n $userquery->reset_password(1,$request['username']);\n\n if(error())\n {\n throw_error_msg(error('single'));\n }\n else\n { \n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'success', \"data\" => \"An Email Has Been Sent To You. Please Follow the Instructions there to Reset Your Password\");\n $this->response($this->json($data));\n }\n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function forgotpasswordAction()\n {\n $user_service = $this->getServiceLocator()->get('user');\n $email_sent = false;\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost();\n\n $email = trim($data['email']);\n $email = strtolower($email);\n $user_service->emailPassword($email);\n $email_sent = true;\n }\n\n return ['email_sent' => $email_sent];\n }", "public function forgotPassword()\n {\n $email = $this->input->post('email');\n $token = bin2hex(random_bytes(25));\n\n $user_id = $this->authentication_helper->checkEmail($email);\n\n if (isset($user_id) && !empty($user_id)) \n {\n $status = $this->authentication_worker->createToken($token, $user_id);\n if ($status) {\n $to_email = $email;\n $subject = \"Redefina sua senha\";\n $url = site_url('authentication/resetNewPassword' . \"?token=\" . $token);\n $message = \"Redefina sua senha da ZZjober clicando no link<br/><a href='\" . $url. \"'>\".$url.\"</a>\";\n $this->sendMail($to_email, $subject, $message);\n $this->session->set_flashdata('success_msg', 'Verifique seu e-mail para redefinir sua nova senha através do link');\n redirect('home/Entrar');\n }\n } else {\n $this->session->set_flashdata('error_msg', 'E-mail não encontrado');\n redirect('home/Entrar');\n }\n\n }", "function forgot_password()\n\t{\n\t\tif ($this->tank_auth->is_logged_in()) {\t\t\t\t\t\t\t\t\t// logged in\n\t\t\tredirect('');\n\n\t\t} elseif ($this->tank_auth->is_logged_in(FALSE)) {\t\t\t\t\t\t// logged in, not activated\n\t\t\tredirect('/auth/send_again/');\n\n\t\t} else {\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean|valid_email');\n\n\t\t\t$data['errors'] = array();\n\n\t\t\tif ($this->form_validation->run()) {\t\t\t\t\t\t\t\t// validation ok\n\t\t\t\tif (!is_null($data = $this->tank_auth->forgot_password(\n\t\t\t\t\t\t$this->form_validation->set_value('email')))) {\n\n\t\t\t\t\t$data['site_name'] = $this->config->item('website_name', 'tank_auth');\n\n\t\t\t\t\t// Send email with password activation link\n\t\t\t\t\t$this->_send_email('forgot_password', $data['email'], $data);\n\n\t\t\t\t\t$this->_show_message($this->lang->line('auth_message_new_password_sent'));\n\n\t\t\t\t} else {\n\t\t\t\t\t$errors = $this->tank_auth->get_error_message();\n\t\t\t\t\tforeach ($errors as $k => $v)\t$data['errors'][$k] = $this->lang->line($v);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//$this->load->view('auth/forgot_password_form', $data);\n\t\t\tdisplay('forgot_password', $data);\n\t\t}\n\t}", "function reset_email()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_failed'));\n\t\t}\n\t}", "public function post_forgotpasswordconfirmed() {\n try {\n $i = Input::post();\n\n $user = new \\Craftpip\\OAuth\\Auth($i['user_id']);\n $key = $user->getAttr('forgotpassword_key');\n if ($key != $i['key']) {\n throw new Exception('Sorry, the token has expired.');\n }\n\n if (!(strlen($i['password']) > 5 && strlen($i['password']) < 12)) throw new Exception('Sorry, something went wrong.');\n\n $user->setPassword($i['password']);\n $user->removeAttr('forgotpassword_key');\n $user->setAttr('verified', true); // because password reset happened via email.\n if ($user->existAttr('verify_key')) $user->removeAttr('verify_key');\n $user->force_login($user->user_id);\n\n $response = array(\n 'status' => true,\n 'message' => 'Password has been changed successfully.',\n );\n } catch (Exception $e) {\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n echo json_encode($response);\n }", "function userForgotPassword($userData)\n\t\t{\n\t\t\tif(isset($userData['email']) && !empty($userData['email']))\n\t\t\t{\n\t\t\t\t//get values from email id\n\t\t\t\t$user = $this->manageContent->getValue_where('user_credentials','*','email_id',$userData['email']);\n\t\t\t\tif(!empty($user[0]))\n\t\t\t\t{\n\t\t\t\t\t//set password\n\t\t\t\t\t$password = uniqid();\n\t\t\t\t\t//update the password\n\t\t\t\t\t$update_pass = $this->manageContent->updateValueWhere('user_credentials','password',md5($password),'email_id',$userData['email']);\n\t\t\t\t\t//mail to user\n\t\t\t\t\t$mailsent = $this->mailSent->forgotPasswordMail($user[0]['email_id'], $user[0]['username'], $password);\n\t\t\t\t\tif($mailsent == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$_SESSION['success'] = 'Password is sent to your mail';\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$_SESSION['warning'] = 'Mail sending unsuccessfull';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['warning'] = 'Invalid EmailId';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function actionForgetpassword(){\n\t\t\n\t\t$model=new ForgetpasswordForm; //**models/ForgetpasswordForm.php\n\t\t$returnurl = Yii::app()->user->returnUrl;\t\t\n\t\tif(isset($_POST['ForgetpasswordForm'])){\n\t\t\t$model->attributes = $_POST['ForgetpasswordForm'];\t\t\n\t\t\t$user=Users::model()->findByEmailId($model->attributes['email']);\n\t\t\tif($user){\n\t\t\t\t$chars = array_merge( range('a','z'),range(0,9),range('A','Z'));\n\t\t\t\tshuffle($chars);\n\t\t\t\t$token = implode(array_slice($chars, 0, 8));\n\t\t\t\t$path = $this->createAbsoluteUrl('/site/resetpassword');\n\t\t\t\t$user_id = $model->get_user_id($model->attributes['email']);\t\t\t\n\t\t\t\t$token = $token.\"user\".$user_id;\n\t\t\t\t$key = 'forget password posly';\t\t\n\t\t\t\t $encrypted_token = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $token, MCRYPT_MODE_CBC, md5(md5($key))));\n\t\t\t\t//echo \"<br/>\";\n\t\t\t\t//$decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($encrypted_token), MCRYPT_MODE_CBC, md5(md5($key))), \"\\0\");\n\t\t\t\t//$user_token = urlencode($encrypted_token);\n\t\t\t\t$link = $path.\"?token=\".$encrypted_token;\t\t\t\t\n\t\t\t\t$model->reset_password_token($token,$model->attributes['email']);\n\t\t\t\tYii::import('ext.yii-mail.YiiMailMessage');\t\t\t\t\n\t\t\t\t$message = new YiiMailMessage;\n\t\t\t\t$message->setBody('Dear Member,\n\nWe got a request to reset your Posly password.\n\nPlease find the link showed below:\n'.$link.'\n\nIf you ignore this message, your password would not be changed.\n\nSincerely, \nPosly Team\n\n\n', 'text');\n\t\t\t\t$message->subject = 'Reset Your Password';\n\t\t\t\t$message->addTo($model->attributes['email']);\n\t\t\t\t$message->from = Yii::app()->params['adminEmail'];\n\t\t\t\tYii::app()->mail->send($message);\t\t\t\t\n\t\t\t\t\n\t\t\t\techo CJSON::encode(array(\n\t\t\t\t\t'status'=>'success',\n\t\t\t\t\t'returnUrl'=>$returnurl\n\t\t\t\t));\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$msg = 'Email Not Exists! Please SignUp';\t\n\t\t\t\techo CJSON::encode(array(\n\t\t\t\t 'status'=>'error',\n\t\t\t\t 'msg'=>$msg\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->redirect(Yii::app()->homeUrl);\n\t\t}\n\t\tYii::app()->end();\n\t}", "public function forgotpasswordAction() {\n $form = new Admin_Form_ResendPassword();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n //check user is registered\n $values = $form->getValues();\n $siteUsersMapper = new Application_Model_Table_AdminUsers();\n $exists = $siteUsersMapper->fetchByUsername($values['email_address']);\n if($exists){\n //user exists\n $recoveryEmailsMapper = new Application_Model_Table_AdminUserRecoveryEmails();\n $recoveryEmail = $recoveryEmailsMapper->createRow();\n $recoveryEmail->admin_user_id = $exists->admin_user_id;\n $recoveryEmail->email_address = $exists->username;\n $recoveryEmail->hashActivationKey();\n $recoveryEmail->save();\n }\n $this->_helper->FlashMessenger->addMessage('You password has been reset, please check your email' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-dashboard', true);\n }\n }\n $this->view->form = $form;\n }", "public function forgottenPassword()\n {\n\t\t// Load helpers and libraries\n\t\thelper(['form', 'url']);\n\t\t$M_User = new M_User();\n\n\t\t// Default return\n\t\t$ret = redirect()->to(base_url());\n\n $options = [\n\t\t\t'action' => 'Users/forgottenPassword' // Route\n ];\n \n\t\t$request = $this->request;\n \n\t\t// Retrieving the current step of the process\n\t\t$step = $request->getPostGet('step');\n\n switch ($step){\n\t\t\tcase 1:\n\t\t\t\t// Step 1: Display email form\n\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_1, $options));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t// Step 2: Send the email\n\t\t\t\t$postData = $request->getPostGet('forgottenPwd');\n\n\t\t\t\t$options['alert'] = 'Un problème est survenu lors de l\\'envoi de l\\'email.';\n\t\t\t\t$options['type'] = 'danger';\n\n\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_1, $options));\n\n\t\t\t\tif(is_array($postData))\n {\n\t\t\t\t\t$email = $postData['email'];\n\t\t\t\t\t// Everything went well : sending the password reset email\n\t\t\t\t\tif ($M_User->sendPwdResetEmail($email) == SC_SUCCESS) {\n\t\t\t\t\t\t$options['alert'] = 'Un email vient de vous être envoyé. Merci de cliquer sur le lien qu\\'il contient.';\n $options['type'] = 'success';\n\t\t\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_2, $options));\n }\n\t\t\t\t\t// TODO - User not found\n }\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t// Step 3 : Token verification\n\t\t\t\t$token = $request->getPostGet('token');\n\n\t\t\t\t$options = [\n\t\t\t\t\t'action' => 'Users/forgottenPassword', // Route\n\t\t\t\t\t'token' => $token, // Security token\n\t\t\t\t\t'script' => self::ENCRYPTION_URL // Script URL for SHA256 encryption\n\t\t\t\t];\n\n\t\t\t\tif ($M_User->findOneBy('securityToken', $token) != null) {\n\t\t\t\t\t// A corresponding security token has been found in the DB\n\t\t\t\t\t$ret = render(FORM_FORGOTTEN_PWD_STEP_3, $options);\n }\n\t\t\t\t// TODO - Token expired\n\t\t\t\t// TODO - Invalid Token\n\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t// Step 4 : Updating User password\n\t\t\t\t$postData = $request->getPostGet('pwdReset');\n\t\t\t\tif (is_array($postData)){\n\t\t\t\t\tif ($M_User->resetPassword($postData['token'],$postData['password']) != SC_SUCCESS){\n\t\t\t\t\t\t$options = [\n\t\t\t\t\t\t\t'action' => 'Users/forgottenPassword', // Route\n\t\t\t\t\t\t\t'token' => $postData['token'], // Security token\n\t\t\t\t\t\t\t'alert' => 'Une erreur interne est survenue', // Alert message\n\t\t\t\t\t\t\t'type' => 'danger' // Alert type\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t$ret = render(FORM_FORGOTTEN_PWD_STEP_3, $options);\n } \n }\n\t\t\t\tbreak;\n }\n \n\n return $ret;\n\t}", "public function forgot_pwd()\r\n {\r\n //provided the correct combination of user name and email address\r\n\r\n $username = htmlspecialchars($_POST['username']);\r\n $email = htmlspecialchars($_POST['email']);\r\n\r\n require_once 'database/profile.php';\r\n require_once 'database/session.php';\r\n\r\n $usernameId = getUserId($username);\r\n if (!$usernameId) {\r\n return \"Username does not exist.\";\r\n }\r\n\r\n $userInfo = getProfile($usernameId);\r\n if ($userInfo[\"email\"] != $email) {\r\n return \"Email doesn't match the one we have on file.\";\r\n }\r\n\r\n $password = getPassword($userId);\r\n return $this->send_forgotten_pwd($username, $password, $email);\r\n \r\n }", "function reset_email()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Reset email\n if ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_new_email_failed'));\n }\n }", "public function forgot_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['username'])){\n $email = $_POST['username'];\n $user = $this->User->getByEmail($email);\n $pass = rand(111111, 999999);\n if($this->User->setPassword($user['id'], $pass)) {\n $text = <<<END\nBecause of a request on our site, your password has been reset. To change your password, go to /users/change_password\nYour username is: {$email}\nYour password is: {$pass}\nEND;\n $email = self::getLib('email');\n $html = $email->text2html($text, email);\n $email->setSender('support');\n $email->setReplyTo('support');\n $email->setRecipients( array($recipient) );\n $email->setSubject(\"Your password has been reset\");\n $email->addMessagePart($text);\n $email->addMessagePart($html, \"html\");\n $email->send();\n $flash = \"An email with your new password has been sent to you. You should receive it shortly.\";\n } else {\n $flash = \"An error occured.\";\n }\n } else {\n $flash = \"Please enter a user name.\";\n }\n return array('flash' => $flash);\n }", "public function forgotPwd() {\n\t\tif (isset($_POST['email'])){\n\t\t\t\t$email = $_POST['email'];\n\t\t\t\t$query=\"select * from users where email='$email'\";\n\t\t\t\t$result = mysqli_query($this->connrps,$query);\n\t\t\t\t$count=mysqli_num_rows($result);\n\t\t\t\t// If the count is equal to one, we will send message other wise display an error message.\n\t\t\t\tif($count==1){\n\t\t\t\t\t$rows=mysqli_fetch_array($result);\n\t\t\t\t\t$pass = base64_decode($rows['password']);\n\t\t\t\t\t$to = $rows['email'];\n\t\t\t\t\t$url = $_SERVER['HTTP_HOST'];\n\t\t\t\t\t$body = \"\n\t\t\t\t\tWebsite Url : $url <br/>\n\t\t\t\t\tYour Email Id : $to <br/>\n\t\t\t\t\tHere is your password : $pass <br/><br/><br/><br/>\n\t\t\t\t\tSincerely,<br/>\n\t\t\t\t\tBARNA\";\n\t\t\t\t\t$from = \"[email protected]\";\n\t\t\t\t\t$subject = \"Your password has been recovered\";\n\t\t\t\t\t$headers1 = 'From: Password Recovered <$from>' . \"\\r\\n\";\n\t\t\t\t\t$headers1 .= \"Content-type: text/html;charset=iso-8859-1\\r\\n\";\n\t\t\t\t\t$headers1 .= \"X-Priority: 1\\r\\n\";\n\t\t\t\t\t$headers1 .= \"X-MSMail-Priority: High\\r\\n\";\n\t\t\t\t\t$headers1 .= \"X-Mailer: Password Recovered\\r\\n\";\n\t\t\t\t\t$sentmail = mail ( $to, $subject, $body, $headers1 );\n\t\t\t\t\t//If the message is sent successfully, display sucess message otherwise display an error message.\n\t\t\t\t\tif($sentmail==1){\n\t\t\t\t\t\t$message= \"Your password has been sent to your email address.\";\n\t\t\t\t\t\t$_SESSION['succ_msg'] = $message;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif($_POST['email']!=\"\"){\n\t\t\t\t\t\t\t$message= \"Cannot send password to your e-mail address.Problem with sending mail...\";\n\t\t\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\t\t\treturn 0;\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 ($_POST ['email'] != \"\") {\n\t\t\t\t\t$message= \"Email does not exist.\";\n\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t }\n }", "public function forgot_password_action() {\n $email = $this->input->post(\"email\", true);\n $rply = $this->model_customer->check_username($email);\n $this->load->helper('string');\n if ($rply['errorCode'] == 1) {\n $define_param['to_name'] = ($rply['Firstname']) . \" \" . ($rply['Lastname']);\n $define_param['to_email'] = $rply['Email'];\n $userid = $rply['ID'];\n $hidenuseremail = $rply['Email'];\n $hidenusername = ($rply['Firstname']) . \" \" . ($rply['Lastname']);\n //Encryprt data\n $encid = $this->general->encryptData($userid);\n $encemail = $this->general->encryptData($hidenuseremail);\n $url = base_url(\"reset-password/\" . $encid . \"/\" . $encemail);\n\n $update['reset_password_check'] = 0;\n $update['reset_password_requested_on'] = date(\"Y-m-d H:i:S\");\n $result = $this->model_customer->update(\"app_customer\", $update, \"ID='\" . $userid . \"'\");\n\n //Send email\n $subject = translate('reset_password');\n $define_param['to_name'] = $hidenusername;\n $define_param['to_email'] = $hidenuseremail;\n\n $parameter['URL'] = $url;\n $html = $this->load->view(\"email_template/forgot_password\", $parameter, true);\n $this->sendmail->send($define_param, $subject, $html);\n\n $this->session->set_flashdata('msg', $rply['errorMessage']);\n $this->session->set_flashdata('msg_class', 'success');\n redirect('login');\n } else {\n $this->session->set_flashdata('msg', $rply['errorMessage']);\n $this->session->set_flashdata('msg_class', 'failure');\n redirect('forgot-password');\n }\n }", "function sendUserForgotPassword($argArrPOST) {\n\n @extract($argArrPost);\n $objValid = new Validate_fields;\n $objCore = new Core();\n $objValid->check_4html = true;\n\n $objValid->add_text_field('Email', strip_tags($argArrPOST['frmUserLoginEmail']), 'email', 'y');\n\n if ($objValid->validation()) {\n $errorMsgFirst = 'Please enter valid email address!';\n } else {\n $errorMsg = $objValid->create_msg();\n }\n if ($errorMsg) {\n $objCore->setErrorMsg($errorMsg);\n return false;\n } else {\n $arrUserFlds = array('pkUserID', 'UserFirstName', 'UserEmail', 'UserPassword');\n $varUserWhere = ' 1 AND UserEmail = \\'' . trim($argArrPOST['frmUserLoginEmail']) . '\\'';\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n if ($arrUserList) {\n //update the random key in the database\n\n $varRandomPassword = $this->generate_random_string(5); //die;\n\n\n $varRandomKey = md5(uniqid(microtime()));\n $arrUpdateArray = array('UserAuthorizationToken' => $varRandomKey, 'UserPassword' => md5($varRandomPassword));\n $varaffectedRecord = $this->update(TABLE_USERS, $arrUpdateArray, $varUserWhere);\n\n\n\n $argUserName = $arrUserList[0]['UserEmail'];\n //$argPassword = $arrUserList[0]['UserPassword'];\n $argPassword = $varRandomPassword;\n $argFirstName = $arrUserList[0]['UserFirstName'];\n\n //Send forget Password To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo2.png' . '\"/>';\n\n $varToUser = $argArrPOST['frmUserLoginEmail'];\n $varFromUser = SITE_NAME . '<' . SITE_EMAIL_ADDRESS . '>';\n $varSubject = 'Venueset:Login Details';\n $varResetPasswordlink = '<a href=\"' . SITE_ROOT_URL . 'reset_password.php?userId=' . $arrUserList[0]['pkUserID'] . '&authorizationToken=' . base64_encode($varRandomKey) . '\">Reset Password</a>';\n $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/user_forget_password.html');\n $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5(trim($argArrPOST['frmUserLoginEmail'])) . '\" target=\"_blank\">here</a> to unsubscribe.';\n\n $arrBodyKeywords = array('{USER_FIRST_NAME}', '{USER_NAME}', '{USER_PASSWORD}', '{IMAGE_PATH}', '{SITE_NAME}', '{RESET_PASSWORD_LINK}', '{UNSUBSCRIBE_LINK}');\n\n $arrBodyKeywordsValues = array($argFirstName, $argUserName, $argPassword, $varPath, SITE_NAME, $varResetPasswordlink, $varUnsubscribeLink);\n $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n //echo $varBody;die;\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $objCore->setSuccessMsg(FRON_END_USER_FORGET_PASSWORD_SEND);\n return true;\n } else {\n $objCore->setErrorMsg(FRON_END_USER_EMAIL_EXIST_ERROR);\n return false;\n }\n }\n }", "public function generateResetPassword()\n {\n $this->setRules([ StringLiterals::EMAIL => 'required|max:100|email' ]);\n $this->_validate();\n $this->_customer = $this->_customer->where('email', $this->request->email)->first();\n if (isset($this->_customer) && is_object($this->_customer) && ! empty($this->_customer->id)) {\n $this->_customer->access_otp_token = mt_rand();\n $this->_customer->save();\n $this->email = $this->email->fetchEmailTemplate('password_reset_otp');\n $this->email->content = str_replace([ '##USERNAME##','##OTP##' ], [ $this->_customer->name,$this->_customer->access_otp_token ], $this->email->content);\n $this->notification->email($this->_customer, $this->email->subject, $this->email->content);\n return true;\n }\n return false;\n }", "function reset_email()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->session->set_flashdata('message',$this->lang->line('auth_message_new_email_activated'));\n\t\t\t\t\tredirect('login');\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message',$this->lang->line('auth_message_new_email_failed'));\n\t\t\t\t\tredirect('login');\n\t\t}\n\t}", "public function passwordResetAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $userKey = $this->_getParam('key', null);\n\n if (is_null($userKey)) {\n throw new Ot_Exception_Input('msg-error-noKeyFound');\n }\n\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n $string = pack(\"H*\", $userKey);\n\n $decryptKey = trim(mcrypt_decrypt($cipher, $key, $string, MCRYPT_MODE_CBC, $iv));\n\n if (!preg_match('/[^@]*@[^-]*-[0-9]*/', $decryptKey)) {\n throw new Ot_Exception_Input('msg-error-invalidKey');\n }\n\n $userId = preg_replace('/\\-.*/', '', $decryptKey);\n $ts = preg_replace('/^[^-]*-/', '', $decryptKey);\n\n $timestamp = new Zend_Date($ts);\n\n $now = new Zend_Date();\n\n $now->subMinute((int)$loginOptions['forgotpassword']['numberMinutesKeyIsActive']);\n\n if ($timestamp->getTimestamp() < $now->getTimestamp()) {\n throw new Ot_Exception_Input('msg-error-keyExpired');\n }\n\n $realm = preg_replace('/^[^@]*@/', '', $userId);\n $username = preg_replace('/@.*/', '', $userId);\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $account = new Ot_Model_DbTable_Account();\n $thisAccount = $account->getByUsername($username, $realm);\n\n if (is_null($thisAccount)) {\n throw new Ot_Exception_Data('msg-error-userAccountNotFound');\n }\n\n $form = new Ot_Form_PasswordReset();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n if ($form->getValue('password') == $form->getValue('passwordConf')) {\n\n $data = array(\n 'accountId' => $thisAccount->accountId,\n 'password' => md5($form->getValue('password')),\n );\n\n $account->update($data, null);\n\n $this->_helper->messenger->addSuccess('msg-info-passwordReset');\n\n $loggerOptions = array(\n 'attributeName' => 'accountId',\n 'attributeId' => $data['accountId'],\n );\n\n $this->_helper->log(Zend_Log::INFO, 'User reset their password', $loggerOptions);\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-passwordsNotMatch');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->view->headScript()->appendFile($this->view->baseUrl() . '/public/scripts/ot/jquery.plugin.passStrength.js');\n\n $this->_helper->pageTitle('ot-login-passwordReset:title');\n\n $this->view->assign(array(\n 'form' => $form,\n ));\n\n }", "public function doForgetPassword(){\n $email = Input::get('email');\n $result = 0;\n\n if(!empty($email)){\n $token = User::createAccountToken();\n \tUser::where('email', '=',$email)->update(array('account_token' => $token));\n\n\t\t\t$user = User::getByEmail($email);\n if (!empty($user)) {\n $link_reset = URL::to('/').'/forgetPassword?email='.$email.'&token='.$token;\n\n $data = array(\n 'link_reset' => $link_reset,\n 'user' => $user->toArray()\n );\n\n Mail::send('emails.reset_password', $data, function($message) use($email) {\n $message->to($email, Config::get('constants.website_name'))\n ->subject('【'.Config::get('constants.website_name').'】Cấp lại mật khẩu!');\n });\n\n $result = 1;\n }\n }\n return json_encode($result);\n }", "public function forgetPassword( array $data )\n\t{\n\t\tif( !empty( $data ) ){\n\t\t\t\n\t\t\t// escape variables for security\n\t\t\t$email = mysqli_real_escape_string( $con, trim( $data['email'] ) );\n\t\t\t\n\t\t\tif((!$email) ) {\n\t\t\t\tthrow new Exception( FIELDS_MISSING );\n\t\t\t}\n\t\t\t$password = $this->randomPassword();\n\t\t\t$password1 = md5( $password );\n\t\t\t$query = \"UPDATE users SET password = '$password1' WHERE email = '$email'\";\n\t\t\tif(mysqli_query($con, $query)){\n\t\t\t\t$to = $email;\n\t\t\t\t$subject = \"New Password Request\";\n\t\t\t\t$txt = \"Your New Password \".$password;\n\t\t\t\t$headers = \"From: [email protected]\" . \"\\r\\n\" .\n\t\t\t\t\t\t\"CC: [email protected]\";\n\t\t\t\t\t\n\t\t\t\tmail($to,$subject,$txt,$headers);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else{\n\t\t\tthrow new Exception( FIELDS_MISSING );\n\t\t}\n\t}", "public function resetPassword()\n\t{\n\t\tif($this->session->userdata('VB_USER_ID') <> ''):\n\t\t\tredirect(base_url().'my-profile');\n\t\tendif;\n\t\t$data['error'] \t\t\t\t\t\t= \t'';\n\t\tif($this->input->post('otp')): \n\t\t\t$userData\t\t=\t$this->common_model->checkOTP(trim($this->session->userdata('VB_FORGOT_USER_PHONE')),trim($this->input->post('otp')),'users','user_password_otp');\n\t\t\tif($userData <> \"\"): \n\t\t\t\tif($userData['status'] == 'A'):\n\t\t\t\t\t$param['user_phone_otp']\t\t=\t'';\n\t\t\t\t\t$param['password']\t\t\t\t=\t$this->common_model->encriptPassword(trim($this->input->post('password')));\n\t\t\t\t\t$this->common_model->editData('vb_users',$param,'user_id',$userData['user_id']);\n\t\t\t\t\t$this->session->unset_userdata('VB_FORGOT_USER_PHONE');\n\t\t\t\t\techo \"success\";die;\n\t\t\t\telse:\n\t\t\t\t\techo \"blocked\";die;\n\t\t\t\tendif;\n\t\t\telse:\n\t\t\t\techo \"wrongotp\";die;\n\t\t\tendif;\n\t\tendif;\n\t\t$this->layouts->set_title(stripcslashes('Reset Password | VBloggers'));\n\t\t$this->layouts->set_keyword(stripcslashes('Reset Password | VBloggers'));\n\t\t$this->layouts->set_description(stripcslashes('Reset Password | VBloggers'));\n\t\t\n\t\t$this->layouts->login_view('user/resetpassword',array(),$data);\n\t}", "public function forget($user){\n $reset = md5(time()*5);\n //update database\n $this->pdo->prepare('UPDATE users SET reset = ? WHERE id = ?')->execute([$reset, $user]);\n mail($_POST['email'], \"Réinitialisation de votre mot de passe\", \"Afin de réinitialiser votre mot de passe merci de cliquer sur ce lien:\\n\\nhttp://localhost/tp_member_php/reset/user/$user/$reset\");\n }", "public function otpResetPassword()\n {\n $this->setRules([ StringLiterals::EMAIL => 'required|max:100|email','access_otp_token' => 'required|numeric','acesstype' => StringLiterals::REQUIRED,StringLiterals::PASSWORD => 'required|min:6',\n //'password_confirmation' => 'required|same:password|min:6' \n ]);\n $this->_validate();\n $this->_customer = $this->_customer->where([ 'email' => $this->request->email,'access_otp_token' => $this->request->access_otp_token ])->first();\n if (isset($this->_customer) && is_object($this->_customer) && ! empty($this->_customer->id)) {\n $this->_customer->access_token = $this->randomCharGen(30);\n $this->_customer->access_otp_token = '';\n $this->_customer->acesstype = $this->request->acesstype;\n $this->_customer->password = Hash::make($this->request->password);\n if ($this->_customer->save()) {\n return true;\n }\n }\n return false;\n }", "function reset() {\n $this->wait();\n $viewret = $this->view();\n if($viewret == ''){\n return '';\n }\n //print $viewret.'<br>';\n $pageRet = $this->net_c->get($viewret);\n $rid = $this->parseRidValue($pageRet);\n if($rid == ''){\n return '';\n }\n\n $str = null;\n $strPol = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n $max = strlen($strPol)-1;\n for($i=0;$i<10;$i++){\n $str.=$strPol[rand(0,$max)];\n }\n $this->password = $str;\n\n $data = array('password'=>$this->password, 'password_confirm'=>$this->password, 'rid'=>$rid);\n\n //print $this->mailaddr.'<br>';\n //print $this->password.'<br>';\n //print $rid.'<br>';\n //print $data.'<br>';\n\n require_once('idd.php');\n $db = new IdoDB();\n $db->update($this->mailaddr,'passwd',$this->password);\n\n $this->net_c->post('https://www.dmm.co.jp/my/-/passwordreminder/complete/',$data);\n \n return $this->password;\n }", "function update_forgot_password($user, $token, $expires);", "public function ForgotPassword($email)\n {\n $link = base_url(\"admin/redefine-password/{$email['user_uuid']}\");\n\n // PHPMailer object\n $mail = $this->phpmailer_lib->load();\n\n // SMTP configuration\n $mail->isSMTP();\n $mail->SMTPAuth = true;\n $mail->Host = getenv('MAIL_HOST');\n $mail->Username = getenv('MAIL_USER');\n $mail->Password = getenv('MAIL_PASS');\n $mail->Port = intval(getenv('MAIL_PORT'));\n\n $mail->setFrom(getenv('MAIL_USER'), \"Sistema - \" . getenv('SIS_NAME'));\n $mail->addReplyTo(getenv('MAIL_USER'), \"Sistema - \" . getenv('SIS_NAME'));\n\n // Add a recipient\n $mail->addAddress($email['user_email'], $email[\"user_name\"]);\n\n // Email subject\n $mail->Subject = 'Redefinir senha';\n\n // Charset\n $mail->CharSet = 'utf-8';\n\n //Language\n $mail->SetLanguage('pt-Br');\n\n\n // Set email format to HTML\n $mail->isHTML(true);\n\n // Email body content\n $mailContent = \"\n <div style=\\\"margin:0;padding:0;background-color:#f0f0f0;\\\">\n <div style=\\\"background-color:#f0f0f0; padding:5px;\\\">\n <div style=\\\"font-size:10px;line-height:10px\\\">&nbsp;</div>\n <table style=\\\"border-collapse:collapse;table-layout:fixed; margin: 20px auto 0;word-wrap:break-word;word-break:break-word;background-color:#ffffff\\\" align=\\\"center\\\">\n <tbody>\n <tr>\n <td style=\\\"padding:0;text-align:left;vertical-align:top;color:#787778;font-size:14px;line-height:21px;font-family:Ubuntu,sans-serif;width:600px\\\">\n <div style=\\\"Margin-left:20px;Margin-right:20px;Margin-top:24px\\\">\n <div style=\\\"line-height:20px;font-size:1px\\\">&nbsp;</div>\n </div>\n <div style=\\\"Margin-left:20px;Margin-right:20px\\\">\n <h1 style=\\\"Margin-top:0;Margin-bottom:0;font-style:normal;font-weight:normal;color:#565656;font-size:36px;line-height:43px;text-align:center\\\">\n <strong>Redefinir Senha</strong>\n </h1>\n <p>Olá, <b>{$email['user_name']}!</b>.<br/></p>\n <p style=\\\"background-color: #eeeeee; padding: 15px; position: relative; left: -15px;\\\">\n Para garantir uma boa prática de que você realmente pediu para redefinir a senha acesse o link abaixo, pedimos que todos os usuários confirmem a titularidade do e-mail. Assim evitamos enviar mensagens para alguém que não queira recebê-las. <br>\n Clique no <b>LINK</b> abaixo para <b>REDEFINIR A SENHA</b>.\n </p>\n <br/>\n <a href=\\\"{$link}\\\" style=\\\"font-family:'Arial',sans-serif; font-size: 17px; background-color: #5cb85c; padding: 15px; color: #FFFFFF; text-decoration: none;\\\">REDEFINIR A SENHA</a>\n <br/>\n <br/>\n <p>Este e-mail é enviado pelo sistema, por favor não o responda.<br/>Qualquer dúvida entre em contato pelo e-mail <b>\" . getenv('MAIL_SUPORTE') . \"</b>.</p>\n </div>\n <div style=\\\"Margin-left:20px;Margin-right:20px\\\">\n <div style=\\\"line-height:10px;font-size:1px\\\">&nbsp;</div>\n </div>\n <div style=\\\"Margin-left:20px;Margin-right:20px\\\">\n <div style=\\\"line-height:10px;font-size:1px\\\">&nbsp;</div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n <table cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" width=\\\"600\\\" align=\\\"center\\\" bgcolor=\\\"#e0ddd6\\\" border=\\\"0\\\" style=\\\"margin-bottom:20px;\\\">\n <tbody>\n <tr>\n <td width=\\\"15\\\"></td>\n <td>\n <table cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" width=\\\"600\\\" align=\\\"center\\\" bgcolor=\\\"#666666\\\" border=\\\"0\\\" style=\\\"border-bottom-left-radius:4px;border-bottom-right-radius:4px\\\">\n <tbody>\n <tr>\n <td height=\\\"14\\\">\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n <td width=\\\"15\\\"></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n \";\n\n $mail->Body = $mailContent;\n\n // Send email\n if(!$mail->send()):\n return $mail->ErrorInfo;\n \n else: \n return true;\n\n endif;\n }", "public function showForgetPasswordForm()\n { \n \n if(request()->isPost()) {\n \n $inputs = request()->get();\n\n $validator = new ForgetpassValidator;\n $validation = $validator->validate($inputs);\n\n if (count($validation)) {\n session()->set('input', $inputs);\n\n return redirect()->to(url()->previous())\n ->withError(ForgetpassValidator::toHtml($validation));\n }\n\n try {\n $token = bin2hex(random_bytes(100));\n\n $user = $this->userService->getFirstByEmail( $inputs['email']);\n $params = $this->userService->resetPassword($user, $token);\n\n queue(\n // 'Components\\Queue\\Email@registeredSender',\n \\Components\\Queue\\Email::class,\n [\n 'function' => 'registeredSender',\n 'template' => 'emails.forgetpass',\n 'to' => $inputs['email'],\n 'url' => route('showResetPasswordForm', ['token' => $token , 'id' => $user->getId() ]),\n 'subject' => 'You tried to reset your password.',\n ]\n );\n \n } catch (EntityException $e) {\n return redirect()->to(url()->previous())\n ->withError(lang()->get('responses/forgetpass.wait_more', ['time' => $e->getMessage() ]));\n\n \n } catch (EntityNotFoundException $e) {\n return redirect()->to(url()->previous())\n ->withError(lang()->get('responses/forgetpass.no_email'));\n }\n\n return redirect()->to(route('showLoginForm'))\n ->withSuccess(lang()->get('responses/forgetpass.creation_success'));\n\n }\n \n # find session if it has an 'input'\n if (session()->has('input')) {\n\n # get the session 'input' then remove it\n $input = session()->get('input');\n session()->remove('input');\n\n # set the tag 'email' to rollback the value inputted\n tag()->setDefault('email', $input['email']);\n }\n\n return view('auth.showForgetPasswordForm');\n }", "public function testSendsPasswordResetEmail()\n {\n $user = factory(User::class)->create();\n $this->expectsNotification($user, ResetPassword::class);\n $response = $this->post('password/email', ['email' => $user->email]);\n $response->assertStatus(302);\n }", "public function forget()\n\t{\n\t\t//$errMsg[$emailData['errors']]['email'] = $emailData['email'];\n\t\t$email = Validation('email','EMAIL_REF');\n\t\t$errMsg[$email['errors']]['email'] = $email['email'];\n\t\tif(count(@$errMsg['errors']) > 0)\n\t\t{\n\t\t\t@$errMsg['message'] ='error message';\n\t\t\techo json_encode($errMsg);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$postData = xssCleanValidate($_POST);\t\t\t\t\n\t\t\t$check_email = $this->db->get_where('user', array('user_email' => $postData['email']))->row();\n\t\t\tif(count($check_email) > 0)\n\t\t\t{\n\t\t\t\t$token_id = md5(uniqid(mt_rand()));\n\t\t\t\t$resetPassLink = base_url().'home/resetpassword?tokenidxs='.$token_id;\n\t\t\t\t$data['resetPassLink'] = $resetPassLink;\n\t\t\t\t$data['first_name'] = ucfirst($check_email->user_fname.' '.$check_email->user_lname);\n\t\t\t\t$data['email'] = $postData['email'];\n\n\t\t\t\t$subject = \"Forgot Password\";\n\t\t\t\t//$message_body = '';\n\t\t\t\t//$message_body .= 'Dear '.$data['first_name'];\n\t\t\t\t//$message_body .= PHP_EOL.\"Recently a request was submitted to reset a password for your account. If this was a mistake, just ignore this email and nothing will happen. To reset your password\";\n\t\t\t\t//$message_body .= PHP_EOL.\"visit the following link: <a href='.$resetPassLink.'>click here</a>\";\n\t\t\t\t//$message_body .= PHP_EOL.\"Regards\";\n\t\t\t\t//$message_body .= PHP_EOL.\"uozef\";\n\n\t\t\t\t$message_body = strip_tags($this->load->view('/mail/forgotPassword.php', $data, true));\n\t\t\t\t$this->send_mail($postData['email'],$subject,$message_body);\t\t\t\n\t\t\t\t// Insert Into Database\n\t\t\t\t$CreateDate = date(\"Y-m-d\");\n\t\t\t\t$CreateTime = date(\"H:i:s\");\n\t\t\t\t$duration\t= '+15 minutes';\n\t\t\t\t$ExpiryTime = date('H:i:s', strtotime($duration, strtotime($CreateTime)));\n\n\t\t\t\t$insert_data = array(\n\t\t\t\t\t'user_email' => $postData['email'], \n\t\t\t\t\t'user_token' => $token_id, \n\t\t\t\t\t'created_date' => $CreateDate, \n\t\t\t\t\t'CreateTime' => $CreateTime, \n\t\t\t\t\t'ExpiryTime' => $ExpiryTime\n\t\t\t\t);\n\t\t\t\t$this->db->insert('forgotpassword', $insert_data);\n\t\t\t\t\n\t\t\t\t$data['status'] \t= \t\"success\";\n\t\t\t\t$data['back_url'] \t= \tbase_url('home');\n\t\t\t\t$data['message'] \t=\t'Please check your email';\n\t\t\t\techo json_encode($data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = \"failure\";\n\t\t\t\t$data['back_url'] = \"\";\n\t\t\t\t$data['message'] ='This email address is not register with us';\n\t\t\t\techo json_encode($data);\t\n\t\t\t}\n\t\t}\n\t}", "function forget_password($email)\n\t{\n\t $this->db->select('username,password');\n\t\t$this->db->from('es_admin');\n\t\t$this->db->where('email ', $email); \n\t\t$query = $this->db->get();\n\n\t\tif($query->num_rows() >0 ) \n\t\t{\n\t\t $pass_key\t= md5( $email .\"_\". time() );\n\t\t\t$this->update_pass_reset_key($email, $pass_key );\n\t\t \t$to = $email; \n\t\t\t$subject = 'Password Reset'; \n\t\t\t$message= 'To reset your password, click the link below:</br><a href=\"' . base_url().('password/reset/' . $pass_key ) . '\" >Reset admin Account Password.</a>'; \n\t\t\t$headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n\t\t\t$headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n\t\t\t$headers .= 'From: <\"[email protected]\">' . \"\\r\\n\";\n\t\t\t$send = mail($to, $subject, $message,$headers);\n\n\t\t\treturn $msg = \"You should receive an email shortly.\";\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn $msg = \"There is no admin account associated with this email!\";\n\t\t}\n\t}", "public function forgetpassword(){\n $data['page'] = 'ForgotPassword';\n $data['title'] = 'DCP - Forgot Password';\n if($this->input->post()){\n //$setting = settings();\n $res = $this->login_model->get_data_by('user', $this->input->post('femail'), 'u_email',1);\n // print_r($res) ; exit; \n if(isset($res[0]->id) && $res[0]->id != '') { \n\n $var_key = $this->getVarificationCode(); \n $this->login_model->updateRow('user', 'id', $res[0]->id, array('var_key' => $var_key));\n $sub = \"Reset password\";\n $email = $this->input->post('femail');\n \n \n $body = 'thia ia test';\n \n \n //if($setting['mail_setting'] == 'php_mailer') {\n // $this->load->library(\"send_mail\"); \n //$emm = $this->send_mail->email($sub, $body, $email, $setting);\n //}else {\n // content-type is required when sending HTML email\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\n $headers .= \"From:[email protected]\".\"\\r\\n\";\n $emm = mail($email,$sub,$body[0],$headers);\n // }\n if($emm) {\n $this->session->set_flashdata('msg', 'To reset your password, link has been sent to your email');\n redirect( base_url().'login','refresh');\n }\n } else { \n $this->session->set_flashdata('forgotpassword', 'This account does not exist');//die;\n redirect( base_url().\"login/forgetpassword\");\n }\n } else {\n \n $this->load->view('admin/forget_password', $data);\n }\n }", "public function sendPasswordResetRequest() {\r\n\t\t$user_model = $this->load_model('UserModel');\t\r\n\t\t$user_data = $user_model->getUserByEmail($this->params['forgotten_password_email']);\r\n\t\t\r\n\t\tif($user_data !== null){\r\n\t\t\t$password_reset = $this->generatePasswordResetLink($user_data['ID'], $this->params['forgotten_password_email']);\r\n\t\t\t\r\n\t\t\t$password_reset_model = $this->load_model('PasswordResetModel');\r\n\t\t\t$password_reset_model->insertHash($user_data['ID'], $password_reset['hash']);\r\n\t\t\t\r\n\t\t\tif(Utils::sendPasswordResetEmail($this->params['forgotten_password_email'], $password_reset['link'])){\r\n\t\t\t\t$this->sendResponse(1, true);\r\n\t\t\t} else {\r\n\t\t\t\t$this->sendResponse(0, ErrorCodes::EMAIL_ERROR);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t$this->sendResponse(0, array('field' => 'forgotten_password_email', 'error_code' => ErrorCodes::EMAIL_NOT_FOUND));\r\n\t\t}\r\n\t}", "public function forgot()\n\t{\n\t\t/**\n\t\t* Intilize Url class for post and get request\n\t\t**/\n\t\t$email = $this->url->post('mail');\n\t\t/** \n\t\t* Check submit is POST request \n\t\t* Validate input field\n **/\n\t\tif (!isset($_POST['forgot']) || !$this->validateForgot($email)) {\n\t\t\t$this->session->data['error'] = 'Warning: Please enter valid data in input box.';\n\t\t\t$this->url->redirect('forgot');\n\t\t}\n\n\t\t$token = $this->url->post('_token');\n\t\t$token_check = hash('sha512', TOKEN . TOKEN_SALT);\n\t\tif (hash_equals($token_check, $token) === false ) {\n\t\t\t$this->session->data['error'] = 'Warning: Invalid token. Please try again.';\n\t\t\t$this->url->redirect('forgot');\n\t\t}\n\n\t\t/** \n\t\t* If the user exists\n\t\t* Check his account and login attempts\n\t\t* Get user data \n **/\n\t\t$this->loginModel = new Login();\n\t\tif ($user = $this->loginModel->checkUserEmail($email)) {\n\t\t\t/** \n\t\t\t* Check Login attempt\n\t\t\t* The account is locked From too many login attempts \n **/\n\t\t\tif (!$this->checkLoginAttempts($email)) {\n\t\t\t\t$this->session->data['error'] = 'Warning: Your account has exceeded allowed number of login attempts. Please try again in 1 hour.';\n\t\t\t\t$this->url->redirect('forgot');\n\t\t\t} elseif ( $user['status'] != \"1\" ) {\n\t\t\t\t$data['hash'] = md5(uniqid(mt_rand(), true));\n\t\t\t\t$data['email'] = $email;\n\t\t\t\t$data['name'] = $user['name'];\n\t\t\t\t$this->loginModel->editHash($data);\n\t\t\t\t$this->forgotMail($data);\n\t\t\t\t$this->session->data['success'] = 'Success: Reset instruction sent to your E-mail address.';\n\t\t\t\t$this->url->redirect('login');\n\t\t\t} else {\n\t \t/** \n\t \t* If account is disabled by admin \n\t\t * Then Show error to user\n\t\t **/\n\t \t$this->session->data['success'] = 'Success: Your account has disabled by admin, For more info contact us.';\n\t \t$this->url->redirect('login');\n\t }\n\n\t\t\t/** \n\t\t\t* User exists now We check if\n\t\t\t* Send Mail to user for reset password\n **/\n\n\t\t} else {\n\t\t\t$this->session->data['error'] = 'Warning: Account does not exists.';\n\t\t\t$this->url->redirect('forgot');\n\t\t}\n\t}", "public function forgot_password()\n\t{\n\t\t$email = Input::get('email');\n\n\t\t//Get reset code and send email\n\t\tif($resetCode = $this->repo->getResetCode($email))\n\t\t{\n\t\t\treturn View::make('authentication.confirm_reset_code_sent')->with('email',$email)->with('resetCode',$resetCode);\n\t\t}\n\t\treturn View::make('authentication.forgot_password')->withInput(Input::all()); \n\t}", "function testForgotPassword()\n {\n $result = $this->mailgunModel->forgotPassword($this->dataTest->to,\n $this->dataTest->pass,\n $this->dataTest->html\n );\n $this->assertEquals(\"200\", $result->http_response_code);\n $this->assertEquals(\"Queued. Thank you.\", $result->http_response_body->message);\n $this->assertNotNull($result->http_response_body->id);\n }", "static function password_forgot() {\n parent::password_forgot();\n view_var('user', globals('user'));\n }", "public function passwordForgotConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $validator = $this->view->validator;\n\n // set the input params\n $requiredParams = array(\n 'emailAddress',\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( 'authPasswordForgot' );\n }\n\n $inputEmail = $input->emailAddress;\n\n $user = $site->getUserByEmailAddress( $inputEmail );\n\n $validator->checkValidUser( $user, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authPasswordForgot' );\n }\n\n if ( $user->getUserType() == BeMaverick_User::USER_TYPE_KID ) {\n $emailAddress = $user->getParentEmailAddress();\n } else {\n $emailAddress = $user->getEmailAddress();\n }\n\n $resetPasswordUrl = BeMaverick_Email::getResetPasswordUrl( $site, $user );\n\n // send mail to recover your password\n $vars = array(\n 'RESET_PASSWORD_URL' => $resetPasswordUrl,\n );\n\n BeMaverick_Email::sendTemplate( $site, 'user-forgot-password', array( $emailAddress ), $vars );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authPasswordForgot' );\n }\n\n return $this->renderPage( 'authPasswordForgotConfirm' );\n }", "public function forgotPassword()\n\t{\n\t\tif($this->session->userdata('VB_USER_ID') <> ''):\n\t\t\tredirect(base_url().'my-profile');\n\t\tendif;\n\n\t\t$data['error'] \t\t\t\t\t\t= \t'';\n\t\t\n\t\tif($this->input->post('mobile_number')):\n\t\t\t$mobile_number \t=\ttrim($this->input->post('mobile_number'));\n\t\t\t$result \t\t=\t$this->common_model->getAllData('vb_users','mobile_number',$mobile_number,'','','single');\n\t\t\tif($result):\t\n\t\t\t\tif($result['status'] != 'A'):\t\n\t\t\t\t\techo \"blocked\";die;\n\t\t\t\telse:\t\n\t\t\t\t\t$param['user_password_otp']\t\t=\t4321;/*generateRandomString(4,'n');*/\n\t\t\t\t\t$this->common_model->editData('vb_users',$param,'user_id',$result['user_id']);\n\t\t\t\t\t$this->session->set_userdata('VB_FORGOT_USER_PHONE',$result['mobile_number']);\n\t\t\t\t\techo \"success\";die;\n\t\t\t\tendif;\n\t\t\telse:\n\t\t\t\techo \"noaccount\";die;\n\t\t\tendif;\n\t\tendif;\n\t\t\n\t\t$this->layouts->set_title(stripcslashes('Forgot Password | VBloggers'));\n\t\t$this->layouts->set_keyword(stripcslashes('Forgot Password | VBloggers'));\n\t\t$this->layouts->set_description(stripcslashes('Forgot Password | VBloggers'));\n\t\t\n\t\t$this->layouts->login_view('user/forgotpassword',array(),$data);\n\t}", "public function forgot()\n {\n $useremail = $this->input->post(EMAIL);\n $this->load->model('booking/Bookingmodel');\n $constants = $this->Bookingmodel->getConstants();\n $user = $this->user->get_user_by_email_password($useremail);\n if ($user) {\n $slug = md5($user->userID . $user->emailID);\n $message = '<img src=\"' . base_url('assets/images/logo.png') . '\" border=\"0\"><br>It looks like you forgot your password. No problem, we’ll get this cleared up.<br><br>\n <b>To reset your password please click the link below and follow the instructions:</b><br><br>\n **<a href=\"' . base_url('login/reset/' . $user->userID . '/' . $slug) . '\"> ' . base_url('login/reset/' . $user->userID . '/' . $slug) . '</a>\n <br><br>\n If you did not request to reset your password then please ignore this email and no changes will occur.';\n $this->load->library(EMAIL);\n $this->email->from($constants->fromEmail);\n $this->email->to($useremail);\n $this->email->subject('Reset Password');\n $this->email->message($message);\n if (!$this->email->send()) {\n $emailInfo['emailStatus'] = 0;\n $emailInfo['toEmail'] = $useremail;\n $emailInfo['fromEmail'] = $constants->fromEmail;\n $emailInfo['content'] = $message;\n $emailInfo['subject'] = 'Reset Password';\n $this->load->model('profile/Profilemodel');\n $this->Profilemodel->saveEmailStatus($emailInfo);\n }\n echo \"1\";\n } else {\n echo \"0\";\n }\n }", "public function forgetpass($data){\n\n\n \t\t$q = \"SELECT * FROM user_table WHERE email='$data[email]'\";\n\n\n \t\t$result = $this->connection->query($q);\n\n \t\tif($result->num_rows>0){\n\n \t\t\t/* to access the email and password from database */\n\n \t\t\t$r = $result->fetch_assoc();\n\t\t\t\t$password = $r['password'];\n\t\t\t\t$to = $r['email'];\n\t\t\t\t$subject = \"Your Recovered Password\";\n\n\t\t\t\t$message = \"Please use this password to login \" . $password;\n\t\t\t\t$headers = \"From : [email protected]\";\n\n\t\t\t\tif(mail($to, $subject, $message, $headers)){\n\n \t\t\t$_SESSION['sent'] = \"Password sent to email\";\n\n \t\t}\n \t}\n \t\telse{\n\n \t\t\t$_SESSION['sent_err'] = \"Email does not exist\";\n \t\t}\n\n \n }", "public function resetPassword()\n\t{\n\n\t\tif ($this->common->isLoggedIn()) {\n\t\t\t$this->url->redirect('dashboard');\n\t\t}\n\n\t\t$data['error'] = '';\n\t\tif (isset($this->session->data['error'])) {\n\t\t\t$data['error'] = $this->session->data['error'];\n\t\t\tunset($this->session->data['error']);\n\t\t}\n\n\t\t$data['success'] = '';\n\t\tif (isset($this->session->data['success'])) {\n\t\t\t$data['success'] = $this->session->data['success'];\n\t\t\tunset($this->session->data['success']);\n\t\t}\n\t\t$data['mail'] = $this->url->get('id');\n\t\t$data['hash'] = $this->url->get('temp');\n\t\t\n\t\tif (empty($data['mail']) && empty($data['hash']) ) {\n\t\t\t$this->url->redirect('login');\n\t\t}\n\t\t$this->loginModel = new Login();\n\t\tif (!$this->loginModel->checkEmailHash($data)) {\n\t\t\t$this->url->redirect('login');\n\t\t}\n\t\t\n\t\t$data['info'] = $this->commons->getInfo();\n\n\t\t/*Load Language File*/\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/common.php';\n\t\t$data['lang']['common'] = $lang;\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/login.php';\n\t\t$data['lang']['login'] = $login;\n\t\t\n\t\t$data['token'] = hash('sha512', TOKEN . TOKEN_SALT);\n\t\t$data['action'] = URL.DIR_ROUTE.'reset';\n\t\t$this->view->render('auth/reset_password.tpl', $data);\n\t}", "public function send_pw_reset_email($to,$id) {\r\n \r\n $full_url= BASE_URL . \"/#/reset_pw/\" . $id;\r\n $this->mail->addAddress($to); // Add a recipient\r\n $this->mail->Subject = PW_RESET_SUBJECT;\r\n $this->mail->Body = strtr (PW_RESET_BODY, array ('{{res_link}}' => $full_url));;\r\n //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';\r\n $resp = $this->mail->send();\r\n return $resp;\r\n }", "public function forget() {\n\n\t\t$user = new \\M5\\Models\\Users_Model('',true,__METHOD__);\n\n\t\t$forget_aproach = $user->getPref(\"forget_aproach\");\n\t\t$this->request->forget_form = $forget_aproach;\n\n\t\t/*forget by email */\n\t\tif($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && $forget_aproach != \"question\")\n\t\t{\n\t\t\textract($_POST);\n\n\t\t\t/* Check captcha*/\n\t\t\tcaptcha_ck(\"captcha\", \" رمز التحقق البشري غير صحيح! \" );\n\n\t\t\t/* Check email syntax*/\n\t\t\tif(!filter_var($email, FILTER_SANITIZE_EMAIL) ){\n\t\t\t\t$msg = pen::msg(\"صيغة الايميل غير صحيحة\");\n\t\t\t\techo $msg;\n\t\t\t\tdie();\n\t\t\t}\n\t\t\t// $user->set(\"printQuery\");\n\n\t\t\t/* mysql: Fetch data by email*/\n\t\t\t$cond = \" && email = '$email'\";\n\t\t\t$r = $user->_one('',$cond);\n\n\t\t\t/* Check email */\n\t\t\tif(!$r['email']){\n\t\t\t\techo $msg = pen::msg(string('forget_msg_fail'),'alert alert-danger _caps');\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t/* prepare forget item*/\n\t\t\t$rand = substr( md5(rand(100,99999999)),\"0\",\"10\" );\n\n\t\t\t$temp_forget_args =\n\t\t\t[\n\t\t\t\"name\" => $email,\n\t\t\t\"type\" => \"resetAdmin\",\n\t\t\t\"ava\" => $rand,\n\t\t\t\"st\" => 0\n\t\t\t];\n\t\t\tif( $user->insert($temp_forget_args,\"types\",0))\n\t\t\t{\n\n\t\t\t\t/*Send activation link*/\n\t\t\t\t$subj = site_name.\" - \".string(\"reasign_admin_ttl\");\n\t\t\t\t$reciver = $email;\n\t\t\t\t$sender = mail_from;\n\t\t\t\t$link = url().\"admin/index/do/reset/$rand\";\n\t\t\t\t$msg = $logo.'<div>مرحباً </div><br />';\n\t\t\t\t$msg .= '<div>اسم الدخول: '.$r['user'].'</div>';\n\t\t\t\t$msg .= '<div>'.string(\"reasign_admin_ttl\").': </div>'.$link;\n\t\t\t\t$msg .= '<div><br /><hr>'.site_name.'</div>';\n\t\t\t\t$msg .= '<div>'.url().'</div>';\n\n\t\t\t\tif(Email::smtp($subj, $reciver, $sender, $msg) ){\n\t\t\t\t\t// echo $msg;\n\t\t\t\t\techo $msg = pen::msg(string('forget_msg_success / '.$email),'_caps alert alert-info');\n\t\t\t\t\tSession::set(\"captcha\",123);\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}else{\n\t\t\t/*forget by answer security question */\n\n\t\t}\n\n\t}", "public function forgetpass(Request $request)\n {\n $postdata = file_get_contents(\"php://input\");\n\t $requests=json_decode($postdata,true);\n \n\t$messags = array();\n $were= ['email'=> $requests['email']];\n\n /* match email is exists or not */\n $user = User::getbycondition($were);\n \n foreach($user as $u){\n $r = $u;\n }\n\n if(count($user)!=0)\n {\n $id = $r->id; \n $name = $r->name;\n $hash = md5(uniqid(rand(), true));\n $string = $id.\"&\".$hash;\n $iv = base64_encode($string);\n $htmls = Config::get('constants.Forgetpass_html');\n $header = Config::get('constants.Forgetpass_header');\n $buttonhtml = Config::get('constants.Forgetpass_btn_html');\n $pass_url = url('reset_passwords/'.$iv); \n $path = url('resources/views/email.html');\n $email_path = file_get_contents($path);\n $cur_year = date('Y');\n $email_content = array('[name]','[pass_url]','[htmls]','[buttonhtml]','[header]','[cur_year]');\n $replace = array($name,$pass_url,$htmls,$buttonhtml,$header,$cur_year);\n $message = str_replace($email_content,$replace,$email_path);\n $subject = Config::get('constants.Forgetpass_subject');\n $header = 'From: '.env(\"IMAP_HOSTNAME_TEST\").'' . \"\\r\\n\";\n $header .= \"MIME-Version: 1.0\\r\\n\";\n $header .= \"Content-type: text/html\\r\\n\";\n $retval = mail($r->email,$subject,$message,$header); \n\n /* send email for the resetpassword */\n\n if($retval)\n {\n /* update token in data base */\n DB::table('users')\n ->where(['email'=> $r->email])\n ->update(\n ['forget_pass' => $iv]\n );\n $messags['message'] = \"We have e-mailed your password reset link!\";\n $messags['status'] = 1;\n $messags['data'] = 'null';\n }else\n {\n DB::table('users')\n ->where(['email'=> $r->email])\n ->update(\n ['forget_pass' => ' ']\n );\n } \n \n }else\n {\n $messags['message'] = \"Email does not exists.\";\n $messags['status']= 0;\n $messags['data']= 'Null'; \n\t\t\t\t }\n echo json_encode($messags);\n die;\n }", "function forgotPassword(){\n\t\t\t$this->__dataDecode();\n\t\t\tif(!empty($this->data)){\n\t\t\t$data = $this->data;\n\t\t\t$username = $data['User']['userName'];\n\t\t\t$userDetail = $this->User->find('first',array('conditions'=>array(\"User.username \"=> $username)));\n\t\t\tif($username==null){\n\t\t\t\techo $username;\n\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t$response['response']['message']\t= 'please Enter userName';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\telse{ \n\t\t\t\t$userID = $userDetail['User']['id'];\n\t\t\t\t$data = $this->data;\n\t\t\t\t$email_to = $userDetail['User']['email'];\n\t\t\t\tif($userDetail['User']['username'] == ($username)){\n\t\t\t\t\t$password= $this->createRandomPassword();\n\t\t\t\t\t$new_password=md5($password);\n\t\t\t\t\t$this->User->id = $userID;\n\t\t\t\t\t$this->data['User']['password'] = trim($new_password);\n\t\t\t\t\tunset($this->User->validate['password']);\n \t\t\t\t\tunset($this->User->validate['confirm_password']);\n\t\t\t\t\tif($this->User->save($this->data)){\n\t\t\t\t\t\t//Default Mail component is called, to send mail. We are setting the variables for sending email\n\t\t\t\t\t\t$this->Email->to = $email_to;\n\t\t\t\t\t\t//$this->Email->bcc = array($adminEmail);\n\t\t\t\t\t\t$this->Email->subject = 'Your password here';\n\t\t\t\t\t\t$this->Email->replyTo = EMAIL_REPLY;\n\t\t\t\t\t\t$this->Email->from = \"iWrestled admin <\".EMAIL_REPLY.\">\";\n\t\t\t\t\t\t//Here, the element in /views/elements/email/html/ is called to create the HTML body\n\t\t\t\t\t\t$this->Email->template = 'simple_message'; // note no '.ctp'\n\t\t\t\t\t\t//Send as 'html', 'text' or 'both' (default is 'text')\n\t\t\t\t\t\t$this->Email->sendAs = 'both'; // because we like to send pretty mail\n\t\t\t\t\t\t//Set view variables as normal\n\t\t\t\t\t\t$this->set('userDetail', $userDetail);\n\t\t\t\t\t\t$this->set(\"password\", $password);\n\t\t\t\t\t\t//Do not pass any args to send()\n\t\t\t\t\t\tif($this->Email->send()){\n\t\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'success';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Password send to your email id';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\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$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Password Enter valid email id';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "function forgotPassword($emailTO) {\n global $user, $pass;\n\n return $params = array(\n 'api_user' => $user,\n 'api_key' => $pass,\n 'to' => $emailTO,\n 'subject' => 'E-Mart: Reset password',\n 'html' => \"<html>\n <head></head>\n <body>\n <p>You have been outbid by another bidder.\n Please click on the link below to bid agiain:<br>\n <span><a href=\\\"www.e-mart.azurewebsites.net\\\">URL</a></span>\n </p>\n </body>\n </html>\",\n 'text' => 'testing body',\n 'from' => '[email protected]'\n );\n}", "function forget_password()\n\t{\n\t\tif(!empty($this->data))\n\t\t{\n\t\t\t$val = $this->data['User']['email'];\n\t\t\t$condition['conditions'] = array(\"User.email\" => $val, \"User.status !=\" =>2 );\n\t\t\t$condition['recursive']= -1;\n\t\t\t$condition['limit']= 1;\n\n\t\t# getting userdata\n\t\t\t$datalist = $this->User->find('first', $condition);\n\t\t\t//debug($datalist);\n\t\t//\texit;\n\t\tif (isset($datalist) && !empty($datalist['User']['email']))\n\t\t{\n\t\t\tif($datalist['User']['status'] == 2)\n\t\t\t{\n\t\t\t\t$this->Session->setFlash(__('<div class=\"errorCommnt\" id=\"server_message\">The account is Blocked. Please contact Administrator !</div>',true));\n\t\t\t\t$this->redirect(array('controller' => 'users','action' => 'forget_password'));\n\t\t\t}\n\t\t\tif($datalist['User']['status'] == 0)\n\t\t\t{\n\t\t\t\t$this->data['User']['email'] = '';\n\t\t\t\t$this->Session->setFlash(__('<div class=\"errorCommnt\" id=\"server_message\">Email address does not exist !</div>',true));\n\t\t\t\t$this->redirect(array('controller' => 'users','action' => 'forget_password'));\n\t\t\t} else {\n\t\t\t\t//$this->randomnumber();\n\t\t\t\t$uniqueid = substr(rand(),0,5);\n\t\t\t\t$this->data['User']['password'] = $this->Auth->password($uniqueid);\n\t\t\t\t$this->data['User']['id'] = $datalist['User']['id'];\n\t\t\t\t$result = $this->User->save($this->data);\n\t\t\t\tif($result)\n\t\t\t\t{\n\t\t\t\t\t$this->data['User']['username'] = $datalist['User']['username'];\n\t\t\t\t\t$this->data['User']['password'] = $uniqueid;\n\t\t\t\t\t\n\t\t\t\t\t$getuserinfo = $this->data['User'];\n\t\t\t\t\t$to = $datalist['User']['email'];\n\t\t\t\t\t$username = $datalist['User']['username'];\n\t\t\t\t\t$addcc = $this->User->Field('email', array('id' =>'1'));\n\t\t\t\t\t# mail Section\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->Sendemail->userforgotpassword($to, $addcc, $getuserinfo);\n\t\t\t\t\tif($result)\n\t\t\t\t\t{\n\t\t\t\t\t$this->data['User']['email'] = '';\n\t\t\t\t\t$this->Session->setFlash(__('<div class=\"successCommnt\" id=\"server_message\">Your password has been sent to your email.</div>',true));\n\t\t\t\t\t$this->redirect(array('controller' => 'users','action' => 'login'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->data['User']['email'] = '';\n\t\t\t$this->Session->setFlash(__('<div class=\"errorCommnt\" id=\"server_message\">Email address does not exist !</div>',true));\n\t\t\t$this->redirect(array('controller' => 'users','action' => 'forget_password'));\n\t\t}\n\t\t}\n\t}", "public function postForgot()\n {\n if( Confide::forgotPassword( Input::get( 'email' ) ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_forgot');\n return Redirect::to('user/login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_forgot');\n return Redirect::to('user/forgot')\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }", "function __sendForgotPasswordEmail($id = null) {\n $id = $this->request->getData('user_id');\n if (!empty($id)) {\n $user = $this->Users->get($id);\n $email = new Email();\n $email\n ->template('reset_password_request', 'default')\n ->subject('OTP Code Request - DO NOT REPLY')\n ->emailFormat('html')\n ->setViewVars(['user' => $user,\n 'password' => $password])\n ->from('[email protected]')\n ->to($user->email)\n ->send();\n\n return true;\n }\n return false;\n }", "public function sendReset($email) {\n\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return 'Invalid email address';\n }\n\n\n // check to see if the email exists\n $qry = sprintf(\"SELECT uv.userID\n FROM sysUGFValues AS uv\n INNER JOIN sysUsers AS u ON u.itemID=uv.userID\n WHERE uv.sysStatus='active'\n AND uv.sysOpen='1'\n AND u.sysStatus='active'\n AND u.sysOpen='1'\n AND uv.fieldID='3'\n AND uv.value='%s'\",\n $this->db->escape($email));\n $res = $this->db->query($qry);\n if ($this->db->num_rows($res) > 0) {\n\n $mail = new PHPMailer();\n\n while ($u = $this->db->fetch_assoc($res)) {\n\n $hash = $this->generateToken();\n\n // insert a unique hash into the DB to check on later\n $qry = sprintf(\"UPDATE sysUsers SET fpHash='%s' WHERE itemID='%d'\",\n $hash,\n $u['userID']);\n $this->db->query($qry);\n $resetLink = 'http://' . $_SERVER['HTTP_HOST'] . '/reset-password?token=' . $hash;\n\n $mail->Subject = ucwords($_SERVER['HTTP_HOST']) . \" password reset\";\n $mail->AddAddress($email);\n $mail->SetFrom('[email protected]', 'Intervue');\n\n\n $mail->Body = \"<p>Hi there,</p>\n\n <p>There was recently a request to change the password on your account.</p>\n\n <p>If you requested this password change, please set a new password by following the link below:</p>\n\n <p>{$resetLink}</p>\n\n <p>If you don't want to change your password, just ignore this message.</p>\n\n <p>Thanks</p>\";\n\n $mail->AltBody = strip_tags($mail->Body);\n\n if (!$mail->Send()) {\n return false;\n }\n\n $mail->ClearAllRecipients();\n\n }\n\n return true;\n }\n\n return 'No user found';\n }", "public function doForgotPassword()\r\n {\r\n if (Confide::forgotPassword(Input::get('email'))) {\r\n $notice_msg = Lang::get('confide::confide.alerts.password_forgot');\r\n Session::flash('systemMessages', ['notice' => [$notice_msg]]);\r\n } else {\r\n $error_msg = Lang::get('pages.login.errors.wrong_password_forgot');\r\n Session::flash('systemMessages', ['errors' => [[$error_msg]]]);\r\n }\r\n\r\n return Redirect::action('UserController@login');\r\n }", "function resetPassword($userEmail){\n\n}", "public function forgotpassword() {\n // Fetch the request data in JSON format and convert it into object\n $request_data = $this->request->input('json_decode');\n switch (true) {\n // When request is not made using POST method\n case!$this->request->isPost() :\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Wrong request method.';\n break;\n // Request is valid and phone no and name are present\n case!empty($request_data) && !empty($request_data->email):\n // && !empty($request_data->comment):\n // Check if phone no exists\n $data = $this->User->findUserByEmail(trim($request_data->email));\n\n // Check if record exists\n if (count($data) != 0) {\n\n $userEmail = $request_data->email;\n $userName = trim($data[0]['User']['name']);\n $recoveryStr = $this->generateRandomString(12);\n\n $dataArray = array();\n $dataArray['User']['_id'] = $data[0]['User']['_id'];\n $dataArray['User']['recoverystr'] = $recoveryStr;\n\n if ($this->User->save($dataArray)) {\n\n $recoveryLink = HOST_ROOT_PATH . 'recover/password/id:' . (string) $data[0]['User']['_id'] . '/rid:' . $recoveryStr;\n // send mail to user..\n $messageEmail = \"Hi $userName,<br><br>\n You can recover your password by using this link : <a href='$recoveryLink'>$recoveryLink</a><br><br>\n Regards,<br>Support Team.\";\n App::uses('CakeEmail', 'Network/Email');\n $Email = new CakeEmail();\n $Email->config('default');\n $Email->from(array(SUPPORT_SENDER_EMAIL => SUPPORT_SENDER_EMAIL_NAME));\n $Email->to($userEmail);\n $Email->addCc(SUPPORT_RECEIVER_EMAIL);\n $Email->subject(SUPPORT_SENDER_EMAIL_NAME . ' | Recover Password');\n $Email->emailFormat('html');\n $Email->send($messageEmail);\n\n $success = true;\n $status = SUCCESS;\n $message = 'Password has been sent to your email.';\n //$message = 'A password recovery link has been sent to your email.';\n } else {\n\n $success = false;\n $status = ERROR;\n $message = 'There was a problem in processing your request';\n }\n }\n // Return false if record not found\n else {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Email not registered.';\n }\n break;\n // User Email blank in request\n case!empty($request_data) && empty($request_data->email):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'User Email cannot be blank.';\n break;\n // Parameters not found in request\n case empty($request_data):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Request cannot be empty.';\n break;\n }\n\n $out = array(\n \"success\" => $success,\n \"message\" => $message\n );\n\n return new CakeResponse(array('status' => $status, 'body' => json_encode($out), 'type' => 'json'));\n }", "public function forgot($m)\n {\n $c = new Message('{\"action\": \"load\", \"urn\": \"urn:Actor:User:System\"}');\n $c->email = $m->email;\n $user = $c->deliver();\n if (count($user)) {\n // generate password\n if (SIMPLEPASSWORDS === true) {\n $newpassword = Security::generateSimplePassword();\n } else {\n $newpassword = Security::generatePassword();\n }\n // HASH user password with sha1\n $update_user = new Message();\n $update_user->action = \"update\";\n $update_user->urn = $user->urn;\n $dynamicsalt = mt_rand(1, 2147483647);\n $update_user->dynamicsalt = $dynamicsalt;\n $hashedSaltedPassword = sha1($dynamicsalt . $newpassword . SECURITY_SALT_STATIC);\n $update_user->password = $hashedSaltedPassword;\n $update_user->deliver();\n\n $user->newpassword = $newpassword;\n\n // send email, update related passworded (ftp etc)\n Broker::instance()->send($user, \"MANAGERS\", \"user.onforgot\");\n $m = new Message(array(\"notify\" => \"Password sent\"));\n if (ENV == 'DEVELOPMENT') {\n $m->newpassword = $newpassword;\n }\n return $m;\n } else {\n return new Message(array(\"error\" => \"email not registered\"));\n }\n }", "private function user_reset_password(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\tif(!isset($_POST['password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['confirm_password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter confirm_password are require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\n\t\t\t$user_id = $this->_request['table_doctor_id'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$cpassword = $this->_request['confirm_password'];\n\n\t\t\tif(!empty($password) && !empty($cpassword) ) {\n\n\t\t\t\tif($password!=$cpassword) {\n\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Password and Confirm password is not matched\");\n\t\t\t\t\t$this->response($this->json($error), 200);\n\n\t\t\t\t} else{\n\t\t\t\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t$sql = \"UPDATE table_user SET user_password='\".$hashed_password.\"' WHERE user_id='\".$user_id.\"' \";\n\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t$update = $stmt->execute();\n\t\t\t\t\t\t$fetchData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\t\t\t\tif(count($update)==1){\n\t\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Profile Updated\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function resetPasswordFromLogin()\r\n {\r\n $email = Input::get('EMAIL');\r\n $lead = Lead::where('email',$email)->first();\r\n if($lead!=null)\r\n {\r\n $lead->password = substr(md5(microtime().rand()), 0, 8);\r\n $lead->save();\r\n\r\n //Create Transaction\r\n Transaction::createTransaction('', $lead->id, '',\"RESTORE-PASSWORD\", '', '', $lead->email, '', '', $lead->phone, '');\r\n\r\n //send the new password by email\r\n mail($lead->email, 'PATENT SERVICES NEW PASSWORD', 'Your new Password is: '.$lead->password);\r\n\r\n//\r\n return \"1\";\r\n }\r\n return \"-1\";\r\n }", "function forogt_reset($post)\n{\n $data['destination'] = $post['r_email'];\n $data['subject'] = 'Pendaftaran Akun Baru Peserta Didik Portal Akademik ' . profil()->nama_sekolah;\n $data['massage'] = \"\n <p>\n <html>\n <body>\n Hallo, Permintaan reset Password berhasil, dengan rincian sebagai berikut : <br>\n Username : \" . $post['username'] . \" <br>\n Level Akun : \" . $post['level'] . \" <br>\n Tanggal Reset : \" . $post['tgl_reset'] . \" <br>\n Expired reset : \" . date('D, d M Y') . \" at 23.59 <br>\n Silahkan Klik Tombol Reset Password Dibawah ini untuk Mereset akun anda... <br>\n <center>\n <a href='\" . site_url('auth/reset/' . $post['id_user']) . '?d=' . date('dmy') . '&w=' . date('hi') . \"' target='_blank'> Reset Password </a>\n </center>\n </body>\n </html>\n </p>\n \";\n return smtp_email($data);\n}", "function forgot_password()\n {\n if ($this->tank_auth->is_logged_in()) {\t\t\t\t\t\t\t\t\t// logged in\n redirect('');\n\n\n\n } elseif ($this->tank_auth->is_logged_in(FALSE)) {\t\t\t\t\t\t// logged in, not activated\n redirect('/auth/send_again/');\n\n } else {\n $this->form_validation->set_rules('login', 'Email or login', 'trim|required|xss_clean');\n\n $data['errors'] = array();\n\n if ($this->form_validation->run()) {\t\t\t\t\t\t\t\t// validation ok\n if (!is_null($data = $this->tank_auth->forgot_password(\n $this->form_validation->set_value('login')))) {\n\n $data['site_name'] = $this->config->item('website_name', 'tank_auth');\n\n // Send email with password activation link\n\n $this->_send_email('forgot_password', $data['email'], $data);\n\n $this->_show_message($this->lang->line('auth_message_new_password_sent'));\n\n\n\n } else {\n $errors = $this->tank_auth->get_error_message();\n foreach ($errors as $k => $v)\t$data['errors'][$k] = $this->lang->line($v);\n }\n }\n $this->load->view('auth/forgot_password_form', $data);\n }\n }", "public function ResetPassword( )\n {\n\t\t\t$dataArray = array(\"email\"=>$this->email, \"password\"=>$this->password );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/ResetPassword/123\", \"json\" );\n\t\t\t\n\t\t\treturn $response;\n }", "public function forgot_password() {\n\t\t$this->output->append_title('Forgot Password');\n\t\t$data = array();\n\t\tif($this->input->post())\n\t\t{\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|required');\n\t\t\tif($this->form_validation->run() == TRUE)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$email = $this->input->post('email');\n\t\t\t\t\t$subject = 'Password Reset Confirmation';\n\t\t\t\t\t\n\t\t\t\t\t// Find the user using the user email address\n\t\t\t\t\t$user = Sentry::findUserByLogin($email);\n\t\t\t\t\t\n\t\t\t\t\t// Get the password reset code\n\t\t\t\t\t$resetCode = $user->getResetPasswordCode();\n\t\t\t\t\t$url = website_url('auth/reset/'.$resetCode);\n\t\t\t\t\t$template_data = array(\n\t\t\t\t\t\t'email_title' => 'Forgot Password',\n\t\t\t\t\t\t'email_heading' => 'Hello',\n\t\t\t\t\t\t'email_body' => 'There was recently a request to reset your password.\n\t\t\t\t\t\t<br/>If you requested this password change, please click on the following link to reset your password:<br/> <a href=\"'.$url.'\">'.$url.'</a><br/>\n\t\t\t\t\t\tIf clicking the link does not work, please copy and paste the URL into your browser instead.<br/><br/>\n\t\t\t\t\t\tIf you didn\\'t make this request, you can ignore this message and your password will remail the same.\n\t\t\t\t\t\t'\n\t\t\t\t\t);\n\n\t\t\t\t\t$body = $this->parser->parse('emails/user_registration', $template_data,TRUE);\n\t\t\t\t\tif($this->common->sendEmail($email,$subject,$body))\n\t\t\t\t\t{\n\t\t\t\t\t\t$message = array('type' => 'success','message' => 'An email has been sent to your email address with instructions to reset your password.');\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$message = array('type' => 'warning','message' => 'Unable to send email, please try again later.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n\t\t\t\t{\n\t\t\t\t\t$message = array('type' => 'danger','message' => 'Email does not exists.');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$message = array('type' => 'danger','message' => $this->message->validation_errors());\n\t\t\t}\n\t\t\t\n\t\t\t$this->message->set($message['type'], $message['message']);\n\t\t}\n\t\t\n\t\t$data['email'] = array('name' => 'email',\n\t\t\t'autofocus' => 'autofocus',\n\t\t\t'id' => 'email',\n\t\t\t'placeholder' => 'Email',\n\t\t\t'class' => 'form-control',\n\t\t\t'type' => 'text',\n\t\t\t//'value' => $this->form_validation->set_value('email')\n\t\t);\n\t\t$this->load->view(parent::$module.'/forgot_password',$data);\n\t}", "function sendPasswordResetEmail($email)\n{\n $userManager = new UserManager();\n $user_req = $userManager->getUser(\"\", $email);\n \n if ($user = $user_req->fetch())\n {\n $hash = $user['hash'];\n $to = $email;\n $subject = 'Reset your Camagru password';\n $message = '\n \n Hi there! Did you forget how to log in to your Camagru account? :(\n \n Please click this link to reset your password:\n http://localhost:8100/index.php?action=verifyAccountForReset&email='.$email.'&hash='.$hash.'\n \n ';\n \n $headers = 'From:[email protected]' . \"\\r\\n\";\n mail($to, $subject, $message, $headers);\n \n $msg = \"A link to reset your password was sent to your email address!\";\n } else {\n $msg = \"Sorry, there is no registered account for this email address :/\";\n }\n \n require('view/forgotPasswordView.php');\n}", "public function forgotpass($stat=0) {\n\t\t$this->layout = \"adminloginLayout\";\n\t\t$this->loadModel('User');\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$useremail = $this->request->data['txtEmails'];\n\t\t\t//unbind user model\n\t\t\t$this->User->unbindModel(array(\n\t\t\t\t'hasMany'=>array('UserCreditDetail','CustomerRide','DriverRide'),\n\t\t\t\t'hasOne'=>array('CustomerCustom','DriverCustom','VehicleDetail')\n\t\t\t));\n\t\t\t$findEmail = $this->User->find('first',array(\n\t\t\t\t'conditions'=> array('User.email'=>$useremail,'User.user_type'=>'1')\n\t\t\t));\n\n\t\t\tif (is_array($findEmail) && count($findEmail)>0){\n\t\t\t\t$id=$findEmail['User']['id']; \n\t\t\t\t$email = $findEmail['User']['email'];\n\t\t\t\t$name = ucwords($findEmail['User']['f_name'].\" \".$findEmail['User']['l_name']);\n\t\t\t\t\n\t\t\t\t$encriptbase= md5(\"Txc-\".rand(9999,99999).\"-\".$id);\n\t\t\t\t//unbind the user model\n\t\t\t\t$this->User->unbindModel(array(\n\t\t\t\t\t'hasMany'=>array('UserCreditDetail','CustomerRide','DriverRide'),\n\t\t\t\t\t'hasOne'=>array('CustomerCustom','DriverCustom','VehicleDetail')\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t$this->User->updateAll(array('User.passretrivestr'=>\"'\".$encriptbase.\"'\"),array('User.id'=>$id));\n\t\t\t\t//get encripted string\n\t\t\t\t$encriptlink = $this->encriptlinkstr($email,$encriptbase);\n\t\t\t\t$resetpasslink = FULL_BASE_URL.$this->base.'/users/resetpassword/'.$encriptlink;\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t$userpass= 'Taxicel-'.rand(999,99999);\n\t\t\t\t$id= $findEmail['User']['id']; \n\t\t\t\t\n\t\t\t\t$this->User->updateAll(array('User.pass'=>\"'\".md5($userpass).\"'\"),array('User.id'=>$id));\n\t\t\t\t\n\t\t\t\t$email = $findEmail['User']['email'];\n\t\t\t\t$name = $findEmail['User']['username'];\n\t\t\t\t*/\n\t\t\t\t$serverIsLocalHost = $this->serverDetect();\n\t\t\t\tif(!$serverIsLocalHost){\n\t\t\t\t\t//EMAIL TO USER\n\t\t\t\t\t$Email = new CakeEmail();\n\t\t\t\t\t$Email->template('forgot_pass','complaint_email');\n\t\t\t\t\t$Email->viewVars(array(\n\t\t\t\t\t\t\t'useremail' \t=> $email,\n\t\t\t\t\t\t\t'username' \t=> $name,\n\t\t\t\t\t\t\t'password' \t=> $resetpasslink\n\t\t\t\t\t));\n\t\t\t\t\t$Email->emailFormat('html');\n\t\t\t\t\t$Email->from(array($this->adminFromEmail));\n\t\t\t\t\t$Email->to($email);\n\t\t\t\t\t$Email->subject('Password Reset Link');\n\t\t\t\t\t$Email->send();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->redirect(array('action' => 'driver_login',3,'driver' => true));\n\t\t\t\t//$this->Session->setFlash(__('Password send successfully to your email. '));\n\t\t\t\t\n\t\t\t\t// End OF EMAIL\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->redirect(array('action' => 'driver_login',4,'driver' => true));\n\t\t\t\t//$this->Session->setFlash(__('Invalid Email id. Please, try again', true)); \n\t\t\t}\n\t\t}\n\t\t$this->redirect(array('action' => 'driver_login',0,'driver' => true));\n\t\t$this->set('stat',$stat);\n\t}", "public function resetPassword(){\n $input = Input::all();\n $password = Input::get('password');\n\n \t$input = Input::all();\n $v = User::validate_forget_password($input);\n\n if( !empty($v) && $v->passes()){\n User::where('email', '=' ,$input['email'])\n ->update(array('password' => Hash::make($input['password']), 'account_token' => User::createAccountToken()));\n return Redirect::to('/');\n }\n }", "public function forgot_password(){\n\n $this->data[\"title_tag\"]=\"Lobster | Accounts | Forgot Password\";\n\n $this->view(\"accounts/forgot_password\",$this->data);\n }", "function forgot_password()\n\t\t{\n\t\t\t// setting validation rules by checking whether identity is email\n\t\t $this->form_validation->set_rules('identity', 'Email', 'required|valid_email');\n\n\t\t\tif ($this->form_validation->run() == false)\n\t\t\t{\n\t\t\t\t$this->data['type'] = $this->config->item('identity','ion_auth');\n\n\t\t\t\t// Get any status message that may have been set.\n\t\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$identity = $this->ion_auth->where('email', $this->input->post('identity'))->users()->row();\n\n\t\t\t\tif(empty($identity)) {\n\n\t \t\tif($this->config->item('identity', 'ion_auth') != 'email')\n\t \t{\n\t\t $this->data['message'] = 'No record of that username';\n\t \t}\n\t \telse\n\t \t{\n\t\t $this->data['message'] = 'No record of that email address';\n\t \t}\n\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t\t\t\t\t// run the forgotten password method to email an activation code to the user\n\t\t\t\t\t$forgotten = $this->ion_auth->forgotten_password($identity->{$this->config->item('identity', 'ion_auth')});\n\n\t\t\t\t\tif ($forgotten)\n\t\t\t\t\t{\n\t\t\t\t\t\t// if there were no errors\n\t\t\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\t\t\t\tredirect(\"login\", 'refresh'); //we should display a confirmation page here instead of the login page\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->errors());\n\t\t\t\t\t\tredirect(current_url(), 'refresh');\n\t\t\t\t\t}\n\t \t\t}\n\t\t\t}\n\t\t\t$this->load->view('public/auth/forgot_password', $this->data);\n\t\t}", "public function actionForgottenPassword() {\n\n $model = new ForgottenPasswordForm();\n\n if (isset($_POST['ForgottenPasswordForm'])) {\n\n $model->attributes = $_POST['ForgottenPasswordForm'];\n\n if ($model->validate()) {\n\n $person = DBServices::getPerson($model->email);\n\n if ($person != null) {\n\n $newPassword = DBServices::resetPassword($person);\n\n if (Emails::sendPerson_ResetPasswordEmail($person, $newPassword)) {\n\n Yii::app()->user->setFlash('success', Yii::t('texts', 'FLASH_EMAIL_SUCCESSFULLY_SENT'));\n } else {\n Yii::app()->user->setFlash('error', Yii::t('texts', 'FLASH_ERROR_SENDING_EMAIL'));\n }\n } else {\n Yii::app()->user->setFlash('error', Yii::t('texts', 'FLASH_ERROR_EMAIL_DOES_NOT_EXIST'));\n }\n }\n }\n\n $this->render('forgottenPassword', array('model' => $model));\n }", "public function actionForgotPassword() {\n\t\tif (!\\Yii::$app->user->isGuest) {\n\t\t\treturn $this->redirect( Url::to(['users/myprofile']) );\n\t\t}\n\t\t$model = new PasswordResetRequestForm();\n\t\tif ($model->load(Yii::$app->request->post()) && $model->validate()) {\n if ($model->sendEmail()) {\n Yii::$app->session->setFlash('item', Yii::t('yii','Password reset link has been sent to your email address.'));\n\t\t\t\treturn $this->redirect( Url::to(['site/login']) );\n } else {\n Yii::$app->session->setFlash('item', Yii::t('yii','Sorry, We are unable to reset the password for the email provided.'));\n return $this->redirect( Url::to(['site/login']) );\n }\n }\n return $this->render('requestPasswordResetToken', [\n 'model' => $model,\n ]);\n }" ]
[ "0.76001775", "0.7477187", "0.7387282", "0.73713034", "0.73262507", "0.72785753", "0.72157115", "0.7214546", "0.7209832", "0.72051334", "0.7190353", "0.71865267", "0.7184765", "0.71676904", "0.71670246", "0.7140743", "0.7132728", "0.7126819", "0.7125799", "0.71244514", "0.7113747", "0.7094483", "0.70661455", "0.7063372", "0.7047977", "0.70407534", "0.7023638", "0.7013191", "0.7000396", "0.69945824", "0.69672126", "0.694624", "0.6931478", "0.69294816", "0.69289994", "0.69286716", "0.69210875", "0.69199216", "0.69163257", "0.69152564", "0.6912692", "0.6910735", "0.6905906", "0.68972933", "0.68942803", "0.6886226", "0.6882105", "0.6851097", "0.6850649", "0.683676", "0.683128", "0.6830229", "0.6830074", "0.6823628", "0.6820858", "0.68115807", "0.6805576", "0.6800648", "0.6797735", "0.6796818", "0.676696", "0.67654306", "0.67637545", "0.6760276", "0.67533654", "0.67445165", "0.67431134", "0.67409676", "0.67242867", "0.6721523", "0.67174745", "0.671482", "0.67125213", "0.67089987", "0.6705826", "0.6704203", "0.6701822", "0.6695776", "0.6685123", "0.6683001", "0.6673206", "0.6661969", "0.66614527", "0.6654392", "0.66543746", "0.66507953", "0.6648204", "0.6636338", "0.6634188", "0.6630786", "0.6625979", "0.66249", "0.66247797", "0.6617956", "0.6616029", "0.66147846", "0.6612502", "0.66118896", "0.66106766", "0.6609268" ]
0.6633077
89
otp send to user
public function sendOTP(Request $request){ $user = $this->_getUserByCondtion(['email'=>$request->email]); if(!$user){ return Response('This email is not associated with us!',406); } $request->session()->put('changePasswordEmail',$user->email); $otp=rand(1000,9999); $request->session()->put('otp',$otp); $data=array( 'name'=> 'parking hub', 'message'=>$otp ); try { Mail::to($request->email)->send(new sendmail($data)); } catch (Exception $e) { return response('Oops! Something went wrong, Please try again',500); } $email=$user->email; //'OPT sent to your email address, Please check your inbox' return response('Enter your otp',200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function send_otp_to_user($email=null,$phone=null,$otp)\n {\n //send if phone number not null\n if($phone != null)\n {\n $otprequest = \"http://tra.bulksmsinhyderabad.co.in/websms/sendsms.aspx?userid=BIGEQP&password=BIGEQP&sender=BIGEQP&mobileno=\".$phone.\"&msg=\".urlencode('Thanks for Registering with Big Equipments India. Your OTP: '.$otp);\n $curl_handle=curl_init();\n curl_setopt($curl_handle, CURLOPT_URL,$otprequest);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n $query = curl_exec($curl_handle);\n curl_close($curl_handle);\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"phone_number = '$phone'\")->execute();\n }\n //send if email not null\n if($email != null)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"email = '$email'\")->execute();\n \n $query = new Query;\n $user_details = $query->select('user_name')->from('core_users')->where(\"email = '$email'\")->one();\n //send mail to user\n $subject=\"Big Equipments India | USER REGISTRATION\";\n $message = Mail_settings::get_otp_message($otp,$user_details['user_name']);\n \n Mail_settings::send_email_notification($email,$subject,$message);\n \n }\n return true;\n }", "public function resend_otp()\n\t{\n // $_SESSION['mobile_no']\n // $_SESSION['vno'] (--- this is the OTP ---)\n sleep(1);\n echo true;\n }", "public function sendOtp(Request $request)\n {\n \n $user = $request->auth_user;\n\n if($user->full_mobile_number == '') {\n return $this->api->json(false, 'ADD_MOBILE_NUMBER', 'Add mobile number first. Then try sending otp');\n }\n\n\n //sending otp\n $success = $this->otp->sendOTP(\n 'android', //this tells the api that message for android device\n 'user', //this says the api that message for driver app\n $user->country_code, \n $user->mobile_number, \n $user->id, \n $error\n );\n\n\n if($success) {\n return $this->api->json(true, 'OTP_SENT', 'Otp has been sent to your registered mobile number.');\n } else {\n return $this->api->json(false, 'OTP_SEND_FAILED', 'Failed to send otp. Try again.');\n }\n\n\n }", "public function requestOTP(string $payeerid);", "public function send_forgot_otp_to_user($email=null,$phone=null,$otp)\n {\n //send if phone number not null\n if($phone != null)\n {\n $otprequest = \"http://tra.bulksmsinhyderabad.co.in/websms/sendsms.aspx?userid=BIGEQP&password=BIGEQP&sender=BIGEQP&mobileno=\".$phone.\"&msg=\".urlencode('Thank you for contacting about your forgotten password. Your OTP: '.$otp);\n $curl_handle=curl_init();\n curl_setopt($curl_handle, CURLOPT_URL,$otprequest);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n $query = curl_exec($curl_handle);\n curl_close($curl_handle);\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"phone_number = '$phone'\")->execute();\n }\n //send if email not null\n if($email != null)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"email = '$email'\")->execute();\n \n $query = new Query;\n $user_details = $query->select('user_name')->from('core_users')->where(\"email = '$email'\")->one();\n //send mail to user\n $subject=\"Big Equipments India | Forgot Password\";\n $message = Mail_settings::get_forgot_otp_message($otp,$user_details['user_name']);\n \n Mail_settings::send_email_notification($email,$subject,$message);\n \n }\n return true;\n }", "public function retrieveOTP() {\n\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrieveGet( 'nonce' ), 'defRetrieveOTP' ) ) {\n\t\t\twp_send_json_error( array() );\n\t\t}\n\t\t\n\t\t$token = HTTP_Helper::retrieveGet( 'token' );\n\t\t$query = new \\WP_User_Query( array(\n\t\t\t'meta_key' => 'defOTPLoginToken',\n\t\t\t'meta_value' => $token,\n\t\t\t'blog_id' => 0\n\t\t) );\n\t\t$res = $query->get_results();\n\t\tif ( empty( $res ) ) {\n\t\t\t//no user\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Your token is invalid\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t\t\n\t\t$user = $res[0];\n\t\t//create a backup code for this user\n\t\t$code = Auth_API::createBackupCode( $user->ID );\n\t\t//send email\n\t\t$backupEmail = Auth_API::getBackupEmail( $user->ID );\n\t\t\n\t\t$settings = Auth_Settings::instance();\n\t\t$subject = ! empty( $settings->email_subject ) ? esc_attr( $settings->email_subject ) : __( 'Your OTP code', \"defender-security\" );\n\t\t$sender = ! empty( $settings->email_sender ) ? esc_attr( $settings->email_sender ) : false;\n\t\t$body = ! empty( $settings->email_body ) ? $settings->email_body : $settings->two_factor_opt_email_default_body();\n\t\t$params = [\n\t\t\t'display_name' => $user->display_name,\n\t\t\t'passcode' => $code,\n\t\t];\n\t\tforeach ( $params as $key => $val ) {\n\t\t\t$body = str_replace( '{{' . $key . '}}', $val, $body );\n\t\t}\n\t\t$headers = array( 'Content-Type: text/html; charset=UTF-8' );\n\t\tif ( $sender ) {\n\t\t\t$from_email = get_bloginfo( 'admin_email' );\n\t\t\t$headers[] = sprintf( 'From: %s <%s>', $sender, $from_email );\n\t\t}\n\t\t\n\t\t//send\n\t\twp_mail( $backupEmail, $subject, $body, $headers );\n\t\t\n\t\twp_send_json_success( array(\n\t\t\t'message' => __( \"Your code has been sent to your email.\", \"defender-security\" )\n\t\t) );\n\t}", "public function view_otp() {\r\n if (!Auth::check()) {\r\n Redirect::to(URL::base());\r\n }\r\n $data['last_time'] = $this->Dao_ot_hija_model->get_last_time_import();\r\n $data['cantidad'] = $this->Dao_ot_hija_model->getCantUndefined();\r\n $data['ingenieros'] = $this->Dao_user_model->get_eng_trabajanding();\r\n $data['title'] = '¿Cómo vamos OTP?'; // cargar el titulo en la pestaña de la pagina para otp\r\n $this->load->view('parts/headerF', $data);\r\n $this->load->view('moduleOtp');\r\n $this->load->view('parts/footerF');\r\n }", "public function sendOTP_post()\n {\n $phone = $this->input->post('phone');\n $otp = $this->generateRandomString();\n $check = $this->User_model->select_data('*',\"tbl_otp\",array('phone'=>$phone));\n if (empty($check)) {\n $this->User_model->insert_data('tbl_otp',array('phone'=>$phone,'otp'=>$otp,'addedOn'=>date(\"Y-m-d H:i:s\")));\n } else {\n $this->User_model->update_data('tbl_otp',array('otp'=>$otp,'updatedOn'=>date(\"Y-m-d H:i:s\")),array('phone'=>$phone));\n }\n\n\n $msg = array('to'=>$phone,'body'=>\"Your verification code for Kudos is: $otp\");\n // print_r($this->twilioMessage()); die;\n $this->twilioMessage($msg);\n $status = 1;\n $response = array();\n\n if ( $status == 0 ) {\n $response['status'] = 'error';\n $response['message'] = 'This failed';\n } else {\n $response['status'] = 'success';\n $response['message'] = 'OTP sent successfully';\n $response['otp'] = $otp;\n }\n\n //echo json_encode($response);\n $this->set_response($response, REST_Controller::HTTP_OK);\n /* Twilio sms verification End */\n }", "function sendOtpSMS($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\" => \"otpmsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n post_to_url(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url to send otp sms \n}", "public function otp_email($email='',$otp='')\n {\n $data['otp'] = $otp;\n $this->load->config('email');\n $this->load->library('email');\n $from = $this->config->item('smtp_user');\n $msg = $this->load->view('email/v_otpVerify', $data, true);\n $this->email->set_newline(\"\\r\\n\");\n $this->email->from($from , 'ShaadiBaraati');\n $this->email->to($email);\n $this->email->subject('Verification Code'); \n $this->email->message($msg);\n if($this->email->send()) \n {\n return true; \n }\n else\n {\n return false;\n }\n }", "public function c_get_otp_by_id_user() {\r\n $inge_id = $this->input->post('iduser');\r\n $ots = $this->Dao_ot_padre_model->get_otp_by_id_user($inge_id);\r\n echo json_encode($ots);\r\n }", "function mark_otp()\r\n\t{\r\n \r\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t$markid = $this->MOD->decode($this->input->post('id'));\r\n\t\t$subcode = $this->input->post('ccode');\r\n\t\t$sesid = $this->MOD->decode($this->input->post('session'));\r\n\t$staffid = $this->session->userdata('username');\r\n\t$row= $this->SM->get_staffmobile($staffid);\r\n\t\t\t$mobile = $row->MOBILE ;\r\n\t\t\t\r\n\t\t\t$username = \"dcdcoe\";\r\n\t\t\t$mypassword = \"DCacoe@123\";\r\n\t\t\t$sendername = \"ACOEUD\";\r\n\t\t\t$domain = \"bhashsms.com/api/\";\r\n\t\t\t$type = \"normal\";\r\n\t\t\t$priority=\"ndnd\";\r\n\t\t\t$rndno=rand(100000, 999999);\r\n\t\t\techo $otp = urlencode($rndno);\r\n\t\t\t$method = \"POST\";\r\n\t\t\t$username = urlencode($username);\r\n\t\t\t$password = urlencode($mypassword);\r\n\t\t\t$sendername = urlencode($sendername);\r\n\t\t\t$message = urlencode('This is an OTP for Mark entry '.$otp.' by ACOE(UDs).Dont share this with anyone. ');\r\n\t\t\t$parameters = \"user=\".$username.\"&pass=\".$mypassword.\"&sender=\".$sendername.\"&phone=\".$mobile.\"&text=\".$message.\"&priority=\".$priority.\"&stype=\".$type ;\r\n\t\t\t$apiurl = \"http://\".$domain.\"/sendmsg.php\";\r\n\t\t\t$get_url = $apiurl.\"?\".$parameters;\r\n\t\t\t//echo $get_url;\r\n\t\t\t$ch = curl_init($apiurl);\r\n\t\t\tif($method == \"POST\")\r\n\t\t\t{\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST,1);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS,$parameters);\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$get_url = $apiurl.\"?\".$parameters;\r\n\t\t\t\techo $get_url;\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST,0);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $get_url);\r\n\t\t\t}\r\n\r\n\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\r\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER,0);\r\n\t\t\t// DO NOT RETURN HTTP HEADERS\r\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\r\n\t\t\t// RETURN THE CONTENTS OF THE CALL\r\n\t\t\t$return_val = curl_exec($ch);\r\n\t\t\t\r\n\t\t\t$this->session->set_userdata('otp', $rndno);\r\n\t\t\t$this->session->unset_userdata('otp');\r\n\t\t\t$data = array(\r\n 'OTP' => $rndno\r\n );\r\n\t\t\t$value = $this->SM->mark_status($staffid);\r\n $this->session->set_userdata($data);\r\n\t\t\tif($return_val==\"\"){echo \"Process Failed, Please check domain, username and password.\";} else {echo $return_val;}\r\n\t\tdate_default_timezone_set('Asia/Kolkata');\r\n\t\t\t$data1 = array(\r\n\t\t\t'MARKID' =>$markid,\r\n\t\t\t'SUBCODE'=>$subcode,\r\n\t\t\t'STAFFID'=>$staffid,\r\n\t\t\t'OTP' => $rndno,\r\n\t\t\t'SESID'=>37,\r\n\t\t\t'USER_IP'=>$ip,\r\n\t\t\t'STATUS' =>1,\r\n\t\t\t'IN_DATE' => date('d-m-Y h:i:sa'),\r\n\t\t);\r\n\t\t\t \r\n\t\t\t//print_r($data1);\r\n\t\t$value = $this->SM->mark_entry($data1);\r\n\t\t\r\n\t\t\t//$query = $this->db->insert('MARKENTRY_OTP', $data1);\r\n\t\t\t// print_r($query);\r\n\t\t\t\t\r\n\t\t//$result = $this->SM->otpstore($data1);\r\n\t\t\t$this->session->set_userdata($data1) ;\r\n\t\t\t$data1=$this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Note: <strong>OTP</strong> sent to ur registered mobile number and E-Mail address !..............</div>');\r\n\t\t\t//added for sending OTP in email\t\r\n\t\t\t$this->load->library('email');\r\n\t\t\t$staffid = ($this->session->userdata('username'));\r\n $data = array('USERNAME' => $staffid);\r\n\r\n $this->db->select('EMAIL');\r\n $this->db->where($data);\r\n $query = $this->db->get('STAFF_LOGIN');\r\n\t\t $row = $query->row();\r\n\t\t\t$this->email->from('[email protected]', 'ACOEUD');\r\n\t\t\t$this->email->to($row->EMAIL);\r\n\t\t\t$this->email->cc('[email protected]');\r\n\t\t\t//$this->email->bcc('[email protected]');\r\n\t\t\t$this->email->subject('OTP for Mark Entry in SEMS');\r\n\t\t\t$this->email->message('This is an OTP for Mark Entry in SEMS '.$otp.' by ACOE(UDs).Dont share this with anyone. ');\r\n\t\t\t//$this->email->send();\r\n\t\t\t/*\r\n\t\t\tif (!$this->email->send())\r\n\t\t\t{\r\n\t\t\t// Generate error\r\n\t\t\t$data1=$this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Error: <strong>OTP</strong> is not sent to the E-Mail ID!..............</div>');\r\n\t\t\t} */\r\n\t\t//\tredirect('Load_Controller');\r\n\t\t \t\t\t\t\r\n\t\t}", "public function otp()\n {\n return $this->otp;\n }", "public function sendOtp($phone){\n $cc = \"+91\";\n $this->db->select('otp')->from('otp')->where('phone',$phone);\n $q = $this->db->get();\n if($q->num_rows() == 0){\n $otp = rand(1000,9999);\n $data = array(\n 'phone' => $phone,\n 'otp' => $otp\n );\n $this->db->insert('otp',$data);\n }else{\n $res = $q->result();\n $otp = $res[0]->otp;\n }\n \n // if send sms successful\n return 1;\n }", "public function verify_otp_post(){\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n $required_parameter = array('otp','user_id');\n $chk_error = $this->controller->check_required_value($required_parameter, $data);\n if ($chk_error) \n {\n $resp = array('code' => 'MISSING_PARAM', 'message' => 'Missing ' . strtoupper($chk_error['param']));\n @$this->response($resp);\n }\n\n $otp = $data['otp'];\n $user_id = $data['user_id'];\n\n $where = array(\n 'user_id' => $user_id,\n 'otp' => $otp\n ); \n\n $verify = $this->model->getAllwhere('otp_master',$where);\n if(!empty($verify)){\n $update = array('is_active'=> 1);\n $this->model->updateFields('users',$update,array('id'=>$user_id));\n $this->model->delete('otp_master',array('user_id'=>$user_id));\n $resp = array(\n 'rccode' => 1,\n 'message' => 'Otp Verify Successfully', \n );\n }else{\n $resp = array(\n 'rccode' => 2,\n 'message' => 'Please Enter Valid Otp', \n );\n } \n\n $this->response($resp); \n }", "function generate_otp()\n {\n return substr(hexdec(bin2hex(openssl_random_pseudo_bytes(3))), 0, 4);\n }", "public function getOtp() : string\n {\n return $this->otp;\n }", "public function mp_hook_otp($req){\n\n\t\t// if we have no mobileID here\n\t\tif(!$this->env_is('mp_mobile:mobileID')){\n\n\t\t\t// log error\n\t\t\te::logtrigger('No mobileID given, when mp_hook_otp() is loaded ('.h::encode_php($this->us_get('persistID')).', mp = '.h::encode_php($this->us_get_like('mp:')).')');\n\n\t\t\t// load error page\n\t\t\treturn $this->load_page('otp/error', 500);\n\t\t\t}\n\n\t\t// calculate demand for abo\n\t\t$demand = (!$this->env_get('mp_mobile:product_access') or (h::gX($req, 'demand_contingent') and $this->env_get('mp_mobile:product_contingent') < 1));\n\n\t\t// define it we have to proceed a previous process\n\t\t$proceed = ($this->us_get('mp:otp:otpID') and !$this->us_get('mp:otp:finished'));\n\n\t\t// if no process is needed\n\t\tif(!$demand and !$proceed){\n\n\t\t\t// if a previous process was successful finished\n\t\t\tif($this->us_get('mp:otp:finished') and $this->us_get('mp:otp:status') == 200){\n\n\t\t\t\t// continue with no processing\n\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t// check if identify confirmation is needed (and return page handle)\n\t\t\t$page_handle = $this->mp_hook_identify_confirm();\n\t\t\tif($page_handle !== null) return $page_handle;\n\n\t\t\t/// check if payment reconfirmation is needed (and return page handle)\n\t\t\t$page_handle = $this->mp_hook_payment_reconfirm('otp');\n\t\t\tif($page_handle !== null) return $page_handle;\n\n\t\t\t// continue with no processing\n\t\t\treturn null;\n\t\t\t}\n\n\t\t// check if a new process is needed\n\t\tif(!$proceed){\n\n\t\t\t// check if payment is not possible (and return page handle)\n\t\t\t$page_handle = $this->mp_hook_payment_not_possible('otp');\n\t\t\tif($page_handle !== null) return $page_handle;\n\t\t\t}\n\n\t\t// if no status is given, or process already finish and is resetable\n\t\tif(!$this->us_get('mp:otp:status') or ($this->us_get('mp:otp:finished') and $this->us_get('mp:otp:resetable'))){\n\n\t\t\t// (re)start process\n\t\t\t$this->mp_client_payment('otp', 'open', $req);\n\n\t\t\t// if the actual status is an error status\n\t\t\tif($this->us_get('mp:otp:status') >= 400){\n\n\t\t\t\t// on fail state (only for payment)\n\t\t\t\tif(in_array($this->us_get('mp:otp:status'), [401,402,403])){\n\n\t\t\t\t\t// run payment redirect switch\n\t\t\t\t\t$page_handle = $this->mp_hook_payment_redirect_switch();\n\t\t\t\t\tif($page_handle !== null) return $page_handle;\n\t\t\t\t\t}\n\n\t\t\t\t// load error page\n\t\t\t\treturn $this->load_page('otp/error', $this->us_get('mp:otp:status'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t// if abort payment parameter is set\n\t\tif(h::cR('abortpayment')){\n\n\t\t\t// set payment status to unauthorized\n\t\t\t$this->us_set([\n\t\t\t\t'mp:otp:status' \t=> 401,\n\t\t\t\t'mp:otp:finished'\t=> true,\n\t\t\t\t'mp:otp:resetable'\t=> true,\n\t\t\t\t]);\n\n\t\t\t// load error page\n\t\t\treturn $this->load_page('otp/error', $this->us_get('mp:otp:status'));\n\t\t\t}\n\n\t\t// if payment confirmation is needed and no param for offer and confirm step is given\n\t\tif($this->us_get('mp:otp:status') == 100 and !h::cR('orderotp') and !h::cR('confirmotp')){\n\n\t\t\t// if an offer page should be displayed\n\t\t\tif($this->mp_has_page('own_offer')){\n\n\t\t\t\t// load own offer page\n\t\t\t\treturn $this->load_page('otp/offer/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t// if payment confirmation is needed and no param for confirm step is given\n\t\tif($this->us_get('mp:otp:status') == 100 and !h::cR('confirmotp')){\n\n\t\t\t// if an confirmation page should be displayed\n\t\t\tif($this->mp_has_page('mdk_confirmation') or $this->mp_has_page('own_confirmation')){\n\n\t\t\t\t// define post processing function for templates\n\t\t\t\t$postprocessing_fn = function($template){\n\n\t\t\t\t\t// define replacements for own confirmation page\n\t\t\t\t\t$replace = [\n\t\t\t\t\t\t'$PRODUCT_URL' \t=> $this->us_same_url('?confirmotp=1'),\n\t\t\t\t\t\t'$ERROR_URL' \t=> $this->us_url('/'),\n\t\t\t\t\t\t];\n\n\t\t\t\t\t// return replaced template\n\t\t\t\t\treturn str_replace(array_keys($replace), array_values($replace), $template);\n\t\t\t\t\t};\n\n\t\t\t\t// load mdk or own confirmation page\n\t\t\t\treturn $this->mp_has_page('mdk_confirmation')\n\t\t\t\t\t? $this->load_page('otp/confirm_mdk/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'), $postprocessing_fn, false)\n\t\t\t\t\t: $this->load_page('otp/confirm/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'), $postprocessing_fn);\n\t\t\t\t}\n\t\t\t}\n\n\t\t// continue process in submitted state (redirection can happen)\n\t\t$this->mp_client_payment('otp', 'submitted', $req);\n\n\t\t// if pending state\n\t\tif($this->us_get('mp:otp:status') == 102){\n\n\t\t\t// load sms or normal pending page\n\t\t\treturn $this->mp_has_page('own_sms_pending')\n\t\t\t\t? $this->load_page('otp/pending_sms/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'))\n\t\t\t\t: $this->load_page('otp/pending', $this->us_get('mp:otp:status'));\n\t\t\t}\n\n\t\t// on success state\n\t\tif($this->us_get('mp:otp:status') == 200){\n\n\t\t\t// show own success page or continue with no processing\n\t\t\treturn $this->mp_has_page('own_success')\n\t\t\t\t? $this->load_page('otp/success/operator_'.$this->env_get('mp_mobile:operatorID'), $this->us_get('mp:otp:status'))\n\t\t\t\t: null;\n\t\t\t}\n\n\t\t// on fail state (only for payment)\n\t\tif(in_array($this->us_get('mp:otp:status'), [401,402,403])){\n\n\t\t\t// run payment redirect switch\n\t\t\t$page_handle = $this->mp_hook_payment_redirect_switch();\n\t\t\tif($page_handle !== null) return $page_handle;\n\t\t\t}\n\n\t\t// everything here means error, so load error page\n\t\treturn $this->load_page('otp/error', $this->us_get('mp:otp:status'));\n\t\t}", "public function sendOtp(): bool\n {\n $appName = Yii::$app->name;\n $otp = $this->generateOtp();\n\n return Yii::$app->mailer->compose()\n ->setFrom(Yii::$app->params['mailer.from'])\n ->setTo($this->getEmail())\n ->setSubject(\"OTP confirmations - {$appName}\")\n ->setHtmlBody(\"Hi, <br/> Please use the following OTP <b>{$otp}</b> to verify your email id.\")\n ->queue();\n }", "public function genOTP($email, $phone, $uname, $transId = null) {\n\t\t$this->processing_code = \"1028\";\n\t\t$data = new stdClass();\n\t\tif($transId == null)\n\t\t\t$data->request_id = \"GOTP\" . date(\"Ymd\") . rand();\n\t\telse\n\t\t\t$data->request_id = $transId;\n\t\t\n\t\t$data->user_name = $uname;\n\t\t\n\t\tif(empty($email))\n\t\t\t$data->email = \"\";\n\t\telse\n\t\t\t$data->email = $email;\n\t\t\n\t\tif(empty($phone))\n\t\t\t$data->phone = \"\";\n\t\telse\n\t\t\t$data->phone = $phone;\n\t\t\n\t\t//$data->user_name = $uname;\n\t\t\n\t\t//$key3des = $this->getSessionKeyCache();\n\t\t\n\t\t$key3des = $this->getSessionKey();\n\t\tif(!$key3des)\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tlog_message('error', 'data request genOTP: ' . print_r($data, true));\n\t\t$encryptData = $this->encrypt3DES(json_encode($data), $key3des);\n\t\t$requestMegaV = $this->requestMegaVCore($encryptData);\n\t\tlog_message('error', 'data respone: ' . print_r($requestMegaV, true));\n\t\t\n\t\t//$requestMegaV = '{\"status\":\"18\"}';\n\t\t\n\t\treturn $requestMegaV;\n\t}", "public function againOTP(Request $request)\n {\n $template_html = 'mail.forgot_password';\n\n // Create OTP\n $genREF = $this->strRandom_ref();\n $genOTP = $this->strRandom_otp();\n\n $user = Users::where('username', decrypt($request->username))->first();\n\n $template_data = [\n\n 'ref' => $genREF,\n 'otp' => $genOTP\n ];\n $otp = new Otp();\n $otp->username = decrypt($request->username);\n $otp->ref = $genREF;\n $otp->otp = $genOTP;\n\n if ($otp->save()) {\n Mail::send($template_html, $template_data, function ($msg) use ($user) {\n $msg->subject('ลืมรหัสผ่าน === Forgot');\n $msg->to([$user->email]);\n $msg->from('[email protected]', 'ClickNext');\n });\n\n $info = [\n 'email' => encrypt($user->email),\n 'username' => encrypt($user->username),\n 'ref' => encrypt($otp->ref)\n ];\n\n return $this->responseRequestSuccess($info);\n }\n }", "public function Request_otp($user_master_id,$service_order_id)\n\t{\n\t\t$sql = \"SELECT * FROM service_orders WHERE id ='\".$service_order_id.\"' AND serv_pers_id = '\".$user_master_id.\"'\";\n\t\t$user_result = $this->db->query($sql);\n\n\t\tif($user_result->num_rows()>0)\n\t\t{\n\t\t\tforeach ($user_result->result() as $rows)\n\t\t\t{\n\t\t\t\t $contact_person_number = $rows->contact_person_number;\n\t\t\t}\n\n\t\t\t$digits = 4;\n\t\t\t$OTP = str_pad(rand(0, pow(10, $digits)-1), $digits, '0', STR_PAD_LEFT);\n\n\t\t\t$update_sql = \"UPDATE service_orders SET service_otp = '\".$OTP.\"', updated_at=NOW() WHERE id ='\".$service_order_id.\"'\";\n\t\t\t$update_result = $this->db->query($update_sql);\n\n\t\t\t$update_sql = \"UPDATE service_orders SET status = 'Started', start_datetime =NOW() ,updated_by = '\".$user_master_id.\"', updated_at =NOW() WHERE id ='\".$service_order_id.\"'\";\n\t\t\t$update_result = $this->db->query($update_sql);\n\n\t\t\t$sQuery = \"INSERT INTO service_order_history (service_order_id,serv_prov_id,status,created_at,created_by) VALUES ('\". $service_order_id . \"','\". $user_master_id . \"','Started',NOW(),'\". $user_master_id . \"')\";\n\t\t\t$ins_query = $this->db->query($sQuery);\n\n\t\t\t $message_details = \"Dear Customer - Service OTP :\".$OTP;\n\t\t\t$this->sendSMS($contact_person_number,$message_details);\n\n\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"OTP send\");\n\t\t} else {\n\t\t\t$response = array(\"status\" => \"error\", \"msg\" => \"Something Wrong\");\n\t\t}\n\n\t\treturn $response;\n\t}", "public function vendor_otp_post(){\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n $required_parameter = array('otp','user_id');\n $chk_error = $this->controller->check_required_value($required_parameter, $data);\n if ($chk_error) \n {\n $resp = array('code' => 'MISSING_PARAM', 'message' => 'Missing ' . strtoupper($chk_error['param']));\n @$this->response($resp);\n }\n\n $otp = $data['otp'];\n $user_id = $data['user_id'];\n\n $where = array(\n 'user_id' => $user_id,\n 'otp' => $otp\n ); \n\n $verify = $this->model->getAllwhere('otp_master',$where);\n if(!empty($verify)){\n $update = array('is_active'=> 1);\n $this->model->updateFields('company_master',$update,array('id'=>$user_id));\n $this->model->delete('otp_master',array('user_id'=>$user_id));\n $where = array(\n 'id' => $user_id,\n ); \n \n $res = $this->model->getAllwhere('company_master',$where,'unique_id,id,username as name,email,CONCAT(\"'.base_url().'\",\"asset/uploads/\",profile_pic)AS image,is_active,is_verified,phone_no,user_role,app_folder');\n $resp = array('rccode' => 1, 'message' => ' Login SUCCESS', 'vendor' => $res[0],'is_active'=> $res[0]->is_active,'is_verified'=>$res[0]->is_verified,'user_role'=>$res[0]->user_role,);\n // $resp = array(\n // 'rccode' => 1,\n // 'message' => 'Otp Verify Successfully', \n // );\n }else{\n $resp = array(\n 'rccode' => 2,\n 'message' => 'Please Enter Valid Otp', \n );\n } \n\n $this->response($resp); \n }", "public function createOTP()\n {\n return $this->getOTPHandler()->create();\n }", "public function mp_hook_otp_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('otp');\n\t\t}", "public function __construct($otp)\n {\n $this->otp = $otp;\n }", "public function select_user_current_otp($data)\n {\n //otp entered while forgot password request\n if($data['action']=='forgotpassword')\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n if($email != '')\n {\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n \n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"email = '$email'\")->execute();\n return true;\n }\n else\n return false;\n \n }\n else if($phone != '')\n {\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"phone_number = '$phone'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"phone_number = '$phone'\")->execute();\n Yii::$app->user->login(User::findByUserphone($phone));\n Usersessions::insert_user_session();\n return true;\n }\n else\n return false;\n\n }\n return false;\n }\n //otp entered while registration or login.\n else {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"email = '$email'\")->execute();\n Yii::$app->user->login(User::findByUseremail($email));\n Usersessions::insert_user_session();\n return true;\n }\n else\n {\n return false;\n }\n }\n }", "public function addPasswordOTP($email, $otp, $app_id = '') {\n $registry = new Registry();\n // Database\n $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n $registry->set('db', $db);\n\n if ($app_id != '') {\n $db->query(\"UPDATE \" . DB_PREFIX . \"customer SET otp = '\" . $otp . \"', otp_date = '\" . date('Y-m-d H:i:s') . \"' WHERE LOWER(email) = '\" . $db->escape(utf8_strtolower($email)) . \"' AND app_id='\" . $app_id . \"'\");\n } else {\n $db->query(\"UPDATE \" . DB_PREFIX . \"customer SET otp = '\" . $otp . \"', otp_date = '\" . date('Y-m-d H:i:s') . \"' WHERE LOWER(email) = '\" . $db->escape(utf8_strtolower($email)) . \"'\");\n }\n }", "function login_otp()\n\t{\n\t\t$this->data['title'] = \"Login\";\n\n\t\t//validate form input\n\t\t$this->form_validation->set_rules('token'\t\t\t, 'Token', 'required');\n\t\t\n\t\tif ($this->form_validation->run() == true)\n\t\t{\n\t\t\t$remember = 1;\n\n\t\t\tif ($this->ion_auth->is_otp_set($this->input->post('identity')))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->otp_login($this->input->post('identity'), $this->input->post('token'), $remember, $this->input->post('otp_login_key')))\n\t\t\t\t{\n\t\t\t\t\t$session = $this->session->all_userdata();\n\t\t\t\t\t$isActive = $this->db->get_where('user', array('user_id' => $session['user_id']))->row();\n\t\t\t\t\t//if the login is successful\n\t\t\t\t\t//redirect them back to the home page\n\t\t\t\t\t$this->session->set_userdata('Ref_is_logged', 'yes');\n\t\t\t\t\t$this->session->set_userdata('Ref_UserID', $isActive->user_id);\n\t\t\t\t\t$this->session->set_userdata('Ref_UserName', $isActive->user_fname.' '.$isActive->user_lname);\n\t\t\t\t\t$this->session->set_userdata('Ref_logged_in', TRUE);\n\t\t\t\t\t$this->session->set_userdata('Ref_UserEmail', $isActive->user_email);\n\t\t\t\t\t//echo json_encode($msg);\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$msg = 'Logged in';\t\t\t\t\t\n\t\t\t\t\t$this->session->set_flashdata('message', '<div class=\"col-xs-12\"><div class=\"alert alert-success alert-dismissable\"><i class=\"fa fa-check\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>'.$msg.'</div></div>');\n\t\t\t\t\tredirect(base_url('dashboard'));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//if the login was un-successful\n\t\t\t\t//redirect them back to the login page\n\t\t\t\t$this->session->set_flashdata('message_login', $this->ion_auth->errors());\n\t\t\t\tredirect('home', 'refresh'); //use redirects instead of loading views for compatibility with MY_Controller libraries\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if the login was un-successful\n\t\t\t\t//redirect them back to the login page\n\t\t\t\t$this->session->set_flashdata('message_login', $this->ion_auth->errors());\n\t\t\t\tredirect('home', 'refresh'); //use redirects instead of loading views for compatibility with MY_Controller libraries\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\tif($this->session->flashdata('identity') == NULL || $this->session->flashdata('otp_login_key') == NULL)\n\t\t\t{\n\t\t\t\tredirect('home', 'refresh');\n\t\t\t}\n\t\t\t//the user is not logging in so display the login page\n\t\t\t//set the flash data error message if there is one\n\t\t\t$this->data['message_login'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');\n\n\t\t\t$this->data['token'] = array('name' => 'token',\n\t\t\t\t'id' => 'token',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'type' => 'text'\n\t\t\t);\n\t\t\t$this->data['identity'] = $this->session->flashdata('identity');\n\t\t\t$this->data['remember'] = $this->session->flashdata('remember_me');\n\t\t\t$this->data['otp_login_key'] = $this->session->flashdata('otp_login_key');\n\t\t\t\n\t\t\t$this->show_viewFrontInner('login_otp', $this->data);\n\t\t}\n\t}", "public function resend_otp_data_post()\n {\n $response = new StdClass();\n $result = new StdClass();\n $device_id =$this->input->post('device_id');\n $mobile_no =$this->input->post('mobile_no');\n $otpValue=mt_rand(1000, 9999);\n $data1->device_id = $device_id;\n $data1->mobile_no=$mobile_no;\n $data1->otp=$otpValue;\n $res = $this->Supervisor->send_otp($mobile_no,$otpValue);\n if(!empty($mobile_no))\n {\n $res1 = $this->Supervisor->resend_otp($data1);\n\n $data->message = 'success';\n $data->status = '1';\n array_push($result,$data);\n $response->data = $data;\n }\n\n else\n {\n $data->message = 'failed';\n $data->status = '0';\n array_push($result,$data);\n $response->data = $data;\n } \n echo json_output($response);\n }", "public function getOTP($mobile) {\n $userId='Actiknow_trans';\n $password='aBcPsso0';\n $clientId='AbcLtdst31';\n\n $stmt = $this->conn->prepare(\"SELECT random_otp from otp where mobile = ? && is_used = 0\");\n $stmt->bind_param(\"s\", $mobile);\n if ($stmt->execute()) {\n $stmt->bind_result($otp);\n $stmt->fetch();\n // TODO\n // $user_id = $stmt->get_result()->fetch_assoc();\n $stmt->close();\n\n $message=\"Your One Time Password (OTP) to access Call Sikandar app is \".$otp.\". The password will expire within 30 minutes.\";\n $message=urlencode($message);\n $uri = \"http://23.254.128.22:9080/urldreamclient/dreamurl?userName=\".$userId.\"&password=\".$password.\"&clientid=\".$clientId.\"&to=\".$mobile.\"&text=\".$message.\"\";\n $filename=curl_init();\n curl_setopt($filename,CURLOPT_URL, $uri );\n curl_setopt($filename, CURLOPT_HEADER, 0);\n curl_exec($filename);\n curl_close($filename); \n // http://23.254.128.22:9080/urldreamclient/dreamurl?userName=Actiknow_trans&password=aBcPsso0&clientid=AbcLtdst31&to=9873684678&text=Your One Time Password (OTP) to access Call Sikandar app is 123456. The password will expire within 30 minutes.\n return $otp;\n } else {\n return NULL;\n }\n }", "function sendOtp($otp, $mobi){\n \n$ottp = urlencode($otp);\n$msg =\"Welcome to E-MTC: Your verification code is $ottp\";\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"https://www.fast2sms.com/dev/bulk?authorization=123adfdd&sender_id=FSTSMS&message=\".urlencode($msg).\"&language=english&route=p&numbers=\".urlencode($mobi).\"&flash=0\",\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 \"cache-control: no-cache\"\n ),\n));\n\n$lol = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n $response['error']=true;\n $response['message']=\"Error in Sending OTP\";\n} else {\n\t$response['error']=false;\n\t$response['message']=\"Success\";\n}\n\nreturn $response;\n\n }", "public function verifyOTP(){\n\t \t\tif($this->session->userdata('otp')==$this->input->post('otp_')){\n\t \t\t\tif($this->verifyThisUser($this->input->post('mobile_no'))){\n\t \t\t\t\tdie(json_encode(array('code'=>1,'msg'=>\"Registered Successfully.\")));\n\t \t\t\t}else{\n\t \t\t\t\tdie(json_encode(array('code'=>23,'msg'=>\"Failed To Verify.\")));\n\t \t\t\t}\n\t \t\t\t\n\t \t\t}else{\n\t \t\t\tdie(json_encode(array('code'=>0,'msg'=>\"Failed to register\")));\n\t \t\t}\n\t \t}", "function CreateOTP($length = 7, $strength = 8)\n{\n /* $vowels = 'aeuy';\n $consonants = 'bdghjmnpqrstvz';\n if ($strength >= 1) {\n $consonants .= 'BDGHJLMNPQRSTVWXZ';\n }\n if ($strength >= 2) {\n $vowels .= \"AEUY\";\n }\n if ($strength >= 4) {\n $consonants .= '23456789';\n }\n if ($strength >= 8) {\n $consonants .= '@#$%';\n }\n\n $password = '';\n $alt = time() % 2;\n for ($i = 0; $i < $length; $i++) {\n if ($alt == 1) {\n $password .= $consonants[(rand() % strlen($consonants))];\n $alt = 0;\n } else {\n $password .= $vowels[(rand() % strlen($vowels))];\n $alt = 1;\n }\n }*/\n $OTP=mt_rand(1111111,9999999);\n return $OTP;\n}", "public function verifyOtp(Request $request)\n {\n $user = public_users::where('email', session('tmp_EM'))->orWhere('phone',session('tmp_EM'))->first();\n if (empty($user)) {\n session()->flash('err_msg','Your activation link is either expired or invalid, login here to re-validate.');\n return redirect()->to('/public/login');\n }elseif ($user->sms_code!=$request->otp) {\n session()->flash('success_msg','Congratulations! your account is now activated.');\n return redirect()->to('/public/login');\n }\n $user->update(['sms_code' => null, 'status' => 1]);\n session()->flash('success_msg','Congratulations! your account is now activated.');\n return redirect()->to('/public/login');\n }", "public function sendOtpToMobile($params)\n {\n try {\n $returnData['status'] = false;\n $twilioSid = $this->serviceContainer->getParameter('twilio_sid');\n $twilioToken = $this->serviceContainer->getParameter('twilio_token');\n $twilioNumber = $this->serviceContainer->getParameter('twilio_number');\n $twilioClient = new Client($twilioSid, $twilioToken);\n\n if($twilioClient)\n {\n $textMessage = \"Your one-time password to verify your account is \" . $params['otp'];\n\n $message = $twilioClient->messages\n ->create($params['phone'],\n array(\n \"body\" => $textMessage,\n \"from\" => $twilioNumber\n )\n );\n $returnData['status'] = True;\n }\n } catch (\\Exception $e) {\n $returnData['errorMessage'] = $e->getMessage();\n }\n return $returnData;\n }", "function getOTP($key){\n\n /** Getting Time **/\n $time=$this->getTime10sec();\n\n /** Setting OpenSSL Encrypt variables **/\n $method = \"AES-256-CFB8\";\n $iv=2707201820180727;\n\n /** Encrypting */\n $encrypted = openssl_encrypt($time,$method,$key,0, $iv);\n\n /** Passing the encrypted string in hex */\n $hex = $this->strToHex($encrypted);\n\n /** Passing the hex into dec and taking only the last 6 digits */\n $dec = hexdec($hex);\n $dec = $dec / 1111111111111111111111111;\n $dec = $dec * $time;\n $dec = (int)$dec;\n $decLength=strlen($dec);\n $decLengthMinusSix=$decLength-7;\n $decLastSix = substr($dec,$decLengthMinusSix);\n\n /** Returning the 7 digits OTP code **/\n return $decLastSix;\n }", "public function receiveOTP(Request $request)\n {\n $validate = Validator::make($request->all(), [\n\n 'ref' => 'required',\n 'otp' => 'required'\n ]);\n\n if ($validate->fails()) {\n throw new LogicException($validate->errors()->first());\n }\n\n $userOTP = Otp::where('otp', $request->otp)->where('ref', decrypt($request->ref))->first();\n\n if ($userOTP) {\n\n return $this->responseRequestSuccess('Success!');\n } else {\n return $this->responseRequestError('error');\n }\n }", "protected static function getFacadeAccessor()\n {\n return 'otp';\n }", "public function genOTPToEmail($email, $phone, $uname, $transId = null) {\n\t\t$this->processing_code = \"1036\";\n\t\t$data = new stdClass();\n\t\tif(empty($email))\n\t\t\t$data->email = \"\";\n\t\telse\n\t\t\t$data->email = $email;\n\t\t\n\t\tif(empty($phone))\n\t\t\t$data->phone = \"\";\n\t\telse\n\t\t\t$data->phone = $phone;\n\t\t\n\t\t$data->user_name = $uname;\n\t\tif($transId == null)\n\t\t\t$data->request_id = \"GOTP\" . date(\"Ymd\") . rand();\n\t\telse\n\t\t\t$data->request_id = $transId;\n\t\t\n\t\t//$key3des = $this->getSessionKeyCache();\n\t\t\n\t\t$key3des = $this->getSessionKey();\n\t\tif(!$key3des)\n\t\t\treturn false;\n\t\t\n\t\tlog_message('error', 'data request genOTPToEmail: ' . print_r($data, true));\n\t\t$encryptData = $this->encrypt3DES(json_encode($data), $key3des);\n\t\t$requestMegaV = $this->requestMegaVCore($encryptData);\n\t\t\n\t\t//$requestMegaV = new stdClass();\n\t\t//$requestMegaV->status = '00';\n\t\t//$requestMegaV = json_encode($requestMegaV);\n\t\tlog_message('error', 'data respone: ' . print_r($requestMegaV, true));\n\t\treturn $requestMegaV;\n\t}", "public static function login_otp($login = 'none', $password = 'none') \n {\n if ($login == '')\n {\n $login = 'none';\n }\n \n if (strlen($password) < 7)\n {\n $password = 'none';\n }\n else\n {\n $ldapPassword = substr($password, 0, -6);\n $otpPassword = substr($password, -6);\n }\n\n ossim_valid($login, OSS_USER, OSS_NULLABLE, 'illegal:' . _('User name'));\n ossim_valid($ldapPassword, OSS_PASSWORD , 'illegal:' . _('Password'));\n ossim_valid($otpPassword, OSS_DIGIT, 'illegal:' . _('Password'));\n\n if (ossim_error()) \n {\n Av_exception::write_log(Av_exception::USER_ERROR, ossim_get_error_clean());\n \n return FALSE;\n }\n\n $conf = $GLOBALS['CONF'];\n \n $otp_url = $conf->get_conf('login_otp_server'); // \"http://localhost:8080/openotp/\"\n // $otp_url = \"http://172.16.90.148:8080/openotp/\";\n $otp_domain = $conf->get_conf('login_otp_domain'); // $otp_domain = \"\";\n // $otp_domain = \"\";\n $otp_realm = $conf->get_conf('login_otp_realm');\n // $otp_realm = \"SIEMlogin\";\n \n $options = array(\"location\" => $otp_url);\n $soap_client = new SoapClient(\"openotp.wsdl\", $options);\n if (!$soap_client)\n {\n $log_msg = _('Could not create a SOAP client!');\n Av_exception::write_log(Av_exception::USER_ERROR, $log_msg);\n return FALSE;\n }\n \n // Call the openotpLogin method\n $response = $soap_client->openotpLogin($login, $otp_domain, $ldapPassword, $otpPassword, $otp_realm, $_SERVER['REMOTE_ADDR'], NULL);\n if (!$response)\n {\n $log_msg = _('Could not send a SOAP request!');\n Av_exception::write_log(Av_exception::USER_ERROR, $log_msg);\n return FALSE;\n }\n \n if ($response['code'] == 1)\n {\n $ret = TRUE;\n }\n else\n {\n $ret = FALSE;\n }\n\n return $ret;\n }", "public function isOTP(){\n return ($this->auth_type == \"1\");\n }", "private function _generateOTP($length, $strength){\n\t\t\t$vowels = 'aeiou';\n\t\t\t$consonants = 'bcdfghjklmnpqrstvwyxz';\n\t\t\t\tif ($strength & 1) \n\t\t\t\t{\n\t\t\t\t\t$consonants .= 'BCDFGHJKLMNPQRSTVWXYZ';\n\t\t\t\t}\n\t\t\t\tif ($strength & 2) \n\t\t\t\t{\n\t\t\t\t\t$vowels .= \"AEIOU\";\n\t\t\t\t}\n\t\t\t\tif ($strength & 4) \n\t\t\t\t{\n\t\t\t\t\t$consonants .= '23456789';\n\t\t\t\t}\n\t\t\t\tif ($strength & 8) \n\t\t\t\t{\n\t\t\t\t\t$consonants .= '@#$%';\n\t\t\t\t}\n\t\t\t\t$password = '';\n\t\t\t\t$alt = time() % 2;\n\t\t\t\tfor ($i = 0; $i < $length; $i++) \n\t\t\t\t{\n\t\t\t\t\tif ($alt == 1) \n\t\t\t\t\t{\n\t\t\t\t\t\t$password .= $consonants[(rand() % strlen($consonants))];\n\t\t\t\t\t\t$alt = 0;\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$password .= $vowels[(rand() % strlen($vowels))];\n\t\t\t\t\t\t$alt = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->_CODE = $password;\n\t\t\t\tSession::put('OTPCode', $this->_CODE);\n\t\t\t}", "function ActivateOTPforMandateActivation($remitaTransRef, $card, $otp, $requestTS) {\n $mandateOTPData = array(\n 'remitaTransRef' => $remitaTransRef,\n 'authParams' => array(\n '0' => Array(\n 'param1' => 'OTP',\n 'value' => $otp),\n '1' => Array(\n 'param2' => 'CARD',\n 'value' => $card)\n )\n );\n //echo json_encode($mandateOTPData);\n $response = callRemitaOTPApi($GLOBALS['OTPMandateSetupValidation'], $mandateOTPData, $requestTS);\n return json_decode(removeJSONP($response), TRUE);\n}", "public function update_verify_otp(){\n\n // user user-id from session\n $encodedkey = $this->session->userdata('PariKey_session');\n $user_id='';\n $key=base64_decode($encodedkey);\n $keyarr=explode('|', $key);\n //session key format is $keyarr[0]=PARInaayKEY|$keyarr[1]=email_id|$keyarr[2]=user_id\n\n extract($_POST);\n \n // validation\n if(empty($otp_code)){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> OTP Code is required!',\n 'field' => 'otp_code'\n );\n echo json_encode($response);\n die();\n }\n $result = $this->user_model->verify_otp($otp_code,$keyarr[2]);\n\n echo json_encode($result);\n}", "public function generateOTPCode()\n {\n return generate_otp_code();\n }", "private function _otp_sender($phone, $token)\n {\n $email_api = urlencode(\"[email protected]\");\n $passkey_api = urlencode(\"Hm123123\");\n $phone_ = urlencode($phone);\n $message = urlencode(\"Click this link to verify your account : \" . base_url() . \"visitor/verify?phone=\" . $phone . \"&token=\" . $token . \" \");\n\n $url = \"https://reguler.medansms.co.id/sms_api.php?action=kirim_sms&email=\" . $email_api . \"&passkey=\" . $passkey_api . \"&no_tujuan=\" . $phone_ . \"&pesan=\" . $message . \"&json=1\";\n $result = $this->_send_api($url);\n $resultArr = json_decode($result, true);\n return $resultArr;\n }", "function sendUnicodeOtpSMS($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\" => \"unicodeotpmsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n post_to_url_unicode(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url_unicode to send single unicode sms \n}", "public function verifyConfigOTP() {\n\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrievePost( 'nonce' ), 'defVerifyOTP' ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$otp = HTTP_Helper::retrievePost( 'otp' );\n\t\t$otp = trim( $otp );\n\t\tif ( strlen( $otp ) == 0 ) {\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Please input a valid OTP code\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t\t\n\t\t$secret = Auth_API::getUserSecret();\n\t\t//at this stage, secret should have value, do not need to check\n\t\t$res = Auth_API::compare( $secret, $otp );\n\t\tif ( $res ) {\n\t\t\t//save it\n\t\t\tupdate_user_meta( get_current_user_id(), 'defenderAuthOn', 1 );\n\t\t\tupdate_user_meta( get_current_user_id(), 'defenderForceAuth', 0 );\n\t\t\twp_send_json_success();\n\t\t} else {\n\t\t\t//now need to check if the current user have backup otp\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Your OTP code is incorrect. Please try again.\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t}", "public function an_otp_mail_is_send_when_user_is_logged_in()\n {\n Mail::fake();\n\n $this->withExceptionHandling();\n $user = factory(User::class)->create();\n $res= $this->post('/login',['email' => $user->email,'password'=>'secret']);\n Mail::assertSent(OTPMail::class);\n\n //$res->assertRedirect('/');\n\n }", "public function defenderVerifyOTP() {\n\t\tif ( ( $otp = HTTP_Helper::retrievePost( 'otp', null ) ) != null ) {\n\t\t\t$params = array();\n\t\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrievePost( '_wpnonce' ), 'DefOtpCheck' ) ) {\n\t\t\t\t$params['error'] = new \\WP_Error( 'security_fail', __( \"Some error happen\", \"defender-security\" ) );\n\t\t\t}\n\t\t\t\n\t\t\t$login_token = HTTP_Helper::retrievePost( 'login_token' );\n\t\t\t$query = new \\WP_User_Query( array(\n\t\t\t\t'meta_key' => 'defOTPLoginToken',\n\t\t\t\t'meta_value' => $login_token,\n\t\t\t\t'blog_id' => 0\n\t\t\t) );\n\t\t\t$res = $query->get_results();\n\t\t\tif ( empty( $res ) ) {\n\t\t\t\t//no users, redirect to the login page immediatly\n\t\t\t\twp_redirect( site_url( 'wp-login.php', 'login_post' ) );\n\t\t\t\texit;\n\t\t\t} else {\n\t\t\t\t$user = $res[0];\n\t\t\t\t$secret = Auth_API::getUserSecret( $user->ID );\n\t\t\t\t$redirect = HTTP_Helper::retrievePost( 'redirect_to', admin_url() );\n\t\t\t\tif ( Auth_API::compare( $secret, $otp ) ) {\n\t\t\t\t\t//sign in\n\t\t\t\t\tdelete_user_meta( $user->ID, 'defOTPLoginToken' );\n\t\t\t\t\twp_set_current_user( $user->ID, $user->user_login );\n\t\t\t\t\twp_set_auth_cookie( $user->ID, true );\n\t\t\t\t\t$redirect = apply_filters( 'login_redirect', $redirect, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user );\n\t\t\t\t\twp_safe_redirect( $redirect );\n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\t\t\t\t$backupCode = get_user_meta( $user->ID, 'defenderBackupCode', true );\n\t\t\t\t\tif ( $backupCode && $backupCode['code'] == $otp && strtotime( '+3 minutes', $backupCode['time'] ) > time() ) {\n\t\t\t\t\t\tdelete_user_meta( $user->ID, 'defOTPLoginToken' );\n\t\t\t\t\t\tdelete_user_meta( $user->ID, 'defenderBackupCode' );\n\t\t\t\t\t\twp_set_current_user( $user->ID, $user->user_login );\n\t\t\t\t\t\twp_set_auth_cookie( $user->ID, true );\n\t\t\t\t\t\t$redirect = apply_filters( 'login_redirect', $redirect, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user );\n\t\t\t\t\t\twp_safe_redirect( $redirect );\n\t\t\t\t\t\texit;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$params['error'] = new \\WP_Error( 'opt_fail', __( \"Whoops, the passcode you entered was incorrect or expired.\", \"defender-security\" ) );\n\t\t\t\t\t\t$this->showOTPScreen( $user, $params );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function otpverification()\n\t{\t\n\t\tif($this->session->userdata('VB_USER_ID') <> ''):\n\t\t\tredirect(base_url().'my-profile');\n\t\tendif;\n\t\t$data['error'] \t\t\t\t\t\t= \t'';\n\t\t$data['formError'] \t\t\t\t\t=\t''; \t\n\n\t\tif($this->input->post('verifyotp')):\n\t\t\t\t$userData\t\t=\t$this->common_model->checkOTP(trim($this->session->userdata('VB_REGISTER_MOBILE')),trim($this->input->post('verifyotp')),'users','user_phone_otp');\n\t\t\t\tif($userData <> \"\"): \n\t\t\t\t\tif($userData['status'] == 'I'):\n\t\t\t\t\t\t$param['user_phone_verify']\t=\t'Y';\n\t\t\t\t\t\t$param['user_phone_otp']\t=\t'';\n\t\t\t\t\t\t$param['status']\t\t\t=\t'A';\n\t\t\t\t\t\t$this->common_model->editData('vb_users',$param,'user_id',$userData['user_id']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->session->unset_userdata('VB_REGISTER_MOBILE');\n\t\t\t\t\t\tsetcookie('VB_USER_LOGIN_TOKEN',$loginParam['user_token'],time()+60*60*24*100,'/');\n\t\t\t\t\t\t$this->session->set_userdata(array(\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_LOGGED_IN'\t\t=>\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_ID'\t\t\t=>\t$userData['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_FULL_NAME'\t\t\t=>\t$userData['full_name'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_EMAIL'\t\t\t=>\t$userData['user_email'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_MOBILE'\t\t=>\t$userData['mobile_number'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_TYPE_ID'\t\t=>\t$userData['usertype_id'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_TYPE_NAME'\t\t=>\t$userData['usertype_name'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_CURRENT_PATH'\t=>\t$currentPath));\n\t\t\t\t\t\techo \"success\";die;\n\t\t\t\t\telseif($userData['status'] == 'B'):\n\t\t\t\t\t\techo \"blocked\";die;\n\t\t\t\t\telseif($userData['status'] == 'A'):\n\t\t\t\t\t\techo \"active\";die;\n\t\t\t\t\tendif;\n\t\t\t\telse:\n\t\t\t\t\techo \"wrongotp\";die;\n\t\t\t\tendif;\n\t\tendif;\n\t\t\n\t\t$this->layouts->set_title(stripcslashes('OTP Verification | VBloggers'));\n\t\t$this->layouts->set_keyword(stripcslashes('OTP Verification | VBloggers'));\n\t\t$this->layouts->set_description(stripcslashes('OTP Verification | VBloggers'));\n\t\t\n\t\t$this->layouts->login_view('user/otpverification',array(),$data);\n\t}", "function add_otp($mobile,$otp)\n{\n\tglobal $sapiUrl,$sapiVersion,$sapiEncoding;\n\t\n\t$response = Array();\n\t\n\t$url = $sapiUrl.\"?VERSION=\".$sapiVersion.\"&ENCODING=\".$sapiEncoding.\"&METHOD=ADD_OTP&mobile=\".$mobile.\"&otp=\".$otp;\n\t\n\t$data = json_decode(file_get_contents($url),true);\n\t\n\t/* if ($data['RESULT'] == 'SUCCESS')\n\t{\n\t\t\t$response = $data['RESPONSE'];\n\t\t\treturn $response;\n\t\t\t\n\t} \n\telse{\n\t\t return $response;\n\t\t} */\n return $data;\n}", "public function getOTPCode(){\n\t\t\t\treturn $this->_CODE;\n\t\t\t}", "public function otp_confirm() {\n\t\tif (request()->method() == 'POST') {\n\n\t\t\t$rules = array(\n\t\t\t\t'code_confirm' => 'required',\n\t\t\t);\n\t\t\t// validation custom messages\n\t\t\t$niceNames = array(\n\t\t\t\t'code_confirm' => trans('admin_messages.code'),\n\t\t\t);\n\n\t\t\t$validator = Validator::make(request()->all(), $rules);\n\t\t\t$validator->setAttributeNames($niceNames);\n\t\t\tif ($validator->fails()) {\n\n\t\t\t\treturn back()->withErrors($validator)->withInput(); // Form calling with Errors and Input values\n\t\t\t} else {\n\n\t\t\t\t$code = request()->code_confirm;\n\t\t\t\t$user_id = request()->user_details;\n\n\t\t\t\t$user = User::find($user_id);\n\n\t\t\t\t// dd($session_code);\n\t\t\t\tif ($user->otp != $code) {\n\t\t\t\t\treturn back()->withErrors(['code_confirm' => trans('messages.store_dashboard.code_is_incorrect')])->withInput(); // Form calling with Errors and Input values\n\t\t\t\t}\n\t\t\t\treturn redirect()->route('reset_password');\n\t\t\t}\n\t\t} else {\n\t\t\t$user_id = session::get('reset_user_id');\n\t\t\t$user_details = User::findOrFail($user_id);\n\t\t\t$this->view_data['user_details'] = $user_details;\n\n\t\t\treturn view('home/forgot_password2', $this->view_data);\n\n\t\t}\n\t}", "function generate_otp_code(){\n return rand(1000,9999);\n}", "static function generateOtp()\n {\n $code = rand(1001, 9999);\n $otp = new Otp();\n $otp->otp = $code; \n $otp->valid_till = Carbon::now()\n ->addMinutes(env('OTP_VALID_MINUTES'))\n ->toDateTimeString(); \n $otp->save();\n \n return [\n 'otp' => $code,\n 'txn_id' => $otp->id\n ];\n }", "public function c_getHitosOtp() {\r\n $idOtp = $this->input->post('idOtp');\r\n $hitosotp = $this->Dao_ot_padre_model->getHitosOtp($idOtp);\r\n echo json_encode($hitosotp);\r\n }", "public function actionRestaurantOtpVerification() {\n //validate webservice\n $requiredParams = ['user_id', 'otp'];\n\n CommonApiHelper::validateRequestParameters($requiredParams);\n\n $response = [];\n\n try {\n //Get request parameters.\n $post = Yii::$app->request->bodyParams;\n $post = array_map('trim', $post);\n\n $user_id = $post['user_id'];\n //$access_token = $post['access_token'];\n $otp = $post['otp'];\n\n //Fetch logged in user details\n $userdata = Users::find()->where(['user_id' => $user_id])->one();\n\n //Verify OTP\n $otpVerified = RestaurantOtp::findOne(['email' => $userdata->email, 'status' => 1]);\n if (empty($otpVerified)) {\n return CommonApiHelper::return_error_response(\"OTP does not exist:\", \"Please contact Administrator to Generate OTP for your Restaurant.\", \"2\");\n } else if ($otpVerified->restaurant_otp != $otp) {\n return CommonApiHelper::return_error_response(\"Invalid OTP:\", \"Please enter correct OTP.\", \"3\");\n }\n\n //Update User Type to Restaurant and Verify OTP\n $userdata->user_type = Yii::$app->params['USER_TYPE']['restaurant'];\n $userdata->is_otp_verified = 1;\n $userdata->save(false);\n\n //Prepare response\n $response[] = [\n 'user_id' => $userdata->user_id,\n 'user_type' => $userdata->user_type,\n 'name' => $userdata->name,\n 'email' => $userdata->email,\n 'profile_pic' => !empty($userdata->profile_pic) ? $userdata->profile_pic : '',\n 'is_otp_verified' => $userdata->is_otp_verified\n ];\n //Remove OTP\n $otpVerified->delete();\n\n return CommonApiHelper::return_success_response(\"OTP has been verified successfully.\", \"\", $response);\n } catch (\\Exception $e) {\n return CommonApiHelper::return_error_response('Sorry, Please try again.');\n }\n }", "function forget_send_code($mobile) {\n\t\t$varifycode = rand('10000000', '99999999');\n\t\t//$code = 1234;\n\t\t$code = str_pad($varifycode, 3, '0', STR_PAD_LEFT);\n\t\t$mobileNumber = substr($mobile, 1);\n\t\t$msg = \"New Password of Recharge login : \" . $code;\n\t\t$encodedMessage = urlencode($msg);\n\t\t// $route = \"4\";\n\t\t// $authKey = \"109829ANu1kqLdg570b4e25\";\n\t\t// $senderId = \"Recharge\";\n\t\t// $postData = array(\n\t\t// 'authkey' => $authKey,\n\t\t// 'mobiles' => $mobileNumber,\n\t\t// 'message' => $encodedMessage,\n\t\t// 'sender' => $senderId,\n\t\t// 'route' => $route\n\t\t// );\n\t\t//$url=\"http://api.msg91.com/api/sendhttp.php\";\n\t\t$url = \"http://www.kudisms.net/components/com_spc/smsapi.php?username=smerp&password=abhishek&sender=kudisms&recipient='\" . $mobile . \"'&message=\" . $encodedMessage;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $postData, CURLOPT_FOLLOWLOCATION => true));\n\t\t//\n\t\t//\n\t\t// //Ignore SSL certificate verification\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t//\n\t\t//\n\t\t// //get response\n\t\t$output = curl_exec($ch);\n\t\t//\n\t\t// if (curl_errno($ch)) {\n\t\t// $result = array('status' => 'false', 'message' => 'Error in sending OTP, please verify your contact number and try again.');\n\t\t// echo json_encode($result);\n\t\t// exit();\n\t\t// // // //\n\t\t// }\n\t\tcurl_close($ch);\n\t\treturn $code;\n\t}", "public function generateOtp()\n {\n $digit = 4;\n $otpNumber = rand(pow(10, $digit - 1), pow(10, $digit) - 1);\n return $otpNumber;\n }", "private function showOTPScreen( $user, $params = array() ) {\n\t\t//now show the OTP screen\n\t\t$this->addAction( 'login_enqueue_scripts', 'includeAuthStyles' );\n\t\twp_enqueue_script( 'jquery' );\n\t\t$params['loginToken'] = $this->createLoginToken( $user );\n\t\t$params['redirect_to'] = HTTP_Helper::retrievePost( 'redirect_to' );\n\t\tif ( ! isset( $params['error'] ) ) {\n\t\t\t$params['error'] = null;\n\t\t}\n\t\t//if this goes here then the current user is ok, need to show the 2 auth\n\t\t$this->renderPartial( 'login/otp', $params );\n\t\texit;\n\t}", "public function sendPasswordReset(Request $request)\n {\n\n //creating full mobile number\n $full_mobile_number = $request->country_code.$request->mobile_number;\n $user = $this->user->where('full_mobile_number', $full_mobile_number)->first();\n\n if(!$user) {\n return $this->api->json(false, 'MOBILE_NUMBER_NOT_EXIST', 'Entered mobile number does not exist in our database.');\n }\n\n\n\n //crate otp entry\n $otp = $this->otp->createOtpToken($user->country_code, $user->mobile_number);\n\n $contactEmail = $this->setting->get('website_contact_email');\n $messageText = \"Your password reset one time password(OTP) is : {{otp_code}}. If you receives this mail or sms multiple times then contact to our support {$contactEmail}\";\n $messageText = str_replace('{{otp_code}}', $otp->token, $messageText);\n\n //send otp via sms\n $this->otp->sendMessage($user->country_code, $user->mobile_number, $messageText);\n // send otp via email\n $this->email->sendCommonEmail($user->email, $user->fname, 'Password reset OTP', $messageText);\n\n return $this->api->json(true, 'PASSWORD_RESET_OTP_SENT', 'Password reset otp sent. Check you registerd mobile and email.');\n\n\n }", "public function generate_seller_otp($seller_id, $otp, $mobile){\n\n $this->db->where(\"seller_id\", $seller_id);\n\n $this->db->delete(\"seller_otp\");\n\n\n\n //Enter new otp\n\n $otp = array(\n\n \"seller_id\" => $seller_id,\n\n \"otp_code\" => $otp,\n\n \"is_verified\" => 0,\n\n \"timestamp\" => time()\n\n );\n\n\n\n $insert = $this->db->insert(\"seller_otp\", $otp);\n\n\n\n if($insert){\n\n $result['success'] = 1;\n\n }\n\n else{\n\n $result['success'] = 0; \n\n }\n\n\n\n return $result;\n\n\n\n }", "public function sendOtp(Request $request)\n {\n try{\n $ResetValidate = $this->ResetValidate($request);\n if($ResetValidate){\n return $ResetValidate;\n } \n $user = Otp::select('email')->where('email', $request->email)->orderBy('id', 'desc')->first();\n if(!$user){\n try{\n $userInfo = Consultant::where('email' , $request->email)->first();\n $userEmail = Consultant::select('email')->where('email', $request->email)->first();\n $otp = $this->generateOtp(); \n $details = [\n 'greeting' => trans('response_msg.greeting') . ' '. $userInfo['name'],\n 'body' => trans('response_msg.body').' : ' .$otp,\n 'thanks' => trans('response_msg.thanks'),\n ]; \n Notification::send($userEmail , new SendOtpRestPasswordNotification($details));\n Otp::create([\n 'email' => $request->email,\n 'code' => $otp,\n 'receiver_id' => $userInfo['id']\n ]);\n return $this->returnSuccessMessage(trans('response_msg.successOtp'),'S000'); \n }catch (\\Exception $ex){\n return $this->returnError($ex->getCode(), $ex->getMessage());\n }\n\n }\n $userDetails = Consultant::select('name')->where('email' , $request->email)->first();\n $emailDetails = Consultant::select('email')->where('email', $request->email)->first();\n $old_otp = Otp::select('code')->where('email', $request->email)->orderBy('id', 'desc')->first();\n $details = [\n 'greeting' => trans('response_msg.greeting'). ' '.$userDetails['name'],\n 'body' => trans('response_msg.body').' : ' . $old_otp['code'],\n 'thanks' => trans('response_msg.thanks'),\n ]; \n Notification::send($emailDetails, new SendOtpRestPasswordNotification($details));\n return $this->returnSuccessMessage(trans('response_msg.successOtp'),'S000'); \n }catch (\\Exception $ex){\n return $this->returnError($ex->getCode(), $ex->getMessage());\n }\n\n }", "function forget_send_code($mobile){\n\t\t$varifycode = rand('10000000', '99999999');\n\t\t//$code = 1234;\n\t\t $code = str_pad($varifycode, 3, '0', STR_PAD_LEFT);\n\t\t $mobileNumber = substr($mobile, 1);\n\t\t $msg = \"New Password of Recharge login : \" . $code;\n $encodedMessage = urlencode($msg);\n $route = \"4\";\n $authKey = \"109829ANu1kqLdg570b4e25\";\n $senderId = \"Recharge\";\n $postData = array(\n 'authkey' => $authKey,\n 'mobiles' => $mobileNumber,\n 'message' => $encodedMessage,\n 'sender' => $senderId,\n 'route' => $route\n);\n $url=\"http://api.msg91.com/api/sendhttp.php\";\n $ch = curl_init();\ncurl_setopt_array($ch, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $postData\n ,CURLOPT_FOLLOWLOCATION => true\n));\n// \n// \n// //Ignore SSL certificate verification\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n// \n// \n// //get response\n $output = curl_exec($ch);\n// \n // if (curl_errno($ch)) {\n\t // $result = array('status' => 'false', 'message' => 'Error in sending OTP, please verify your contact number and try again.');\n // echo json_encode($result);\n\t\t\t // exit();\n// // // // \n\t\t // }\n curl_close($ch);\n\t\treturn $code;\n\t}", "public static function generateOtp()\n {\n $string = '0123456789';\n $string_shuffled = str_shuffle($string);\n $OTP = substr($string_shuffled, 1, 6);\n return $OTP;\n }", "public function resendOtp($subscriber_id, $app_id)\n {\n $data['message'] = \"empty response!\";\n if (!empty($subscriber_id) && !empty($app_id)) {\n $subscription_data = $this->getSubscriptionStatus($subscriber_id, $app_id);\n if ($subscription_data != null) {\n // $data['data'] = $subscription_data;\n if ($subscription_data['status'] === 'UNREGISTERED') {\n\n $sub_response = json_decode($this->subscribe($app_id, $subscriber_id), true);\n\n $data['subscribe'] = $sub_response;\n\n if (isset($sub_response['subscriptionStatus'])\n && $sub_response['subscriptionStatus'] == \"REGISTERED\") {\n $data[\"valid_subscriber\"] = true;\n $data['message_ussd'] = 'you are already subscribed! resending your OTP';\n $subData = new SubscriptionData();\n $subData->appId = $app_id;\n $subData->subscriberId = $this->refineSubscriberId($subscriber_id);\n $otp = $this->generateRandomString(6);\n $subData->otp = $otp;\n\n if ($subData->save()) {\n $link_msg = isset($link) ? 'Download this app from: ' . $this->getPlaystoreLink($app_id) : \"\";\n $msg = \"You have successfully subscribed to our service. Your code is:\" . $otp . \" Please use this Code or open http://activate?otp=\" . $otp . \" with your APP to avail your service.\" . $link_msg . \" Thank you \";\n $musk = $this->refineSubscriberId($subscriber_id);\n $data['msg'] = $msg;\n $data['resend_otp'] = json_decode($this->sendSubsriptionSmsToSubscriber($app_id, $msg, $musk));\n }\n\n\n $sms = new SmsSaved();\n\n $sms->version = isset($sub_response['version']) ? $sub_response['version'] : \"\";\n $sms->applicationId = isset($app_id) ? $app_id : \"\";\n $sms->subscriberId = isset($subscriber_id) ? $this->refineSubscriberId($subscriber_id) : \"\";\n $sms->status = isset($sub_response['subscriptionStatus']) ? $sub_response['subscriptionStatus'] : \"\";\n $sms->otp_id = $otp;\n $sms->frequency = isset($frequency) ? $frequency : \"mannual\";\n $sms->timeStamp = isset($timeStamp) ? $timeStamp : \"\";\n\n\n if ($sms->save()) {\n $data['sucess'] = true;\n $data['message'] = \"already subscribed but otp generation failed! resending!\";\n }\n\n } else {\n $data[\"valid_subscriber\"] = false;\n $data['message'] = \"trying to re-subscribe!\";\n $data['message_ussd'] = 'Thanks for the request. Please wait until you got a pop up asking to confirm your your subscription.';\n }\n\n\n } else if ($subscription_data['status'] === 'REGISTERED') {\n $data[\"valid_subscriber\"] = true;\n $data['message'] = \"resending otp!\";\n $data['message_ussd'] = 'you are already subscribed! resending your OTP';\n $data[\"otp\"] = SubscriptionData::where(['subscriberId' => $subscriber_id, 'AppId' => $app_id,])->get('otp')->last()['otp'];\n $link = $this->getPlaystoreLink($app_id);\n $link_msg = isset($link) ? 'Download this app from: ' . $link : \"\";\n $msg = \"You have successfully subscribed to our service. Your code is:\" . $data['otp'] . \" Please use this Code or open http://activate?otp=\" . $data['otp'] . \" with your APP to avail your service.\" . $link_msg . \" Thank you \";\n $musk = $this->refineSubscriberId($subscriber_id);\n $data['resend_otp'] = json_decode($this->sendSubsriptionSmsToSubscriber($app_id, $msg, $musk));\n $data['msg'] = $msg;\n\n }\n } else {\n $data['message'] = \"no data! >> new!\";\n $data['message_ussd'] = 'Thanks for the request. Please wait until you got a pop up asking to confirm your your subscription.';\n $data['subscribe'] = json_decode($this->subscribe($app_id, $subscriber_id));\n }\n\n } else {\n $data['message'] = \"params missing!\";\n }\n\n\n return $data;\n }", "function send_code($mobile_no) {\n\n\t\t$varifycode = rand('1000', '9999');\n\t\t$code = str_pad($varifycode, 3, '0', STR_PAD_LEFT);\n\t\t$code = 1234;\n\t\t$mobile = \"0\" . $mobile_no;\n\t\t// $mobileNumber = substr($mobile_no, 1);\n\t\t$msg = \"Recharge Verification Code : \" . $code;\n\t\t$encodedMessage = urlencode($msg);\n\t\t// $route = \"4\";\n\t\t// $authKey = \"109829ANu1kqLdg570b4e25\";\n\t\t// $senderId = \"Recharge\";\n\t\t// $postData = array(\n\t\t// 'authkey' => $authKey,\n\t\t// 'mobiles' => $mobileNumber,\n\t\t// 'message' => $encodedMessage,\n\t\t// 'sender' => $senderId,\n\t\t// 'route' => $route\n\t\t// );\n\t\t$url = \"http://www.kudisms.net/components/com_spc/smsapi.php?username=smerp&password=abhishek&sender=kudisms&recipient=$mobile&message=\" . $encodedMessage;\n\t\t// $url=\"http://api.msg91.com/api/sendhttp.php\";\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true,\n\t\t// CURLOPT_POSTFIELDS => $postData\n\t\tCURLOPT_FOLLOWLOCATION => true));\n\t\t//\n\t\t//\n\t\t// //Ignore SSL certificate verification\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t//\n\t\t//\n\t\t// //get response\n\t\t$output = curl_exec($ch);\n\t\t//\n\t\t// if (curl_errno($ch)) {\n\t\t// $result = array('status' => 'false', 'message' => 'Error in sending OTP, please verify your contact number and try again.');\n\t\t// echo json_encode($result);\n\t\t// exit();\n\t\t// // // //\n\t\t// }\n\t\tcurl_close($ch);\n\t\treturn $code;\n\t\t//echo $output;\n\t}", "function send_code($mobile_no) {\n\n\t\t$varifycode = rand('1000', '9999');\n\t\t$code = str_pad($varifycode, 3, '0', STR_PAD_LEFT);\n\t\t$code = 1234;\n\t\t// $mobileNumber = substr($mobile_no, 1);\n\t\t// $msg = \"Recharge Verification Code : \" . $code;\n // $encodedMessage = urlencode($msg);\n // $route = \"4\";\n // $authKey = \"109829ANu1kqLdg570b4e25\";\n // $senderId = \"Recharge\";\n // $postData = array(\n // 'authkey' => $authKey,\n // 'mobiles' => $mobileNumber,\n // 'message' => $encodedMessage,\n // 'sender' => $senderId,\n // 'route' => $route\n// );\n// $url=\"http://api.msg91.com/api/sendhttp.php\";\n // $ch = curl_init();\n// curl_setopt_array($ch, array(\n // CURLOPT_URL => $url,\n // CURLOPT_RETURNTRANSFER => true,\n // CURLOPT_POST => true,\n // CURLOPT_POSTFIELDS => $postData\n // //,CURLOPT_FOLLOWLOCATION => true\n// ));\n// \n// \n// //Ignore SSL certificate verification\n// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n// \n// \n// //get response\n// $output = curl_exec($ch);\n// \n // if (curl_errno($ch)) {\n\t // $result = array('status' => 'false', 'message' => 'Error in sending OTP, please verify your contact number and try again.');\n // echo json_encode($result);\n\t\t\t // exit();\n// // // // \n\t\t // }\n // curl_close($ch);\nreturn $code;\n\t\t//echo $output;\n\t}", "public function loginUsingOtp(Request $request){\n Log::info('#############################################################');\n Log::info('Inside loginUsingOtp() :: Role: USER');\n Log::info('#############################################################');\n if($request->phone && $request->otp){\n // First check phone is valid or not\n $user = \\App\\User::where('phone', $request->phone)->get()->first();\n Log::info('IsRoleCustomer: ' .$user->hasRole('Customer'));\n if($user && $user->hasRole('Customer')){\n if($user->is_active == 1){\n Log::info('IsActive: ' .$user->is_active);\n\n $sms = new Sms();\n Log::info('Calling Verify OTP.....: ');\n $verifyResponse = $sms->verifyOtp($request->phone, $request->otp);\n if($verifyResponse['valid_otp'] == true){\n Log::info('OTP Verification: true');\n $user->password = \\Hash::make($request->otp);\n $user->save();\n\n Log::info('Saving push token......');\n if($request->push_token){\n $this->savePushToken($user->id, $request->push_token);\n }\n\n $defaultAddress = null;\n if ($user->default_address_id !== 0) {\n $default_address = \\App\\Address::where('id', $user->default_address_id)->get()->first();\n }\n\n\n try{\n if($request->meta != null){\n $loginSession = LoginSession::where('user_id', $user->id)->get()->first();\n if(!$loginSession){\n $loginSession = new LoginSession();\n $loginSession->user_id = $user->id;\n }\n $loginSession->login_at = Carbon::now();\n $loginSession->mac_address = isset($request->meta['MAC']) ? $request->meta['MAC'] : null;\n $loginSession->ip_address = isset($request->meta['wifiIP']) ? $request->meta['wifiIP'] : null;\n $loginSession->manufacturer = isset($request->meta['manufacturer']) ? $request->meta['manufacturer'] : null;\n $loginSession->model = isset($request->meta['model']) ? $request->meta['model'] : null;\n $loginSession->sdk = isset($request->meta['sdk']) ? $request->meta['sdk'] : null;\n $loginSession->brand = isset($request->meta['brand']) ? $request->meta['brand'] : null;\n $loginSession->save();\n\n }\n }catch (\\Throwable $th) {\n Log::error('ERROR inside login() during meta record insertion');\n Log::error('ERROR: ' .$th->getMessage());\n }\n\n Log::info('Fetch Running Orders.....');\n //$running_order = null;\n $running_orders = \\App\\Order::where('user_id', $user->id)\n ->whereIn('orderstatus_id', ['1', '2', '3', '4', '7', '8'])\n ->with('orderitems', 'restaurant')\n ->get();\n\n $response = [\n 'success' => true,\n 'message' => \"login success\",\n 'data' => [\n 'id' => $user->id,\n 'auth_token' => $user->auth_token,\n 'name' => $user->name,\n 'photo' => $user->photo,\n 'email' => $user->email,\n 'email_verified_at' => $user->email_verified_at,\n 'phone' => $user->phone,\n 'default_address_id' => $user->default_address_id,\n 'default_address' => $defaultAddress,\n 'delivery_pin' => $user->delivery_pin,\n 'wallet_balance' => $user->balanceFloat,\n 'photo' => $user->photo,\n 'running_orders' => $running_orders,\n ], \n ];\n return response()->json($response);\n\n }else{\n return response()->json(['success' => false,\"message\" => \"Invalid OTP\", ]);\n }\n }else{\n throw new AuthenticationException(ErrorCode::ACCOUNT_BLOCKED, \"User blocked\");\n }\n }else{\n if(!$user)throw new AuthenticationException(ErrorCode::PHONE_NOT_EXIST, \"Customer not found for \" .$request->phone);\n if(!$user->hasRole('Customer'))throw new AuthenticationException(ErrorCode::BAD_REQUEST, \"Invalid Role \");\n throw new AuthenticationException(ErrorCode::BAD_RESPONSE, \"Something error happened\");\n }\n\n\n }else{\n if(!$request->phone)throw new ValidationException(ErrorCode::INVALID_REQUEST_BODY, \"phone should not be null\");\n if(!$request->otp)throw new ValidationException(ErrorCode::INVALID_REQUEST_BODY, \"otp should not be null\");\n return response()->json([\n 'success' => false,\n \"message\" => \"Invalid request body\"\n ]);\n }\n }", "public function verify($otp, $input, $window = null);", "public function otp($email)\n {\n \n return true;\n }", "public function otpVerification(Request $request){\n $status = 0;\n $message = \"\";\n Utility::stripXSS();\n $this->encdesc($request->get('email'),'decrypt');\n if(!$this->verifyChecksum($request)){\n return response()->json([\"status\"=>0,\n \"message\"=>'checksum not verified',\n \"data\"=>json_decode('{}')]);\n }\n\n\n try{\n $validator = Validator::make($request->all(), [\n 'otp' => 'required|string',\n 'email' => 'required|string|max:255'\n ]);\n\n //$validator->errors()\n if($validator->fails()){\n return response()->json([\"status\"=>$status,\"message\"=>\"Invalid input data.\",\"data\"=>json_decode(\"{}\")]);\n }\n\n\n $request->email = $this->string_replace(\"__\",\"/\",$request->email);\n\n $request->otp = $this->encdesc($request->otp,'decrypt');\n\n $request->merge([\n 'email' => $request->email,\n 'otp' => $request->otp\n ]);\n //echo $request->otp; die;\n if(isset($request->email) && isset($request->otp)){\n $cond = [['email',$request->email],['otp',$request->otp]];\n }\n $user = User::where($cond)->get();\n //print_r($user[0]->status); die;\n if($user->count()>0){\n if($user[0]->verified_otp != 1){\n $status = 1;\n //User::where('email', $user[0]->email)->update(['verified_otp'=>1,'status'=>'1']);\n User::where('email', $user[0]->email)->update(['verified_otp'=>1]);\n\n $data = [];\n //$request->email = $this->string_replace(\"_\",\"/\",$request->email);\n $data['email'] = $this->encdesc($user[0]->email,'decrypt');\n $data['name'] = ucwords($user[0]->name);\n $data['role_id'] = $user[0]->role_id;\n $data['supportEmail'] = config('mail.supportEmail');\n $data['website'] = config('app.site_url');\n $data['site_name'] = config('app.site_name');\n $data['subject'] = 'Registration OTP verification Success From '.config('app.site_name');\n $data['email_msg_1'] = '';\n //$data['password'] = $request->get('password');\n if($user[0]->role_id == 3){\n $data['email_msg_1'] = '<br>Your registration details have been sent to the administrator for approval. Once approved, your listing will be visible on the Namaste Yoga app<br><br>';\n }\n if($this->SendMail($data,'verified_registration')){\n\n //notify code starts\n $user[0]->type = $user[0]->Role->role;\n $this->sendNotificationMail($user[0]);\n //notify code ends\n return response()->json(['status'=>$status,'message'=>\"Successfully verified OTP\",'data'=>json_decode(\"{}\")]);\n }else{\n return response()->json(['status'=>0,'message'=>\"Mail not sent\",'data'=>json_decode(\"{}\")]);\n }\n }else{\n return response()->json(['status'=>$status,'message'=>\"OTP Already verified\",'data'=>json_decode(\"{}\")]);\n }\n }else{\n return response()->json(['status'=>$status,'message'=>\"Invalid input data\",'data'=>json_decode(\"{}\")]);\n }\n }catch(Exception $e){\n $message = \"Technical error\";\n return response()->json(['status'=>$status,'message'=>$message,'data'=>json_decode(\"{}\")]);\n }\n\n }", "public function updateOtpCode($otp)\n {\n $pdo = static::getDB();\n\n $sql = \"UPDATE users SET otp = :otp, otp_last_date = TO_DATE(:otp_last_date, 'YYYY-MM-DD HH24:MI:SS') WHERE email = :email\";\n\n $result = $pdo->prepare($sql);\n\n return $result->execute([\n ':email' => $this->email,\n ':otp' => $otp,\n ':otp_last_date' => Extra::getCurrentDateTime()\n ]);\n }", "private function getYubikeyKeyByOTP($otp){\n\t\treturn substr($otp, 0, 12);\n\t}", "public function verify_otp_get($email=null,$otp=null){\n\t\tif(!empty($email) && !empty($otp)){\n\t\t\t$q = $this->db->where('email',$email)->where('verification_code',$otp)->get('users')->result();\n\t\t\tif(count($q)>0){\n\t\t\t\t$this->response(['Correct'], REST_Controller::HTTP_OK);\n\t\t\t}else{\n\t\t\t\t$this->response(['Invaild Email or OTP.'], '500');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->response(['Too few arguments'], '500');\n\t\t}\n\t}", "static function password_forgot() {\n parent::password_forgot();\n view_var('user', globals('user'));\n }", "public function matchOTP(Request $request){\n\n /** validation */\n $validator = Validator::make($request->all(), [\n 'otp' => 'required',\n 'user_id' => 'required'\n ],[]);\n\n if ($validator->fails()) {\n $response = ['status'=>'false','message'=>'Validation errors','errors'=>$validator->errors()];\n return response()->json($response);\n }\n\n $user = User::where('id',$request['user_id'])->first();\n \n if(!empty($user)){\n\n if($user->otp == $request['otp']){\n\n\n $user->otp = NULL;\n $user->is_email_verified = '1';\n $user->save();\n\n $response = ['status'=>'true','message'=>'Your account verified successfully'];\n return response()->json($response);\n\n }else{\n $response = ['status'=>'false','message'=>'User not identified'];\n return response()->json($response);\n }\n\n }else{\n $response = ['status'=>'false','message'=>'User not identified'];\n return response()->json($response);\n }\n\n }", "public function setOtp(string $otp)\n {\n $this->otp = $otp;\n\n return $this;\n }", "public function forgotPassword(Request $request){\n $status = 0;\n $message = \"\";\n\n if(!$this->verifyChecksum($request)){\n return response()->json([\"status\"=>0,\n \"message\"=>'checksum not verified',\n \"data\"=>json_decode('{}')]);\n }\n\n Utility::stripXSS();\n try{\n $validator = Validator::make($request->all(), [\n 'email' => 'required|string|max:255',\n ]);\n\n //$validator->errors()\n if($validator->fails()){\n return response()->json([\"status\"=>$status,\"message\"=>\"invalid input.\",\"data\"=>json_decode(\"{}\")]);\n }\n $request->email = $this->string_replace(\"__\",\"/\",$request->email);\n $request->merge([\n 'email'=>$request->email\n ]);\n $users = User::where('email',$request->email)->get();\n\n\n if($users->count() > 0){\n\n\n if(!$this->checkOtpHistory('FP',$users[0]->id)){\n return response()->json(['status'=>$status,'message'=>'Your OTP limit over now. Please try after 24 hour','data'=>json_decode(\"{}\")]);\n }\n\n $userObj = new User();\n $newpassOrig = $userObj->generateVarchar();\n $data = array();\n\n $data['email'] = $this->encdesc($request->email,'decrypt');\n $data['name'] = ucwords($this->encdesc($users[0]->name,'decrypt'));\n $data['supportEmail'] = config('mail.supportEmail');\n $data['website'] = config('app.site_url');\n $data['site_name'] = config('app.site_name');\n //$data['newpass'] = $newpassOrig;\n //$newpassOrigEnc = Hash::make($newpassOrig);\n $otp = rand(111111,999999);\n $data['otp'] = $otp;\n\n\n $data['subject'] = 'Password change OTP from '.config('app.site_name');\n $this->SendMail($data,'change_pass_otp');\n\n $users[0]->otp = $otp;\n $users[0]->verified_otp = 0;\n if($users[0]->save()){\n\n $otpHistory = new OtpHistory();\n $otpHistory->user_id = $users[0]->id;\n $otpHistory->type = 'FP';\n $otpHistory->save();\n\n return response()->json(['status'=>1,'message'=>'Otp sent','data'=>json_decode(\"{}\")]);\n }else{\n return response()->json(['status'=>$status,'message'=>'mail not sent','data'=>json_decode(\"{}\")]);\n }\n }else{\n return response()->json(['status'=>$status,'message'=>'If the email address is known to us, we will send a OTP in a few minutes.','data'=>json_decode(\"{}\")]);\n }\n\n }catch(Exception $e){\n return response()->json(['status'=>$status,'message'=>'exception error','data'=>json_decode(\"{}\")]);\n }\n }", "public function getCreatedOTP()\n {\n return $this->getOTPHandler()->getOtp();\n }", "function statement($details,$phone){\n\t$ussd_text=\"CON <br/> Enter your PIN\"; \n ussd_proceed($ussd_text); \n}", "public function __construct($length,$strength){ \n\t\t\t$this->_generateOTP($length,$strength);\n\t\t}", "public function sendIpnForUpdatedUser($userId){\r\n \r\n // send ipn to AMT\r\n $objAmtIpnHndlr = new AmtIpnHandler();\r\n $objAmtIpnHndlr->sendIpnForUser($userId);\r\n \r\n }", "public function generateNumericOTP($n) {\r\n // all numeric digits \r\n $generator = \"1357902468\"; \r\n \r\n // Iterate for n-times and pick a single character \r\n // from generator and append it to $result \r\n \r\n // Login for generating a random character from generator \r\n // ---generate a random number \r\n // ---take modulus of same with length of generator (say i) \r\n // ---append the character at place (i) from generator to result \r\n \r\n $result = \"\"; \r\n \r\n for ($i = 1; $i <= $n; $i++) { \r\n $result .= substr($generator, (rand()%(strlen($generator))), 1); \r\n } \r\n \r\n // Return result \r\n return $result; \r\n}", "public function resetPassWord($email, $phone, $userName, $otp, $pass, $transId) {\n\t\t$this->processing_code = \"1012\";\n\t\t$data = new stdClass();\n\t\tif(empty($email))\n\t\t\t$data->email = \"\";\n\t\telse\n\t\t\t$data->email = $email;\n\t\t\n\t\tif(empty($phone))\n\t\t\t$data->phone = \"\";\n\t\telse\n\t\t\t$data->phone = $phone;\n\t\t\n\t\t$data->user_name = $userName;\n\t\t\n\t\tif(is_null($transId))\n\t\t\t$data->request_id = \"RGT\" . date(\"Ymd\") . rand();\n\t\telse\n\t\t\t$data->request_id = $transId;\n\t\t\n\t\tlog_message('error', 'data request resetPassWord: ' . print_r($data, true));\n\t\t$data->otp = $otp;\n\t\t$data->password = $pass;\n\t\t\n\t\t$key3des = $this->getSessionKey();\n\t\tif(!$key3des)\n\t\t\treturn false;\n\t\t\n\t\t$encryptData = $this->encrypt3DES(json_encode($data), $key3des);\n\t\t$requestMegaV = $this->requestMegaVCore($encryptData);\n\t\tlog_message('error', 'data respone: ' . print_r($requestMegaV, true));\n\t\treturn $requestMegaV;\n\t}", "public function __construct($registant,$otp)\n {\n $this->registant = $registant;\n $this->otp = $otp;\n }", "function generateNumericOTP() {\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 <= 5; $i++) { \n $result .= substr($generator, (rand()%(strlen($generator))), 1); \n } \n \n // Return result \n return $result; \n}", "function _checkYubikeyOTP($otp) {\n try {\n $yubi = &new Auth_Yubico($this->client_id, $this->api_key);\n $auth = @$yubi->verify($otp);\n } catch ( PEAR_Exception $e) {\n common_log(LOG_ERR, \"Yubikey:: exception \".$e);\n return false;\n } \n if (PEAR::isError($auth)) {\n common_log(LOG_ERR, \"Yubikey:: Authentication failed: \" . $auth->getMessage().' Response: '.$yubi->getLastResponse());\n return false;\n } else {\n common_log(LOG_DEBUG, \"Yubikey:: Valid OTP login\");\n return true;\n }\n }", "public function otpResetPassword()\n {\n $this->setRules([ StringLiterals::EMAIL => 'required|max:100|email','access_otp_token' => 'required|numeric','acesstype' => StringLiterals::REQUIRED,StringLiterals::PASSWORD => 'required|min:6',\n //'password_confirmation' => 'required|same:password|min:6' \n ]);\n $this->_validate();\n $this->_customer = $this->_customer->where([ 'email' => $this->request->email,'access_otp_token' => $this->request->access_otp_token ])->first();\n if (isset($this->_customer) && is_object($this->_customer) && ! empty($this->_customer->id)) {\n $this->_customer->access_token = $this->randomCharGen(30);\n $this->_customer->access_otp_token = '';\n $this->_customer->acesstype = $this->request->acesstype;\n $this->_customer->password = Hash::make($this->request->password);\n if ($this->_customer->save()) {\n return true;\n }\n }\n return false;\n }", "public function generateOtp() \n {\n return rand(100000,999999);\n }", "public function sendEDM($type, $emaildata) {\n $subject_admin = '';\n $content_admin = '';\n $storename = $emaildata['storename'];\n $fromemail = $emaildata['from'];\n $myto = $emaildata['to'];\n $username = $emaildata['username'];\n $key = 'f894535ddf80bb745fc15e47e42a595e';\n\n if ($type == 1) {\n $auto_otp = $emaildata['otp'];\n\n if ($auto_otp != '') {\n $subject = 'Thank you for registering with ' . $storename . '. Verify your e-mail address';\n $content = \"Hi \" . $username . \",<br /><br />\n\t\t\t\t\t\t\tIn order to activate your \" . $storename . \" account, we need to verify your email address. Please use the authentication code below to log in:<br /><br />\n\t\t\t\t\t\t\t\" . $auto_otp . \"<br /><br />\n\t\t\t\t\t\t\tWishing you a great experience at \" . $storename . \".<br /><br />\n\t\t\t\t\t\t\tBest Regards,<br />\n\t\t\t\t\t\t\tTeam \" . $storename;\n } else {\n $subject = 'Congratulations! You are now registered on ' . $storename;\n $content = \"Hi \" . $username . \",<br /><br />\n\t\t\t\t\t\t\tThank you for verifying your email address. You are now successfully registered on \" . $storename . \" app. Get your palate ready for some delicious food!<br /><br />\n\t\t\t\t\t\t\tBest Regards,<br />\n\t\t\t\t\t\t\tTeam \" . $storename;\n }\n } elseif ($type == 2) {\n $subject = 'Congratulations! You are now registered on ' . $storename;\n $content = \"Hi \" . $username . \",<br /><br />\n\t\t\t\t\t\tThank you for verifying your email address. You are now successfully registered on \" . $storename . \" app. Get your palate ready for some delicious food!<br /><br />\n\t\t\t\t\t\tBest Regards,<br />\n\t\t\t\t\t\tTeam \" . $storename;\n } elseif ($type == 3) {\n $subject = 'Thank you for registering with ' . $storename;\n $content = \"Hi \" . $username . \",<br /><br />\n\t\t\t\t\t\tThank you for your registration request with \" . $storename . \". We will verify the registration and revert within 24 hrs.<br /><br />\n\t\t\t\t\t\tBest Regards,<br />\n\t\t\t\t\t\tTeam \" . $storename;\n\n // email to Admin\n if ($emaildata['is_verified'] == 0) { // if not whitelisted domain\n $name = $emaildata['name'];\n $time = date('Y-m-d H:i:s');\n $mob = $emaildata['phone'];\n $timestamp = strtotime(\"now\");\n $base_user_id = $emaildata['base_user_id'];\n $subject_admin = 'Admin, you have received a registration request';\n $content_admin = 'Hi Admin,<br /><br />\n\t\t\t\t\t\t\t\t\tYou have received a registration request for PuristMeal app. Here are the details: <br /><br />\n\t\t\t\t\t\t\t\t\tUser Name: ' . $name . '<br />\n\t\t\t\t\t\t\t\t\tRegistration Time: ' . $time . '\n\t\t\t\t\t\t\t\t\tUser Email: <b>' . $myto . '</b><br />\n\t\t\t\t\t\t\t\t\tUser Mobile: ' . $mob . '<br /><br /> \n\t\t\t\t\t\t\t\t\tPlease <a href=\"http://52.41.179.72/users/' . $base_user_id . '/1/' . $timestamp . '\">ACCEPT</a> or <a href=\"http://52.41.179.72/users/' . $base_user_id . '/0/' . $timestamp . '\">DECLINE</a> the registration.\n\t\t\t\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t\t\t\tBest Regards,<br />\n\t\t\t\t\t\t\t\t\tTeam ' . $storename;\n }\n } elseif ($type == 4) {\n $status = $emaildata['status'];\n if ($status == 1) {\n $subject = 'Congratulations! You are now registered on ' . $storename;\n $content = \"Hi \" . $username . \",<br /><br />\n\t\t\t\t\t\t\tCongratulations! You have got successfully registered on PuristMeal App. Get your palate ready for some delicious food.<br /><br />\n\t\t\t\t\t\t\tJust log in and start ordering.<br /><br />\n\t\t\t\t\t\t\tBest Regards,<br />\n\t\t\t\t\t\t\tTeam \" . $storename;\n } else {\n $subject = 'Sorry! Your registration request was not approved';\n $content = \"Hi \" . $username . \",<br /><br />\n\t\t\t\t\t\t\tOops! It seems like your registration request was not approved. If you have any queries, please contact us at <a href='mailto:[email protected]'>[email protected]</a><br /><br />\n\t\t\t\t\t\t\tBest Regards,<br />\n\t\t\t\t\t\t\tTeam \" . $storename;\n }\n } elseif ($type == 5) {\n $password = $emaildata['password'];\n $subject = $storename . ' App - Reset your password';\n $content = \"Hi \" . $username . \",<br /><br />\n\t\t\t\t\t\tOops! It seems like you have forgotten your password. Don't worry. Just use the activation code below to reset your password:<br /><br />\n\t\t\t\t\t\t\" . $password . \"<br /><br />\n\t\t\t\t\t\tIf you did not submit a password reset request for your account, please ignore this e-mail.<br /><br />\n\t\t\t\t\t\tBest Regards,<br />\n\t\t\t\t\t\tTeam \" . $storename;\n } elseif ($type == 6) {\n $subject = 'Your meal is on the way!';\n $content = \"Hi \" . $username . \",<br /><br />\n\t\t\t\t\t\t Thanks for ordering with \" . $storename . \" app. We are preparing your order now.<br /><br />\";\n if ($emaildata['date_time'] == 1) {\n $content .= \"Your order will be delivered on \" . $emaildata['delivery_date'] . \" between \" . $emaildata['time_slot'] . \"<br /><br />\";\n } elseif ($emaildata['date_time'] == 2) {\n $content .= \"Your order will be delivered between \" . $emaildata['time_slot'] . \"<br /><br />\";\n }\n $content .= \"Best Regards,<br />\n\t\t\t\t\t\t Team \" . $storename;\n } elseif ($type == 7) {\n $password = $emaildata['password'];\n $subject = $storename . ' App - New password';\n $content = \"Hi \" . $username . \",<br /><br />\n\t\t\t\t\t\tA new password was requested from \" . $storename . \"<br /><br />\n\t\t\t\t\t\tYour new password is:\" . $password . \"<br /><br />\n\t\t\t\t\t\tBest Regards,<br />\n\t\t\t\t\t\tTeam \" . $storename;\n }\n\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://api.falconide.com/falconapi/web.send.rest',\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => array(\n 'api_key' => $key,\n 'subject' => $subject,\n 'fromname' => $storename,\n 'from' => $fromemail,\n 'content' => $content,\n 'recipients' => $myto\n )\n ));\n $customerhead = curl_exec($curl);\n\n curl_close($curl);\n\n // if email need to send to Admin\n if ($subject_admin != '' && $content_admin != '') {\n $curl_admin = curl_init();\n curl_setopt_array($curl_admin, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://api.falconide.com/falconapi/web.send.rest',\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => array(\n 'api_key' => $key,\n 'subject' => $subject_admin,\n 'fromname' => $storename,\n 'from' => $fromemail,\n 'content' => $content_admin,\n 'recipients' => $fromemail\n )\n ));\n $adminSendCheck = curl_exec($curl_admin);\n\n curl_close($curl_admin);\n }\n }", "public function sendToken(User $user): string;", "public function verifydOtp(Request $request)\n {\n $user = $request->auth_user;\n\n if($this->otp->verifyOTP($user->country_code, $user->mobile_number, $request->otp_code)){\n\n //verify mobile number\n $user->is_mobile_number_verified = 1;\n $user->save();\n\n return $this->api->json(true, 'OTP_VERIFIED', 'Mobile verified successfully.');\n }\n\n return $this->api->json(false, 'OTP_VERIFY_FAILED', 'Invalid otp code entered or expired.');\n\n }", "public function phone_check($value='')\n {\n $phone = $this->input->post('phone');\n $output = $this->m_vendorDetail->phone_check($phone);\n if (empty($output)) {\n $output = $this->m_vendorDetail->phone_user($phone);\n }\n\n if (empty($output)) {\n $otp = random_string('numeric','6');\n if ($this->m_vendorDetail->addOtp($this->email,$otp)) {\n if($this->otp_sms($otp))\n {\n $output = '';\n }else{\n $output = 3;\n }\n } else{\n $output = 3;\n }\n }\n\n echo $output;\n }", "protected function sendAuthRequest() : void\n {\n $message = \"PASSWORD \" . $this->id . \" \" . $this->password;\n $this->sendRequest($message);\n }", "public function getValidOtp()\n {\n $otp = $this->isOtpValid();\n if(!$otp){\n $otp = random_int(100000, 900000);\n $this->updateOtpCode($otp);\n }\n return $otp;\n }", "function sendForgetPassword($userData)\n {\n $this->getCountryCode($userData->country_id);\n $template = 'USR007';\n $username = \"$userData->first_name $userData->last_name\";\n $replace = ['[UserName]', '[ResetPasswordLink]', '[UserTempCode]'];\n $with = [$username, FRONT_URL . \"/reset_password?token=$userData->reset_pass_token\", $userData->reset_pass_code];\n $to = $this->countryCode . (int) $userData->mobile_no;\n parent::sendSms($to, $replace, $with, $template);\n }", "public function c_getProductByOtp() {\r\n $idOtp = $this->input->post('id_otp');\r\n $numServicio = $this->input->post('num_servicio');\r\n $res = $this->Dao_ot_padre_model->getProductByOtp($idOtp, $numServicio);\r\n echo json_encode($res);\r\n }" ]
[ "0.70574176", "0.6981252", "0.6954572", "0.6924916", "0.69024247", "0.68983245", "0.67402047", "0.6695809", "0.6576659", "0.64790624", "0.64414567", "0.64370304", "0.6410705", "0.6351671", "0.634918", "0.6342847", "0.63409424", "0.6253137", "0.6247669", "0.6241211", "0.6239292", "0.62229615", "0.6219944", "0.6199478", "0.61795855", "0.6167338", "0.61412716", "0.6101816", "0.609453", "0.6093241", "0.60476696", "0.6046653", "0.60258055", "0.60213774", "0.60073704", "0.5990714", "0.59875506", "0.5980206", "0.5976062", "0.5955851", "0.5949491", "0.5947256", "0.59216446", "0.5911248", "0.59111446", "0.5906082", "0.5838511", "0.5835855", "0.5806613", "0.5797132", "0.57876104", "0.57728094", "0.57425606", "0.57313067", "0.56771076", "0.5672962", "0.56692576", "0.5668307", "0.56558275", "0.56481355", "0.56474376", "0.5646961", "0.5637076", "0.5588359", "0.5568604", "0.5558241", "0.5540037", "0.5522392", "0.55176306", "0.5480038", "0.54634464", "0.5458504", "0.5450201", "0.54433906", "0.5439414", "0.54328114", "0.5429761", "0.5410209", "0.5355061", "0.5350377", "0.53429735", "0.53392625", "0.53392565", "0.5330366", "0.5326419", "0.53180534", "0.53091687", "0.53043586", "0.52898973", "0.52812284", "0.52736455", "0.525183", "0.52515244", "0.5244111", "0.52323264", "0.52245575", "0.522438", "0.52221704", "0.5221355", "0.52203524" ]
0.7402916
0
/ Check OTP is verified or not
public function resetPassword(Request $request){ if(!session()->has('otpVerified') || !session()->get('otpVerified')){ return response('Something went wrong, Please try again',403); } $msg = [ "required"=>":attribute is required" ]; $validation=Validator::make($request->all(),[ 'confirmpwd' => 'required', 'newpwd' => 'required', ],$msg); $errors=$validation->errors(); if($validation->fails()){ return response("All fields are required",500); } /* vendor*/ if( Vendor::where(['email'=>$request->session()->get('changePasswordEmail')])->first()){ $user = Vendor::where(['email'=>$request->session()->get('changePasswordEmail')])->first(); } elseif (User::where(['email'=>$request->session()->get('changePasswordEmail')])->first()){ $user = User::where(['email'=>$request->session()->get('changePasswordEmail')])->first(); } if(!$user){ return response('OTP expired',404); } $newPassword = Hash::make($request->newpwd); $user->password=$newPassword; $user->save(); session()->forget('changePasswordEmail'); session()->forget('otpVerified'); return response('Successfully changed',200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function verifyConfigOTP() {\n\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrievePost( 'nonce' ), 'defVerifyOTP' ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$otp = HTTP_Helper::retrievePost( 'otp' );\n\t\t$otp = trim( $otp );\n\t\tif ( strlen( $otp ) == 0 ) {\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Please input a valid OTP code\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t\t\n\t\t$secret = Auth_API::getUserSecret();\n\t\t//at this stage, secret should have value, do not need to check\n\t\t$res = Auth_API::compare( $secret, $otp );\n\t\tif ( $res ) {\n\t\t\t//save it\n\t\t\tupdate_user_meta( get_current_user_id(), 'defenderAuthOn', 1 );\n\t\t\tupdate_user_meta( get_current_user_id(), 'defenderForceAuth', 0 );\n\t\t\twp_send_json_success();\n\t\t} else {\n\t\t\t//now need to check if the current user have backup otp\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Your OTP code is incorrect. Please try again.\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t}", "public function verify()\n {\n if (!$this->user->validateOtpByIdentityLoggedIn($this->otp)) {\n $this->addError('otp', Yii::t('app', 'Otp is invalid!'));\n\n return false;\n } else {\n return true;\n }\n }", "public function verifyOTP(){\n\t \t\tif($this->session->userdata('otp')==$this->input->post('otp_')){\n\t \t\t\tif($this->verifyThisUser($this->input->post('mobile_no'))){\n\t \t\t\t\tdie(json_encode(array('code'=>1,'msg'=>\"Registered Successfully.\")));\n\t \t\t\t}else{\n\t \t\t\t\tdie(json_encode(array('code'=>23,'msg'=>\"Failed To Verify.\")));\n\t \t\t\t}\n\t \t\t\t\n\t \t\t}else{\n\t \t\t\tdie(json_encode(array('code'=>0,'msg'=>\"Failed to register\")));\n\t \t\t}\n\t \t}", "public function isOTP(){\n return ($this->auth_type == \"1\");\n }", "function _checkYubikeyOTP($otp) {\n try {\n $yubi = &new Auth_Yubico($this->client_id, $this->api_key);\n $auth = @$yubi->verify($otp);\n } catch ( PEAR_Exception $e) {\n common_log(LOG_ERR, \"Yubikey:: exception \".$e);\n return false;\n } \n if (PEAR::isError($auth)) {\n common_log(LOG_ERR, \"Yubikey:: Authentication failed: \" . $auth->getMessage().' Response: '.$yubi->getLastResponse());\n return false;\n } else {\n common_log(LOG_DEBUG, \"Yubikey:: Valid OTP login\");\n return true;\n }\n }", "public function doVerification() {\n $this->validate ( $this->request, $this->getRules () );\n $user = $this->_user->where ( StringLiterals::EMAIL, $this->decodeParam ( $this->request->user ) )->where ( 'otp', $this->request->otp )->first ();\n if (count ( $user ) > 0) {\n Auth::loginUsingId ( $user->id );\n return true;\n } else {\n return false;\n }\n }", "public function hasVerifiedPhone();", "public function verifyOtp(Request $request)\n {\n $user = public_users::where('email', session('tmp_EM'))->orWhere('phone',session('tmp_EM'))->first();\n if (empty($user)) {\n session()->flash('err_msg','Your activation link is either expired or invalid, login here to re-validate.');\n return redirect()->to('/public/login');\n }elseif ($user->sms_code!=$request->otp) {\n session()->flash('success_msg','Congratulations! your account is now activated.');\n return redirect()->to('/public/login');\n }\n $user->update(['sms_code' => null, 'status' => 1]);\n session()->flash('success_msg','Congratulations! your account is now activated.');\n return redirect()->to('/public/login');\n }", "public function isValidOTP($otp)\n {\n return hash_check($otp, $this->otp);\n }", "public function verifyOtp(Request $request)\n\t{\n\n\t\treturn $this->cnuser->verifyOtpFromMobile($request->get('code'),$request->get('mobileNumber'));\n\n\t}", "public function verifyOTP($response_code){\n\t\t\t\tif(Session::exists('OTPCode') && $response_code===Session::get('OTPCode')){\n\t\t\t\t\t\tSession::delete('OTPCode');\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t}", "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 checkOTP($mobile, $otp) {\n $stmt = $this->conn->prepare(\"SELECT * from otp where mobile = ? && random_otp = ?\");\n $stmt->bind_param(\"ii\", $mobile, $otp);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0; \n }", "public function verify($otp, $input, $window = null);", "public function verifydOtp(Request $request)\n {\n $user = $request->auth_user;\n\n if($this->otp->verifyOTP($user->country_code, $user->mobile_number, $request->otp_code)){\n\n //verify mobile number\n $user->is_mobile_number_verified = 1;\n $user->save();\n\n return $this->api->json(true, 'OTP_VERIFIED', 'Mobile verified successfully.');\n }\n\n return $this->api->json(false, 'OTP_VERIFY_FAILED', 'Invalid otp code entered or expired.');\n\n }", "public function isValid(OneTimePasswordInterface $otp);", "public function matchOTP(Request $request){\n\n /** validation */\n $validator = Validator::make($request->all(), [\n 'otp' => 'required',\n 'user_id' => 'required'\n ],[]);\n\n if ($validator->fails()) {\n $response = ['status'=>'false','message'=>'Validation errors','errors'=>$validator->errors()];\n return response()->json($response);\n }\n\n $user = User::where('id',$request['user_id'])->first();\n \n if(!empty($user)){\n\n if($user->otp == $request['otp']){\n\n\n $user->otp = NULL;\n $user->is_email_verified = '1';\n $user->save();\n\n $response = ['status'=>'true','message'=>'Your account verified successfully'];\n return response()->json($response);\n\n }else{\n $response = ['status'=>'false','message'=>'User not identified'];\n return response()->json($response);\n }\n\n }else{\n $response = ['status'=>'false','message'=>'User not identified'];\n return response()->json($response);\n }\n\n }", "public function otpverification()\n\t{\t\n\t\tif($this->session->userdata('VB_USER_ID') <> ''):\n\t\t\tredirect(base_url().'my-profile');\n\t\tendif;\n\t\t$data['error'] \t\t\t\t\t\t= \t'';\n\t\t$data['formError'] \t\t\t\t\t=\t''; \t\n\n\t\tif($this->input->post('verifyotp')):\n\t\t\t\t$userData\t\t=\t$this->common_model->checkOTP(trim($this->session->userdata('VB_REGISTER_MOBILE')),trim($this->input->post('verifyotp')),'users','user_phone_otp');\n\t\t\t\tif($userData <> \"\"): \n\t\t\t\t\tif($userData['status'] == 'I'):\n\t\t\t\t\t\t$param['user_phone_verify']\t=\t'Y';\n\t\t\t\t\t\t$param['user_phone_otp']\t=\t'';\n\t\t\t\t\t\t$param['status']\t\t\t=\t'A';\n\t\t\t\t\t\t$this->common_model->editData('vb_users',$param,'user_id',$userData['user_id']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->session->unset_userdata('VB_REGISTER_MOBILE');\n\t\t\t\t\t\tsetcookie('VB_USER_LOGIN_TOKEN',$loginParam['user_token'],time()+60*60*24*100,'/');\n\t\t\t\t\t\t$this->session->set_userdata(array(\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_LOGGED_IN'\t\t=>\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_ID'\t\t\t=>\t$userData['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_FULL_NAME'\t\t\t=>\t$userData['full_name'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_EMAIL'\t\t\t=>\t$userData['user_email'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_MOBILE'\t\t=>\t$userData['mobile_number'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_TYPE_ID'\t\t=>\t$userData['usertype_id'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_TYPE_NAME'\t\t=>\t$userData['usertype_name'],\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_CURRENT_PATH'\t=>\t$currentPath));\n\t\t\t\t\t\techo \"success\";die;\n\t\t\t\t\telseif($userData['status'] == 'B'):\n\t\t\t\t\t\techo \"blocked\";die;\n\t\t\t\t\telseif($userData['status'] == 'A'):\n\t\t\t\t\t\techo \"active\";die;\n\t\t\t\t\tendif;\n\t\t\t\telse:\n\t\t\t\t\techo \"wrongotp\";die;\n\t\t\t\tendif;\n\t\tendif;\n\t\t\n\t\t$this->layouts->set_title(stripcslashes('OTP Verification | VBloggers'));\n\t\t$this->layouts->set_keyword(stripcslashes('OTP Verification | VBloggers'));\n\t\t$this->layouts->set_description(stripcslashes('OTP Verification | VBloggers'));\n\t\t\n\t\t$this->layouts->login_view('user/otpverification',array(),$data);\n\t}", "public function verifyForgotPasswordOtp(Request $request)\n {\n # Validate request data\n $validator = Validator::make($request->all(), [ \n 'mobile' => 'required|numeric',\n 'otp' => 'required|numeric',\n 'country_phone_code' => 'required'\n ]);\n\n # If validator fails return response\n if ($validator->fails()) { \n return response()->json(['message'=> $validator->errors()], 401); \n } \n\n # fetch user of this mobile number\n $user = $this->user\n ->where('mobile', $request->get('mobile'))\n ->where('country_phone_code', $request->get('country_phone_code'))\n ->first(); \n\n if ($user->mobile_otp == $request->get('otp')) {\n # verify success\n return response()->json([\n 'message'=> 'OTP verification success',\n 'code' => $this->successStatus,\n 'data' => [\n 'mobile' => (string)$request->get('mobile'),\n 'country_mobile_code' => (string)$request->get('country_phone_code'),\n ]\n ]); \n } else {\n # verify error\n return response()->json([\n 'message'=> 'Wrong OTP',\n 'code' => $this->failedStatus \n ]); \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}", "public function verify($token):bool;", "public function verify_otp_post(){\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n $required_parameter = array('otp','user_id');\n $chk_error = $this->controller->check_required_value($required_parameter, $data);\n if ($chk_error) \n {\n $resp = array('code' => 'MISSING_PARAM', 'message' => 'Missing ' . strtoupper($chk_error['param']));\n @$this->response($resp);\n }\n\n $otp = $data['otp'];\n $user_id = $data['user_id'];\n\n $where = array(\n 'user_id' => $user_id,\n 'otp' => $otp\n ); \n\n $verify = $this->model->getAllwhere('otp_master',$where);\n if(!empty($verify)){\n $update = array('is_active'=> 1);\n $this->model->updateFields('users',$update,array('id'=>$user_id));\n $this->model->delete('otp_master',array('user_id'=>$user_id));\n $resp = array(\n 'rccode' => 1,\n 'message' => 'Otp Verify Successfully', \n );\n }else{\n $resp = array(\n 'rccode' => 2,\n 'message' => 'Please Enter Valid Otp', \n );\n } \n\n $this->response($resp); \n }", "public function validateOTP($otp)\n {\n return $this->getOTPHandler()->validate($otp);\n }", "public function isOtpValid()\n {\n $pdo = static::getDB();\n\n $sql = \"select otp, to_char(otp_last_date, 'YYYY-MM-DD HH24:MI:SS') as otp_last_date from users where email = :email\";\n $result = $pdo->prepare($sql);\n $result->execute([$this->email]);\n\n $result = $result->fetchObject();\n\n $currentTime = strtotime(Extra::getCurrentDateTime());\n $time = strtotime($result->OTP_LAST_DATE);\n\n $diff_in_seconds = ($currentTime - $time);\n\n if($diff_in_seconds > 300){\n return false;\n }\n return $result->OTP;\n }", "public function defenderVerifyOTP() {\n\t\tif ( ( $otp = HTTP_Helper::retrievePost( 'otp', null ) ) != null ) {\n\t\t\t$params = array();\n\t\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrievePost( '_wpnonce' ), 'DefOtpCheck' ) ) {\n\t\t\t\t$params['error'] = new \\WP_Error( 'security_fail', __( \"Some error happen\", \"defender-security\" ) );\n\t\t\t}\n\t\t\t\n\t\t\t$login_token = HTTP_Helper::retrievePost( 'login_token' );\n\t\t\t$query = new \\WP_User_Query( array(\n\t\t\t\t'meta_key' => 'defOTPLoginToken',\n\t\t\t\t'meta_value' => $login_token,\n\t\t\t\t'blog_id' => 0\n\t\t\t) );\n\t\t\t$res = $query->get_results();\n\t\t\tif ( empty( $res ) ) {\n\t\t\t\t//no users, redirect to the login page immediatly\n\t\t\t\twp_redirect( site_url( 'wp-login.php', 'login_post' ) );\n\t\t\t\texit;\n\t\t\t} else {\n\t\t\t\t$user = $res[0];\n\t\t\t\t$secret = Auth_API::getUserSecret( $user->ID );\n\t\t\t\t$redirect = HTTP_Helper::retrievePost( 'redirect_to', admin_url() );\n\t\t\t\tif ( Auth_API::compare( $secret, $otp ) ) {\n\t\t\t\t\t//sign in\n\t\t\t\t\tdelete_user_meta( $user->ID, 'defOTPLoginToken' );\n\t\t\t\t\twp_set_current_user( $user->ID, $user->user_login );\n\t\t\t\t\twp_set_auth_cookie( $user->ID, true );\n\t\t\t\t\t$redirect = apply_filters( 'login_redirect', $redirect, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user );\n\t\t\t\t\twp_safe_redirect( $redirect );\n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\t\t\t\t$backupCode = get_user_meta( $user->ID, 'defenderBackupCode', true );\n\t\t\t\t\tif ( $backupCode && $backupCode['code'] == $otp && strtotime( '+3 minutes', $backupCode['time'] ) > time() ) {\n\t\t\t\t\t\tdelete_user_meta( $user->ID, 'defOTPLoginToken' );\n\t\t\t\t\t\tdelete_user_meta( $user->ID, 'defenderBackupCode' );\n\t\t\t\t\t\twp_set_current_user( $user->ID, $user->user_login );\n\t\t\t\t\t\twp_set_auth_cookie( $user->ID, true );\n\t\t\t\t\t\t$redirect = apply_filters( 'login_redirect', $redirect, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user );\n\t\t\t\t\t\twp_safe_redirect( $redirect );\n\t\t\t\t\t\texit;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$params['error'] = new \\WP_Error( 'opt_fail', __( \"Whoops, the passcode you entered was incorrect or expired.\", \"defender-security\" ) );\n\t\t\t\t\t\t$this->showOTPScreen( $user, $params );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function resend_otp()\n\t{\n // $_SESSION['mobile_no']\n // $_SESSION['vno'] (--- this is the OTP ---)\n sleep(1);\n echo true;\n }", "public function verify_otp_get($email=null,$otp=null){\n\t\tif(!empty($email) && !empty($otp)){\n\t\t\t$q = $this->db->where('email',$email)->where('verification_code',$otp)->get('users')->result();\n\t\t\tif(count($q)>0){\n\t\t\t\t$this->response(['Correct'], REST_Controller::HTTP_OK);\n\t\t\t}else{\n\t\t\t\t$this->response(['Invaild Email or OTP.'], '500');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->response(['Too few arguments'], '500');\n\t\t}\n\t}", "function verify_mobile_number() {\n\n\t\t//$iAccountNo = safeText('account_no', FALSE, 'get');\n\n\t\t$this->authentication->is_user_logged_in(TRUE, 'user/login');\n\n\t\t$this->mcontents['iAccountNo'] = s('ACCOUNT_NO');\n\n\n\t\t$aWhere = array(\n\t\t\t\t\t\t'status' => $this->aUserStatus['active'],\n\t\t\t\t\t);\n\t\tif( ! $oUser = $this->user_model->getUserBy('account_no', $this->mcontents['iAccountNo'], 'basic', $aWhere) ) {\n\t\t\t/*\n\t\t\tp($this->mcontents['iAccountNo']);\n\t\t\tp($oUser);\n\t\t\texit;\n\t\t\t*/\n\t\t\tsf('error_message', 'You cannot access this section right now');\n\t\t\tredirect('home');\n\t\t}\n\n\n\t\t/* Temporary set up to skip mobile number verification step */\n\t\t\t$bSkipMobileNumberVerification = FALSE;\n\n\t\t\tif($bSkipMobileNumberVerification) {\n\t\t\t\t$this->user_model->skipMobileNumberVerification($oUser->account_no);\n\t\t\t}\n\t\t/* Temporary set up to skip mobile number verification step - End */\n\n\n\n\t\t$bIsAccountAwaitingMobileNumVerification = $this->user_model->isAccountAwaitingMobileNumVerification( $oUser->account_no );\n\t\t//$bIsAccountAwaitingMobileNumVerification = TRUE; // to be removed if not useful\n\n\n\t\tif( ! $oUser ) {\n\n\t\t\tsf('error_message', 'The link you are trying to access does not exist.');\n\t\t\tredirect('home');\n\t\t}\n\t\tif( ! $bIsAccountAwaitingMobileNumVerification ) {\n\n\t\t\t//sf('error_message', 'The link you are trying to access does not exist.');\n\t\t\tredirect('user/manage_mobile_number');\n\t\t}\n\n\n\n\t\tif( isset($_POST) && !empty($_POST) ) {\n\n\t\t\t$this->form_validation->set_rules('verification_code', 'Verification code', 'trim|required');\n\n\t\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t\t$sToken = safeText('verification_code');\n\n\t\t\t\t$aTokenResult = $this->common_model->isValidToken_new($sToken, 'mobile_number_verification', $oUser->account_no);\n\n\t\t\t\t$aTokenStatus = c('token_status');\n\n\t\t\t\tif( $aTokenResult['status'] != $aTokenStatus['valid'] ) {\n\n\t\t\t\t\t//find the reason why this token is not valid\n\t\t\t\t\tif( $aTokenResult['status'] == $aTokenStatus['invalid'] ) {\n\n\t\t\t\t\t\t$iAttempts = 0;\n\t\t\t\t\t\t$iMaxAttempts = 3;\n\n\t\t\t\t\t\tif($iAttempts >= $iMaxAttempts) {\n\n\t\t\t\t\t\t\t$this->user_model->unsetMobileNumVerificationCode($aTokenResult['oToken']);\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$this->merror['error'][] = 'the code entered is invalid code.';\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t} elseif($aTokenResult['status'] == $aTokenStatus['expired']) {\n\n\t\t\t\t\t\t$this->user_model->unsetMobileNumVerificationCode($aTokenResult['oToken']);\n\n\t\t\t\t\t\tsf('error_message', 'The token you entered has expired.');\n\t\t\t\t\t\tredirect('user/verify_mobile_number');\n\t\t\t\t\t}\n\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$this->user_model->unsetMobileNumVerificationCode($aTokenResult['oToken']);\n\n\n\t\t\t\t\t$aUserMobileVerificationStatus = $this->config->item('user_mobile_verification_status');\n\n\t\t\t\t\t// set the mobile number as verified\n\t\t\t\t\t$this->db->set('mobile_verification_status', $aUserMobileVerificationStatus['sms_verified']);\n\t\t\t\t\t$this->db->where('account_no', $oUser->account_no);\n\t\t\t\t\t$this->db->update('users');\n\n\t\t\t\t\tsf('success_message', 'Your mobile number has been verified');\n\n\t\t\t\t\t// do the initial setup routines check to see if the user passes it.\n\t\t\t\t\t$this->user_model->initialSetupRoutines($oUser->account_no);\n\n\t\t\t\t\tredirect('profile/edit');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tloadTemplate('user/verify_mobile_number');\n\t}", "public function otpVerification(Request $request){\n $status = 0;\n $message = \"\";\n Utility::stripXSS();\n $this->encdesc($request->get('email'),'decrypt');\n if(!$this->verifyChecksum($request)){\n return response()->json([\"status\"=>0,\n \"message\"=>'checksum not verified',\n \"data\"=>json_decode('{}')]);\n }\n\n\n try{\n $validator = Validator::make($request->all(), [\n 'otp' => 'required|string',\n 'email' => 'required|string|max:255'\n ]);\n\n //$validator->errors()\n if($validator->fails()){\n return response()->json([\"status\"=>$status,\"message\"=>\"Invalid input data.\",\"data\"=>json_decode(\"{}\")]);\n }\n\n\n $request->email = $this->string_replace(\"__\",\"/\",$request->email);\n\n $request->otp = $this->encdesc($request->otp,'decrypt');\n\n $request->merge([\n 'email' => $request->email,\n 'otp' => $request->otp\n ]);\n //echo $request->otp; die;\n if(isset($request->email) && isset($request->otp)){\n $cond = [['email',$request->email],['otp',$request->otp]];\n }\n $user = User::where($cond)->get();\n //print_r($user[0]->status); die;\n if($user->count()>0){\n if($user[0]->verified_otp != 1){\n $status = 1;\n //User::where('email', $user[0]->email)->update(['verified_otp'=>1,'status'=>'1']);\n User::where('email', $user[0]->email)->update(['verified_otp'=>1]);\n\n $data = [];\n //$request->email = $this->string_replace(\"_\",\"/\",$request->email);\n $data['email'] = $this->encdesc($user[0]->email,'decrypt');\n $data['name'] = ucwords($user[0]->name);\n $data['role_id'] = $user[0]->role_id;\n $data['supportEmail'] = config('mail.supportEmail');\n $data['website'] = config('app.site_url');\n $data['site_name'] = config('app.site_name');\n $data['subject'] = 'Registration OTP verification Success From '.config('app.site_name');\n $data['email_msg_1'] = '';\n //$data['password'] = $request->get('password');\n if($user[0]->role_id == 3){\n $data['email_msg_1'] = '<br>Your registration details have been sent to the administrator for approval. Once approved, your listing will be visible on the Namaste Yoga app<br><br>';\n }\n if($this->SendMail($data,'verified_registration')){\n\n //notify code starts\n $user[0]->type = $user[0]->Role->role;\n $this->sendNotificationMail($user[0]);\n //notify code ends\n return response()->json(['status'=>$status,'message'=>\"Successfully verified OTP\",'data'=>json_decode(\"{}\")]);\n }else{\n return response()->json(['status'=>0,'message'=>\"Mail not sent\",'data'=>json_decode(\"{}\")]);\n }\n }else{\n return response()->json(['status'=>$status,'message'=>\"OTP Already verified\",'data'=>json_decode(\"{}\")]);\n }\n }else{\n return response()->json(['status'=>$status,'message'=>\"Invalid input data\",'data'=>json_decode(\"{}\")]);\n }\n }catch(Exception $e){\n $message = \"Technical error\";\n return response()->json(['status'=>$status,'message'=>$message,'data'=>json_decode(\"{}\")]);\n }\n\n }", "public function verify();", "public function update_verify_otp(){\n\n // user user-id from session\n $encodedkey = $this->session->userdata('PariKey_session');\n $user_id='';\n $key=base64_decode($encodedkey);\n $keyarr=explode('|', $key);\n //session key format is $keyarr[0]=PARInaayKEY|$keyarr[1]=email_id|$keyarr[2]=user_id\n\n extract($_POST);\n \n // validation\n if(empty($otp_code)){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> OTP Code is required!',\n 'field' => 'otp_code'\n );\n echo json_encode($response);\n die();\n }\n $result = $this->user_model->verify_otp($otp_code,$keyarr[2]);\n\n echo json_encode($result);\n}", "public function CheckOTPValidate($request)\n {\n $rules = [\n 'code' => 'required|numeric',\n 'email' => 'required|email|exists:consultants,email'\n ];\n $messages = [\n 'code' =>trans('validation.code'),\n 'email' =>trans('validation.email'), \n ];\n $validator = Validator::make($request->all(), $rules, $messages );\n if ($validator->fails()) {\n $code = $this->returnCodeAccordingToInput($validator);\n return $this->returnValidationError($code, $validator);\n }\n }", "public function checkAuth();", "public function checkAuth();", "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 }", "public function isPhoneNumberVerify()\n {\n\n return database::getInstance()->has(\"user\",[\n \"isVerify\" => user_type::PHONE_NUMBER_VERIFIED,\n \"id\" => $this->get_id()\n ]);\n\n }", "public function check_email($email){\n $query = $this->db->select('01_email')\n ->where('01_email', $email)\n ->get('register_01');\n if($query->num_rows()>0){\n return 0;\n }else{\n $query = $this->db->where('is_sms', 1)\n ->where('number', $email)\n ->get('verify_otp_12');\n if($query->num_rows()>0){\n return 'sent';\n }else{\n $query = $this->db->where('number', $email)\n ->delete('verify_otp_12');\n $otp = rand(10000, 1000000);\n $data = array(\n 'number' => $email,\n 'otp' => $otp,\n );\n $query = $this->db->insert('verify_otp_12', $data);\n return true;\n }\n }\n }", "function isVerified(){\n\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 verifyForgotPassword(Request $request){\n $status = 0;\n $message = \"\";\n Utility::stripXSS();\n try{\n\n if(!$this->verifyChecksum($request)){\n return response()->json([\"status\"=>0,\n \"message\"=>'checksum not verified',\n \"data\"=>json_decode('{}')]);\n }\n\n $validator = Validator::make($request->all(), [\n 'email' => 'required|string|max:255',\n 'otp' => 'required|string',\n 'newpass' => 'required|string',\n ]);\n\n //$validator->errors()\n if($validator->fails()){\n return response()->json([\"status\"=>$status,\"message\"=>\"invalid credential.\",\"data\"=>json_decode(\"{}\")]);\n }\n\n $request->email = $this->string_replace(\"__\",\"/\",$request->email);\n $request->otp = $this->encdesc($request->otp,'decrypt');\n $request->newpass = $this->encdesc($request->newpass,'decrypt');\n $request->merge([\n 'email'=>$request->email,\n 'otp'=>$request->otp,\n 'newpass'=>$request->newpass\n ]);\n $users = User::where([\n ['email',$request->email],\n ['otp',$request->otp]\n ])->get();\n\n\n if($users->count() > 0){\n\n if($users[0]->verified_otp==1){\n return response()->json(['status'=>0,'message'=>'otp already verified','data'=>json_decode(\"{}\")]);\n }\n $userObj = new User();\n $data = array();\n\n if(!$this->checkOtpHistory('OV',$users[0]->id)){\n return response()->json(['status'=>$status,'message'=>'Your OTP limit over now. Please try after 24 hour','data'=>json_decode(\"{}\")]);\n }\n\n $data['email'] = $this->encdesc($request->email,'decrypt');\n $data['name'] = ucwords($users[0]->name);\n $data['newpass'] = $request->newpass;\n $data['supportEmail'] = config('mail.supportEmail');\n $data['website'] = config('app.site_url');\n $data['site_name'] = config('app.site_name');\n $newpassOrigEnc = Hash::make($request->newpass);\n\n $data['subject'] = 'Password change from '.config('app.site_name');\n \n $this->SendMail($data,'newpassword');\n \n $users[0]->password = $newpassOrigEnc;\n $users[0]->verified_otp = 1;\n \n if($users[0]->save()){\n $otpHistory = new OtpHistory();\n $otpHistory->user_id = $users[0]->id;\n $otpHistory->type = 'OV';\n $otpHistory->save();\n \n return response()->json(['status'=>1,'message'=>'','data'=>json_decode(\"{}\")]);\n }else{\n return response()->json(['status'=>$status,'message'=>'mail not sent','data'=>json_decode(\"{}\")]);\n }\n }else{\n return response()->json(['status'=>$status,'message'=>'invalid input data','data'=>json_decode(\"{}\")]);\n }\n\n }catch(Exception $e){\n return response()->json(['status'=>$status,'message'=>'exception error','data'=>json_decode(\"{}\")]);\n }\n }", "public function otp_email($email='',$otp='')\n {\n $data['otp'] = $otp;\n $this->load->config('email');\n $this->load->library('email');\n $from = $this->config->item('smtp_user');\n $msg = $this->load->view('email/v_otpVerify', $data, true);\n $this->email->set_newline(\"\\r\\n\");\n $this->email->from($from , 'ShaadiBaraati');\n $this->email->to($email);\n $this->email->subject('Verification Code'); \n $this->email->message($msg);\n if($this->email->send()) \n {\n return true; \n }\n else\n {\n return false;\n }\n }", "public function check() : int\n {\n\n /**\n * @return invalid request(1) if a code is empty ,null or undefined,\n * if not continue the next execution\n */\n\n if(!$this->code) return INVALID_REQUEST;\n\n\n /** @var $is_valid check the specified code is equal and valid */\n\n $is_valid = database::getInstance()->has('user',[\n\n \"id\" => (new Users())->get_id(),\n\n \"verification_code\" => $this->code\n\n ]);\n\n /** validation */\n\n if($is_valid) {\n\n /** @var $success if a specified code is valid\n * update the current status of \"isVerify\" attribute of a database\n * to PHONE_NUMBER_VERIFIED(1) and\n * @return the number of affected rows\n */\n\n $success = database::getInstance()->update('user',['isVerify'=>user_type::PHONE_NUMBER_VERIFIED],[\n\n \"id\"=> (new Users())->get_id()\n\n ])->rowCount();\n\n /** if has a affeted rows return valid request(2), invalid request if not */\n\n return $success ? VALID_REQUEST : INVALID_REQUEST;\n\n }\n\n\n /** return invalid request(1) if a code is not equal */\n\n return INVALID_REQUEST;\n\n\n\n }", "public function isVerified();", "function user_verify(){\n \n $verify = false;\n \n if( isset($_SESSION['user_id']) ){\n \n if( isset($_SESSION['user_ip']) && $_SERVER['REMOTE_ADDR'] == $_SESSION['user_ip'] ){\n \n if( isset($_SESSION['user_agent']) && $_SERVER['HTTP_USER_AGENT'] == $_SESSION['user_agent'] ){\n \n $verify = true;\n\n }\n \n }\n \n }\n \n return $verify;\n \n }", "public function getValidOtp()\n {\n $otp = $this->isOtpValid();\n if(!$otp){\n $otp = random_int(100000, 900000);\n $this->updateOtpCode($otp);\n }\n return $otp;\n }", "static function verifyOtp($data)\n {\n $otp = Otp::find($data['txn_id']);\n \n // Check if transaction exists\n if(!$otp) {\n return [\n 'status' => false,\n 'msg' => 'Invalid transaction',\n ];\n }\n\n // Check for time\n $valid_till = $otp->valid_till;\n $valid_till = Carbon::createFromFormat('Y-m-d H:i:s', $valid_till);\n\n if($valid_till->lt(Carbon::now())) {\n return [\n 'status' => false,\n 'msg' => 'OTP expired',\n ];\n }\n\n // Check if OTP matches\n $code = $otp->otp;\n if($code != $data['otp']) {\n return [\n 'status' => false,\n 'msg' => 'Incorrect OTP',\n ];\n }\n\n return [\n 'status' => true,\n 'msg' => 'OTP verified',\n ];\n }", "private function validateTokens()\n {\n $whoami = $this->getJson('/ping/whoami');\n if (isset($whoami['authenticated']) && $whoami['authenticated'])\n {\n syslog(LOG_DEBUG, \"Monzo: Token is still valid\");\n return true;\n }\n else\n {\n return false;\n }\n }", "public function testVerifyPasswordRecoveryToken()\n {\n }", "function verification() {\n\t\t$reffer_code = $_REQUEST['user_reffer_code'];\n\t\t$code = $_REQUEST['user_verification_code'];\n\t\t$mobile = $_REQUEST['user_mobile_no'];\n\t\t//$token = $_POST['token'];\n\t\tif (!empty($code)) {\n\n\t\t\t// Refferal amount\n\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t//-----------------/////\n\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\tif (!empty($records)) {\n\n\t\t\t\t$user_id = $records['0']['user_id'];\n\t\t\t\t$token = $records['0']['user_verified_code'];\n\t\t\t\t$status = $records['0']['user_mobile_verify_status'];\n\t\t\t\t$user_email = $records['0']['user_email'];\n\t\t\t\t$user_self_reffer = $records['0']['user_refferal_code'];\n\t\t\t\t$wallet_amount = $records[0]['wallet_amount'];\n\t\t\t\t$user_profile_pic = $records[0]['user_profile_pic'];\n\t\t\t\tif (!empty($user_profile_pic)) {\n\t\t\t\t\tif (filter_var($user_profile_pic, FILTER_VALIDATE_URL)) {\n\t\t\t\t\t\t$img = $user_profile_pic;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$img = self_img_url . $user_profile_pic;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$img = '';\n\t\t\t\t}\n\t\t\t\tif ($code != $token) {\n\t\t\t\t\t$post = array('status' => 'false', 'message' => 'Invalid Varification code');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t} else if ($code == $token) {\n\t\t\t\t\tif ($status == '1') {\n\t\t\t\t\t\t$post = array('status' => 'false', 'message' => 'Already verified');\n\t\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t\t$data['user_mobile_verify_status'] = 1;\n\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\n\t\t\t\t\t//check reffer code\n\t\t\t\t\t$reffer_records = $this -> conn -> get_table_row_byidvalue('user', 'user_refferal_code', $reffer_code);\n\t\t\t\t\tif (!empty($reffer_records)) {\n\t\t\t\t\t\t$user11_id = $reffer_records['0']['user_id'];\n\n\t\t\t\t\t\t$data12['reffer_user_id'] = $user11_id;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data12);\n\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t if(!empty($reffer_records)){\n\t\t\t\t\t * \t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t $refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t $user11_id = $reffer_records['0']['user_id'];\n\t\t\t\t\t $reffer_code_database = $reffer_records['0']['user_refferal_code'];\n\t\t\t\t\t $wallet = $reffer_records['0']['wallet_amount'];\n\t\t\t\t\t $frnd_number = $reffer_records['0']['user_contact_no'];\n\t\t\t\t\t $current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t $transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t $wt_type=2; // credit in frnd acconnt\n\t\t\t\t\t $refferamount=$refferal_amount; // reffer amount\n\t\t\t\t\t $wt_category=9; // refferal amount recieved in wallet\n\t\t\t\t\t $wt_desc=\"Refferal amount add in your wallet using by \".substr($mobile,4);\n\t\t\t\t\t if($reffer_code == $reffer_code_database){\n\n\t\t\t\t\t $add_reffer_money = $this -> conn -> insertnewrecords('refferal_records','refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\n\t\t\t\t\t $add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\t\t\t\t\t $data12['reffer_amount_status']=$wallet+$refferal_amount;\n\t\t\t\t\t $update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user11_id, $data12);\n\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t */\n\n\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Successfully verified\", \"mobile\" => $_REQUEST['user_mobile_no'], 'user_id' => $user_id, 'user_wallet' => $wallet_amount, 'user_email' => $user_email, 'login_type' => 1, 'user_reffer_code' => $user_self_reffer, 'profile_pic' => $img, 'user_pin_status' => '2');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$error = array('status' => \"false\", \"message\" => \"User not Exist\");\n\t\t\t\techo $this -> json($error);\n\t\t\t}\n\t\t} else {\n\t\t\t$error = array('status' => \"false\", \"message\" => \"Please Enter a valid verification code\", 'user_mobile_no' => $_POST['user_mobile_no'], 'verification_code' => $_POST['user_verification_code']);\n\t\t\techo $this -> json($error);\n\t\t}\n\t}", "public function otp_confirm() {\n\t\tif (request()->method() == 'POST') {\n\n\t\t\t$rules = array(\n\t\t\t\t'code_confirm' => 'required',\n\t\t\t);\n\t\t\t// validation custom messages\n\t\t\t$niceNames = array(\n\t\t\t\t'code_confirm' => trans('admin_messages.code'),\n\t\t\t);\n\n\t\t\t$validator = Validator::make(request()->all(), $rules);\n\t\t\t$validator->setAttributeNames($niceNames);\n\t\t\tif ($validator->fails()) {\n\n\t\t\t\treturn back()->withErrors($validator)->withInput(); // Form calling with Errors and Input values\n\t\t\t} else {\n\n\t\t\t\t$code = request()->code_confirm;\n\t\t\t\t$user_id = request()->user_details;\n\n\t\t\t\t$user = User::find($user_id);\n\n\t\t\t\t// dd($session_code);\n\t\t\t\tif ($user->otp != $code) {\n\t\t\t\t\treturn back()->withErrors(['code_confirm' => trans('messages.store_dashboard.code_is_incorrect')])->withInput(); // Form calling with Errors and Input values\n\t\t\t\t}\n\t\t\t\treturn redirect()->route('reset_password');\n\t\t\t}\n\t\t} else {\n\t\t\t$user_id = session::get('reset_user_id');\n\t\t\t$user_details = User::findOrFail($user_id);\n\t\t\t$this->view_data['user_details'] = $user_details;\n\n\t\t\treturn view('home/forgot_password2', $this->view_data);\n\n\t\t}\n\t}", "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}", "public function otp($email)\n {\n \n return true;\n }", "public function verify($password): bool;", "public function checkOtp(Request $request)\n {\n try{\n $CheckOTPValidate = $this->CheckOTPValidate($request);\n if($CheckOTPValidate){\n return $CheckOTPValidate;\n } \n $otp = Otp::select('code')->where('email',$request->email)->orderBy('id', 'desc')->first();\n if(!$otp){\n return $this->returnError('001',trans('response_msg.OtpNotFoundInDb'));\n }\n if($otp['code'] == $request->code){\n $otp_id = Otp::select('id')->where('email',$request->email)->first();\n if(!$otp_id){\n return $this->returnError('001',trans('response_msg.errorOtp'));\n }\n $otp_record = otp::find($otp_id['id']);\n $user = Consultant::where('email',$request->email)->first();\n $otp_record->delete(); \n if($user['email_verified'] == 0){\n $user->update([\n 'email_verified' => 1\n ]);\n return $this->returnSuccessMessage(trans('response_msg.successActive'),'S000'); \n }\n return $this->returnSuccessMessage(trans('response_msg.successOtpCheck'),'S000'); \n }\n return $this->returnError('001',trans('response_msg.errorOtpCheck'));\n }catch (\\Exception $ex){\n return $this->returnError($ex->getCode(), $ex->getMessage());\n }\n }", "function verify_telephone()\n\t{\n\t\tlog_message('debug', 'Account/verify_telephone');\n\t\t$data = filter_forwarded_data($this);\n\t\tlog_message('debug', 'Account/verify_telephone:: [1] post='.json_encode($_POST));\n\n\t\tif(!empty($_POST)){\n\t\t\t$result = FALSE;\n\t\t\t$data['msg'] = '';\n\t\t\t$data['hasPosted'] = 'Y';\n\n\t\t\t# a) Is user updating their phone details?\n\t\t\tif(!empty($_POST['telephone'])){\n\t\t\t\t# Add or update phone and send verification code\n\t\t\t\t$response = $this->_api->post('user/telephone', array(\n\t\t\t\t\t'telephone'=>$_POST['telephone'],\n\t\t\t\t\t'provider'=>$_POST['provider__provider'],\n\t\t\t\t\t'isPrimary'=>'Y'\n\t\t\t\t));\n\n\t\t\t\t# Update the user telephone and provider if sucessful\n\t\t\t\tif(!empty($response['result']) && $response['result']=='SUCCESS'){\n\t\t\t\t\t$data['msg'] .= $this->native_session->get('__telephone') != $_POST['telephone']? 'Your phone number has been updated and a': 'A';\n\t\t\t\t\t$data['msg'] .= ' code has been sent for verification';\n\t\t\t\t\t$this->native_session->set('__telephone', $_POST['telephone']);\n\t\t\t\t\t$this->native_session->set('__provider', $response['provider']);\n\t\t\t\t\t$this->native_session->set('__provider_id', $_POST['provider__provider']);\n\t\t\t\t\t$result = TRUE;\n\t\t\t\t\t$data['area'] = 'verify_code_form';\n\t\t\t\t}\n\t\t\t\telse $data['msg'] .= 'ERROR: Your phone number could not be updated or code sent.';\n\t\t\t}\n\n\t\t\t# b) Verify telephone code\n\t\t\telse if(!empty($_POST['usercode'])){\n\t\t\t\t$response = $this->_api->post('account/verify', array(\n\t\t\t\t\t'code'=>$_POST['usercode'],\n\t\t\t\t\t'telephone'=>$this->native_session->get('__telephone'),\n\t\t\t\t\t'baseLink'=>base_url()\n\t\t\t\t));\n\n\t\t\t\tif(!empty($response['verified']) && $response['verified']=='Y'){\n\t\t\t\t\t$this->native_session->set('__telephone_verified', 'Y');\n\t\t\t\t\t$data['msg'] = '20 Points have been added to your Clout Score';\n\t\t\t\t\t$data['area'] = 'verify_code_results';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$data['msg'] = 'ERROR: Your phone could not be verified.<br>Please try again.';\n\t\t\t\t\t$data['area'] = 'verify_code_form';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data['area'] = !empty($data['area'])? $data['area']: 'user_phone_details';\n\t\t$this->load->view('account/verify_phone', $data);\n\t}", "function _yubivs_yubikey_validate($node, $otp) {\n dsm($node);\n dsm($otp);\n}", "function verification() {\n\t\t$reffer_code = $_REQUEST['user_reffer_code'];\n\t\t$code = $_REQUEST['user_verification_code'];\n\t\t$mobile = country_code.$_REQUEST['user_mobile_no'];\n\t\t//$token = $_POST['token'];\n\t\tif (!empty($code)) {\n\t\t\t\n\t\t\t\t// Refferal amount\n\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t//-----------------/////\n\t\t\t\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\n\t\t\t\t$user_id = $records['0']['user_id'];\n\t\t\t\t$token = $records['0']['user_verified_code'];\n\t\t\t\t$status = $records['0']['user_mobile_verify_status'];\n\t\t\t\t$user_email = $records['0']['user_email'];\n\t\t\t\t$user_self_reffer = $records['0']['user_refferal_code'];\n\t\t\t\t$wallet_amount=$records[0]['wallet_amount'];\n\t\t\t\t$user_profile_pic=$records[0]['user_profile_pic'];\n\t\t\t\tif (!empty($user_profile_pic)) \t{\n\t\t\t\t\tif (filter_var($user_profile_pic, FILTER_VALIDATE_URL)) {\n \t\t\t\t\t$img = $user_profile_pic;\n\t\t\t\t\t} else {\n \t\t\t\t\t$img = self_img_url.$user_profile_pic;\n\t\t\t\t\t}\n\t\t\t\t\t} else \t{\n\t\t\t\t\t$img = '';\t\n\t\t\t\t\t}\n\t\t\t\tif ($code != $token) {\n\t\t\t\t\t$post = array('status' => 'false', 'message' => 'Invalid Varification code');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t} else if ($code == $token) {\n\t\t\t\t\tif($status=='1'){\n\t\t\t\t\t$post = array('status' => 'false', 'message' => 'Already verified');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\t\t$data['user_mobile_verify_status']=1;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data);\n\t\t\t\t\t\n\t\t\t\t\t//check reffer code\n\t\t\t\t\t$reffer_records = $this -> conn -> get_table_row_byidvalue('user', 'user_refferal_code',$reffer_code);\n\t\t\t\tif(!empty($reffer_records)){\n\t\t\t\t\t\t$user11_id = $reffer_records['0']['user_id'];\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$data12['reffer_user_id']=$user11_id;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data12);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tif(!empty($reffer_records)){\n\t\t\t\t * \t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t\t\t\t$user11_id = $reffer_records['0']['user_id'];\n\t\t\t\t\t\t\t\t\t\t$reffer_code_database = $reffer_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t\t\t\t\t$wallet = $reffer_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t\t\t\t\t$frnd_number = $reffer_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t\t\t\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\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\t\t\t$wt_type=2; // credit in frnd acconnt\n\t\t\t\t\t\t\t\t\t\t\t$refferamount=$refferal_amount; // reffer amount\n\t\t\t\t\t\t\t\t\t\t\t$wt_category=9; // refferal amount recieved in wallet\n\t\t\t\t\t\t\t\t\t\t\t$wt_desc=\"Refferal amount add in your wallet using by \".substr($mobile,4);\n\t\t\t\t\t\t\t\t\t\tif($reffer_code == $reffer_code_database){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records','refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\t\t\t\t\t\t\t\t\t\t\t$data12['reffer_amount_status']=$wallet+$refferal_amount;\n\t\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user11_id, $data12);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Successfully verified\", \"mobile\" => $_REQUEST['user_mobile_no'],'user_id'=>$user_id,'user_wallet'=>$wallet_amount,'user_email'=>$user_email,'login_type'=>1,'user_reffer_code'=>$user_self_reffer,'profile_pic'=>$img,'user_pin_status'=>'2');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$error = array('status' => \"false\", \"message\" => \"User not Exist\");\n\t\t\t\techo $this -> json($error);\n\t\t\t}\n\t\t} else {\n\t\t\t$error = array('status' => \"false\", \"message\" => \"Please Enter a valid verification code\" ,'user_mobile_no' => $_POST['user_mobile_no'],'verification_code'=>$_POST['user_verification_code']);\n\t\techo $this -> json($error);\n\t\t}\n\t}", "public function check_otp($mobile, $otp){\n $query = $this->db->select('id')\n ->where('number', $mobile)\n ->where('otp', $otp)\n ->get('verify_otp_12');\n if($query->num_rows()>0){\n $query = $this->db->where('number', $mobile)\n ->delete('verify_otp_12');\n return true;\n }else{\n return false;\n }\n }", "function verifiedUser($num, $pid, $td_user)\n{\n\t$db_obj = Db::getInstance()->ExecuteS('SELECT * FROM '.pSQL(_DB_PREFIX_.'sociallogin').' as c WHERE c.id_customer='.\" '$num'\".'\n\tAND c.provider_id='.\" '$pid'\".' LIMIT 0,1');\n\t$verified = $db_obj['0']['verified'];\n\tif ($verified == 1 || $td_user == 'yes')\n\t\treturn true;\n\treturn false;\n}", "public function checkCode(TwoFactorInterface $user, $code);", "function is_verified()\n {\n return false;\n }", "public function Mobile_check($phone_no)\n\t{\n\t\t$sql = \"SELECT * FROM login_users WHERE phone_no ='\".$phone_no.\"' AND user_type = '4' AND status='Active'\";\n\t\t$user_result = $this->db->query($sql);\n\t\t$ress = $user_result->result();\n\n\t\t$digits = 4;\n\t\t$OTP = str_pad(rand(0, pow(10, $digits)-1), $digits, '0', STR_PAD_LEFT);\n\n\t\tif($user_result->num_rows()>0)\n\t\t{\n\t\t\tforeach ($user_result->result() as $rows)\n\t\t\t{\n\t\t\t\t $user_master_id = $rows->id;\n\t\t\t}\n\n\t\t\t$update_sql = \"UPDATE login_users SET otp = '\".$OTP.\"', updated_at=NOW() WHERE id ='\".$user_master_id.\"'\";\n\t\t\t$update_result = $this->db->query($update_sql);\n\n\t\t\t$message_details = \"Dear Customer your OTP :\".$OTP;\n\t\t\t$this->sendSMS($phone_no,$message_details);\n\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"Mobile OTP\", \"user_master_id\"=>$user_master_id, \"phone_no\"=>$phone_no, \"otp\"=>$OTP);\n\n\t\t} else {\n\t\t\t $response = array(\"status\" => \"error\", \"msg\" => \"Invalid login\");\n\t\t}\n\n\t\treturn $response;\n\t}", "public function isVerified(): bool;", "public function hasPassword() : bool;", "public function verified()\n {\n return $this->verifyToken === null;\n }", "static function verifyMobile($usr,$code){\r\n\t\t$usr = funcs::check_input($usr);\r\n\t\t$code = funcs::check_input($code);\r\n\r\n\t\t$expired_time = 7*24*60*60;\r\n\t\tif(strlen(trim($usr)) > 0)\r\n\t\t{\r\n\t\t\t$usrId = funcs::getUserid(htmlspecialchars($usr,ENT_QUOTES,'UTF-8'));\r\n\t\t\tif(ctype_digit($usrId) && strlen(trim($code)) > 0)\r\n\t\t\t{\r\n\t\t\t\t$chk = DBConnect::assoc_query_1D(\"SELECT vcode_mobile,waitver_mobileno,vcode_mobile_insert_time FROM \".TABLE_MEMBER.\" WHERE id=\".$usrId);\r\n\t\t\t\tif(strlen(trim($chk['waitver_mobileno'])) > 0 && strlen(trim($chk['vcode_mobile'])) > 0 && $chk['vcode_mobile'] == $code)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(time() <= ((int)$chk['vcode_mobile_insert_time']+$expired_time))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$query = \"UPDATE \".TABLE_MEMBER.\" SET validated='1',mobileno='\".$chk['waitver_mobileno'].\"',waitver_mobileno='' WHERE id=\".$usrId;\r\n\t\t\t\t\t\tDBconnect::execute_q($query);\r\n\t\t\t\t\t\t$_SESSION['MOBILE_VERIFIED'] = 1;\r\n\r\n\t\t\t\t\t\tif(COIN_VERIFY_MOBILE > 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$username = funcs::findUserName($usrId);\r\n\t\t\t\t\t\t\t$coinVal = funcs::checkCoin($username);\r\n\r\n\t\t\t\t\t\t\tDBconnect::execute_q(\"UPDATE \".TABLE_MEMBER.\" SET coin=coin+\".COIN_VERIFY_MOBILE.\" WHERE id=\".$usrId);\r\n\t\t\t\t\t\t\t$sqlAddCoinLog = \"INSERT INTO coin_log (member_id, send_to, coin_field, coin, coin_remain, log_date) VALUES ('1','$usrId','Mobile Verify','\".COIN_VERIFY_MOBILE.\"',\".$coinVal.\", NOW())\";\r\n\t\t\t\t\t\t\tDBconnect::execute($sqlAddCoinLog);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\treturn 4;\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\treturn 3;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn 2;\r\n\t\t\t}\r\n\t\t\tunset($usrId);\r\n\t\t}\r\n\t}", "public function receiveOTP(Request $request)\n {\n $validate = Validator::make($request->all(), [\n\n 'ref' => 'required',\n 'otp' => 'required'\n ]);\n\n if ($validate->fails()) {\n throw new LogicException($validate->errors()->first());\n }\n\n $userOTP = Otp::where('otp', $request->otp)->where('ref', decrypt($request->ref))->first();\n\n if ($userOTP) {\n\n return $this->responseRequestSuccess('Success!');\n } else {\n return $this->responseRequestError('error');\n }\n }", "public function OTPUsed($mobile, $otp) {\n $stmt = $this->conn->prepare(\"UPDATE `otp` SET `is_used` = '1' WHERE mobile = ? && random_otp = ?\");\n $stmt->bind_param(\"ii\", $mobile, $otp);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0; \n }", "public function sendPhoneVerificationNotification();", "public function check()\n {\n // TODO : Verif csrf\n // TODO : Oublie de mot de passe & mail divers\n }", "function verify_authcode_phone($authcode,$phone,$verify=true)\n\t{\n\t\t$user_id=$code_type=0;\n if($this->_redis)\n {\n $data=$this->cache->get($authcode.'_'.sha1($phone));\n if(!empty($data))\n {\n $data=json_decode($data);\n $user_id=$data->user_id;\n $code_type=$data->code_type;\n\t\t\t\tif($verify) $this->cache->delete($authcode.'_'.sha1($phone));\n $errorcode=true;\n }\n else\n {\n $errorcode=false;\n log_message('error_tizi','17051:phone verify code failed',array('phone'=>$phone));\n }\n }\n else\n\t\t{\n\t\t\t$this->db->select(\"id,user_id,phone,code_type,generate_time\");\n\t\t\t$this->db->from($this->_table);\n\t\t\t$this->db->where(\"authcode\",$authcode);\n\t\t\t//加密手机号码\t\n\t\t\t$e_phone=sha1($phone);\t\n\t\t\n\t\t\t$this->db->where(\"phone\",$e_phone);\n\t\t\t$this->db->where(\"has_verified\",0);\n\t\t\t$this->db->where(\"type\",Constant::VERIFY_TYPE_PHONE);\n\t\t\t$query=$this->db->get();\t\n\t\t\t$total=$query->num_rows();\n\t\t\tif($total) $gen_time=$query->row()->generate_time;\n\t\t\tif($total==1&&date(\"Y-m-d H:i:s\",strtotime($gen_time.\" + \".Constant::AUTHCODE_EXPIRE_PHONE))>date(\"Y-m-d H:i:s\"))\n\t\t\t{\n\t\t\t\t$id=$query->row()->id;\n\t\t\t\t$user_id=$query->row()->user_id;\n\t\t\t\t//$phone=$query->row()->phone;//电话号码已加密\n\t\t\t\t$code_type=$query->row()->code_type;\n\t\t\t\tif($verify)\n\t\t\t\t{\n\t\t\t\t\t$this->db->where('id',$id);\n\t\t\t\t\t$this->db->update($this->_table,array('has_verified'=>1,'verified_time'=>date(\"Y-m-d H:i:s\")));\n\t\t\t\t\tif($this->db->affected_rows()==1) $errorcode=true;\n\t else $errorcode=false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$errorcode=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$errorcode=false;\n\t\t\t}\n\t\t}\n\t\treturn array('user_id'=>$user_id,'phone'=>$phone,'code_type'=>$code_type,'errorcode'=>$errorcode);\n\t}", "abstract public function nonce_check();", "function verifyemail() {\n\t$a = array(\n\t 'status' => 'system-error'\n\t);\n\n\t// raw inputs\n\t$taint_si = isset($_POST['si']) ? $_POST['si'] : 0;\n\t$taint_tic = isset($_POST['tic']) ? $_POST['tic'] : 0;\n\t$taint_pword = isset($_POST['pword']) ? $_POST['pword'] : 0;\n\n\t// validate inputs\n\t$si = validateToken($taint_si);\n\t$tic = validateTic($taint_tic);\n\t$pword = validatePword($taint_pword);\n\n\t// validate parameter set\n\tif (!$si || !$tic || !$pword) {\n\t\tLog::write(LOG_WARNING, 'attempt with invalid parameter set');\n\t\treturn $a;\n\t}\n\n\t// get db connection\n\t$conn = getConnection();\n\tif (!$conn) {\n\t\treturn $a;\n\t}\n\n\t// read token and user table\n\t$result = getUserByToken($conn, $si);\n\tif (!$result) {\n\t\treturn $a;\n\t}\n\n\t// get fields\n\t$row = pg_fetch_array($result, 0, PGSQL_ASSOC);\n\t$userid = $row['id'];\n\t$hashpassword = $row['hashpassword'];\n\t$auth = $row['auth'];\n\t$hashtic = $row['hashtic'];\n\t$oldemail = $row['email'];\n\n\t// verify user authentication state\n\tif (!isUserEmailPending($auth)) {\n\t \tLog::write(LOG_NOTICE, 'attempt to verify email on user not auth=email-pending');\n\t\treturn $a;\n\t}\n\n\t// verify the password\n\t$boo = verifyPassword($pword, $hashpassword);\n\tif (!$boo) {\n\t\tLog::write(LOG_NOTICE, 'attempt with invalid password');\n\t\treturn $a;\n\t}\n\n\t// verify the tic from the email\n\t$boo = verifyTic($tic, $hashtic);\n\tif (!$boo) {\n\t\tLog::write(LOG_NOTICE, 'attempt with invalid tic');\n\t\treturn $a;\n\t}\n\n\t// update user record\n\t$auth = DB::$auth_verified;\n\t$name = 'verify-email';\n\t$sql = \"update accounts.user set email=newemail, newemail='', auth=$1, hashtic=null, tmhashtic=null where id = $2\";\n\t$params = array($auth, $userid);\n\t$result = execSql($conn, $name, $sql, $params, true);\n\tif (!$result) {\n\t\treturn false;\n\t}\n\n\t// send security notice\n\t$boo = sendAuthenticationEmail($oldemail, 'changedemail', '');\n\tif (!$boo) {\n\t\t$a['status'] = 'send-email-failed';\n\t\treturn $a;\n\t}\n\n\t// success\n\t$a['status'] = 'ok';\n\t$a['auth'] = $auth;\n\treturn $a;\n}", "public function retrieveOTP() {\n\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrieveGet( 'nonce' ), 'defRetrieveOTP' ) ) {\n\t\t\twp_send_json_error( array() );\n\t\t}\n\t\t\n\t\t$token = HTTP_Helper::retrieveGet( 'token' );\n\t\t$query = new \\WP_User_Query( array(\n\t\t\t'meta_key' => 'defOTPLoginToken',\n\t\t\t'meta_value' => $token,\n\t\t\t'blog_id' => 0\n\t\t) );\n\t\t$res = $query->get_results();\n\t\tif ( empty( $res ) ) {\n\t\t\t//no user\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Your token is invalid\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t\t\n\t\t$user = $res[0];\n\t\t//create a backup code for this user\n\t\t$code = Auth_API::createBackupCode( $user->ID );\n\t\t//send email\n\t\t$backupEmail = Auth_API::getBackupEmail( $user->ID );\n\t\t\n\t\t$settings = Auth_Settings::instance();\n\t\t$subject = ! empty( $settings->email_subject ) ? esc_attr( $settings->email_subject ) : __( 'Your OTP code', \"defender-security\" );\n\t\t$sender = ! empty( $settings->email_sender ) ? esc_attr( $settings->email_sender ) : false;\n\t\t$body = ! empty( $settings->email_body ) ? $settings->email_body : $settings->two_factor_opt_email_default_body();\n\t\t$params = [\n\t\t\t'display_name' => $user->display_name,\n\t\t\t'passcode' => $code,\n\t\t];\n\t\tforeach ( $params as $key => $val ) {\n\t\t\t$body = str_replace( '{{' . $key . '}}', $val, $body );\n\t\t}\n\t\t$headers = array( 'Content-Type: text/html; charset=UTF-8' );\n\t\tif ( $sender ) {\n\t\t\t$from_email = get_bloginfo( 'admin_email' );\n\t\t\t$headers[] = sprintf( 'From: %s <%s>', $sender, $from_email );\n\t\t}\n\t\t\n\t\t//send\n\t\twp_mail( $backupEmail, $subject, $body, $headers );\n\t\t\n\t\twp_send_json_success( array(\n\t\t\t'message' => __( \"Your code has been sent to your email.\", \"defender-security\" )\n\t\t) );\n\t}", "public function checkPassword($value);", "private function verifyByLuhnAlgorithm($number){ }", "public function otpResetPassword()\n {\n $this->setRules([ StringLiterals::EMAIL => 'required|max:100|email','access_otp_token' => 'required|numeric','acesstype' => StringLiterals::REQUIRED,StringLiterals::PASSWORD => 'required|min:6',\n //'password_confirmation' => 'required|same:password|min:6' \n ]);\n $this->_validate();\n $this->_customer = $this->_customer->where([ 'email' => $this->request->email,'access_otp_token' => $this->request->access_otp_token ])->first();\n if (isset($this->_customer) && is_object($this->_customer) && ! empty($this->_customer->id)) {\n $this->_customer->access_token = $this->randomCharGen(30);\n $this->_customer->access_otp_token = '';\n $this->_customer->acesstype = $this->request->acesstype;\n $this->_customer->password = Hash::make($this->request->password);\n if ($this->_customer->save()) {\n return true;\n }\n }\n return false;\n }", "public function verifyResetPassword()\n {\n $result['error'] = false;\n $result['message'] = '';\n $this->setRules([ 'token' => 'required']);\n $this->_validate();\n $customerInfo = $this->_customer->where('forgot_password', $this->request->token)->first();\n if (empty($customerInfo)) {\n $result['error'] = true;\n $result['message'] = trans('passwords.token_expired');\n }\n return $result;\n }", "function checkToken() {\n\t\t\t// Split the token up again to make sure the first 40 chars are the same (TOKEN)\n\t\t\t$splitToken = substr($this->tokenFromCookie, 0, 40);\n\t\t\t\n\t\t\t// Split the token up again to make sure the second 40 chars are the same (ZIPPED)\n\t\t\t$splitZipped = substr($this->tokenFromCookie, 40, 40);\n\t\t\t\n\t\t\t// Unzip the second 40 chars\n\t\t\t$result = $this->unzip($splitZipped);\n\n\t\t\t// Check if the sha of the zipped portion matches the token.\n\t\t\t// If so, no one has messed with the token\n\t\t\tif(strcmp($splitToken, sha1($splitZipped) == 0)) {\n\t\t\t\t// Grab all data from unzip\n\t\t\t\t$ip = base_convert($result[0], IP_ADDRESS, 10);\n\t\t\t\t$time = base_convert($result[1], REQUEST_TIME, 10);\n\t\t\t\t$user = $result[2];\n\t\t\t\t$random = $result[3];\n\t\t\t\t$expires = substr($this->tokenFromCookie, 80, strlen($this->tokenFromCookie));\n\n\t\t\t\t// Check if token is expired after one hour\n\t\t\t\tif(time() - $expires <= 3600) {\n\t\t\t\t\tif(strpos($_SERVER['REMOTE_ADDR'], \":\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\":\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\telseif(strpos($_SERVER['REMOTE_ADDR'], \".\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\".\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Check if userIp is the same as when s/he originally logged in\n\t\t\t\t\t$validity = (strcmp($ip, $userIpAddImp) == 0) ? true : false;\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\t$validity = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$validity = false;\n\t\t\t}\n\t\t\t\n\t\t\treturn $validity;\n\t\t}", "public function verifyPhone(){\n return view('auth.register_phone');\n }", "function checkTotp($secret, $key, $timedrift = 1);", "public function hasVerification()\r\n {\r\n // No need for CVN in creating/updating token\r\n return Mage::getModel('ewayrapid/method_notsaved')->hasVerification();\r\n }", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "public function otp_is_stored_in_cache_for_the_user()\n {\n\n $user = factory(User::class)->create();\n $res= $this->post('/login',['email' => $user->email,'password'=>'secret']);\n $this->assertNotNull($user->OTP());\n\n }", "public function markPhoneAsVerified();", "public function verify()\n {\n $phone = $this->input->get('phone');\n $token = $this->input->get('token');\n\n if ($phone != $this->session->userdata('phone')) {\n $this->session->set_flashdata('message', 'checkin-error');\n redirect('visitor');\n } else {\n $user = $this->m_visitor->get_user('sms_verify', 'phone', $phone);\n if ($user) {\n $token_ = $this->m_visitor->get_user('sms_verify', 'token', $token);\n if ($token_) {\n $data = [\n 'phone' => $phone,\n 'public_space_id' => $this->session->userdata('public_space_id')\n ];\n\n $this->m_visitor->insert('record', $data);\n $this->m_visitor->delete('sms_verify', 'phone', $phone);\n\n $this->session->set_userdata('status', 'in');\n\n $this->session->set_flashdata('message', 'checkin-success');\n redirect('visitor');\n } else {\n $this->session->set_flashdata('message', 'checkin-error');\n redirect('visitor');\n }\n } else {\n $this->session->set_flashdata('message', 'checkin-error');\n redirect('visitor');\n }\n }\n }", "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 sendOTP(Request $request){\r\n\t\t\t$user = $this->_getUserByCondtion(['email'=>$request->email]);\r\n\r\n\t\t\tif(!$user){\r\n\t\t\t\treturn Response('This email is not associated with us!',406);\r\n\t\t\t}\r\n\r\n\t\t\t$request->session()->put('changePasswordEmail',$user->email);\r\n\t\t\t$otp=rand(1000,9999);\r\n\t\t\t$request->session()->put('otp',$otp);\r\n\r\n\t\t\t$data=array(\r\n\t\t\t\t'name'=> 'parking hub',\r\n\t\t\t\t'message'=>$otp\r\n\t\t\t);\r\n\t\t\ttry {\r\n\t\t\t\tMail::to($request->email)->send(new sendmail($data));\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\treturn response('Oops! Something went wrong, Please try again',500);\r\n\t\t\t}\r\n\r\n\t\t\t$email=$user->email;\r\n\t\t\t//'OPT sent to your email address, Please check your inbox'\r\n\t\t\treturn response('Enter your otp',200);\r\n\r\n\t}", "public function settings_verify()\n {\n $method = rcube_utils::get_input_value('_method', rcube_utils::INPUT_POST);\n $timestamp = intval(rcube_utils::get_input_value('_timestamp', rcube_utils::INPUT_POST));\n $success = false;\n\n if ($driver = $this->get_driver($method)) {\n $data = @json_decode(rcube_utils::get_input_value('_data', rcube_utils::INPUT_POST), true);\n if (is_array($data)) {\n foreach ($data as $key => $value) {\n if ($value !== '******') {\n $driver->$key = $value;\n }\n }\n }\n\n $success = $driver->verify(rcube_utils::get_input_value('_code', rcube_utils::INPUT_POST), $timestamp);\n $method = $driver->method;\n }\n\n // put session into high-security mode\n if ($success && !empty($_POST['_session'])) {\n $_SESSION['kolab_2fa_secure_mode'] = time();\n }\n\n $this->api->output->command('plugin.verify_response', array(\n 'method' => $method,\n 'success' => $success,\n 'message' => str_replace('$method', $this->gettext($method),\n $this->gettext($success ? 'codeverificationpassed' : 'codeverificationfailed'))\n ));\n\n $this->api->output->send();\n }", "public function getVerify(): bool\n {\n }", "public final function verify($token)\n {\n }", "public function testRegistrationPasswordOnlyNumbers(): void { }", "function check_authcode_phone($phone,$code_type,$user_id=\"\")\n {\n\t\tif($phone)\n\t\t{\n\t\t\tif($this->_redis)\n\t\t\t{\n\n\t\t\t\t$errorcode=$this->check_auth('phone',sha1($phone));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->select(\"id\");\n\t\t\t\t$this->db->from($this->_table);\n\t\t\t\t$this->db->where(\"phone\",sha1($phone));//需要通过服务获得加密后的电话号码\n\t\t\t\t$this->db->where(\"code_type\",$code_type);\n\t\t\t\t$this->db->where(\"has_verified\",0);\n\t\t\t\t$this->db->where(\"generate_time >\",date(\"Y-m-d H:i:s\",strtotime(date(\"Y-m-d H:i:s\").\" - \".Constant::SEND_AUTHCODE_INTERVAL_PHONE)));\n\t\t\t\t$query=$this->db->get();\n\t\t\t\t$total=$query->num_rows();\n\t\t\t\tif($total>0) $errorcode=true;\n\t\t\t\telse $errorcode=false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errorcode=true;\n\t\t}\n\t\treturn array(\"errorcode\"=>$errorcode);\t\n }", "function _inputCheck(){\n if (isset($_POST['verder']) && $this->_verify() == \"\") {\n return true;\n }\n else {\n return false;\n }\n }", "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 }", "protected function verifyToken($token)\n {\n $return = (object) [\n 'status' => TRUE,\n 'message' => ''\n ];\n\n $user_id = DB::table('email_phone_verify')\n ->where('token', '=', $token)\n ->value('user_id');\n if (!is_numeric($user_id)) {\n $return->status = FALSE;\n $return->message = __('Invalid phone verification token.');\n } else {\n $created_at = DB::table('email_phone_verify')\n ->where('token', '=', $token)\n ->value('created_at');\n if (!$created_at or ($created_at and $this->verifyTokenExpired($created_at))) {\n DB::table('email_phone_verify')->where('token', '=', $token)->delete();\n $return->status = FALSE;\n $return->message = __('Phone verification token is invalid or expired, please request new verification.');\n } else {\n $token_phone = support_decrypt_string($token);\n $user = DB::table('users')\n ->where('id', '=', $user_id)->first();\n if ($token_phone != $user->phone_number) {\n $return->status = FALSE;\n $return->message = __('There was something wrong, please contact administrator.');\n } elseif (!empty($user->phone_verified_at)) {\n $return->status = FALSE;\n $return->message = __('Your phone number is already verified.');\n }\n }\n }\n\n return $return;\n }", "function m_verifyEditPass()\n\t{\n\t\t$this->errMsg=MSG_HEAD.\"<br>\";\n\t\tif(empty($this->request['password']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif(empty($this->request['verify_pw']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_VERIFYPASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif($this->request['password']!=$this->request['verify_pw'])\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_NOTMATCHED.\"<br>\";\n\t\t}\n\t\treturn $this->err;\n\t}", "public function phone_check($value='')\n {\n $phone = $this->input->post('phone');\n $output = $this->m_vendorDetail->phone_check($phone);\n if (empty($output)) {\n $output = $this->m_vendorDetail->phone_user($phone);\n }\n\n if (empty($output)) {\n $otp = random_string('numeric','6');\n if ($this->m_vendorDetail->addOtp($this->email,$otp)) {\n if($this->otp_sms($otp))\n {\n $output = '';\n }else{\n $output = 3;\n }\n } else{\n $output = 3;\n }\n }\n\n echo $output;\n }", "function is_phone_stored($phoneNumber){\n $data = array(\"phone\"=>$phoneNumber);\n $status = CallAPI(\"ussd.myfarmnow.com/api/verifyphone\", $data);\n if($status == 1){\n return true;\n }elseif($status == 0){\n return false;\n }\n}", "function verifyusersresponse($challenge,$response,$encryptedpassword){\n\treturn md5($challenge.$encryptedpassword)==$response;\n}" ]
[ "0.7584218", "0.7575734", "0.7416783", "0.73633474", "0.7290051", "0.7021241", "0.69265634", "0.69039273", "0.68252224", "0.6815819", "0.6789733", "0.6777905", "0.67406356", "0.6737853", "0.6731931", "0.66634655", "0.66526586", "0.66259694", "0.6618031", "0.6581429", "0.65719235", "0.65526617", "0.6549871", "0.6525008", "0.6478439", "0.6473271", "0.63947564", "0.6362529", "0.6355679", "0.6328692", "0.6313372", "0.6310054", "0.63096815", "0.63096815", "0.63064766", "0.6306069", "0.63059205", "0.62762433", "0.62658983", "0.6263216", "0.6253803", "0.6225151", "0.6216543", "0.6215482", "0.6200858", "0.6168743", "0.6145912", "0.6144274", "0.6140176", "0.6134602", "0.6130958", "0.61023617", "0.6096098", "0.6091124", "0.6075547", "0.60710883", "0.60662556", "0.60494465", "0.60371625", "0.60356396", "0.602664", "0.6022855", "0.6022002", "0.6020957", "0.6015988", "0.59993476", "0.5987809", "0.5986679", "0.59864515", "0.5980204", "0.59738564", "0.5961381", "0.5959764", "0.59594727", "0.59528595", "0.5950155", "0.59402984", "0.59303546", "0.59303486", "0.5926117", "0.5925057", "0.59249085", "0.5920285", "0.5920285", "0.59099936", "0.58947796", "0.58898836", "0.5889374", "0.5885267", "0.5872213", "0.5868602", "0.5863694", "0.58588415", "0.5858221", "0.58578384", "0.58574426", "0.5849027", "0.584827", "0.58384514", "0.5834055", "0.58261204" ]
0.0
-1
/ } forget password end only show index page
public function index_page(){ $sessionData = [ 'name' => 'admin', 'email' => '[email protected]', 'id' => '1', 'profile' => '', 'role'=>'customer' ]; // session()->put('USER',$sessionData); // $user=User::find(session()->get('USER')['id']); return view('index',array('userInfo'=>$sessionData)); // return view('index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function forgetpassword()\n \t{\n \t\t$this->data['title'] = 'Forgot Password';\n\t\t$this->show_viewFrontInner('forget-password', $this->data);\n \t}", "public function index()\n\t{\n\t\trequire 'application/views/_templates/header.php';\n\t\trequire_once \"application/views/no_password/index.php\";\n\t}", "public function index()\n {\n if (!Auth::check()) {\n return view ('usuarios.requestpassword'); \n } else{\n return Redirect::to('/');\n }\n \n }", "public function index()\n {\n return view('admin.my.password.index');\n }", "public function index()\n {\n UpdatePassword::clean();\n return view('auth.passwords.target');\n }", "public function index() {\n $this->view->layout = \"loginlayout\";\n $this->view->LoadView('forgetpassword');\n }", "public function index()\n {\n \treturn view('admin.forgot-password');\n }", "public function index()\n {\n //\n if(!Auth::check()){\n return view('auth.login');\n }\n return view('emidetails');\n }", "public function indexForgot()\n\t{\n\t\t$data['error'] = '';\n\t\tif (isset($this->session->data['error'])) {\n\t\t\t$data['error'] = $this->session->data['error'];\n\t\t\tunset($this->session->data['error']);\n\t\t}\n\n\t\tif (isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER'])) {\n\t\t\t$this->session->data['refferal'] = $_SERVER['HTTP_REFERER'];\n\t\t}\n\t\t\n\t\t$data['info'] = $this->commons->getInfo();\n\n\t\t/*Load Language File*/\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/common.php';\n\t\t$data['lang']['common'] = $lang;\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/login.php';\n\t\t$data['lang']['login'] = $login;\n\n\t\t$data['token'] = hash('sha512', TOKEN . TOKEN_SALT);\n\t\t$data['action'] = URL.DIR_ROUTE.'forgot';\n\t\t$this->view->render('auth/forgot.tpl', $data);\n\t}", "public function index()\n {\n if(Auth::user()->roles()->first()->slug === 'unverified'){\n return redirect('activate');\n }else{\n if(Auth::user()->isAdmin()){\n return view('pages.admin.home');\n }else{\n if(Auth::user()->UserInfo4()->first()->Activation == 0){\n return redirect('user/password')->with('error','You must change your password first to fully secure your account from recent attacks that we have been through.');\n }\n return view('pages.user.home');\n }\n }\n }", "public function indexAction()\n {\n if (AuthService::Get()->getUser()) {\n header(\"Location: /\", true, 301);\n exit();\n }\n\n $data = [\n 'title' => TranslateService::Get()->getTranslateSecure('Авторизация')\n ];\n if ($this->getArgumentSecure('Submit')) {\n if ($data['messageRegister'] = $this->registerAction()) {\n $data['register'] = true;\n } else {\n header('Location: /', true, 301);\n exit();\n }\n\n } elseif ($this->getArgumentSecure('signIn')) {\n if ($this->loginAction()) {\n header(\"Location: /\", true, 301);\n exit();\n } else {\n $data['message'] = TranslateService::Get()->getTranslateSecure('Неправильный логин или пароль');\n }\n }\n View::renderTemplate('auth.html', $data);\n }", "public function index()\n {\n $id = (int) Input::get(\"id\");\n $md5 = Input::get(\"secret\");\n $email = Input::get(\"email\");\n if (!$id || !$md5 || !$email) {\n Redirect::autolink(URLROOT . \"/home\", Lang::T(\"MISSING_FORM_DATA\"));\n }\n $row = Users::getEditsecret($id);\n if (!$row) {\n Redirect::autolink(URLROOT . \"/home\", Lang::T(\"NOTHING_FOUND\"));\n }\n $sec = $row['editsecret'];\n if ($md5 != $sec) {\n Redirect::autolink(URLROOT . \"/home\", Lang::T(\"NOTHING_FOUND\"));\n }\n Users::updateUserEmailResetEditsecret($email, $id, $row['editsecret']);\n Redirect::autolink(URLROOT . \"/home\", Lang::T(\"SUCCESS\"));\n }", "public function index() {\n\t\treturn View::make('reset_password');\n\t}", "function forgot_password() {\n $datos['titulo'] = \"Restablecer Contraseña\";\n $this->render_page('usuarios/forgot_password', $datos);\n }", "public function forgetpassword(){\r\n\t\treturn view('forgetpassword');\r\n\t}", "public function forgotPassword()\n {\n // if user is logged in, do not let him access this page\n if( Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n View::make('templates/front/forgot-password.php',array());\n }", "public function passwordAction(){\r\n $this->view->password = '';\r\n }", "function forgotpass() {\r\n load_admin_view('forgot_password_view');\r\n }", "public function displayForgotPassword()\n {\n $this->render('forgot-password', ['head'=>['title'=>'Mot de passe oublié', 'meta_description'=>'']]);\n }", "public function getIndex() {\n return view('password');\n }", "public function showpassword()\n\t\t{\n\t\t\tif(Auth::check()) {\n\t\t\t\treturn View::make('updatepassword');\n\t\t\t} else {\n\t\t\t\tApp::abort(403);\n\t\t\t}\n\t\t}", "public function home()\n {\n // Page de validation du compte\n define(\"TITLE_HEAD\", \"Volunteers | Forgot password\");\n $this->load->view('user/forgot_password.php');\n }", "public function indexAction()\n {\n // TODO: Client side field validation\n $this->requireGuest();\n //header('Location: http://'.$_SERVER['HTTP_HOST'].'/Home/index');\n View::renderBlade('register/index2');\n\n }", "public function passwordForgotAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authPasswordForgot' );\n }", "public function gantiPassword(){\n $data['title']\t\t= \"Ganti Password\";\n\t\t$data['custom_css']\t= null;\n\t\t$data['custom_js']\t= null;\n\t\t$data['custom_script']\t= null;\n $data['content']\t= \"content/gantiPassword\";\n\n\t\t$this->load->view('Main', $data);\n }", "public function index() {\r\n\t\t$this->show_login_page();\r\n\t}", "public function forget_password()\n {\n return view('Admin.login.forget_password');\n }", "public function index()\n {\n $this->authorize(PasswordResetsPolicy::ability('index'));\n\n return $this->view('auth.password-resets.index');\n }", "function index(){\n\t\tredirect('');\n\t}", "public function forgotPasswordAction ()\n {\n $this->view->setRenderLevel (View::LEVEL_ACTION_VIEW);\n }", "public function index(){\n\t\tif($this->authex->checkLoginRedirectToHome()){\n\t\t\t$data['titel'] = 'International Days';\n\t\t\t$partials = array('template_menu' => 'reset-password/reset_menu', 'template_pagina' => 'activate/activate_user');\n\t\t\t$this->template->load('template/template_master', $partials, $data);\n\t\t}\n\t}", "public function forgotPassword(){\r\n\r\n fn_logged_in();\r\n\r\n $view = \"forgot_password\";\r\n $data = array(\r\n \"page_title\" => \"Forgot Password\"\r\n );\r\n $this->render_page($view, $data);\r\n }", "public function index() {\n\t\t$userid = Auth::user ()->userid;\n\t\t$cityCD = Auth::user ()->citycode;\n\t\t$parameter = Parameter::where ( 'citycode', $cityCD )->first ();\n\t\t$intpasscalss = $parameter->intpasscalss;\n\t\t$count = Logindata::where ( 'userid', $userid )->count ();\n\t\tif ($count == 1) {\n\t\t\tif ($intpasscalss == 1 or $intpasscalss == 2) {\n\t\t\t\treturn Redirect ( '/usersetting' );\n\t\t\t}\n\t\t}\n\t\treturn view ( 'home' );\n\t}", "public function showForgotPassword() {\n\t\treturn view(\"pages.passwordreset.forgotpassword\");\n\t}", "public function recover_password()\n { \n $data['page'] = 'user/recover_password';\n $this->load->view('index',$data);\n }", "function index()\n\t{\n\t\t$this->view->render('login/login',0);\n\t}", "public function index()\n {\n return view(\"auth.passwords.change\");\n }", "public function reminder_password()\n\t{\n\t\t$this->load->view( $this->config->item( 'start_page' ) );\n\t}", "public function index()\n {\n $user = Auth::user();\n\n //Ensures account is active after successful login\n if (!$user->active)\n {\n Auth::logout();\n return redirect('/login')->withErrors([\"not_allowed\"=>\"Your account has been disabled. Please contact support for assistance.\"]);\n }\n\n //Ensures user's password has not expired (expires every 3 months)\n if (date('Y-m-d H:i:s', strtotime($user->password_expires_at)) < date('Y-m-d H:i:s'))\n {\n Auth::logout();\n return redirect('/login')->withErrors([\"not_allowed\"=>\"Your password has expired. Use the 'Forgot Your password' link to reset it.\"]);\n }\n\n return redirect('/');\n }", "public function index()\n {\n $this\n ->middleware('auth')\n ->except('index', 'show');\n }", "public function actionIndex()\n {\n \techo 'Permission Denied.';\n \texit;\n return $this->render('index');\n }", "public function actionIndex()\n {\n $this->layout = '//layouts/forgot';\n\n $email = '';\n if (r()->isPostRequest) {\n $email = $_POST['email'];\n // $captcha = app()->getController()->createAction(\"captcha\");\n\n // $code = $captcha->verifyCode;\n\n //check email\n if ($_POST['email'] != '') {\n\n $email = $_POST['email'];\n // check the email from parse is correct\n $query = new parseQuery('_User');\n $query->where('email', $email);\n $result = $query->find();\n\n if (count($result->results) == 0) {\n //no user exists\n user()->setFlash('error', 'Invalid email!');\n } else {\n // the email is valid and we send the email reset password for him\n $user = new parseUser();\n $user->requestPasswordReset($email);\n\n user()->setFlash('success', 'An email has sent to your email');\n\n $this->refresh();\n\n }\n } else {\n user()->setFlash('error', 'Username or Email is required');\n }\n\n }\n $this->render('index', array(\n 'email' => $email\n ));\n }", "function index()\r\n\t{\r\n\t\t\tredirect('c_login', 'refresh');\r\n\t}", "public function indexAction()\n {\n View::renderTemplate('Login/index.html');\n }", "public function showResetPassword() {\n\t\treturn view(\"pages.passwordreset.resetpassword\");\n\t}", "public function action_index() { \n $this->template->content = View::factory('login/login'); \n }", "public function index()\n\t{\n\t\t$this->login();\n }", "public function action_index() {\n\t\tUser::current()->logout();\n\t}", "function forgetPassword()\n {\n return view('auth.driver-password');\n }", "public function index()\n {\n $results = EmailPassword::with('user', 'email')->where('state', 0)->get();\n //dd($results);\n\n return view('app.administration.reset_password.index', compact('results'));\n }", "public function index()\n\t{\n\t\t$this->login();\n\t}", "public function actionIndex()\n {\n $data = array();\n if (!empty($_GET['dest'])) {\n $redirect = base64_decode($_GET['dest']);\n }\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n if (!isset($_GET['dest'])) {\n $redirect = $this->createUrl('index/index');\n }\n\n $email = formPostParams('email', VARIABLE_STRING);\n $password = formPostParams('password', VARIABLE_STRING);\n $condition = array(\n ':email' => $email,\n ':password' => md5($password)\n );\n $query = \"SELECT * FROM {{\" . $this->_table . \"}} WHERE email = :email AND password = :password\";\n $user = $this->db->createCommand($query)->bindValues($condition)->queryRow();\n\n if (!empty($user)) {\n Yii::app()->session['user'] = $user;\n $this->redirect($redirect);\n } else {\n createMessage('Email hoặc mật khẩu không đúng', 'danger');\n }\n } else {\n $user = Yii::app()->session['user'];\n if (!empty($user)) {\n $this->redirect($redirect);\n }\n }\n $this->renderPartial('index', array('data' => $data));\n }", "public function getIndex()\n {\n $data = array();\n return view('user/change-password', $data);\n }", "public function showEditPassword()\n {\n return view('pages.settings.password.index');\n }", "public function index()\n\t{\n\t\t\t$idUser = $this->session->userdata(\"id\");\n\t\t\t\n\t\t\t$this->load->model(\"general_model\");\n\t\t\t$arrParam = array(\n\t\t\t\t\"table\" => \"user\",\n\t\t\t\t\"order\" => \"id_user\",\n\t\t\t\t\"column\" => \"id_user\",\n\t\t\t\t\"id\" => $idUser\n\t\t\t);\n\t\t\t$data['information'] = $this->general_model->get_basic_search($arrParam);\n\n\t\t\t$data[\"view\"] = \"form_password\";\n\t\t\t$this->load->view(\"layout\", $data);\n\t}", "function forgotpassword(){ \n $data['meta_description'] = METADESCRIPTION;\n $data['page_title'] = SITE_TITLE;\n $data['page_name'] = \"Forgot Password\";\n $data['page_slug']\t\t= $this->uri->segment(1);\n $this->load->view('admin/common/header.php',$data);\n $this->load->view('admin/forgetpassword', $data);\n $this->load->view('admin/common/footer.php',$data);\n }", "public function index()\n {\n if(auth()->guest())\n return redirect('/login')->with('error', 'Nuk keni autorizim');\n else\n return view('daljet.index'); \n }", "public function actionPasswordReset()\n\t{\n\t\t$this->render('passwordReset');\n\t}", "public function index()\r\n\t{\r\n\t\t$this->viewloader(\"auth/loginform\");\r\n\t\t\r\n\t}", "public function indexAction()\n {\n if (!$this->identity()) {\n return $this->redirect()->toRoute('account/login');\n }\n }", "public function index()\n {\n if($result = check_auth_to('QXXX_INDEX')) return $result;\n $site = Config::get('site');\n $data['authList'] = Auth::paginate($site['page_size']);\n return view('admin.auth.index', $data);\n }", "public function index() {\r\n self::acceso();\r\n $this->view->ver('login.php'); \r\n }", "public function index()\n {\n $this->data['noCabinetOrAdmin'] = true;\n\n $this->isUser();\n\n $this->render('index');\n }", "public function forgot_password(){\n\n $this->data[\"title_tag\"]=\"Lobster | Accounts | Forgot Password\";\n\n $this->view(\"accounts/forgot_password\",$this->data);\n }", "protected function password_reset() {\n return \"password_reset page\";\n }", "public function forgotPassword()\n\t{\n\t\t$this->layout->content = View::make('login.password');\n\t}", "function recovery_pass() {\n load_similar_content($uri);\n $this -> data['uri'] = 'recovery_pass';\n $this -> data['content'] = $this -> load -> view('front_login/recovery_form', $this -> data, TRUE);\n $this -> load -> view('front/default', $this -> data);\n }", "public function index(){\t\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_PATH);\n\t\t}else {\n\t\t\tredirect(ADMIN_PATH.'/promocodes/display_promocodes');\n\t\t}\n\t}", "public static function index() {\n if (Auth::hasUser()) {\n redirect('/');\n } else {\n $login_page = new View('forms/signin.php');\n $login_page->render();\n }\n }", "public function index()\n {\n if (!Gate::allows('canLogin')) {\n abort(503,'Account Deactivated! Contact your Administrator');\n }\n if (Gate::allows('hasUpdated')) {\n if (Gate::allows('isSuperAdmin')) {\n $allItems = Item::all()->count();\n $allStudents = Student::all()->count();\n } else {\n $allItems = Item::where('location_id', Auth::user()->location_id)->count();\n $allStudents = Student::where('location_id', Auth::user()->location_id)->count();\n }\n return view('home', compact('allItems', 'allStudents'));\n } else {\n return view('change-password');\n }\n }", "public function index(){\r\n\r\n if(empty($_SESSION['rick_auto'])){\r\n $url= base_url().'admin/index/signin';\r\n redirect($url);\r\n\t\t\treturn;\r\n\t\t}else{\t\r\n\t\t\t$url= base_url().'admin/index/dashboard';\r\n\t\t\tredirect($url);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n }", "public function indexAction()\n {\n $generate = Register::generate();\n View::render('LandingPage/index.php',['token'=>$generate]);\n }", "public function goIndex()\n\t{\n\t\t$userName = Request::get('userName');\n\t\t$userPassword = Request::get('password');\n\t\t$checUserkLists = \\DB::select(\\DB::raw(\"select * from user_table where login_id='\".$userName.\"' and user_password='\".$userPassword.\"'\"));\n\n\t\t if(!$checUserkLists)\n\t\t {\n\t\t \t$_SESSION[\"LOGIN_FAILED\"] = '*Invalid User Name or Password';\t\n\t\t \treturn view('welcome');\n\t\t }\n\t\t else\n\t\t {\n\t\t\t\n\t\t\tforeach($checUserkLists as $row)\n\t\t\t{\n\t\t\t\t$userType = $row->user_type;\n\t\t\t\t$loginId = $row->login_id;\n\t\t\t\t$userName = $row->user_name;\n\t\t\t\t$userID = $row->user_id;\n\t\t\t\t$emailID = $row->email;\t\n\t\t\t}\n\t\t\t$_SESSION[\"USERID\"] = $userID;\n\t\t\t$_SESSION[\"USERTYPE\"] = $userType;\n\t\t\t$_SESSION[\"USERNAME\"] = $userName;\n\t\t\t$_SESSION[\"LOGINID\"] = $loginId;\n\t\t\t$_SESSION[\"LOGIN_FAILED\"] = ' ';\n\t\t\t$_SESSION[\"EMAIL\"] = $emailID;\n\n\t\t\treturn redirect('home');\n\t\t}\n\n\t}", "public function index(){\t\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_ENC_URL);\n\t\t} else {\n\t\t\tredirect(ADMIN_ENC_URL.'/promocode/display_promocode');\n\t\t}\n\t}", "protected function showForgot() {}", "public function index()\n {\n return view('auth.passwords.change-password');\n }", "function forgotten_password()\n {\t\n \t$data['heading'] = $this->lang->line('FAL_forgotten_password_label');\n \t$data['fal'] = $this->fal_front->forgotten_password();\n\t\t$this->load->view($this->_container, $data); \n\t\t$this->output->enable_profiler(TRUE);\n }", "public function indexAction(){\n View::renderTemplate('Login/index.html');\n \n \n }", "public function changePassowrdShow(){\n return view(\"pages.changepassword\");\n }", "public function get_index() {\n\n $this->successes = array();\n if(Session::has('successes')) {\n $this->successes = unserialize(Session::get('successes'));\n Session::forget('successes');\n }\n\n $this->warnings = array();\n if(Session::has('warnings')) {\n $this->warnings = unserialize(Session::get('warnings'));\n Session::forget('warnings');\n }\n\n return View::make('login.index', array(\n 'successes' => $this->successes,\n 'warnings' => $this->warnings,\n ));\n }", "public function index() {\n $this->login();\n }", "public function index(){\n return view('profile.change_pass');\n }", "public function index() {\n if(!$this->user){\n die('Members Only <a href=\"/users/login\">Login</a>');\n } \n echo \"This is the index page\";\n }", "public function index()\n {\n $this->view->title = \"Signup | Frindse\";\n $this->view->version = SITE_TEMPLATES_VER;\n $this->view->stylesheet = \"signup\";\n $this->view->javascript = \"Signup\";\n $this->view->header = \"header-logged-out\";\n\n // Now create the view\n $this->view->render('signup', 'index', SITE_TEMPLATES_VER);\n }", "function index() {\n\t\t\tif (!isset($_SESSION['admin'])) {\n\t\t\t\tView::render(\"admin\" . DS . \"login\");\n\t\t\t}else {\n\t\t\t\theader(\"Location: ../contenido/principal/\");\n\t\t\t}\n\t\t}", "public function index()\n {\n return view('user.change-password');\n }", "public function actionIndex()\n\t{\n\t\t$this->email = $_POST['email'];\n\t\t$this->pwd = $_POST['pwd'];\n\t\t$this->authenticate();\n\t}", "public function index()\n {\n //\n if (Auth::user()) {\n return redirect('');\n } else if (!Auth::user()) {\n return view('register');\n }\n }", "public function Forgotpassword()\n\t{\n\t\t$login = get_cookie(sha1('besaf'));\n\t\tif ($login) {\n\t\t\t//! cek login\n\t\t\tif ($this->session->userdata('role_id') == 1) {\n\t\t\t\t// user\n\t\t\t\tredirect('user');\n\t\t\t} elseif ($this->session->userdata('role_id') == 2) {\n\t\t\t\t// admin\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t} elseif (!$login) {\n\t\t\t//! cek login\n\t\t\tif ($this->session->userdata('role_id') == 1) {\n\t\t\t\t// user\n\t\t\t\tredirect('user');\n\t\t\t} elseif ($this->session->userdata('role_id') == 2) {\n\t\t\t\t// admin\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\n\t\t$this->session->set_userdata(['reset' => true]);\n\n\t\t$this->load->view('Front/template/header');\n\t\t$this->load->view('Front/Forgot_password');\n\t\t$this->load->view('Front/template/footer');\n\t}", "public function displayResetPassword()\n {\n $this->render('reset-password', ['head'=>['title'=>'Réinitialisation de votre mot de passe', 'meta_description'=>'']]);\n }", "public function index()\n\t{\n\t\t//\n\t\t// echo \"HELLLLLLLLL\";\n\t\t// die();\n\t\t// return view('dashboard.userprofile');\n\t\n\t}", "public function forget_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n if ($this->input->is_post()) {\n $res = $this->_api('user')->reset_password($this->input->post());\n\n if($res['submit']) {\n redirect('/login/forget_password_complete');\n return;\n }\n $view_data = [\n 'form_errors' => isset($res['invalid_fields']) ? $res['invalid_fields'] : [],\n 'errmsg' => isset($res['errmsg']) ? $res['errmsg'] : null,\n 'post' => $this->input->post()\n ];\n }\n\n $this->_render($view_data);\n }", "public function index() {\n // render page\n return \\View::make('control.login.index')\n ->with('class', 'login-page')\n ->with('title', $this->_title . ' | Login');\n \n }", "public function admin_forgot_password_form() {\n if ($this->checkLogin('A') == '') {\n\t\t\t\t$this->load->view(ADMIN_ENC_URL.'/templates/forgot_password.php', $this->data);\n } else {\n redirect(ADMIN_ENC_URL.'/dashboard');\n }\n }", "public function index(Request $request)\n {\n //\n return view('changepassword');\n }", "public function forget()\n\t{\n //$this->load->model('Admin_model');\n $this->load->view('login-forget');\n }", "protected function indexAction() {}", "public function actionIndex()\n {\n \t$session=Yii::$app->session;\n \tif (!$session['username']) {\n \t\treturn Yii::$app->getResponse()->redirect(Url::toRoute('/login'));\n \t}\n return $this->render('index');\n }", "public function indexAction()\n {\n $this->view->title = 'Li-No | Admin Index';\n $this->_forward('login', 'auth');\n }", "public function index() {\n\t\tif(!$this->user) {\n\t\t\tRouter::redirect('/users/login');\n\t\t}else{\n\t\t\tRouter::redirect('/users/profile');\t\n\t\t}\n\t}", "public function action_index() {\r\n\r\n\t$main_content = View::forge(\"account/simpleauth\");\r\n $main_sidebar = View::forge(\"vlog/sidebar\");\r\n\r\n\t$this->template->page_content = $main_content;\r\n $this->template->page_sidebar = $main_sidebar;\r\n }" ]
[ "0.74157465", "0.7368982", "0.719471", "0.70688343", "0.70387083", "0.70316064", "0.6973417", "0.6947279", "0.69462633", "0.6882142", "0.6864511", "0.686108", "0.6851199", "0.6847043", "0.68113405", "0.67738974", "0.6734467", "0.67245626", "0.6714781", "0.6713951", "0.6652019", "0.6644111", "0.66283876", "0.658865", "0.6588303", "0.65764225", "0.6555004", "0.65521884", "0.6544679", "0.6528938", "0.6505592", "0.6491543", "0.6487866", "0.6470159", "0.64668983", "0.6465023", "0.64387214", "0.64357644", "0.64321077", "0.64148027", "0.6407452", "0.63943017", "0.63879657", "0.63808954", "0.6377579", "0.6374547", "0.6364522", "0.63618326", "0.6360628", "0.63443166", "0.6337767", "0.633732", "0.63305086", "0.6327786", "0.63216954", "0.63138664", "0.63092816", "0.6304041", "0.6299363", "0.6298399", "0.6298041", "0.62899417", "0.6286116", "0.6285835", "0.6284186", "0.6277191", "0.6276155", "0.62760967", "0.62607896", "0.62585497", "0.6257901", "0.6255001", "0.6254511", "0.6251484", "0.62459034", "0.6244726", "0.6240959", "0.6240184", "0.6239548", "0.6237923", "0.6230865", "0.6230837", "0.6221568", "0.62144285", "0.62129515", "0.62108517", "0.6205129", "0.6205029", "0.6203656", "0.62019295", "0.62011707", "0.62009954", "0.6196065", "0.6195596", "0.6191701", "0.6190271", "0.61898315", "0.6186307", "0.61769354", "0.6174986", "0.6172492" ]
0.0
-1
url can be divided into parts at each slash and this will return the part at the given index
public function param($index = null) { $params = array_filter(explode('/', $this->path)); if (strlen($params[0]) === 0) array_shift($params); if ($index === null) return array_map('rawurldecode', $params); if ($index < 0) { $slice = array_slice($params, $index, 1); if (!isset($slice[0])) return null; return rawurldecode($slice[0]); } if (!isset($params[$index])) return null; return rawurldecode($params[$index]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function urlSegment($int=''){\n $input = get('url');\n $input = explode('/', $input);\n $int--;\n return $input[$int];\n }", "function _tryToGetUrlPart( $offset ) {\n\n $_tmp['path'] = explode( \"/\", $this->_getPathUrl());\n if (! empty( $_tmp['path'][$offset] )) {\n return $_tmp['path'][$offset];\n }\n }", "function getSegment($n)\n{\n foreach (explode(\"/\", preg_replace(\"|/*(.+?)/*$|\", \"\\\\1\", RURL)) as $val) {\n $val = clearSegment($val);\n if ($val != '') {\n $segments[] = $val;\n }\n }\n\n return isset($segments[$n - 1]) ? $segments[$n - 1] : \"\";\n}", "public function uriSegment($index)\n\t{\n\t\t$uriParts = explode('/', $this->uri());\n\t\treturn isset($uriParts[$index]) ? $uriParts[$index] : null;\n\t}", "public function parseURL()\n {\n $url = $_GET['url']; // localhost/HornyMVC/admin/erfds/sd/ds -> $url = admin/erfds/sd/ds\n\n $url = explode('/', trim($url));\n\n $url = array_slice($url, array_search(\"HornyMVC\", $url) ? array_search(\"HornyMVC\", $url) + 1 : 0);\n\n return $url;\n }", "function get_url($index = '')\n{\n /**\n * $_GET['url'] merupakan URL atau pretty url yang di set\n * atau dirapikan pada file .htaccess, jadi penulisannya yang di set\n * menggunakan htaccess adalah index.php?url=xyz sebagai default\n * maka dari itu bisa memanggil $_get['url']\n */\n if (isset($_GET['url'])) {\n /**\n * Merapikan url menggukan method rtrim untuk menhapus / dibagian akhir url\n * \tmengamankan url dari variabel aneh dengan method Filter_var \n * memecar URL menjadi array dengan method explode setiap bertemu string atau karakter /\n */ \n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n if ($index !== '') {\n return $url[$index];\n } else {\n return $url;\n }\n }else{\n \n $url = trim($_SERVER[\"REQUEST_URI\"], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n if ($index !== '') {\n return $url[$index];\n unset($url[0]);\n } else {\n return $url;\n }\n }\n}", "function menuGetFirstUrlPart() {\n $request_uri = Slim_Http_Uri::getUri();\n $url_parts = explode('/', $request_uri);\n array_shift($url_parts);\n\n return '/'. $url_parts[0];\n}", "function segment_explode($uri){\n\t\t$len = strlen($uri);\n\n\t\t//If there is a '/' at the first index,\n\t\t//Set new $uri starting from index 1.\n\t\tif(substr($uri, 0, 1) == '/'){\n\t\t\t$uri = $substr($uri, 1, $len);\n\t\t}\n\n\t\t//If there is a '/' at the end,\n\t\t//Set new $uri from index 0 to length -1.\n\t\tif(substr($uri, -1) == '/'){\n\t\t\t$uri = $substr($uri, 0, $len-1);\n\t\t}\n\n\t\treturn explode('/', $uri);\n\t}", "abstract public function getNextPart($full_url, $next_part, &$previous_parts);", "public static function getSegmentOfUrl($position) {\n $aSegment = explode('/', str_replace(Yii::app()->baseUrl, '', Yii::app()->request->requestUri));\n if (isset($aSegment[$position]))\n return $aSegment[$position];\n return '';\n }", "function _get_component_from_parsed_url_array($url_parts, $component = -1)\n {\n }", "private static function parseUri($uri) \n {\n $path = str_replace(INDEX_PATH,\"\",$uri);\n $path = explode(\"?\",$path);\n $path = $path[0];\n $path = trim($path,'/');\n return explode('/',$path);\n }", "function uriSegment($segment = '')\n {\n $request_uri = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');\n $explode = explode('/', str_replace('index.php/', '', $request_uri));\n\n if(empty($segment)) return '';\n\n if(!empty($explode[($segment-1)]))\n return $explode[($segment-1)];\n else \n return '';\n }", "public static function getSegmentOfUrl($position)\n {\n $aSegment = explode('/', str_replace(Yii::app()->baseUrl, '', Yii::app()->request->requestUri));\n if(isset($aSegment[$position]))\n return $aSegment[$position];\n return '';\n }", "function get_path($url) {\n preg_match('/^([^?]+)(\\?path.*?)?(&content.*)?$/', $url, $matches);\n if (isset($matches[2])) {\n\t\tparse_str(substr($matches[2], 1), $path);\n\t\t$parse_path = preg_split(\"/[-]+/\", $path['path']);\n\t} else {\n\t\t$parse_path[0] = '';\n\t\t$parse_path[1] = '';\n\t\t$parse_path[2] = '';\n\t\t$parse_path[3] = '';\n\t}\n return $parse_path;\n}", "function segment($index){\n\t\t\tif(!empty($this->path[$index-1])){\n\t\t\t return $this->path[$index-1];\n\t\t\t}else{ \n\t\t\t return false;\n\t\t\t}\n\t\t}", "function extractString($url, $start, $end) {\r\n $url = \" \".$url;\r\n $ini = strpos($url, $start);\r\n if ($ini == 0) return \"\";\r\n $ini += strlen($start);\r\n $len = strpos($url, $end, $ini) - $ini;\r\n return substr($url, $ini, $len);\r\n}", "static final function getCurrentUrl($pos){\n\n $rest = explode(\"/\", $_SERVER['REQUEST_URI']);\n $rest = '/'.$rest[$pos];\n return $rest;\n }", "function get($get = '', $replace = false) {\r\n $uri = $_SERVER['REQUEST_URI'];\r\n \t\r\n if(strpos($uri, '?')):\r\n \t$explode = explode('?', $uri);\r\n \t$uri = $explode[0];\r\n endif;\r\n \r\n if(!$replace):\r\n if(!empty($uri)):\r\n if(empty($get)):\r\n return (string) $uri;\r\n else:\r\n\r\n if(preg_match('#^\\/#', $uri)):\r\n $uri = substr($uri, 1);\r\n endif;\r\n\r\n if(preg_match('#\\/$#', $uri)):\r\n $uri = substr($uri, 0, -1);\r\n endif;\r\n\r\n if(empty($uri)):\r\n return 'index';\r\n endif;\r\n\r\n $list = array();\r\n $var = explode('/', $uri);\r\n $i = 1;\r\n foreach($var as $key):\r\n $list[$i] = $key;\r\n $i++;\r\n endforeach;\r\n\r\n if(isset($list[$get])):\r\n return $list[$get];\r\n else:\r\n return 'index';\r\n endif;\r\n endif;\r\n else:\r\n return 'index';\r\n endif;\r\n else:\r\n $getArray = explode('/', substr($uri, 1, -1));\r\n\t\tif ($getArray[0]==='') {\r\n\t\t\t$getArray = array_slice($getArray, 1);\r\n\t\t}\r\n for($i = 0; $i < $get; $i++):\r\n if(!isset($getArray[$i])):\r\n $getArray[$i] = 'index';\r\n endif;\r\n endfor;\r\n $getArray[$get-1] = $replace;\r\n\t\t$return = preg_replace('#\\/\\/#','/','/'.implode('/', $getArray).'/');\r\n\t\t$return = preg_replace('#\\/index\\/$#', '/', $return);\r\n return $return;\r\n endif;\r\n}", "public function parseUrl()\n\t\t{\n\t\t\tif(isset($_GET['url']))\n\t\t\t{\n\t\t\t\t// explode(separator, string, limit);\n\t\t\t\treturn $url = explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n\t\t\t}\n\t\t}", "function get_last_url_slug() {\n\n $url = $_SERVER['REQUEST_URI'];\n $parts = explode(\"/\", $url);\n $lastPart = $parts[count($parts)-2];\n \n \n return $lastPart;\n}", "public function parseURI() {\n $uri = explode(\"/\", $this->getRequestURI());\n $rootDIR = array_search($this->getProjectDIR(), $uri);\n\n return array_splice($uri, ($rootDIR+1));\n }", "function get_route_name_at_index($index)\n{\n $route = \\Illuminate\\Support\\Facades\\Request::path();\n $route_array = explode('/', $route);\n return isset($route_array[$index]) ? $route_array[$index] : false;\n}", "function getPage(){\n $current_location = \"index\";\n if($url_part = array_pop(explode(\"/\", $_SERVER[\"REQUEST_URI\"]))){\n $url_part = array_slice(explode(\".php\", $url_part),0,1);\n if(!empty($url_part)){\n return $url_part[0];\n }\n }\n return $current_location;\n}", "public function segment($num_segment=NULL){\n\t\t$base_url = $this->site_url();\n\t\t$actual_link = $this->protocol() . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t$set_parse = str_replace($base_url, $this->protocol() . 'g.g/', $actual_link);\n\t\t$parse_url = parse_url($set_parse, PHP_URL_PATH);\n\t\t$arrPath = explode('/', $parse_url);\n\t\t/*\tmembuat urutan ulang index array. urutan pertama menjadi 1 */\n\n\t\tif($num_segment == NULL){\n\n\t\t\t/* menampilkan semua data array */\n\t\t\treturn $arrPath;\n\t\t} else {\n\n\t\t\t/* chcek jika input data melebihi jumlah array path */\n\t\t\tif(count($arrPath) >= $num_segment){\n\t\t\t\tif(isset($arrPath[$num_segment])){\n\t\t\t\t\treturn $arrPath[$num_segment];\n\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}", "public function parseUrl()\n { #Explode para transformar em array, seprando por /, rtrim para retirar os espaços vazios, filter_ sanitize_url fucao do php para retirar caractres ilegais \n return explode(\"/\",rtrim($_GET['url']),FILTER_SANITIZE_URL);\n }", "private function parseUrl($url): string {\n $splittedUrl = explode('/', $url);\n $newUrl = '';\n foreach ($splittedUrl as $partUrl) {\n if($partUrl !== '') {\n if($partUrl[0] === '{' && $partUrl[strlen($partUrl) - 1] === '}') {\n $newUrl.= '/VALUE';\n continue;\n }\n $newUrl .= '/' . $partUrl;\n }\n }\n return $newUrl;\n }", "public function uriSegment($pos)\n {\n $app = \\Slim\\Slim::getInstance();\n $request = $app->request;\n\n $uriPath = $request->getResourceUri();\n\n if (isset($uriPath)) {\n $segments = explode('/', $uriPath);\n\n return isset($segments[$pos]) ? $segments[$pos] : null;\n }\n }", "public function getParts()\n {\n if (empty($this->parts)) {\n $this->parts = $this->getUrlArguments();\n if (empty($this->parts)) {\n $this->parts = array('index');\n }\n else if (reset($this->parts) == 'api') {\n array_shift($this->parts);\n }\n }\n return $this->parts;\n }", "function getLastSlash($str) {\n\n\n\n $arr = explode(\"/\", $str);\n\n\n\n return $arr[count($arr) - 1];\n }", "function uri_to_array($index=0){\n\t\t\tif(is_array($this->path)){\n\t\t\t\treturn array_slice($this->path,$index);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function getUriHistory(string $uri, int $count):string {\n // 2 : two first items\n // -1 : all except last item\n // -2 : all except two last items\n $items = explode('/', $uri);\n if ($count < 0) $count = count($items) + $count;\n $count = min($count, count($items));\n return implode('/', array_slice($items, 0, $count));\n }", "function getContentUrl($url){\n return $url[1];\n\t}", "function get_main_url($url){\r\n $parts = parse_url($url);\r\n $url = $parts[\"scheme\"] .\"://\".$parts[\"host\"];\r\n return $url;\r\n}", "static function get_url_segment() {\r\n\t\tself::$url_path;\r\n\t}", "static public function getUrlArray()\n {\n \tstatic $url_array = NULL;\n \tif( is_null( $url_array ) ) {\n\t\t\t$url_array = explode( '/', ltrim( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), '/' ) );\n\t\t\tforeach( $url_array as &$url_part ) {\n\t\t\t\t$url_part = ( $url_part !== \"\" ) ? strtolower( $url_part ) : \"index\";\n\t\t\t}\n\t\t}\n\t\treturn $url_array;\n }", "function pick_one_string($str, $delimiter = \"/\")\n{\n\t$parts = preg_split('/\\s*\\/\\s*/', $str);\n\t\n\treturn $parts[0];\n}", "function read(){\n if($this->url != \"\"){\n if($this->url[strlen($this->url)-1] == \"/\") {\n $this->url = substr($this->url, 0,(strlen($this->url)-1));\n }\n $this->url_arr = explode(\"/\", $this->url);\n } else {\n $this->url_arr[0] = \"\";\n }\n \n return $this->url_arr;\n }", "function getSubstrAfterLastSlash($str)\n{\n $slashPos = strrpos($str, '/');\n $substr = $slashPos === false ? $str : substr($str, $slashPos + 1);\n\n return $substr;\n}", "function _get_item_segments()\n{\n$segments = \"musical/instrument/\";\nreturn $segments;\n\n}", "protected function get_url_parts($url)\n {\n // use the REQUEST_URI as default\n if (empty($url)) {\n $url = Request::get_request_url();\n }\n\n // get the url parts and format required values\n $url_parts = parse_url($url);\n $url_parts['path'] = isset($url_parts['path']) ? $url_parts['path'] : '/';\n\n return $url_parts;\n }", "public function getFirstPageUrl();", "function getPathFromUrl($url)\n{\n $path = UrlHelper::getPathAndQueryFromUrl($url);\n if (empty($path)) {\n return 'index';\n }\n return $path;\n}", "function GetMainBaseFromURL()\n{\n\t$url = (!empty($_SERVER['HTTPS'])) ? \"https://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : \"http://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n\n\t$chars = preg_split('//', $url, -1, PREG_SPLIT_NO_EMPTY);\n\t$slash = 3; // 3rd slash\n\t$i = 0;\n\tforeach($chars as $key => $char)\n\t{\n\t\tif($char == '/')\n\t\t{\n\t\t $j = $i++;\n\t\t}\n\t\n\t\tif($i == 3)\n\t\t{\n\t\t $pos = $key; break;\n\t\t}\n\t}\n\tif($_REQUEST['CFSystem']['url_friendly'])\n\t{\n\t\t$url = (!empty($_SERVER['HTTPS'])) ? \"https://\".$_SERVER['SERVER_NAME']: \"http://\".$_SERVER['SERVER_NAME'];\n\t\t$main_base = rtrim($url.'/'.basename($_REQUEST['CFSystem']['baseurl']),'/');\n\t}\n\telse\n\t{\n\t\t$main_base = substr($url, 0, $pos);\n\t}\n\treturn $main_base.'/';\t\n}", "private function __getCategoryIdFromUrl() {\n return $this->uri->segment( 3, 0 );\n }", "public function url()\n {\n return explode('?' ,$this->uri)[0];\n }", "public static function getURIparts($include_i18n_segment=false)\n\t{\n\t\t$_uri_parts = explode(\"/\",ltrim(Core::getURI(),\"/\"));\n\t\tif($_uri_parts[0] == \"public\")\n\t\t{\n\t\t\tarray_shift($_uri_parts);\n\t\t}\n\n\t\tif(!$include_i18n_segment && is_array($_ENV['config']['i18n_segments']) && preg_grep(\"/$_uri_parts[0]/i\",$_ENV['config']['i18n_segments']))\n\t\t{\n\t\t\tarray_shift($_uri_parts);\n\t\t}\n\n\t\treturn $_uri_parts;\n\t}", "public function parseUrl(){\n\n if(isset($_GET['url'])){\n //echo $_GET['url'];\n\n return $url = explode('/',filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n }\n }", "public function getPathPart($part)\n\t{\n $path_parts = pathinfo($this->getFullPath());\n return array_key_exists($part, $path_parts)? $path_parts[$part]: '';\n // dirname, basename, extension, filename\n // see http://php.net/manual/en/function.pathinfo.php\n\t}", "static function filtrarUrl($url) {\n if (strpos($url, \"?\") !== false) {\n $parts = explode(\"?\", $url);\n return $parts[0];\n } else\n return $url;\n }", "public function get($index = null, $default = false) {\n\t\tif (!is_null($index)) {\n\n\t\t\t// the model is defined by the first element in the uri - so 'model' returns the 0 index.\n\t\t\tif ($index == 'model') return $this->path[0];\n\n\t\t\t// return the full uri as a string.\n\t\t\tif ($index == 'full') {\n\t\t\t\t// remove the query string from the uri. (preg_replace will generally be fastest)\n return preg_replace('/\\?(?!.*\\?)\\S+/', '', implode('/',$this->path));\n\t\t\t}\n\n if (isset($this->path[$index]) && $this->path[$index] != '') {\n \t// remove the query string from the specified uri segment.\n return preg_replace('/\\?(?!.*\\?)\\S+/', '', $this->path[$index]);\n }\n else return $default;\n }\n // return the path as an array.\n else return $this->path;\n\t}", "function get_item($s, $index)\n{\n\t$head = 0;\n\tfor ($i = 0; $i < $index; $i++)\n\t{\n\t\t$head = strpos($s, \"\\t\", $head + 1);\n\t}\n\t$tail = strpos($s, \"\\t\", $head + 1);\n\t$ret = substr($s, $head + 1, $tail - $head - 1);\n\t//\techo \"$head - $tail = '$ret'\\n\";\n\n\treturn $ret;\n}", "function wp_parse_url($url, $component = -1)\n {\n }", "function qa_request_parts($start = 0)\n{\n\treturn array_slice(explode('/', qa_request()), $start);\n}", "function nebula_url_components($segment=\"all\", $url=null) {\n\tif ( !$url ) {\n\t\t$url = nebula_requested_url();\n\t}\n\n\t$url_compontents = parse_url($url);\n\tif ( empty($url_compontents['host']) ) {\n\t\treturn;\n\t}\n\t$host = explode('.', $url_compontents['host']);\n\n\t//Best way to get the domain so far. Probably a better way by checking against all known TLDs.\n\tpreg_match(\"/[a-z0-9\\-]{1,63}\\.[a-z\\.]{2,6}$/\", parse_url($url, PHP_URL_HOST), $domain);\n\t$sld = substr($domain[0], 0, strpos($domain[0], '.'));\n\t$tld = substr($domain[0], strpos($domain[0], '.'));\n\n\tswitch ($segment) {\n\t\tcase ('all') :\n\t\t\treturn $url;\n\t\t\tbreak;\n\n\t\tcase ('protocol') : //Protocol and Scheme are aliases and return the same value.\n\t\tcase ('scheme') : //Protocol and Scheme are aliases and return the same value.\n\t\tcase ('schema') :\n\t\t\tif ( $url_compontents['scheme'] != '' ) {\n\t\t\t\treturn $url_compontents['scheme'];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('host') : //In http://something.example.com the host is \"something.example.com\"\n\t\tcase ('hostname') :\n\t\t\treturn $url_compontents['host'];\n\t\t\tbreak;\n\n\t\tcase ('www') :\n\t\t\tif ( $host[0] == 'www' ) {\n\t\t\t\treturn 'www';\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('subdomain') :\n\t\tcase ('sub_domain') :\n\t\t\tif ( $host[0] != 'www' && $host[0] != $sld ) {\n\t\t\t\treturn $host[0];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('domain') : //In http://example.com the domain is \"example.com\"\n\t\t\treturn $domain[0];\n\t\t\tbreak;\n\n\t\tcase ('basedomain') : //In http://example.com/something the basedomain is \"http://example.com\"\n\t\tcase ('base_domain') :\n\t\t\treturn $url_compontents['scheme'] . '://' . $domain[0];\n\t\t\tbreak;\n\n\t\tcase ('sld') : //In example.com the sld is \"example\"\n\t\tcase ('second_level_domain') :\n\t\tcase ('second-level_domain') :\n\t\t\treturn $sld;\n\t\t\tbreak;\n\n\t\tcase ('tld') : //In example.com the tld is \".com\"\n\t\tcase ('top_level_domain') :\n\t\tcase ('top-level_domain') :\n\t\t\treturn $tld;\n\t\t\tbreak;\n\n\t\tcase ('filepath') : //Filepath will be both path and file/extension\n\t\t\treturn $url_compontents['path'];\n\t\t\tbreak;\n\n\t\tcase ('file') : //Filename will be just the filename/extension.\n\t\tcase ('filename') :\n\t\t\tif ( contains(basename($url_compontents['path']), array('.')) ) {\n\t\t\t\treturn basename($url_compontents['path']);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('path') : //Path should be just the path without the filename/extension.\n\t\t\tif ( contains(basename($url_compontents['path']), array('.')) ) { //@TODO \"Nebula\" 0: This will possibly give bad data if the directory name has a \".\" in it\n\t\t\t\treturn str_replace(basename($url_compontents['path']), '', $url_compontents['path']);\n\t\t\t} else {\n\t\t\t\treturn $url_compontents['path'];\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('query') :\n\t\tcase ('queries') :\n\t\t\treturn $url_compontents['query'];\n\t\t\tbreak;\n\n\t\tdefault :\n\t\t\treturn $url;\n\t\t\tbreak;\n\t}\n}", "final public static function getUrl()\n {\n\n $url = explode('/', $_GET['url']);\n\n $pos = array_search('index.php', $url);\n\n if($pos === 0){\n unset($url[$pos]);\n }\n\n $url = self::orderUrl($url);\n\n return $url;\n }", "public function processUrl(){\n\t\t\n\t\tif (isset($_GET['url'])) {\n\t\t\treturn $url = explode('/',filter_var(rtrim($_GET['url'],'/'),FILTER_SANITIZE_URL));//what we're doing here is attempting to filter the url to make it clean and easy to use in our case we're going to explode the url into an array.\n\t\t}\n\n\n\t}", "private static function splitPath_getPath($page) /* WARNING: maybe we can simplify this fonction as dots are probably not used anymore */\r\n\t{\r\n\t\tif( ! strstr($page, '.') )\r\n\t\t\treturn Array($page, \"$page/\");\r\n\t\treturn Array(str_replace('.', '/', $page), '');\r\n\t}", "public function getUrlSegment()\n {\n // Create URL segment if we don't have one.\n if(!$this->url_segment){\n $this->url_segment = str_slug($this->getFullName().' '.$this->id);\n $this->save();\n }\n\n return $this->url_segment;\n }", "function getComponentFromURL($url, $component){\n\t$url_parts = parse_url($url);\n\tif($url_parts !== false && isset($url_parts[$component])){\n\t\treturn $url_parts[$component];\n\t}\n\n\treturn false;\n}", "function _get_items_segments()\n{\n$segments = \"music/instruments/\";\nreturn $segments;\n\n}", "function getStringpart($string,$startStr,$endStr)\n{\n $start = strpos( $string, $startStr);\n\n $end = strrpos( $string, $endStr) + strlen($endStr);\n //we need the length of the substring for the third argument, not its index\n $len = ($end-$start);\n\n $fstr = substr($string, $start, $len );\n\nreturn $fstr;\n}", "private function mapWildcard($index) {\n\t\t$routeParts = explode('/', $this->route);\n\n\t\tif (!isset($routeParts[$index])) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$wildcardParts = array_slice($routeParts, $index);\n\t\t$wildcard = '';\n\n\t\tforeach ($wildcardParts as $idx => $piece) {\n\t if (!$idx && !$piece) {\n\t continue;\n\t }\n\n\t if ($idx) {\n\t \t$wildcard .= \"/\";\n\t }\n\n\t $wildcard .= $piece;\n\t\t}\n\n\t\treturn $wildcard;\n\t}", "private function parseUrl()\n {\n try\n {\n if(isset($_GET[Constants::GET_ARRAY_URL]))\n {\n $url = $_GET[Constants::GET_ARRAY_URL];\n\n //Remove the Additional Slashes and Separate the url\n return explode('/',filter_var(rtrim($url,'/')), FILTER_SANITIZE_URL);\n }\n }\n catch (Exception $e)\n {\n return null;\n }\n }", "private static function split_uri($input)\r\n\t{\r\n\t\t$pos = strpos($input, '/');\r\n\r\n\t\tif ($pos !== false)\r\n\t\t{\r\n\t\t\treturn explode('/', $input);\r\n\t\t}\r\n\r\n\t\treturn array($input);\r\n\t}", "private function prepareRuta(){\n\t\t$this->uriArray = array_slice(explode('/',$this->uri), $this->webPathNumber,3);\n\t}", "protected function extractId($url)\n {\n $parts = explode('/', $url);\n return end($parts);\n }", "public function parse_path($uri) {\n\n\t\t/**\n\t\t * Strip away the GET string from the URI if it's around.\n\t\t * @todo Do something with the GET string here eventually, or completely deprecate it.\n\t\t */\n\t\tlist($path, $get) = explode('?', $uri);\n\n\t\t/**\n\t\t * trim the path to make sure there's not a hanging empty array item after exploding...\n\t\t * however the path string is expected to always start with / so we add it back\n\t\t */\n\t\t$path = explode(\"/\", '/'.trim($path,'/'));\n\n\t\t/**\n\t\t * Because the string starts with a \"/\", array[0] is empty. This is important because\n\t\t * we actually want array 1 to be the first var\n\t\t * @todo I think it would be better to have a proper array here and +1 to the pointer later\n\t\t */\n\t\tunset($path[0]);\t\t\n\n\t\t/**\n\t\t * Return the parsed array of segments.\n\t\t */\n\t\treturn $path;\n\t}", "function getSuffixPath() {\r\n\t$url = $_SERVER['REQUEST_URI']; // \"/some/app/script.php/cid/c1/seg/1234-init.mp4\r\n\t$idx = strpos($url, \".php/\", 0);\r\n\tif($idx===false) return \"\";\r\n\t$url = substr($url, $idx+1); // script.php/cid/c1/seg/1234-init.mp4\r\n\t$path= substr($url, strpos($url, \"/\",0)+1); // cid/c1/seg/1234-init.mp4\r\n\treturn $path;\r\n}", "function getUri()\r\n{\r\n\treturn explode(\"/\", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));\r\n}", "function split2($path) {\n\t// Album is everything after\n\treturn preg_split(\"/\\/+/\", $path, 2);\n}", "function valid_news_url($val)\n{\n $news=explode('/',$val);\n if($news[1]=='news'){\n return true;\n }else{\n return false;\n }\n //print_r($news);\n\n}", "function getParam($str)\r\n\t{\r\n\t\t$pos =strpos($str, $this->_BASEURL);\r\n\r\n\t\tif ($pos < 0)\r\n\t\t\treturn null;\r\n\r\n\t\t$temp = explode($this->_BASEURL.\"index.php\", $str);\r\n\r\n\t\tif (count($temp) == 2)\r\n\t\t{\r\n\t\t\t$p = $temp[1];\r\n\r\n\t\t\t//file check\r\n\t\t\tif (strpos(strtolower($p), \".\") > -1)\r\n\t\t\t\treturn null;\r\n\r\n\t\t\tif (strlen($p) == 0)\r\n\t\t\t\treturn \"Default\";\r\n\r\n\t\t\t$p = substr($p, -1,1) == \"/\" ? substr($p, 0, -1):$p;\r\n\t\t\t\r\n\t\t\treturn substr($p, 0, 1) == \"/\" ? substr($p, 1):$p;\r\n\t\t}\r\n\r\n\t}", "public function getRoute($url);", "function explode_uri($uri=null){\n\t\tif(!isset($uri)){\n\t\t\t$segment_array = array_values($this->uri->segment_array());\n\t\t} else {\n\t\t\t$segment_array = array();\n\t\t\tforeach(explode('/', preg_replace(\"|/*(.+?)/*$|\", \"\\\\1\", $uri)) as $val)\n\t\t\t{\n\t\t\t\t$val = trim($val);\n\t\t\t\tif ($val != '') $segment_array[] = $val;\n\t\t\t}\n\t\t}\n\n\t\t$segment_count = count($segment_array);\n\n\t\t//MODIF 1.6\n\t\t//---URI Completion code: if the requested URI use default controller or default index function shortcut we complete rapyd URI with their values.\n\t\t//---We use it only if rapyd_uri() work on the current browser requested URI, if it works as utility function we assume that we give it a valide URI.\n\t\t//---Now with the new CI Router (v1.6) Ruri always start by the controller clause and then the function clause, even if the controller is into a directory.\n\t\t//---So if there is more than 2 values into rsegments array this means that we have at least one param. so in this case it is impossible that CI use default\n\t\t//---Value for controller and function.\n\t\t//---Now Rapyd Only work on URI so if the requested URI use a route We have nothing to do: CI 1.6 Router deal weel with default controller and index function.\n\t\t//--- So we use Completion code on URI only if there is no used route for it.\n\n\t\tif(!isset($uri) && $this->uri->rsegments[2]=='index' && count($this->uri->rsegments) < 3 && $this->ci_use_route()===false){\n\t\t\tif(count($segment_array)==0)return array('base_uri' => array($this->router->default_controller,'index'));\n\n\t\t\tif($segment_array[$segment_count-1] != 'index') {\n\t\t\t\t$add_arr[1] = 'index';\n\t\t\t\tif($segment_array[$segment_count-1] != $this->router->default_controller) $add_arr[0] = ''; //$add_arr[0] = $this->router->default_controller;\n\t\t\t\tksort($add_arr);\n\t\t\t\t$segment_array = array_merge($segment_array,$add_arr);\n\t\t\t}\n\t\t\treturn array('base_uri' => $segment_array);\n\t\t}\n\n\t\t//<<<<URI clause '/search':>>>>\n\t\t$do_search = array_search(RAPYD_URI_SEARCH,$segment_array);\n\t\tif ($do_search!==false){\n\t\t\t$uri_array['search'] =\tarray_splice($segment_array, $do_search, 1);\n\t\t}\n\t\t//<<<<URI clause '/reset':>>>>\n\t\t$do_reset = array_search(RAPYD_URI_RESET,$segment_array);\n\t\tif ($do_reset!==false) {\n\t\t\t$uri_array['reset'] = array_splice($segment_array, $do_reset, 1);\n\t\t}\n\n\t\t//<<<<URI clause '/orderby/fieldname/sort':>>>>\n\t\t$do_orderby = array_search(RAPYD_URI_ORDERBY,$segment_array);\n\t\tif ($do_orderby!==false){\n\t\t\t$uri_array['orderby'] = array_splice($segment_array, $do_orderby,3);\n\t\t}\n\n\t\t// 2 different lenght possible\n\t\t// /ops URI lenght = 1 ,all other page, /ops/n URI lenght = 2\n\t\t$do_osp = array_search(RAPYD_URI_OSP,$segment_array);\n\t\tif ($do_osp!==false){\n\t\t\t//if($do_osp != count($segment_array)-1 && $do_osp != count($segment_array)-2){echo \" Error in osp URI range<br>\";}\n\t\t\t$uri_array['osp'] = array_splice($segment_array, $do_osp,2);\n\t\t}else{\n\t\t\t$uri_array['osp'] = array(RAPYD_URI_OSP);\n\t\t}\n\n\t\t//<<<<URI clause '/uri_search/field1/value1/field2/value2....':>>>>\n\t\t$do_uri_search = array_search(RAPYD_URI_URI_SEARCH,$segment_array);\n\t\tif ($do_uri_search!==false) {\n\n\t\t\t$max_length = count(array_slice($segment_array,$do_uri_search));\n\t\t\tif(($max_length % 2)==0){$max_length --;}\n\t\t\t//With $max_length we are sure that we take a right number of couple value. we leave the last URI segment if it is a single.\n\t\t\t$uri_array['uri_search'] = array_splice($segment_array,$do_uri_search,$max_length);\n\t\t}\n\n\t\t//<<<<URI clause '/gfid/GFID':>>>>\n\t\t$do_gfid = array_search(RAPYD_URI_GFID,$segment_array);\n\t\tif ($do_gfid!==false){\n\t\t\t$uri_array['gfid'] = array_splice($segment_array, $do_gfid,2);\n\t\t}\n\n\t\t//dataedit related\n\n\t\t$do_create = array_search(RAPYD_URI_CREATE,$segment_array);\n\t\tif ($do_create!==false){\n\t\t\t$uri_array['create'] = array_splice($segment_array, $do_create,1);\n\t\t}\n\n\t\t$do_show = array_search(RAPYD_URI_SHOW,$segment_array);\n\t\tif ($do_show!==false){\n\t\t\t$uri_array['show'] = array_splice($segment_array, $do_show, $segment_count-$do_show);\n\t\t}\n\n\t\t$do_modify = array_search(RAPYD_URI_MODIFY,$segment_array);\n\t\tif ($do_modify!==false){\n\t\t\t$uri_array['modify'] = array_splice($segment_array, $do_modify, $segment_count-$do_modify);\n\t\t}\n\n\t\t$do_delete = array_search(RAPYD_URI_DELETE,$segment_array);\n\t\tif ($do_delete!==false){\n\t\t\t$uri_array['delete'] = array_splice($segment_array, $do_delete, $segment_count-$do_delete);\n\t\t}\n\n\t\t$do_do_delete = array_search(RAPYD_URI_DO_DELETE,$segment_array);\n\t\tif ($do_do_delete!==false){\n\t\t\t$uri_array['do_delete'] = array_splice($segment_array, $do_do_delete, $segment_count-$do_do_delete);\n\t\t}\n\n\t\t$do_insert = array_search(RAPYD_URI_INSERT,$segment_array);\n\t\tif ($do_insert!==false){\n\t\t\t$uri_array['insert'] = array_splice($segment_array, $do_insert,1);\n\t\t}\n\n\t\t$do_update = array_search(RAPYD_URI_UPDATE,$segment_array);\n\t\tif ($do_update!==false){\n\t\t\t$uri_array['update'] = array_splice($segment_array, $do_update, $segment_count-$do_update);\n\t\t}\n\n\t\t$uri_array['base_uri'] = $segment_array;\n\n\t\treturn $uri_array;\n\t}", "public static function segments(string $uri = null, bool $no_index_path = false, string $index_page_default = NULL){\n $uri = $uri ?? self::getCurrentUri($no_index_path, $index_page_default);\n $uri = ($uri!=NULL)?self::stripSlash($uri):$uri;\n if($uri && ((strlen($uri) == 1 && $uri == '/') || strlen(trim($uri, '/')) == 0)){\n return array('');\n }\n return ($uri && strlen($uri) > 0 )? explode('/', trim($uri, '/')) : null;\n }", "private function parseUrl($url){\n return explode('/', filter_var(trim($url), FILTER_SANITIZE_URL));\n }", "private function get($part)\n {\n return $this->parts[$part];\n }", "function getpath() {\n\t\n\t$parseurl = parse_url(\"http://\".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);\n\t$path = explode('/', $parseurl['path']); \n\n\treturn $path;\n}", "function getFilenameFromUrl($url) {\n $path = parseUrl($url);\n $parts = explode('/', $path['path']);\n $filename = end($parts);\n return $filename;\n}", "public static function split($url, $base = BASE_URL)\n {\n $url = self::stripBase($url, $base);\n if($url != '/') {\n $url = StringHelper::stripEnd($url, '/');\n }\n return empty($url) ? [] : explode('/', $url);\n }", "public function url(): string\n {\n return strtok($this->getUri(), '?');\n }", "function url_parts($url) {\n if (!preg_match('/^(?P<protocol_domain>(?P<protocol>https?\\:\\/+)(?P<domain>([^\\/\\W]|[\\.\\-])+))(?P<request_uri>(?P<pathname>(?P<path>\\/(.+\\/)?)?(?P<file>[^\\?\\#]+?)?)?(?P<query_string>\\?[^\\#]*)?)(\\#(?P<hash>.*))?$/',$url,$url_parts)) {\n echo debug_backtrace();\n throw new Exception(\"Invalid url: $url\");\n }\n return $url_parts;\n}", "function get_valueFromStringUrl($url_path_part , $parameter_name) {\n\t\t\t$parts = parse_url($_SERVER[\"REQUEST_URI\"]);\n\t\t\tif(isset($parts['query'])) {\n\t\t\t\tparse_str($parts['query'], $query);\n\t\t\t\tif(isset($query[$parameter_name])) {\n\t\t\t\t\treturn $query[$parameter_name];\n\t\t\t\t}\n\t\t\t\telse { return null; }\n\t\t\t}\n\t\t\telse { return null; }\n\t\t}", "function qa_request_part($part)\n{\n\t$parts = explode('/', qa_request());\n\treturn @$parts[$part];\n}", "function findExtensionUrl($ex, $url)\n{\n $find = strpos($url, $ex);\n if ($find !== false) {\n $val = substr($url, $find, strlen($ex));\n return $val;\n } //XEM LAI\n return '';\n}", "protected function urlSegmentMatch($get, $num = 0) {\n\t\t\n\t\tif(empty($get) && $num > 0) {\n\t\t\treturn isset($this->urlSegments[$num]) ? $this->urlSegments[$num] : '';\n\t\t}\n\t\t\n\t\t$eqPos = strpos($get, '=');\n\t\tif($eqPos !== false) $get = trim($get, '=');\n\t\tlist($matchBefore, $matchAfter) = array($eqPos === 0, $eqPos > 0);\n\t\n\t\t// check if $get has wildcard or regex\n\t\t$regex = $this->patternToRegex($get);\n\t\t$match = '';\n\t\t$index = 0;\n\n\t\tif($regex) {\n\t\t\t// find matching URL segment and return it\n\t\t\tforeach($this->urlSegments as $index => $segment) {\n\t\t\t\tif($num > 0 && $index !== $num) continue;\n\t\t\t\t$match = $this->patternMatchesValue($regex, $segment);\n\t\t\t\tif($match !== '') break;\n\t\t\t}\n\t\t\tif($match === '') $index = 0;\n\t\t\t\n\t\t} else {\n\t\t\t// return index where segment is found\n\t\t\tif($num > 0) {\n\t\t\t\t// apply only to specific URL segment and return bool\n\t\t\t\t$match = isset($this->urlSegments[$num]) && $this->urlSegments[$num] === $get;\n\t\t\t\t$index = $match ? $num : 0;\n\t\t\t} else {\n\t\t\t\t// search all URL segments and return index\n\t\t\t\t$match = (int) array_search($get, $this->urlSegments);\n\t\t\t\t$index = $match;\n\t\t\t}\n\t\t}\n\t\n\t\t// adjust to use urlSegment before or after when requested\n\t\tif($matchBefore) {\n\t\t\t$match = $index > 1 ? $this->urlSegments[$index-1] : '';\n\t\t} else if($matchAfter) {\n\t\t\t$match = isset($this->urlSegments[$index+1]) ? $this->urlSegments[$index+1] : '';\n\t\t}\n\n\t\treturn $match;\n\t}", "function parseURL()\n{\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n return $url;\n }\n}", "public function parseURL()\n {\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/'); //menghapus tanda / di akhir url\n $url = filter_var($url, FILTER_SANITIZE_URL);//memfilter url dari karakter aneh (hack)\n $url = explode('/', $url); //memecah url yang diinput dengan delimiter / dan menjadikannya array\n return $url;\n }\n }", "function getSearchEngineHostPathFromUrl($url)\n{\n $url = substr($url, strpos($url, '//') + 2);\n return $url;\n}", "public function getBaseSlug()\n {\n $slug = $this->slug;\n\n if (substr($slug, -6) == '/index') {\n $slug = rtrim($slug, 'index');\n }\n\n return $slug;\n }", "public function segment($segment_number, $safe = FALSE) {\n /**\n * get entry url and explode it\n */\n $segments = explode('/', $this->get('url'));\n $count = count($segments);\n /**\n * if any segment not exists return null\n */\n if ($count == 0) {\n return NULL;\n }\n /**\n * ignore all empty value of url\n */\n for ($i = 0; $i < $count; $i++) {\n if ($segments[$i] == '') {\n unset($segments[$i]);\n $count = count($segments);\n }\n }\n /**\n * if all items are correct return invoked value\n */\n if ($segment_number > 0 && is_array($segments) && $segment_number <= $count) {\n $segment = $safe ? strip_tags($segments[$segment_number-1]) : $segments[$segment_number-1];\n return $segment;\n }\n return NULL;\n }", "public function uri_string(){\n return implode('/', $this->segments);\n }", "public function index() {\n $exploded = explode(\"/\", $this->_url);\n if (count($exploded) > 1) {\n $this->page(intval($exploded[1]));\n } else {\n $this->page(0);\n }\n }", "public static function getParamByNum($parNumber){\n\n $uriParameter = self::getParamByName('uri', REQUEST_PARAM_STRING);\n\n if (isset($uriParameter)) {\n // rozparsujeme ho podla \"/\"\n $arrSlugs = explode('/', $uriParameter);\n $parNumber--; // prisposobenie sa polu - to je indexovane od 0\n if (isset($arrSlugs[$parNumber]))\n return $arrSlugs[$parNumber];\n }\n\n return false;\n }", "function split3($path) {\n\t// Song is everything after the last slash\n\t// Album is everything in between\n\t$results = preg_split(\"/\\/+/\", $path);\n\t$artist = array_shift($results);\n\t$song = array_pop($results);\n\t$album = array_shift($results);\n\tforeach ($results as $i) {\n\t\t$album = \"$album/$i\";\n\t}\n\treturn array($artist, $album, $song);\n}", "function extract_name($str) {\n\t\t$file_name = \"\";\n\t\t$i = 0;\n\t\tfor($j = strlen($str) - 1; $j >= 0; $j--) {\n\t\t\t$char = substr($str, $j, 1);\n\t\t\tif($char == '/') {\n\t\t\t\t$i = $j;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor(++$i; $i < strlen($str); $i++) {\n\t\t\t$char = substr($str, $i, 1);\n\t\t\t$file_name .= $char;\n\t\t}\n\t\treturn $file_name;\n\t}", "public function get_url():string\n {\n return strtok($_SERVER[\"REQUEST_URI\"],'?');\n }", "function dirtychop($url,$char){\r\n\t //return split('[/.-]', $url );\r\n\t return explode($char,$url);//split($char, $url );\t\r\n // $tmp =preg_split('@['.$char.']+@', $url ); \r\n\t\t\r\n }", "public function buildIndexUri(): string;" ]
[ "0.76095587", "0.6713584", "0.657735", "0.64487374", "0.642703", "0.6413999", "0.63420784", "0.6126001", "0.6092701", "0.6089099", "0.60823923", "0.60286915", "0.59776956", "0.59767735", "0.59696573", "0.59140915", "0.582758", "0.58208436", "0.5781532", "0.5755739", "0.5717744", "0.5685973", "0.56661755", "0.5644684", "0.5642993", "0.5641793", "0.56362957", "0.5627701", "0.56141025", "0.56117004", "0.56074697", "0.5575535", "0.5569262", "0.55450225", "0.55396533", "0.5532729", "0.550248", "0.5478235", "0.5451149", "0.5435341", "0.5430025", "0.5416959", "0.5404143", "0.5397459", "0.5383757", "0.53701437", "0.5367761", "0.5365456", "0.53604203", "0.53571945", "0.5356914", "0.5343439", "0.5342609", "0.53425723", "0.5338896", "0.532851", "0.53121233", "0.5310423", "0.53045887", "0.5290908", "0.5274343", "0.5272883", "0.52640903", "0.52522117", "0.52499086", "0.5249345", "0.52413195", "0.522331", "0.5209088", "0.5204683", "0.5202661", "0.51958406", "0.51948196", "0.51871103", "0.5178302", "0.5169131", "0.5168379", "0.5156042", "0.513724", "0.5129421", "0.51221025", "0.5119876", "0.5110269", "0.5110105", "0.51098514", "0.5105004", "0.5097419", "0.5094327", "0.50879645", "0.50829816", "0.507475", "0.5072818", "0.5071498", "0.50712305", "0.50629973", "0.5056193", "0.5048983", "0.50421983", "0.5041087", "0.50384754" ]
0.5636689
26
No reason to update a page visit at the moment, they're always a individual occurrence
public function update( $AdminPageVisit, array $values = [], array $where = [] ) { return $AdminPageVisit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function rememberPageHasBeenVisited()\n\t{\n\t\tif( SETTINGS_LOG_VISITS )\n\t\t{\n\t\t\t$page = self::getPageCode();\n\t\t\t$type = Page::getContentType();\n\t\t\tif( $type == Page::KEY_HTML || $type == Page::KEY_DATA )\n\t\t\t{\n\t\t\t\tif( $id = self::getConnectionID() )\n\t\t\t\t{\n\t\t\t\t\tDB::update(\"UPDATE `\".self::$sql_table_connections.\"` SET `logout_date`='\"\n\t\t\t\t\t\t\t\t\t.Common::formatDateToSQL(null, true).\"', `pages_viewed`=`pages_viewed`+1 WHERE `session_id`=$id\");\n\t\t\t\t}\n\t\t\t\telseif( $id = self::trackConnection() )\n\t\t\t\t{\n\t\t\t\t\tClient::setSessionID($id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// track the pages viewed\n\t\t\t\tif( $id && self::$sql_table_pagesViewed && self::isCasualPage() && ! Vars::isPostContext() )\n\t\t\t\t{\n\t\t\t\t\tDB::insert(self::$sql_table_pagesViewed, Array\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t$page, $type, // page name and type\n\t\t\t\t\t\t\t$_SERVER['REQUEST_URI'], // request string, or try $_SERVER['QUERY_STRING']\n\t\t\t\t\t\t\t$id, Common::formatDateToSQL(null, false) // session_id and current date\n\t\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function pageIdCanBeDeterminedWhileMovingARecordToAnotherPage() {}", "static function afterPageHistoryEntry($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)\n\t{\n\t\tself::saveMobUsage($a_page, $a_old_domdoc, $a_old_nr);\n\t}", "function track_visitor()\n{\n $dbh = new db;\n $dbh->createTables();\n\n $ip_address = checkParam($_SERVER,\"REMOTE_ADDR\",'');\n $page_name = checkParam($_SERVER,\"SCRIPT_NAME\",'');\n $query_string = checkParam($_SERVER,\"QUERY_STRING\",'');\n $current_page = $page_name.\"?\".$query_string;\n\n if( isset($_SESSION['visitor_id']) )\n $visitor_id = $_SESSION['visitor_id'];\n else\n $visitor_id = $dbh->getNewVisitorID();\n\n if( isset($_SESSION[\"tracking\"]) )\n {\n // If it's a new page, add new tracking entry\n if($_SESSION[\"current_page\"] != $current_page)\n {\n $dbh->addEntry($visitor_id,$ip_address,$page_name,$query_string);\n }\n }\n else\n {\n $_SESSION[\"tracking\"] = TRUE;\n $_SESSION[\"visitor_id\"] = $visitor_id;\n $dbh->addEntry($visitor_id,$ip_address,$page_name,$query_string);\n }\n $_SESSION[\"current_page\"] = $current_page;\n}", "public function pageIdCanBeDeterminedWhileCopyingARecordToAnotherPage() {}", "private function markCurrentPage() {\n $this->pageReloadMarker = $this->randomMachineName();\n $this->getSession()->executeScript('document.body.appendChild(document.createTextNode(\"' . $this->pageReloadMarker . '\"));');\n }", "function wyz_business_stats_visits() {\n\tif ( ! isset($_POST['id']) || ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'wyz_ajax_custom_nonce' ) )\n\t\treturn;\n\t$id = esc_html( $_POST['id'] );\n\tif( false === get_post_status( $id ) )\n\t\treturn;\n\tWyzHelpers::maybe_increment_business_visits( $id );\n\twp_die();\n}", "function phpTrafficA_addReferrer($table, $connection, $referer, $date,$pageid) {\n$cleanref = phpTrafficA_cleanTextBasic($referer);\n$sql3 = \"UPDATE `$table` SET count=count+1,last='$date' WHERE STRCMP(address,'$referer')=0 AND page=$pageid\";\n$res3 = mysql_query($sql3);\nif (mysql_affected_rows() < 1) {\n\t$req4 =\"INSERT INTO `$table` SET address='$referer', page='$pageid', first='$date', last='$date', count='1', visited='0'\";\n\t$res4 = mysql_query($req4);\n}\nreturn 1;\n}", "function log_stats($page_id)\n {\n global $app, $HTTP_USER_AGENT, $REMOTE_ADDR;\n\t\t$app[current_page] = $page_id;\n\t\t$year = date('Y');\n $hour = date('g a');\n $week = date('w');\n $month = date('F');\n\n\t\t## total hit \n $sql = \"select * from {$app[table][stats_hit]}\n where year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_hit]} \n set counter = counter + 1\n where year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_hit]} (counter, year) values(1,'$year')\";\n endif;\n db::qry($sql);\n \n ## by page\n $sql = \"select * from {$app[table][stats_page]}\n where page_id = '$page_id' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_page]} \n \tset counter = counter + 1\n\t\t\t\t\twhere page_id = '$page_id' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_page]} (page_id, counter, year) values('$page_id',1,'$year')\";\n endif;\n db::qry($sql);\n\t\n ## by browser\n if (eregi(\"Nav\", $HTTP_USER_AGENT) || eregi(\"Gold\", $HTTP_USER_AGENT) || eregi(\"X11\", $HTTP_USER_AGENT) || eregi(\"en-US\", $HTTP_USER_AGENT) || eregi(\"Netscape\", $HTTP_USER_AGENT) || eregi(\"Mozilla/4.74\", $HTTP_USER_AGENT)):\n $browser = \"Netscape\";\n elseif (eregi(\"Lynx\", $HTTP_USER_AGENT)): \n $browser = \"Lynx\";\n elseif (eregi(\"Opera\", $HTTP_USER_AGENT)): \n $browser = \"Opera\";\n elseif (eregi(\"Konqueror\", $HTTP_USER_AGENT)): \n $browser = \"Konqueror\";\n elseif (eregi(\"Bot\", $HTTP_USER_AGENT) || eregi(\"Google\", $HTTP_USER_AGENT) || eregi(\"Slurp\", $HTTP_USER_AGENT) || eregi(\"Scooter\", $HTTP_USER_AGENT) || eregi(\"Spider\", $HTTP_USER_AGENT) || eregi(\"Infoseek\", $HTTP_USER_AGENT)):\n $browser = \"Bot\";\n elseif (eregi(\"MSIE\", $HTTP_USER_AGENT)):\n $browser = \"MSIE\";\n else:\n $browser = \"Other\";\n endif;\n \n $sql = \"select * from {$app[table][stats_browser]}\n where browser = '$browser' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_browser]} \n set counter = counter + 1\n where browser = '$browser' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_browser]} (browser, counter, year) values('$browser',1,'$year')\";\n endif; \n db::qry($sql); \n\t\n ## by OS\n if (eregi(\"Win\", $HTTP_USER_AGENT)):\n $os = \"Windows\";\n elseif (eregi(\"Mac\", $HTTP_USER_AGENT)): \n $os = \"Mac\";\n elseif (eregi(\"PPC\", $HTTP_USER_AGENT)): \n $os = \"Mac\";\n elseif (eregi(\"Linux\", $HTTP_USER_AGENT)): \n $os = \"Linux\";\n elseif (eregi(\"FreeBSD\", $HTTP_USER_AGENT)): \n $os = \"FreeBSD\";\n elseif (eregi(\"SunOS\", $HTTP_USER_AGENT)):\n $os = \"SunOS\";\n elseif (eregi(\"IRIX\", $HTTP_USER_AGENT)):\n $os = \"IRIX\";\n elseif (eregi(\"BeOS\", $HTTP_USER_AGENT)):\n $os = \"BeOS\";\n elseif (eregi(\"OS/2\", $HTTP_USER_AGENT)):\n $os = \"OS2\";\n elseif (eregi(\"AIX\", $HTTP_USER_AGENT)):\n $os = \"AIX\";\n else:\n $os = \"Other\";\n endif;\n \n $sql = \"select * from {$app[table][stats_os]}\n where os = '$os' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_os]} \n set counter = counter + 1\n where os = '$os' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_os]} (os, counter, year) values('$os',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n\t\n\t\t## by hour\n\t\t$sql = \"select * from {$app[table][stats_hour]}\n where jam = '$hour' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_hour]} \n set counter = counter + 1\n where jam = '$hour' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_hour]} (jam, counter, year) values('$hour',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n\t\t\n\t\t## by weekday\n\t\t$sql = \"select * from {$app[table][stats_week]}\n where hari = '$week' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_week]} \n set counter = counter + 1\n where hari = '$week' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_week]} (hari, counter, year) values('$week',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n\t\t\t\n ## by month\n $sql = \"select * from {$app[table][stats_month]}\n where bulan = '$month' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_month]} \n set counter = counter + 1\n where bulan = '$month' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_month]} (bulan, counter, year) values('$month',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n \t\n \t## by IP\n \t$ip = $REMOTE_ADDR;\n \t#$hostname = @gethostbyaddr($ip);\n\t\t$hostname = $ip;\n\t\t$sql = \"select * from {$app[table][stats_ip]} where ip = '$ip' and year = '$year'\";\n\t\t#echo $sql;exit;\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_ip]} \n set counter = counter + 1\n where ip = '$ip' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_ip]} (ip, hostname, counter, year) values('$ip','$hostname', 1, '$year')\";\n endif;\n db::qry($sql);\n\t}", "public static function trackBookmarkVisit(){\r\n\t\tif(self::isBookmarkVisit()) {\r\n\t\t\t$bookmark_count = self::getBookmarkCount();\r\n\t\t\tif($bookmark_count > 10) {\r\n\t\t\t\t$bookmark_count = '10+';\r\n\t\t\t}\r\n\t\t\t$bookmark_position = Helper_Request::getRequest('fb_bmpos', '', 'STR');\r\n\t\t\t$bookmark_source = Helper_Request::getRequest('fb_source', '', 'STR');\r\n\t\t\tif($bookmark_position != '' && $bookmark_source != '') {\r\n\t\t\t\t$position_prepend = $bookmark_source == 'bookmarks_apps' ? 'apps_' : 'favs_';\r\n\t\t\t\t$position_parts = explode('_', $bookmark_position);\r\n\t\t\t\tif(count($position_parts) == 2) {\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "abstract protected function determinePageId() ;", "public function pageIdCanBeDeterminedWhileEditingARegularRecord() {}", "public function pageIdCanBeDeterminedWhileEditingAPageRecord() {}", "protected function determinePageId() {}", "protected function determinePageId() {}", "function view_counter_single_post($pid){\t\r\n\tif($_SERVER['HTTP_REFERER'] == '' || !strstr($_SERVER['HTTP_REFERER'],$_SERVER['REQUEST_URI']))\r\n\t{\r\n\t\t$viewed_count = get_post_meta($pid,'viewed_count',true);\r\n\t\t$viewed_count_daily = get_post_meta($pid,'viewed_count_daily',true);\r\n\t\t$daily_date = get_post_meta($pid,'daily_date',true);\r\n\t\r\n\t\tupdate_post_meta($pid,'viewed_count',$viewed_count+1);\r\n\tif(get_post_meta($pid,'daily_date',true) == date('Y-m-d')){\r\n\t\t\tupdate_post_meta($pid,'viewed_count_daily',$viewed_count_daily+1);\r\n\t\t} else {\r\n\t\t\tupdate_post_meta($pid,'viewed_count_daily','1');\r\n\t\t}\r\n\t\tupdate_post_meta($pid,'daily_date',date('Y-m-d'));\r\n\t}\r\n}", "private function BrowserUpdate() {\n $readAgent = new Read; //Instanciando a classe Read\n $readAgent->ExeRead('siteviews_agent', \"WHERE agent_name = :agent\", \"agent={$this->Browser}\"); //Executando o metodo ExRead da classe Read\n if (!$readAgent->getResult())://Se não fizer leitura então se cria uma nova\n $ArrAgent = ['agent_name' => $this->Browser, 'agent_views' => 1];\n $createAgent = new Create; //Instanciando Classe Create\n $createAgent->ExeCreate('siteviews_agent', $ArrAgent); //Executando o Metodo ExCreate da classe Create passando os dados a serem criados no banco\n else://Se fez leitura então atualiza\n $ArrAgent = ['agent_views' => $readAgent->getResult()[0]['agent_views'] + 1];\n $updateAgent = new Update; //Instanciando o metodo Update\n $updateAgent->ExeUpdate('siteviews_agent', $ArrAgent, \"WHERE agent_name = :name\", \"name={$this->Browser}\"); //Executando o metodo ExUpdate da classe Update, neste atualizando as informações no banco\n endif;\n }", "private function extract_pages(){\r\n $dom = new DOMDocument();\r\n @$dom->loadHTMLFile($this->get_sitemap_url());\r\n $dOMXPath = new DOMXPath($dom);\r\n foreach ($dOMXPath->query(\"//urlset/url/loc\") as $node) {\r\n $this->add_page($node->nodeValue);\r\n }\r\n\t}", "function identifyPage() {\n//\t\t$req_uri = $_SERVER['REQUEST_URI'];\n//\t\tprint \"init\";\n\t\t$query = new Query();\n\t\tif($query->sql(\"SELECT id, relation, name, url FROM \" . UT_MEN . \" WHERE url LIKE '%\".$this->url.\"%'\")) {\n\t\t\t$item->id = $query->getQueryResult(0, \"id\");\n\t\t\t$item->name = $this->translate($query->getQueryResult(0, \"name\"));\n\n\t\t\t$item->url = str_replace(FRAMEWORK_PATH.\"/admin\", \"\", $this->url);\n\t\t\t$item->url = str_replace(GLOBAL_PATH.\"/admin\", \"\", $item->url);\n\t\t\t$item->url = str_replace(REGIONAL_PATH.\"/admin\", \"\", $item->url);\n\n//\t\t\t$item->url = ereg_replace(FRAMEWORK_PATH.\"/admin|\".GLOBAL_PATH.\"/admin|\".REGIONAL_PATH.\"/admin\", \"\", $query->getQueryResult(0, \"url\"));\n\t\t\tarray_unshift($this->trail, $item);\n\t\t\t$relation = $query->getQueryResult(0, \"relation\");\n\t\t\tif($relation) {\n\t\t\t\t$this->pageTrail($relation);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function update_refurls()\n{\n\tglobal $database;\n\n\t// IF URL IS NOT EMPTY\n\t$referring_url = $_SERVER[\"HTTP_REFERER\"];\n\tif(strpos(strtolower($referring_url), strtolower($_SERVER[\"HTTP_HOST\"])) !== FALSE) { return; }\n\n\tif( $referring_url )\n {\n\t // IS URL ALREADY IN DATABASE? IF YES, ADD TO HITS. IF NO, ADD NEW ROW\n\t $referring_url = str_replace(\"http://www.\", \"http://\", $referring_url);\n\t $database->database_query(\"\n INSERT INTO se_statrefs\n (statref_hits, statref_url)\n VALUES\n ('1', '{$referring_url}')\n\t\t\tON DUPLICATE KEY UPDATE\n statref_hits=statref_hits+1\n \");\n \n\t // IF 1000 ROWS REACHED, DELETE ONE TO MAKE ROOM\n\t $refurl_totalrows = $database->database_num_rows($database->database_query(\"SELECT statref_id FROM se_statrefs\"));\n \n\t if( $refurl_totalrows > 1000 )\n $database->database_query(\"DELETE FROM se_statrefs WHERE statref_hits='1' ORDER BY statref_id ASC LIMIT 1\");\n\t}\n}", "function countHit() {\n\n $this->saveField('hits', $this->data['Ringsite']['hits']+1, false);\n }", "public function setPageID(){/*ACTUALLY NOT DEFINED*/}", "private function incCurrentSitemap()\n {\n $this->current_sitemap = $this->current_sitemap + 1;\n }", "function SetPage($page) {\r\n\t\t\t\r\n\t\t\tglobal $REMOTE_ADDR;\r\n\t\t\t\r\n\t\t\t$counter_start_date = $this->_Config->Get('counter_start_date');\r\n\t\t\t$counter_all = $this->_Config->Get('counter_all');\r\n\t\t\t\r\n\t\t\t// is the counter counting the first time ever?\r\n\t\t\tif($counter_start_date == '') {\r\n\t\t\t\t$counter_start_date = mktime();\r\n\t\t\t\t$this->_Config->Save('counter_start_date', $counter_start_date);\r\n\t\t\t}\r\n\t\t\tif($counter_all == '') {\r\n\t\t\t\t$counter_all = 0;\r\n\t\t\t\t$this->_Config->Save('counter_all', 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// check if the user is new on the page\r\n\t\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM \" . DB_PREFIX . \"online\r\n\t\t\t\tWHERE online_id='$this->OnlineID'\r\n\t\t\t\tLIMIT 0,1\";\r\n\t\t\t$result_new = $this->_SqlConnection->SqlQuery($sql);\r\n\t\t\tif($row3 = mysql_fetch_object($result_new)) {\r\n\t\t\t\t$sql = \"UPDATE \" . DB_PREFIX . \"online\r\n\t\t\t\t\tSET online_lastaction='\" . mktime() . \"', online_userid=$this->ID, online_lang='{$this->_Translation->OutputLanguage}', online_page='$page', online_loggedon = '\" . (($this->IsLoggedIn) ? 'yes' : 'no' ) . \"'\r\n\t\t\t\t\tWHERE online_id='$this->OnlineID'\";\r\n\t\t\t\t$this->_SqlConnection->SqlQuery($sql);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// get the ip of the user\r\n\t\t\t\t$ip = getenv ('REMOTE_ADDR');\r\n\t\t\t\t// add the online-record for the user\r\n\t\t\t\t$sql = \"INSERT INTO \" . DB_PREFIX . \"online (online_id, online_ip, online_lastaction, online_page, online_userid, online_lang, online_host, online_loggedon)\r\n\t\t\t\tVALUES ('$this->OnlineID', '$ip', '\" . mktime() . \"', '$page', $this->ID, '{$this->_Translation->OutputLanguage}', '\" . gethostbyaddr($ip) . \"', '\" . (($this->IsLoggedIn) ? 'yes' : 'no' ) . \"')\";\r\n\t\t\t\t$this->_SqlConnection->SqlQuery($sql);\r\n\t\t\t\t$counter_all++;\r\n\t\t\t}\r\n\r\n\t\t\t// set the new counterstatus with the count of all users who visted the site since countig\r\n\t\t\tif($counter_all != 1 && $counter_all != $this->_Config->Get('counter_all'))\r\n\t\t\t\t$this->_Config->Save('counter_all', $counter_all);\r\n\t\t\t\r\n\t\t\t// delete all enries with a last action which is more than 20 minutes passed\r\n\t\t\t$sql = \"DELETE FROM \" . DB_PREFIX . \"online\r\n\t\t\t\tWHERE online_lastaction < '\" . (mktime() - 1200) . \"'\";\r\n\t\t\t$this->_SqlConnection->SqlQuery($sql);\r\n\t\t\t\r\n\t\t}", "public function pageIdCanBeDeterminedWhileCopyingARecordAfterAnExistingRecord() {}", "public function updatingSearch()\n {\n $this->gotoPage(1);\n }", "function hit(){\r\n\t\t$query = \"UPDATE #__rsgallery2_galleries SET hits = hits + 1 WHERE id = {$this->id}\";\r\n\t\t\r\n\t\t$db = &JFactory::getDBO();\r\n\t\t$db->setQuery( $query );\r\n\t\t\r\n\t\tif( !$db->query() ) {\r\n// \t\t\t$this->setError( $db->getErrorMsg() );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$this->hits++;\r\n\t}", "function updateAHSIDs(){\n //scrape alpha pages and load into db\n foreach ($this->alpha as $key => $letter) {\n $this->scrapeAlphaPage($letter);\n }\n }", "function trackPageView() {\n $timeStamp = time();\n $domainName = $_SERVER[\"SERVER_NAME\"];\n if (empty($domainName)) {\n $domainName = \"\";\n }\n\n // Get the referrer from the utmr parameter, this is the referrer to the\n // page that contains the tracking pixel, not the referrer for tracking\n // pixel.\n $documentReferer = $_GET[\"utmr\"];\n if (empty($documentReferer) && $documentReferer !== \"0\") {\n $documentReferer = \"-\";\n } else {\n $documentReferer = urldecode($documentReferer);\n }\n $documentPath = $_GET[\"utmp\"];\n if (empty($documentPath)) {\n $documentPath = \"\";\n } else {\n $documentPath = urldecode($documentPath);\n }\n\n $account = $_GET[\"utmac\"];\n $userAgent = $_SERVER[\"HTTP_USER_AGENT\"];\n if (empty($userAgent)) {\n $userAgent = \"\";\n }\n\n // Try and get visitor cookie from the request.\n $cookie = isset($_COOKIE[COOKIE_NAME]) ? $_COOKIE[COOKIE_NAME] : '';\n\n $dcmguid = isset($_SERVER[\"HTTP_X_DCMGUID\"]) ? $_SERVER[\"HTTP_X_DCMGUID\"] : '';\n $visitorId = getVisitorId(\n $dcmguid, $account, $userAgent, $cookie);\n\n // Always try and add the cookie to the response.\n setrawcookie(\n COOKIE_NAME,\n $visitorId,\n $timeStamp + COOKIE_USER_PERSISTENCE,\n COOKIE_PATH);\n\n $utmGifLocation = \"http://www.google-analytics.com/__utm.gif\";\n\n // Construct the gif hit url.\n $utmUrl = $utmGifLocation . \"?\" .\n \"utmwv=\" . VERSION .\n \"&utmn=\" . getRandomNumber() .\n \"&utmhn=\" . urlencode($domainName) .\n \"&utmr=\" . urlencode($documentReferer) .\n \"&utmp=\" . urlencode($documentPath) .\n \"&utmac=\" . $account .\n \"&utmcc=__utma%3D999.999.999.999.999.1%3B\" .\n \"&utmvid=\" . $visitorId .\n \"&utmip=\" . getIP($_SERVER[\"REMOTE_ADDR\"]);\n\n sendRequestToGoogleAnalytics($utmUrl);\n\n // If the debug parameter is on, add a header to the response that contains\n // the url that was used to contact Google Analytics.\n if (!empty($_GET[\"utmdebug\"])) {\n header(\"X-GA-MOBILE-URL:\" . $utmUrl);\n }\n // Finally write the gif data to the response.\n writeGifData();\n }", "public function scrapeUniqueActivities($activitySessions);", "function qa_check_page_clicks()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_page_error_html;\n\n\tif (qa_is_http_post()) {\n\t\tforeach ($_POST as $field => $value) {\n\t\t\tif (strpos($field, 'vote_') === 0) { // voting...\n\t\t\t\t@list($dummy, $postid, $vote, $anchor) = explode('_', $field);\n\n\t\t\t\tif (isset($postid) && isset($vote)) {\n\t\t\t\t\tif (!qa_check_form_security_code('vote', qa_post_text('code')))\n\t\t\t\t\t\t$qa_page_error_html = qa_lang_html('misc/form_security_again');\n\n\t\t\t\t\telse {\n\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'app/votes.php';\n\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'db/selects.php';\n\n\t\t\t\t\t\t$userid = qa_get_logged_in_userid();\n\n\t\t\t\t\t\t$post = qa_db_select_with_pending(qa_db_full_post_selectspec($userid, $postid));\n\t\t\t\t\t\t$qa_page_error_html = qa_vote_error_html($post, $vote, $userid, qa_request());\n\n\t\t\t\t\t\tif (!$qa_page_error_html) {\n\t\t\t\t\t\t\tqa_vote_set($post, $userid, qa_get_logged_in_handle(), qa_cookie_get(), $vote);\n\t\t\t\t\t\t\tqa_redirect(qa_request(), $_GET, null, null, $anchor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} elseif (strpos($field, 'favorite_') === 0) { // favorites...\n\t\t\t\t@list($dummy, $entitytype, $entityid, $favorite) = explode('_', $field);\n\n\t\t\t\tif (isset($entitytype) && isset($entityid) && isset($favorite)) {\n\t\t\t\t\tif (!qa_check_form_security_code('favorite-' . $entitytype . '-' . $entityid, qa_post_text('code')))\n\t\t\t\t\t\t$qa_page_error_html = qa_lang_html('misc/form_security_again');\n\n\t\t\t\t\telse {\n\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'app/favorites.php';\n\n\t\t\t\t\t\tqa_user_favorite_set(qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), $entitytype, $entityid, $favorite);\n\t\t\t\t\t\tqa_redirect(qa_request(), $_GET);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} elseif (strpos($field, 'notice_') === 0) { // notices...\n\t\t\t\t@list($dummy, $noticeid) = explode('_', $field);\n\n\t\t\t\tif (isset($noticeid)) {\n\t\t\t\t\tif (!qa_check_form_security_code('notice-' . $noticeid, qa_post_text('code')))\n\t\t\t\t\t\t$qa_page_error_html = qa_lang_html('misc/form_security_again');\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($noticeid == 'visitor')\n\t\t\t\t\t\t\tsetcookie('qa_noticed', 1, time() + 86400 * 3650, '/', QA_COOKIE_DOMAIN, (bool)ini_get('session.cookie_secure'), true);\n\n\t\t\t\t\t\telseif ($noticeid == 'welcome') {\n\t\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'db/users.php';\n\t\t\t\t\t\t\tqa_db_user_set_flag(qa_get_logged_in_userid(), QA_USER_FLAGS_WELCOME_NOTICE, false);\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'db/notices.php';\n\t\t\t\t\t\t\tqa_db_usernotice_delete(qa_get_logged_in_userid(), $noticeid);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tqa_redirect(qa_request(), $_GET);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "private function setHistorique($page)\n {\n if(file_exists(ROOT . Prefix_View . $page.'.php')){\n $histo = Session::getAttributArray(\"historique\");\n if(!Session::existeAttribut('historique')) Session::setAttributArray(\"historique\",[\"prev\"=>$this->url, \"current\"=>$this->url]);\n elseif($histo[\"current\"] !== $this->url){\n $histo = Session::getAttributArray(\"historique\");\n $histo[\"prev\"] = $histo[\"current\"];\n $histo[\"current\"] = $this->url;\n Session::setAttributArray(\"historique\",$histo);\n }\n $this->historique = Session::getAttributArray('historique');\n }\n }", "public function setFoundPage($value) { $this->_foundpage = $value; }", "protected function getUpdatablePages() {}", "static function afterPageUpdate($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)\n\t{\n\t\tif (!$a_page->getImportMode())\n\t\t{\n\t\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t\t$mob_ids = ilObjMediaObject::_getMobsOfObject(\n\t\t\t\t$a_page->getParentType().\":pg\", $a_page->getId(), 0, $a_page->getLanguage());\n\t\t\tself::saveMobUsage($a_page, $a_domdoc);\n\t\t\tforeach($mob_ids as $mob)\t// check, whether media object can be deleted\n\t\t\t{\n\t\t\t\tif (ilObject::_exists($mob) && ilObject::_lookupType($mob) == \"mob\")\n\t\t\t\t{\n\t\t\t\t\t$mob_obj = new ilObjMediaObject($mob);\n\t\t\t\t\t$usages = $mob_obj->getUsages(false);\n\t\t\t\t\tif (count($usages) == 0)\t// delete, if no usage exists\n\t\t\t\t\t{\n\t\t\t\t\t\t$mob_obj->delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function visited() {\n // Checking if there's no data in the database - if not, will insert the new view.\n if (!$this->psm->hasdata(\"SELECT id FROM artist_views WHERE artist_id = :ref AND ip = :ip\",[\n ':ref' => $this->data['id'],\n ':ip' => $_SERVER['REMOTE_ADDR']\n ])) {\n $view = true;\n }\n\n // But if not, we must check if it was more than 2 minutes ago or not - if so, we can add! Vice versa.\n else {\n $set = $this->psm->set(\"SELECT timeadded FROM artist_views WHERE artist_id = :ref AND ip = :ip ORDER BY id DESC LIMIT 1\",[\n ':ref' => $this->data['id'],\n ':ip' => $_SERVER['REMOTE_ADDR']\n ]);\n $view = ((time()-$set['timeadded'])/60 > 2)?true:false;\n }\n\n // Finally, if we have decided there's need for the view to be added, execute!\n if ($view) {\n $this->psm->insert('artist_views', [\n 'artist_id' => $this->data['id'],\n 'ip' => $_SERVER['REMOTE_ADDR'],\n 'timeadded' => time()\n ]);\n }\n }", "public function crawl()\n\t{\n \t// truncate any non-existant pages\n\t\t$this->resetIndex();\n\n\t\t// create a temporary table for incrementing counts\n\t\t$this->createTempTable();\n\n\t\t// add initial URL to crawl list\n\t\t$this->addRequest($this->startUrl);\n\n\t\t// begin crawling the url\n\t\t$this->crawlUrls();\n\n\t\t// update url counts and remove the temp table\n\t\t$this->finalizeUrlCounts();\n\t}", "function scrape() \n {\n\t\t$index = $this->curl_index();\n\t\t$check = preg_match('/id\\=\\\"\\_\\_VIEWSTATE\\\"\\svalue\\=\\\"([^\"]*)\"/', $index, $match); \n\t\tif ($check)\n\t\t{\n\t\t\t$vs = $match[1];\n\t\t\t$check = preg_match('/id\\=\\\"\\_\\_EVENTVALIDATION\\\"\\svalue\\=\\\"([^\"]*)\"/', $index, $match); \n\t\t\tif ($check)\n\t\t\t{\n\t\t\t\t$ev = $match[1];\n\t\t\t\t$search = '_'; // this search will return ALL \n\t\t\t\t$index = $this->curl_index($vs, $ev, $search);\n\t\t\t\t$flag = false;\n\t\t\t\t# need to handle paging here\n\t\t\t\tdo \n\t\t\t\t{\n\t\t\t\t\t# build booking_id array\n\t\t\t\t\t//echo $index;\n\t\t\t\t\t$check = preg_match_all('/btnNormal\\\"\\shref\\=\\\"(.*)\\\"/Uis', $index, $matches);\n\t\t\t\t\tif ( ! $check)\n\t\t\t\t\t\tbreak; // break paging loop\n\t\t\t\t\t$booking_ids = array();\n\t\t\t\t\tforeach($matches[1] as $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$booking_ids[] = preg_replace('/[^0-9]*/Uis', '', $match);\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($booking_ids))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($booking_ids as $booking_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$details = $this->curl_details($booking_id);\n\t\t\t\t\t\t\t$extraction = $this->extraction($details, $booking_id);\n\t\t\t if ($extraction == 100) { $this->report->successful = ($this->report->successful + 1); $this->report->update(); }\n\t if ($extraction == 101) { $this->report->other = ($this->report->other + 1); $this->report->update(); }\n\t if ($extraction == 102) { $this->report->bad_images = ($this->report->bad_images + 1); $this->report->update(); }\n\t if ($extraction == 103) { $this->report->exists = ($this->report->exists + 1); $this->report->update(); }\n\t if ($extraction == 104) { $this->report->new_charges = ($this->report->new_charges + 1); $this->report->update(); }\n\t $this->report->total = ($this->report->total + 1); $this->report->update();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { $flag = true; } // no more pages\n\t\t\t\t\t# need to page here\n\t\t\t\t\t$index = $this->curl_page($index);\n\t\t\t\t\tif($index == false) { $flag = true; }\n\t\t\t\t} while($flag == false);\n\t\t\t\t$this->report->failed = ($this->report->other + $this->report->bad_images + $this->report->exists + $this->report->new_charges);\n\t\t $this->report->finished = 1;\n\t\t $this->report->stop_time = time();\n\t\t $this->report->time_taken = ($this->report->stop_time - $this->report->start_time);\n\t\t $this->report->update();\n\t\t return true; \n\t\t\t} else { return false; } // no event validation found\n\t\t} else { return false; } // no viewstate found\n\t}", "function edduh_ajax_track_history() {\n\n\t$page_url = isset( $_REQUEST['page_url'] ) ? esc_url( urldecode( $_REQUEST['page_url'] ) ) : false;\n\t$referrer = isset( $_REQUEST['referrer'] ) ? esc_url( urldecode( $_REQUEST['referrer'] ) ) : false;\n\n\tif ( $page_url ) {\n\t\tdo_action( 'edduh_visited_url', $page_url, time(), $referrer );\n\t}\n\n\twp_send_json_success( array( 'page_url' => $page_url ) );\n}", "function phpTrafficA_add_access($table, $c, $datestring, $pageid, $how=0) {\n// Saving how we got to the page\nswitch($how) {\n\tcase 2:\n\t\t$sql = \"UPDATE `${table}_pages` SET se=se+1 WHERE id=$pageid;\";\n\t\tbreak;\n\tcase 3:\n\t\t$sql = \"UPDATE `${table}_pages` SET ref=ref+1 WHERE id=$pageid;\";\n\t\tbreak;\n\tcase 1:\n\t\t$sql = \"UPDATE `${table}_pages` SET internal=internal+1 WHERE id=$pageid;\";\n\t\tbreak;\n\tdefault:\n\t\t$sql = \"UPDATE `${table}_pages` SET other=other+1 WHERE id=$pageid;\";\n\t\tbreak;\n}\n$res = mysql_query($sql);\n// Updating count\n$sql = \"UPDATE `${table}_acces` SET count=count+1 WHERE label=$pageid AND date='$datestring'\";\n$res = mysql_query($sql);\nif (mysql_affected_rows() < 1) {\n// We failed in incrementing the counter: we need to add a new line\n\t$sql =\"INSERT INTO `${table}_acces` SET label=$pageid, date='$datestring', count='1'\";\n\t$res = mysql_query($sql);\n}\n// Updating count for the whole site\n$sql = \"UPDATE `${table}_acces` SET count=count+1 WHERE label=0 AND date='$datestring'\";\n$res = mysql_query($sql);\nif (mysql_affected_rows() < 1) {\n// We failed in incrementing the counter: we need to add a new line\n\t$sql =\"INSERT INTO `${table}_acces` SET label=0, date='$datestring', count='1'\";\n\t$res = mysql_query($sql);\n}\n// Get the total number of access\n$sql = \"SELECT (se+ref+other+internal+old) as count FROM ${table}_pages WHERE id=$pageid\";\n$res = mysql_query($sql);\n$count=mysql_fetch_array($res);\nreturn $count['count'];\n}", "public function generatePage_postProcessing() {}", "public function testPageUpdate()\n {\n $faker = Faker::create();\n $page = Page::inRandomOrder()->first();\n $response = $this\n ->actingAs(User::inRandomOrder()->first(), 'api')\n ->withHeaders([\n \"User-Agent\" => $faker->userAgent(),\n ])\n ->json('PUT', \"/api/pages/\" . $page->slug, [\n \"data\" => [\n \"name\" => $faker->sentence(4, true),\n ],\n \"relationships\" => [\n \"body\" => [\n \"data\" => [\n \"content\" => $faker->paragraphs(4, true),\n ],\n ],\n ],\n ]);\n $response\n ->assertStatus(200);\n }", "public function seen(): void\n {\n $this->lastSeen = new DateTime();\n }", "private function assertPageNotReloaded(): void {\n $this->assertSession()->pageTextContains($this->pageReloadMarker);\n }", "function track_link($slug,$values)\n {\n global $wpdb, $prli_click, $prli_options, $prli_link, $prli_update;\n \n $query = \"SELECT * FROM \".$prli_link->table_name.\" WHERE slug='$slug' LIMIT 1\";\n $pretty_link = $wpdb->get_row($query);\n $pretty_link_target = apply_filters('prli_target_url',array('url' => $pretty_link->url, 'link_id' => $pretty_link->id));\n $pretty_link_url = $pretty_link_target['url'];\n \n if(isset($pretty_link->track_me) and $pretty_link->track_me)\n {\n $first_click = 0;\n \n $click_ip = isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'';\n $click_referer = isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'';\n $click_uri = isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:'';\n $click_user_agent = isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:'';\n\n //Set Cookie if it doesn't exist\n $cookie_name = 'prli_click_' . $pretty_link->id;\n\n //Used for unique click tracking\n $cookie_expire_time = time()+60*60*24*30; // Expire in 30 days\n \n if(!isset($_COOKIE[$cookie_name]))\n {\n setcookie($cookie_name,$slug,$cookie_expire_time,'/');\n $first_click = 1;\n }\n \n if(isset($prli_options->extended_tracking) and $prli_options->extended_tracking == 'extended')\n {\n $click_browser = $this->php_get_browser();\n $click_host = gethostbyaddr($click_ip);\n\n $visitor_cookie = 'prli_visitor';\n //Used for visitor activity\n $visitor_cookie_expire_time = time()+60*60*24*365; // Expire in 1 year\n \n // Retrieve / Generate visitor id\n if(!isset($_COOKIE[$visitor_cookie]))\n {\n $visitor_uid = $prli_click->generateUniqueVisitorId();\n setcookie($visitor_cookie,$visitor_uid,$visitor_cookie_expire_time,'/');\n }\n else\n $visitor_uid = $_COOKIE[$visitor_cookie];\n }\n else\n {\n $click_browser = array( 'browser' => '', 'version' => '', 'platform' => '', 'crawler' => '' );\n $click_host = '';\n $visitor_uid = '';\n }\n \n if($prli_options->extended_tracking != 'count')\n {\n //Record Click in DB\n $insert_str = \"INSERT INTO {$prli_click->table_name} (link_id,vuid,ip,browser,btype,bversion,os,referer,uri,host,first_click,robot,created_at) VALUES (%d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%d,%d,NOW())\";\n $insert = $wpdb->prepare($insert_str, $pretty_link->id,\n $visitor_uid,\n $click_ip,\n $click_user_agent,\n $click_browser['browser'],\n $click_browser['version'],\n $click_browser['platform'],\n $click_referer,\n $click_uri,\n $click_host,\n $first_click,\n $this->this_is_a_robot($click_user_agent,$click_browser));\n \n $results = $wpdb->query( $insert );\n \n do_action('prli_record_click',array('link_id' => $pretty_link->id, 'click_id' => $wpdb->insert_id, 'url' => $pretty_link_url));\n }\n else\n {\n global $prli_link_meta;\n $exclude_ips = explode(\",\", $prli_options->prli_exclude_ips);\n if(!in_array($click_ip, $exclude_ips) and !$this->this_is_a_robot($click_user_agent,$click_browser))\n {\n $clicks = $prli_link_meta->get_link_meta($pretty_link->id, 'static-clicks', true);\n $clicks = (empty($clicks) or $clicks === false)?0:$clicks;\n $prli_link_meta->update_link_meta($pretty_link->id, 'static-clicks', $clicks+1);\n\n if($first_click)\n {\n $uniques = $prli_link_meta->get_link_meta($pretty_link->id, 'static-uniques', true);\n $uniques = (empty($uniques) or $uniques === false)?0:$uniques;\n $prli_link_meta->update_link_meta($pretty_link->id, 'static-uniques', $uniques+1);\n }\n }\n }\n }\n \n // Reformat Parameters\n $param_string = '';\n \n if(isset($pretty_link->param_forwarding) and ($pretty_link->param_forwarding == 'custom' OR $pretty_link->param_forwarding == 'on') and isset($values) and count($values) >= 1)\n {\n $first_param = true;\n foreach($values as $key => $value)\n {\n if($first_param)\n {\n $param_string = (preg_match(\"#\\?#\", $pretty_link_url)?\"&\":\"?\");\n $first_param = false;\n }\n else\n $param_string .= \"&\";\n \n $param_string .= \"$key=$value\";\n }\n }\n \n if(isset($pretty_link->nofollow) and $pretty_link->nofollow)\n header(\"X-Robots-Tag: noindex, nofollow\", true);\n\n switch($pretty_link->redirect_type)\n {\n case '301':\n header(\"HTTP/1.1 301 Moved Permanently\");\n header('Location: '.$pretty_link_url.$param_string);\n break;\n default:\n if( $pretty_link->redirect_type == '307' or\n !$prli_update->pro_is_installed_and_authorized() )\n {\n if($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')\n header(\"HTTP/1.1 302 Found\");\n else\n header(\"HTTP/1.1 307 Temporary Redirect\");\n header('Location: '.$pretty_link_url.$param_string);\n }\n else\n do_action('prli_issue_cloaked_redirect', $pretty_link->redirect_type, $pretty_link, $pretty_link_url, $param_string);\n }\n }", "public function transition(): void\n\t{\n\t\t$params = ['title', 'referer'];\n\t\tforeach ($params as $param) {\n\t\t\t$$param = $_GET[$param] ?? null;\n\t\t}\n\t\t\n\t\tif (empty($this->client)) {\n\t\t\t$this->client = $this->setInitData($referer);\n\t\t\tif (!$title) $title = $_SERVER['HTTP_REFERER'];\n\t\t\t$this->client['referer'] .= ', на страницу <a href=\"'.$_SERVER['HTTP_REFERER'].'\">'.$title.'</a>';\n\t\t}\n\t\t\n\t\tif (!$this->isRefresh(end($this->client['history'])['url'])) {\n\t\t\t$this->client['history'][] = [\n\t\t\t\t'ts' \t=> time(),\n\t\t\t\t'url' \t=> $_SERVER['HTTP_REFERER'],\n\t\t\t\t'title' => $title\n\t\t\t];\n\t\t}\n\t\t\n\t\t$this->save(false);\n\t}", "function getAlreadyBuiltPageInfo($page_name)\n{\n global $old_page_infos;\n if ($old_page_infos!=\"\")\n foreach($old_page_infos as $p) {\n if ($p[\"name\"] == $page_name) {\n return $p;\n }\n }\n return \"\";\n}", "protected function trackAdd($item, $key) {\n\t\t/** @var RepeaterPage $item */\n\t\t$item->traversalPages($this);\n\t\tparent::trackAdd($item, $key);\n\t}", "private function setVisitsCount()\r\n {\r\n\r\n // settings\r\n\r\n // ip-protection in seconds\r\n $counter_expire = 600;\r\n $counter_filename = \"counter.txt\";\r\n\r\n // ignore agent list\r\n $counter_ignore_agents = array('bot', 'bot1', 'bot3');\r\n\r\n // ignore ip list\r\n $counter_ignore_ips = array('127.0.0.2', '127.0.0.3');\r\n\r\n\r\n // get basic information\r\n $counter_agent = $_SERVER['HTTP_USER_AGENT'] ?? null;\r\n $counter_ip = $_SERVER['REMOTE_ADDR']; \r\n $counter_time = time();\r\n \r\n \r\n if (file_exists($counter_filename)) \r\n {\r\n // check ignore lists\r\n $ignore = false;\r\n \r\n $length = sizeof($counter_ignore_agents);\r\n for ($i = 0; $i < $length; $i++)\r\n {\r\n if (substr_count($counter_agent, strtolower($counter_ignore_agents[$i])))\r\n {\r\n $ignore = true;\r\n break;\r\n }\r\n }\r\n \r\n $length = sizeof($counter_ignore_ips);\r\n for ($i = 0; $i < $length; $i++)\r\n {\r\n if ($counter_ip == $counter_ignore_ips[$i])\r\n {\r\n $ignore = true;\r\n break;\r\n }\r\n }\r\n \r\n // get current counter state\r\n $c_file = array();\r\n $fp = fopen($counter_filename, \"r\");\r\n \r\n if ($fp)\r\n {\r\n //flock($fp, LOCK_EX);\r\n $canWrite = false;\r\n while (!$canWrite) \r\n $canWrite = flock($fp, LOCK_EX);\r\n \r\n while (!feof($fp)) \r\n {\r\n $line = trim(fgets($fp, 1024)); \r\n if ($line != \"\")\r\n $c_file[] = $line; \r\n }\r\n flock($fp, LOCK_UN);\r\n fclose ($fp);\r\n }\r\n else\r\n {\r\n $ignore = true;\r\n }\r\n \r\n \r\n // check for ip lock\r\n if ($ignore == false)\r\n {\r\n $continue_block = array();\r\n for ($i = 1; $i < sizeof($c_file); $i++)\r\n {\r\n $tmp = explode(\"||\", $c_file[$i]);\r\n \r\n if (sizeof($tmp) == 2)\r\n {\r\n list($counter_ip_file, $counter_time_file) = $tmp;\r\n $counter_time_file = trim($counter_time_file);\r\n \r\n if ($counter_ip == $counter_ip_file && $counter_time-$counter_expire < $counter_time_file)\r\n {\r\n // do not count this user but keep ip\r\n $ignore = true;\r\n \r\n $continue_block[] = $counter_ip . \"||\" . $counter_time;\r\n }\r\n else if ($counter_time-$counter_expire < $counter_time_file)\r\n {\r\n $continue_block[] = $counter_ip_file . \"||\" . $counter_time_file; \r\n }\r\n } \r\n }\r\n }\r\n \r\n // count now\r\n if ($ignore == false)\r\n {\r\n // increase counter\r\n if (isset($c_file[0]))\r\n $tmp = explode(\"||\", $c_file[0]);\r\n else\r\n $tmp = array();\r\n \r\n if (sizeof($tmp) == 8)\r\n {\r\n // prevent errors\r\n list($day_arr, $yesterday_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = $tmp;\r\n \r\n $day_data = explode(\":\", $day_arr);\r\n $yesterday_data = explode(\":\", $yesterday_arr);\r\n \r\n // yesterday\r\n $yesterday = $yesterday_data[1];\r\n if ($day_data[0] == (date(\"z\")-1)) \r\n {\r\n $yesterday = $day_data[1]; \r\n }\r\n else\r\n {\r\n if ($yesterday_data[0] != (date(\"z\")-1))\r\n {\r\n $yesterday = 0; \r\n }\r\n }\r\n \r\n // day\r\n $day = $day_data[1];\r\n if ($day_data[0] == date(\"z\")) $day++; else $day = 1;\r\n \r\n // week\r\n $week_data = explode(\":\", $week_arr);\r\n $week = $week_data[1];\r\n if ($week_data[0] == date(\"W\")) $week++; else $week = 1;\r\n \r\n // month\r\n $month_data = explode(\":\", $month_arr);\r\n $month = $month_data[1];\r\n if ($month_data[0] == date(\"n\")) $month++; else $month = 1;\r\n \r\n // year\r\n $year_data = explode(\":\", $year_arr);\r\n $year = $year_data[1];\r\n if ($year_data[0] == date(\"Y\")) $year++; else $year = 1;\r\n \r\n // all\r\n $all++;\r\n \r\n // neuer record?\r\n $record_time = trim($record_time);\r\n if ($day > $record)\r\n {\r\n $record = $day;\r\n $record_time = $counter_time;\r\n }\r\n \r\n // speichern und aufräumen und anzahl der online leute bestimmten\r\n $online = 1;\r\n \r\n // write counter data (avoid resetting)\r\n if ($all > 1)\r\n {\r\n $fp = fopen($counter_filename,\"w+\");\r\n if ($fp)\r\n {\r\n //flock($fp, LOCK_EX);\r\n $canWrite = false;\r\n while (!$canWrite) \r\n $canWrite = flock($fp, LOCK_EX);\r\n \r\n $add_line1 = date(\"z\") . \":\" . $day . \"||\" . (date(\"z\")-1) . \":\" . $yesterday . \"||\" . date(\"W\") . \":\" . $week . \"||\" . date(\"n\") . \":\" . $month . \"||\" . date(\"Y\") . \":\" . $year . \"||\" . $all . \"||\" . $record . \"||\" . $record_time . \"\\n\"; \r\n fwrite($fp, $add_line1);\r\n \r\n $length = sizeof($continue_block);\r\n for ($i = 0; $i < $length; $i++)\r\n {\r\n fwrite($fp, $continue_block[$i] . \"\\n\");\r\n $online++;\r\n }\r\n \r\n fwrite($fp, $counter_ip . \"||\" . $counter_time . \"\\n\");\r\n flock($fp, LOCK_UN);\r\n fclose($fp);\r\n }\r\n } \r\n else\r\n {\r\n $online = 1; \r\n }\r\n }\r\n else\r\n {\r\n // show data when error (of course these values are wrong, but it prevents error messages and prevent a counter reset)\r\n \r\n // get counter values\r\n $yesterday = 0;\r\n $day = $week = $month = $year = $all = $record = 1;\r\n $record_time = $counter_time;\r\n $online = 1;\r\n }\r\n }\r\n else\r\n {\r\n // get data for reading only\r\n if (sizeof($c_file) > 0)\r\n list($day_arr, $yesterday_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", $c_file[0]);\r\n else\r\n list($day_arr, $yesterday_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", date(\"z\") . \":1||\" . (date(\"z\")-1) . \":0||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $counter_time);\r\n \r\n // day\r\n $day_data = explode(\":\", $day_arr);\r\n $day = $day_data[1];\r\n \r\n // yesterday\r\n $yesterday_data = explode(\":\", $yesterday_arr);\r\n $yesterday = $yesterday_data[1];\r\n \r\n // week\r\n $week_data = explode(\":\", $week_arr);\r\n $week = $week_data[1];\r\n \r\n // month\r\n $month_data = explode(\":\", $month_arr);\r\n $month = $month_data[1];\r\n \r\n // year\r\n $year_data = explode(\":\", $year_arr);\r\n $year = $year_data[1];\r\n \r\n $record_time = trim($record_time);\r\n \r\n $online = sizeof($c_file) - 1;\r\n if ($online <= 0)\r\n $online = 1;\r\n }\r\n }\r\n else\r\n {\r\n // create counter file\r\n $add_line = date(\"z\") . \":1||\" . (date(\"z\")-1) . \":0||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $counter_time . \"\\n\" . $counter_ip . \"||\" . $counter_time . \"\\n\";\r\n \r\n // write counter data\r\n $fp = fopen($counter_filename,\"w+\");\r\n if ($fp)\r\n {\r\n //flock($fp, LOCK_EX);\r\n $canWrite = false;\r\n while (!$canWrite) \r\n $canWrite = flock($fp, LOCK_EX);\r\n \r\n fwrite($fp, $add_line);\r\n flock($fp, LOCK_UN);\r\n fclose($fp);\r\n }\r\n \r\n // get counter values\r\n $yesterday = 0;\r\n $day = $week = $month = $year = $all = $record = 1;\r\n $record_time = $counter_time;\r\n $online = 1;\r\n }\r\n\r\n $this->please->unsetStorage([ 'online', 'day', 'yesterday', 'week', 'month', 'year', 'all' ], true);\r\n $this->please->setStorage([\r\n 'online' => ['content' => function() use ($online) { return $online; }],\r\n 'day' => ['content' => function() use ($day) { return $day; }],\r\n 'yesterday' => ['content' => function() use ($yesterday) { return $yesterday; }],\r\n 'week' => ['content' => function() use ($week) { return $week; }],\r\n 'month' => ['content' => function() use ($month) { return $month; }],\r\n 'year' => ['content' => function() use ($year) { return $year; }],\r\n 'all' => ['content' => function() use ($all) { return $all; }],\r\n ], true);\r\n }", "function updatePage(){\r\n\t$pageData=base64_decode($_POST['data']);\r\n\t// Get the page we need to edit\r\n\t$html=getPage();\r\n\t// Iterate HTML, look for the editable region and make sure it's count matches the one being sent. \r\n\t$eid=0; // Assign logical number to each found class tag\r\n\tforeach($html->find('.clienteditor') as $e){ // TODO: change this to variable defined topic for edit regions\r\n\t \tif($eid==$_GET['id']){\r\n\t \t\t$e->innertext=$pageData;\r\n\t \t}\r\n\t\t$eid++;\r\n\t}\r\n\t// Post Back the updated HTML object.\r\n\t$result=postData($html);\r\n\techo \"{'status':'$result'}\";\r\n}", "function new_since_last_visit() {\n $this->skip_layout = $this->request->isAsyncCall();\n\n $page = (integer) $this->request->get('page');\n if($page < 1) {\n $page = 1;\n } // if\n\n list($objects, $pagination) = ProjectObjects::paginateNew($this->logged_user, $page, 10);\n\n $this->smarty->assign(array(\n 'objects' => $objects,\n 'pagination' => $pagination,\n ));\n }", "public function updatePage(page $page) {\r\n\t$id = $page->getId();\r\n\t$this->pages[$id] = $page->getRegex();\r\n\t$page->save();\r\n }", "function landing_visit_counter($_url_params) {\n\t$_url_params['key'] = _KEY;\n\t$_url_params['landing'] = _LANDING_URL;\n\n $_landing = request_post_api(_VISIT_COUNT_URL,$_url_params);\n return $_landing;\n}", "function findPageUrls();", "function addRaw($row){\n\t\tlist($timestamp, $ip, $page, $query,\n\t\t\t$referrer, $user_agent, $user_lang,\n\t\t\t$status, $load_time)\n\t\t\t= str_getcsv($row, ' ');\n\t\t$bucket = $this->getBucket($timestamp);\n\t\t\n\t\t// log load times for all pages requested for site profiling.\n\t\tif(isset($this->max_load_times[$page][$bucket])) {\n\t\t\tif($this->max_load_times[$page][$bucket] < $load_time)\n\t\t\t\t$this->max_load_times[$page][$bucket] = $load_time;\n\t\t}\n\t\telse $this->max_load_times[$page][$bucket] = $load_time;\n\t\t\n\t\t// bad actors\n\t\tif( strpos($referrer, '/wp-') || strpos($page, '/wp-')\n\t\t\t|| strpos($referrer, '.bak') || strpos($page, '.bak')\n\t\t\t|| strpos($referrer, '/config') || strpos($page, '/config')) \n\t\t{\n\t\t\tauto_increment($this->bad_actors[$ip][$bucket]);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// bots\n\t\t$browser = self::uaToBrowser($user_agent);\n\t\tif(self::isBrowserBot($browser)){\n\t\t\tauto_increment($this->bots[$browser][$bucket]);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// actual visitors\n\t\t//figure out if the page is a content page or a general page.\n\t\trequire_once 'constants.php';\n\t\t$pagetype = '';\n\t\tforeach(array('content'=>constants\\CONTENT_PAGES, 'general'=>constants\\GENERAL_PAGES) as $_ptype => $_pages){\n\t\t\tforeach($_pages as $_page){\n\t\t\t\tif(in_array($page, $_page)) {\n\t\t\t\t\t$page = $_page[0];\n\t\t\t\t\t$pagetype = $_ptype;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($pagetype != '') break;\n\t\t}\n\t\t//If neither content nor general page, do not track it further.\n\t\tif($pagetype == '')\n\t\t\treturn;\n\t\t\n\t\t//log the page view\n\t\tif($pagetype === 'content'){\n\t\t\tauto_increment($this->content[$page.'?'.$query][$bucket]);\n\t\t}elseif($pagetype === 'general'){\n\t\t\tauto_increment($this->general[$page][$bucket]);\n\t\t}\n\t\t\n\t\t//browser\n\t\tauto_increment($this->browsers[$browser][$bucket]);\n\t\t//language\n\t\t$language = self::ulToLanguage($user_lang);\n\t\tauto_increment($this->languages[$user_lang][$bucket]);\n\t\t//referrer if out-of-site\n\t\tif(strpos($referrer, constants\\SITE_ROOT) !== 0)\n\t\t\tauto_increment($this->referrers[$referrer][$bucket]);\n\t\t\n\t\t\n\t\t//TODO WIP\n\t}", "function foucs_post_views() {\n $postID = get_the_ID(); // Get The ID Post\n $metaKey = 'foucs_posts_views'; // The Name Meta Key\n $views = get_post_meta( $postID, $metaKey, true ); //Show Views\n $count_start_num = 1; // The Number Count Will be Start Form 0\n\n $count = ( empty( $views ) ? $count_start_num : $views ); // Check Have Views Or No\n $count++; // The Count +1\n \n if(is_single()) { // Check If In Single Page Or No\n\t\t// Update The Views Number\n \tupdate_post_meta( $postID, $metaKey, $count );\n \techo $count; // Echo Number In Single Page and +1 After Refresh Page\n\t} else {\n\t\t// Echo Views in EvreWhere I Need\n \techo $views;\n \n }\n}", "function crawlPage($link){\r\n echo 'Discovered: '.$link->getURL().'<br>';\r\n $link->setCrawled(true);\r\n array_push($this->link_arry,$link);\r\n getPageLinks($link->getURL());\r\n }", "function set_page_count($url, $count) { \n\n $conn = get_conn();\n \n $res = $conn->query(\"UPDATE click SET count ='\" . $count . \"' WHERE url = '\" . mysql_escape_string($url) . \"'\" );\n \n \n if ($res === false) { \n trigger_error('Error running SQL' . $conn->error, E_USER_ERROR);\n }\n \n}", "public function updatePage()\n {\n $myDataAccess = aDataAccess::getInstance();\n $myDataAccess->connectToDB();\n\n \t$recordsAffected = $myDataAccess->updatePage($this->m_Pageid,$this->m_PageName,$this->m_MenuName, $this->m_visible, $this->m_Modifiedby, $this->m_Desc);\n\n \treturn \"$recordsAffected row(s) affected!\";\n }", "static function update_page_views($postID) {\n if (is_single()) {\n\n //used for general count\n $count = get_post_meta($postID, self::$post_view_counter_key, true);\n if ($count == ''){\n $count = 0;\n delete_post_meta($postID, self::$post_view_counter_key);\n add_post_meta($postID, self::$post_view_counter_key, '0');\n } else {\n $count++;\n update_post_meta($postID, self::$post_view_counter_key, $count);\n }\n\n //stop here if\n if (td_util::get_customizer_option('p_enable_7_days_count') != 'enabled') {\n return;\n }\n\n //used for 7 day count array\n //get the current day\n $get_current_day = date(\"N\") - 1;\n $count_7_day_array = get_post_meta($postID, self::$post_view_counter_7_day_array, true);\n if (is_array($count_7_day_array)) {\n\n if (isset($count_7_day_array[$get_current_day])) {\n $count_7_day_array[$get_current_day]++;\n update_post_meta($postID, self::$post_view_counter_7_day_array, $count_7_day_array);\n }\n\n } else {\n $count_7_day_array = array(0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0);\n $count_7_day_array[$get_current_day] = 1;\n update_post_meta($postID, self::$post_view_counter_7_day_array, $count_7_day_array);\n }\n\n update_post_meta($postID, self::$post_view_counter_7_day_total, array_sum($count_7_day_array));\n }\n }", "function updateHitCount($short_url_id){\n\t\t$this->query('UPDATE short_urls SET hit_count = hit_count + 1, modified = NOW() WHERE id='.$short_url_id);\n\t}", "private function refreshCurrentPage()\n {\n $this->_currentPage = $this->_limit ? floor($this->_offset/$this->_limit) + 1 : 1;\n }", "private function finalizeUrlCounts()\n\t{\n\t\t// batch process any remaining pages in the page cache\n\t\tif (!empty($this->page_cache)) {\n\t\t\t$sql = sprintf('INSERT INTO %s (page_id) VALUES (%s)', $this->tempTable, implode('),(', $this->page_cache));\n\t\t\tmysql_query($sql);\n\t\t}\n\n\t\t// update the counts\n\t\t$sql = sprintf('UPDATE crawl_index\n\t\t\t\t\t\tLEFT JOIN (SELECT page_id, COUNT(page_id) AS total FROM %s GROUP BY page_id) AS crawl_count\n\t\t\t\t\t\tON (crawl_index.id = crawl_count.page_id)\n\t\t\t\t\t\tSET crawl_index.count = (crawl_index.count + IFNULL(crawl_count.total, 0))',\n\t\t\t\t\t\t$this->tempTable);\n\n\t\tmysql_query($sql);\n\n\t\t// delete the temporary table\n\t\t$sql = sprintf('DROP TABLE %s', $this->tempTable);\n\t\tmysql_query($sql);\n\t}", "public function markLastUpdate(){\n if(!$this->updatedAtOveridden) $this->updatedAt = new \\DateTime();\n if($this->applicant) //child pages dont have direct links to the application\n $this->applicant->markLastUpdate();\n if($this->parent) //child pages should update their parents\n $this->parent->markLastUpdate();\n }", "function randomPageObject()\n\t{\n\t\t$this->checkPermission(\"read\");\n\t\t\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPage.php\");\n\t\t$page = ilWikiPage::getRandomPage($this->object->getId());\n\t\t$this->gotoPageObject($page);\n\t}", "protected function handleGosuMatchScrape()\n {\n $source = $this->service->findSource(2);\n\n $matches = $this->params['matches'];\n\n $this->service\n ->addPageForMatches($source, $matches);\n }", "public function incActualCalls() {\n $this->actualCalls+= 1;\n }", "function RecentPage()\n\t{\n\t\t$this->SetInitialValues();\n\t}", "public function pageIdCanBeDeterminedWhileCreatingARecord() {}", "private function reload() {\r\n\r\n \t\t$timestamp = (int) (microtime(true) * 1000);\r\n\r\n \t\t// if the value is empty\r\n \t\tif ($this->NEXT_REQUEST_TIMESTAMP > $timestamp) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\t$this->load();\r\n \t}", "abstract protected function getCurrentPageId() ;", "function phpTrafficA_pageid($table, $connection, $page, $date) {\n$sql3 = \"SELECT id FROM `$table` WHERE STRCMP(name,'$page')=0\";\n$res3 = mysql_query($sql3);\necho mysql_error();\nif ( (mysql_num_rows($res3) == 0) or (mysql_num_rows($res3) == FALSE) ) {\n\t$req4 =\"INSERT INTO `$table` SET name='$page', added='$date', ref='0', se='0', internal='0', other='0', old='0'\";\n\t$res4 = mysql_query($req4);\n\tif ($res4) return mysql_insert_id();\n\treturn -1;\n} else {\n\t$row2 = mysql_fetch_object($res3);\n\t$pageid = $row2->id;\n}\nreturn $pageid;\n}", "function count_site_visit($from_admin_overview=false) {\r\n\tif (file_exists(COUNTER_FILE)) {\r\n\t\t$ignore = false;\r\n\t\t$current_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? addslashes(trim($_SERVER['HTTP_USER_AGENT'])) : \"no agent\";\r\n\t\t$current_time = time();\r\n\t\t$current_ip = $_SERVER['REMOTE_ADDR']; \r\n\t \r\n\t\t// daten einlesen\r\n\t\t$c_file = array();\r\n\t\t$handle = fopen(COUNTER_FILE, \"r\");\r\n\t \r\n\t \tif ($handle) {\r\n\t\t\twhile (!feof($handle)) {\r\n\t\t\t\t$line = trim(fgets($handle, 4096)); \r\n\t\t\t\tif ($line != \"\") {\r\n\t\t\t\t\t$c_file[] = $line;\r\n\t\t\t\t}\t\t \r\n\t\t\t}\r\n\t\t\tfclose ($handle);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t \r\n\t\t// bots ignorieren \r\n\t\tif (substr_count($current_agent, \"bot\") > 0) {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t\t \r\n\t \r\n\t\t// hat diese ip einen eintrag in den letzten expire sec gehabt, dann igornieren?\r\n\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t$counter_time = trim($counter_time);\r\n\t\t \r\n\t\t\tif ($counter_ip == $current_ip && $current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t// besucher wurde bereits gezählt, daher hier abbruch\r\n\t\t\t\t$ignore = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n\t\t// counter hochzählen\r\n\t\tif (!$ignore) {\r\n\t\t\tif (sizeof($c_file) == 0) {\r\n\t\t\t\t// wenn counter leer, dann füllen \r\n\t\t\t\t$add_line1 = date(\"z\") . \":1||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $current_time . \"\\n\";\r\n\t\t\t\t$add_line2 = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t \r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\t\t\t\t\tfwrite($fp, $add_line2);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// werte zur verfügung stellen\r\n\t\t\t\t$day = $week = $month = $year = $all = $record = 1;\r\n\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t$online = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// counter hochzählen\r\n\t\t\t\tlist($day_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", $c_file[0]);\r\n\t\t\t \r\n\t\t\t\t// day\r\n\t\t\t\t$day_data = explode(\":\", $day_arr);\r\n\t\t\t\t$day = $day_data[1];\r\n\t\t\t\tif ($day_data[0] == date(\"z\")) $day++; else $day = 1;\r\n\t\t\t \r\n\t\t\t\t// week\r\n\t\t\t\t$week_data = explode(\":\", $week_arr);\r\n\t\t\t\t$week = $week_data[1];\r\n\t\t\t\tif ($week_data[0] == date(\"W\")) $week++; else $week = 1;\r\n\t\t\t \r\n\t\t\t\t// month\r\n\t\t\t\t$month_data = explode(\":\", $month_arr);\r\n\t\t\t\t$month = $month_data[1];\r\n\t\t\t\tif ($month_data[0] == date(\"n\")) $month++; else $month = 1;\r\n\t\t\t \r\n\t\t\t\t// year\r\n\t\t\t\t$year_data = explode(\":\", $year_arr);\r\n\t\t\t\t$year = $year_data[1];\r\n\t\t\t\tif ($year_data[0] == date(\"Y\")) $year++; else $year = 1;\r\n\t\t\t \r\n\t\t\t\t// all\r\n\t\t\t\t$all++;\r\n\t\t\t \r\n\t\t\t\t// neuer record?\r\n\t\t\t\t$record_time = trim($record_time);\r\n\t\t\t\tif ($day > $record) {\r\n\t\t\t\t\t$record = $day;\r\n\t\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// speichern und aufräumen und anzahl der online leute bestimmten\r\n\t\t\t \r\n\t\t\t\t$online = 1;\r\n\t\t\t \t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\t$add_line1 = date(\"z\") . \":\" . $day . \"||\" . date(\"W\") . \":\" . $week . \"||\" . date(\"n\") . \":\" . $month . \"||\" . date(\"Y\") . \":\" . $year . \"||\" . $all . \"||\" . $record . \"||\" . $record_time . \"\\n\";\t\t \r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\r\n\t\t\t\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\t\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// übernehmen\r\n\t\t\t\t\t\tif ($current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t\t\t\t$counter_time = trim($counter_time);\r\n\t\t\t\t\t\t\t$add_line = $counter_ip . \"||\" . $counter_time . \"\\n\";\r\n\t\t\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\t\t\t$online++;\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$add_line = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function hitURL($url)\n\t{\n\t\t$this->statpro->insert(\n\t\t\t6,\n\t\t\tarray(\n\t\t\t\t$url,\n\t\t\t\ttime(),\n\t\t\t)\n\t\t);\n\t}", "public static function updateVisitorCookie() {\n setcookie('alchemy_visited', 'yes', time() + 86400 * 365 * 2);\n return ;\n }", "private function getAllNotifHistoryByPage() {\n $this->user_panel->checkAuthAdmin();\n $this->notif_history->findAllByPage();\n }", "private function TrafficUpdate() {\n $this->getTraffic(); //Chamando o metodo getTraffic\n $ArrSiteViews = ['siteviews_pages' => $this->Traffic['siteviews_pages'] + 1]; //Atualizando a pages\n $updatePageViews = new Update; //instanciando a classe Update\n $updatePageViews->ExeUpdate('siteviews', $ArrSiteViews, \"WHERE siteviews_date = :date\", \"date={$this->Date}\"); //Executando o metodo ExeUpdate, neste informando tabela e quais dados atualizar\n\n $this->Traffic = null; //Liberado espaço da memoria\n }", "public function pageIdCanBeDeterminedWhileCreatingARecordAfterAnExistingRecord() {}", "public function onPageUpdate( Page $pageObj ){\n if( $pageObj->getCollectionTypeHandle() === 'news_post' ){\n // we don't actually have to do anything in here, the way it works is adjust\n // the constant as noted above\n }\n }", "public function initSpider(){\n echo \"<p>Searching: <b>\".$this->keyword.\"</b> and Looking for: <b>\".$this->website.\"</b></p>\";\n echo str_repeat(\" \", 256);\n $contador=0;\n $encontre=false;\n $_GET['weboriginal']=\"\";\n $_GET['webcontador']=\"\";\n $i=10;\n $c=1;\n while($c<=10) { \n echo \"<ul><li><b>Searching in Page: $c</b></li>\"; \n flush();ob_flush();\n $records= $this->getRecordsAsArray($this->url); \n $count=count($records);\n echo \"<ul>\";\n for($k=0;$k<$count;$k++){\n $j=$k+1;\n $link=$records[$k][2];\n $linkOriginal = $link;\n $link=strip_tags($link);\n $link=str_replace(\"http://www.\",\"\",$link);\n $link=str_replace(\"http://\",\"\",$link);\n $link=str_replace(\"www.\",\"\",$link);\n $pos=strpos($link, \"/\");\n $link=trim(substr($link,0,$pos));\n $contador++;\n if($this->website==$link){\n $domain=$this->website;\n $_GET['weboriginal']=$linkOriginal;\n $_GET['webcontador']=$contador;\n echo \"<li><h1>Result was found in Page: $c and Record: $j</h1></li>\";\n echo \"Web original \".$linkOriginal;\n echo \"<div>Congrats, We searched google's top 10 pages for <b>\\\"\".$this->keyword.\"</b>\\\", we found your domain <b>\\\"$domain\\\"</b> listed on page: $c at $j place </div>\";echo \"</ul></ul>\";\n $encontre=true;\n break;\n }\n else{\n echo \"<li>Result not found on Page: $c and Record: $j</li>\";\n } \n }\n if($encontre==true){\n break;\n }\n echo \"</ul></ul>\";\n $c++;\n $this->url = $this->updateUrl($this->keyword, $i,$this->motor);\n }\n echo \"Crawled through all 10 pages.\"; \n \n if($this->page==false){\n $domain=$this->website;\n $keyword=$this->keyword;\n echo \"<div>Sorry, We searched google's top 10 pages for <b>\\\"$keyword\\\"</b>, but was unable to find your domain <b>\\\"$domain\\\"</b> listed anywhere. </div>\";\n }\n else {\n $page=$this->page;\n $records=$this->records;\n $domain=$this->website;\n $keyword=$this->keyword;\n echo \"<div>Congrats, We searched google's top 10 pages for <b>\\\"$keyword\\\"</b>, we found your domain <b>\\\"$domain\\\"</b> listed on page: $page at $record place </div>\";\n }\n }", "public function mark_stale_entities() {\n $this->update_by('active', TRUE, array('scrape_status' => self::ENTITY_IS_STALE));\n }", "public function runTenIdenticalSearch()\n\t{\t\t\n\t\t$this->client->isLazy(); \t\t\n\t\t$time = time();\n\t\t$request = $this->client->getMessageFactory()->createRequest($this->url, 'GET');\n\t\t$request->addHeader('cookie',$this->strCookie);\n\t\t$request->setTimeout(300000000);\n\t\t$response = $this->client->getMessageFactory()->createResponse();\n\t\t$this->client->send($request, $response);\n\t\tif($response->getStatus() === 200) {\t\t\t\n\t\t\t$responseTime = time();\n\t\t\t$pageLoadTime = $responseTime-$time;\n\t\t\treturn $this->convertToSeconds($pageLoadTime);\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "private function processPage($page, $url, $tagNameToCount)\n {\n $pageParseStartTime = microtime(true);\n $resultStats = [\n ReportView::KEY_URL => $url,\n ReportView::KEY_TAG_COUNT => 0,\n ReportView::KEY_PROCESS_TIME => 0\n ];\n $this->parsedUrls[] = $url;\n\n try {\n $crawler = new DomCrawler($page);\n } catch (\\InvalidArgumentException $exception) {\n $this->outputMessage('no page content for ' . $url);\n\n return $resultStats;\n }\n\n $resultStats[ReportView::KEY_TAG_COUNT] = $crawler->countTags($tagNameToCount);\n\n $currentDomain = parse_url($url, PHP_URL_HOST);\n $urlsOnPage = $crawler->findUrlsOfDomain($currentDomain);\n $this->newUrls = array_merge($this->newUrls, $urlsOnPage);\n\n $pageParseEndTime = microtime(true);\n $resultStats[ReportView::KEY_PROCESS_TIME] = $pageParseEndTime - $pageParseStartTime;\n\n return $resultStats;\n }", "public function initPostVisitss()\n\t{\n\t\t$this->collPostVisitss = array();\n\t}", "public function viewed_signup() {\n\t\tif ( $this->not_page_reload() ) {\n\t\t\t$this->js_record_event( $this->event_name['viewed_signup'] );\n\t\t}\n\t}", "function ScanPage($f3, $page=1, $last_id=0) {\n header(\"Content-Type: application/json\");\n if (!$last_id) {\n $token = isset($_REQUEST['token']) ? $_REQUEST['token'] : \"\";\n if ($token==\"<secret_token>\") ExitOk(\"Records \".(isset($_REQUEST['u']) ? \"UPDATED\" : \"INSERTED\").\" successfully\", 10);\n if ($token!=$f3->get('update_token')) ErrorExit(\"Forbitten. Update token not match.\");\n }\n\n $page = isset($_REQUEST['p']) ? (int)$_REQUEST['p'] : $page; // page number for loadings\n $sql_update = isset($_REQUEST['u']) ? (int)$_REQUEST['u'] : false; // use UPDATE vs INSERT\n\n $db = new DB\\SQL($f3->get('conn_string'), $f3->get('db_username'), $f3->get('db_password'));\n\n $videos_columns = GetColumnsSizeTable($db, 'videos'); // for checks value size before inserting\n \n $html = LoadPage(\"http://www.hdkinoteatr.com/page/$page/\");\n\n // ****************************************\n // Patterns for regex search and parsing (if no groups in pattern, return value as boolean)\n $pattern_block = '#shortstory.*?argcat.*?</div>#s';\n\n $patterns_in_block = array(); // pattern as string OR [pattern OR patterns, FINDMODE_(optional)]\n $patterns_in_block['page' ] = '#<a[^>]+href=[\"\\'](.*?\\.html)[\"\\']#';\n $patterns_in_block['image' ] = '#<img[^>]+src=[\"\\'](.*?)[\"\\']#';\n\n $patterns_in_link = array();\n $patterns_in_link['id' ] = '#/(\\d+)[^/]+html#';\n $patterns_in_link['isserial' ] = '#/series/#'; // if no groups, check it as boolean\n\n $patterns_in_page = array();\n $patterns_in_page['name' ] = ['#\"og:title\"[^>]+content=\"(.*?)\"#', FINDMODE_UNESCAPE];\n $patterns_in_page['name_eng' ] = ['#\"alternateName\":\"(.*?)\"#' , FINDMODE_UNESCAPE];\n $patterns_in_page['link' ] = '#(<div[^>]+id=\"yohoho\".*?</div>)#s';\n $patterns_in_page['year' ] = '#lbl\">Год:.*?(\\d{4})#';\n $patterns_in_page['kpid' ] = '#kinopoiskID[:=\\s\"\\']+(\\d+)#i';\n $patterns_in_page['country' ] = '#(<a[^>]+/country/.*?)</div>#s';\n $patterns_in_page['category' ] = ['#argcat\".*?(<a.*?)</div>#s' , FINDMODE_COMMALINKS];\n $patterns_in_page['director' ] = ['#lbl\">Режиссёр:</span>(.*?)</div>#s' , FINDMODE_COMMALINKS];\n $patterns_in_page['actors' ] = ['#lbl\">В ролях:</span>(.*?)</div>#s' , FINDMODE_COMMALINKS];\n $patterns_in_page['scenarist' ] = ['#lbl\">Сценарий:</span>(.*?)</div>#s' , FINDMODE_COMMALINKS];\n $patterns_in_page['producer' ] = ['#lbl\">Продюсер:</span>(.*?)</div>#s' , FINDMODE_COMMALINKS];\n $patterns_in_page['composer' ] = ['#lbl\">Композитор:</span>(.*?)</div>#s', FINDMODE_COMMALINKS];\n $patterns_in_page['tags' ] = ['#<i>Теги:(.*?)</div>#s' , FINDMODE_COMMALINKS];\n $patterns_in_page['premiere' ] = '#lbl\">Премьера \\(мир\\):(.*?)</div>#s';\n $patterns_in_page['premiere_rf'] = '#lbl\">Премьера \\(РФ\\):(.*?)</div>#s';\n $patterns_in_page['budget' ] = '#lbl\">Бюджет:</span>(.*?)</div>#s';\n $patterns_in_page['time' ] = ['#lbl\">Время:</span>(.*?)</div>#s', FINDMODE_TIME];\n $patterns_in_page['translation'] = '#lbl\">Перевод:</span>(.*?)</div>#s';\n $patterns_in_page['rating_hd' ] = '#our-rating.*?>(.*?)<#';\n $patterns_in_page['rating_hd_votes' ] = '#rating-num.*?>\\((\\d+.*?)[<\\)]#';\n $patterns_in_page['rating_kp' ] = '#kp_rating.*?>(.*?)<#s';\n $patterns_in_page['rating_kp_votes' ] = '#kp_num[^>]+>(\\d+.*?)<#s';\n $patterns_in_page['rating_imdb' ] = '#imdb_rating.*?>(.*?)<#s';\n $patterns_in_page['rating_imdb_votes'] = '#imdb_num[^>]+>(\\d+.*?)<#s';\n $patterns_in_page['date' ] = ['#/\\d{4}/\\d{2}/\\d{2}/\">(.*?)</#', FINDMODE_DATETIME];\n $patterns_in_page['descr' ] = '#(<div[^>]+class=\"[^\"]*descr.*?</div>)#s';\n\n $pattern_skip_if_no_link = '#id=\"reason\"#'; // skip deleted videos\n // ****************************************\n\n // searching blocks in the loaded html\n if (!preg_match_all($pattern_block, $html, $matches))\n ErrorExit('Pattern for search are blocks nothing found.', true);\n\n // ================= MAIN LOOP FOR SCANNING PAGE =================\n $upd_count = 0;\n foreach ($matches[0] as $block) {\n $params = array();\n\n // searching field values in the block\n foreach ($patterns_in_block as $key => $p) $params[$key] = FindField($p, $block);\n\n if (!$params['page']) ErrorExit('Regex pattern for search are `page` in blocks nothing found. Need update the php script.', true);\n\n $page_url = FullLink($params['page'], $f3->get('url_base'));\n $page = LoadPage($page_url);\n\n // searching field values in the url\n foreach ($patterns_in_link as $key => $p) $params[$key] = FindField($p, $page_url);\n // searching field values in the loaded page\n foreach ($patterns_in_page as $key => $p) $params[$key] = FindField($p, $page);\n\n // hdkinoteatr parsing -----------------------------------\n $yohohoVals = RegexValue('#(<div[^>]+id=\"yohoho\".*?</div>)#s', $page);\n $kpID = RegexValue('#data-kinopoisk=\"(.*?)\"#', $yohohoVals);\n $imdb = RegexValue('#data-imdb=\"(.*?)\"#' , $yohohoVals);\n $collaps = RegexValue('#data-collaps=\"(.*?)\"#' , $yohohoVals);\n $hdvb = RegexValue('#data-hdvb=\"(.*?)\"#' , $yohohoVals);\n $videocdn = RegexValue('#data-videocdn=\"(.*?)\"#' , $yohohoVals);\n if (!$kpID) $kpID = $params[\"kpid\"];\n $post = \"videocdn=$videocdn&hdvb=$hdvb&collaps=$collaps&kinopoisk=$kpID&imdb=$imdb\";\n $result = file_get_contents(\"https://ahoy.yohoho.online/\", false, stream_context_create(array(\n \"http\" => array(\n \"method\" => \"POST\",\n \"header\" => \"content-type: application/x-www-form-urlencoded\\r\\n\".\n \"origin: http://www.hdkinoteatr.com\\r\\n\".\n \"referer: http://www.hdkinoteatr.com/\\r\\n\".\n \"user-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36\\r\\n\",\n \"content\" => $post)\n )));\n\n if (isset($_GET[\"testyohoho\"])) die($result);\n\n $videoData = json_decode($result);\n $linksData = array();\n if (!$videoData) {\n var_dump($http_response_header);\n die(\"Request to ahoy.yohoho.online is failed. POST parameters: \".$post);\n }\n\n foreach($videoData as $key => $r) {\n $res = (array)$r;\n if (!empty($res)) {\n if (substr($res[\"iframe\"], 0, 2)==\"//\") $res[\"iframe\"] = \"http:\".$res[\"iframe\"];\n $linksData[$key] = $res;\n }\n }\n\n $apiKinoId = RegexValue('#apikino.club/autoreplace/[^\"/]+id=(\\d+)#', $page);\n if ($apiKinoId) {\n $apiKinoData = file_get_contents(\"https://apikino.club/autoreplace-load/?id=$apiKinoId&hostname=www.hdkinoteatr.com&href=$page_url&kinopoiskId=$kpID\");\n $apiKino = json_decode($apiKinoData);\n if ($apiKino->video_id > 0) {\n $videoLink = 'https://pleeras.club/embed/'.$apiKino->parent_video_hash.'/e/'.$apiKino->video_hash.'/?sid='.$apiKino->site_id;\n $linksData[\"ONIK\"] = array(\"iframe\"=>$videoLink, \"translate\"=>\"\", \"quality\"=>\"\");\n }\n }\n \n if (!isset($linksData[\"trailer\"])) {\n $trailerHtml = RegexValue('#(<div[^>]+id=\"trailer\".*?</div>)#s', $page);\n $trailerLink = RegexValue('#<iframe[^>]+src=\"(.*?)\"#', $trailerHtml);\n if ($trailerLink) {\n $linksData[\"trailer\"] = array(\"iframe\"=>$trailerLink, \"translate\"=>\"\", \"quality\"=>\"\");\n }\n }\n\n if (!empty($linksData)) $params['link'] = json_encode($linksData, JSON_NUMERIC_CHECK|JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);\n\n // --------------------------------------------------------\n\n if (!$params['link']) {\n if (preg_match($pattern_skip_if_no_link, $page, $m)) continue;\n continue;\n //ErrorExit('Regex pattern for search are `link` in blocks nothing found. Need update the php script. '.$page_url, true);\n }\n if (!$params['id' ]) ErrorExit('Regex pattern for search are `id` nothing found. Need update the php script. ' .$page_url, true);\n if (!$params['name']) ErrorExit('Regex pattern for search are `name` nothing found. Need update the php script. '.$page_url, true);\n\n $params['id' ] = (int)$params['id' ];\n $params['year'] = (int)$params['year'];\n $params['kpid'] = (int)$params['kpid'];\n $params['time'] = (int)$params['time'];\n\n if ($last_id && ($params['id'] <= $last_id)) continue; // Skip all videos with ID less or equal $last_id\n \n $params['rating_hd' ] = (float)$params['rating_hd'];\n $params['rating_kp' ] = (float)$params['rating_kp'];\n $params['rating_imdb' ] = (float)$params['rating_imdb'];\n $params['rating_hd_votes' ] = (int)$params['rating_hd_votes'];\n $params['rating_kp_votes' ] = (int)$params['rating_kp_votes'];\n $params['rating_imdb_votes'] = (int)$params['rating_imdb_votes'];\n $params['isserial' ] = (int)$params['isserial'];\n\n // Remove years from title\n if (preg_match('#\\([\\d-]{4,}\\)#', $params['name'], $m))\n $params['name'] = trim(str_replace($m[0], '', $params['name']));\n\n if ($f3->get('engtitle_in_title')) {\n // Separate names\n $names = explode($f3->get('titles_separator'), $name);\n if (count($names) > 1) {\n $params['name' ] = Trim($names[0]);\n $params['name_eng'] = Trim($names[1]);\n }\n }\n\n $upd_count += InsertVideo($f3, $db, (int)$params['id'], $params, $videos_columns, $sql_update);\n }\n // ===================== END OF SCANNING PAGE ====================\n\n if ($upd_count) {\n if ($last_id) $f3->set('clear_cache_videos', true);\n else ClearTableCache($f3, 'videos');\n }\n\n if ($last_id) \n return $upd_count;\n\n ExitOk(\"Records \".($sql_update ? \"UPDATED\" : \"INSERTED\").\" successfully\", $upd_count);\n}", "public function realPageCacheContent() {}", "public function visited($url){\n if(!isset($this->visited)) $this->visited = array();\n if(array_search($url, $this->visited) !== false) return true;\n $this->visited[] = $url;\n return false;\n }", "function seekPageInRecSet()\n\t{\n\t\t\n\t\t$this->resultData = $this->plugin->getGroupList( $this->searchClauseObj->getAllFieldsSearchValue() );\n\t\t$this->numRowsFromSQL = $this->resultData ? count( $this->resultData ) : 0;\n\t\t$this->recSet = $this->numRowsFromSQL;\n\t}", "public function pageIdCanBeDeterminedWhileCallingModuleWithPageTree() {}", "function subpage_update_instance($subpage) {\n global $DB;\n\n $subpage->id = $subpage->instance;\n\n return $DB->update_record(\"subpage\", $subpage);\n}", "public function setPageVisiable(\\SetaPDF_Core_Document_Action $action) {}", "private function _recordVisit() {\n $txnTable = $this->settings['txnTable'];\n $dtlTable = $this->settings['dtlTable'];\n $isRES = BoolYN( $this->_isResource() );\n $rVal = false;\n\n // Construct the INSERT Statement and Record It\n $dsvID = \"CONCAT(DATE_FORMAT(Now(), '%Y-%m-%d %h:00:00'), '-', \" . \n nullInt($this->settings['SiteID']) . \", '-', \" . \n \"'\" . sqlScrub($this->settings['RequestURL']) . \"')\";\n $sqlStr = \"INSERT INTO `$txnTable` (`dsvID`, `DateStamp`, `SiteID`, `VisitURL`, `Hits`, `isResource`, `UpdateDTS`) \" .\n \"VALUES ( MD5($dsvID), DATE_FORMAT(Now(), '%Y-%m-%d %h:00:00'), \" . nullInt($this->settings['SiteID']) . \",\" .\n \" '\" . sqlScrub($this->settings['RequestURL']) . \"',\" .\n \" 1, '$isRES', Now() )\" .\n \"ON DUPLICATE KEY UPDATE `Hits` = `Hits` + 1,\" .\n \" `UpdateDTS` = Now();\" .\n \"INSERT INTO `$dtlTable` (`SiteID`, `DateStamp`, `VisitURL`, `ReferURL`, `SearchQuery`, `isResource`, `isSearch`, `UpdateDTS`) \" .\n \"VALUES ( \" . nullInt($this->settings['SiteID']) . \", DATE_FORMAT(Now(), '%Y-%m-%d %h:00:00'),\" . \n \" '\" . sqlScrub($this->settings['RequestURL']) . \"',\" .\n \" '\" . sqlScrub($this->settings['Referrer']) . \"',\" .\n \" '', '$isRES', 'N', Now() );\";\n $rslt = doSQLExecute( $sqlStr );\n if ( $rslt > 0 ) { $rVal = true; }\n\n // Return the Boolean Response\n return $rVal;\n }", "protected function determineValues()\n {\n $this->intTotalPages = $this->intRows;\n\n $this->intPage = -1;\n $strRequest = rawurldecode(\\Environment::get('request'));\n foreach ($this->arrLinks as $intPage => $strLink) {\n if ($strRequest == rawurldecode($strLink)) {\n $this->intPage = ($intPage + 1);\n break;\n }\n }\n\n if ($this->intPage > $this->intTotalPages) {\n $this->intPage = $this->intTotalPages;\n }\n }", "static function saveMobUsage($a_page, $a_domdoc, $a_old_nr = 0)\n\t{\n\t\t$usages = array();\n\t\t\n\t\t// media aliases\n\t\t$xpath = new DOMXPath($a_domdoc);\n\t\t$nodes = $xpath->query('//MediaAlias');\t\n\t\tforeach($nodes as $node)\n\t\t{\n\t\t\t$id_arr = explode(\"_\", $node->getAttribute(\"OriginId\"));\n\t\t\t$mob_id = $id_arr[count($id_arr) - 1];\n\t\t\tif ($mob_id > 0 && $id_arr[1] == \"\")\n\t\t\t{\n\t\t\t\t$usages[$mob_id] = true;\n\t\t\t}\n\t\t}\n\n\t\t// media objects\n\t\t$xpath = new DOMXPath($a_domdoc);\n\t\t$nodes = $xpath->query('//MediaObject/MetaData/General/Identifier');\t\n\t\tforeach($nodes as $node)\n\t\t{\n\t\t\t$mob_entry = $node->getAttribute(\"Entry\");\n\t\t\t$mob_arr = explode(\"_\", $mob_entry);\n\t\t\t$mob_id = $mob_arr[count($mob_arr) - 1];\n\t\t\tif ($mob_id > 0 && $mob_arr[1] == \"\")\n\t\t\t{\n\t\t\t\t$usages[$mob_id] = true;\n\t\t\t}\n\t\t}\n\n\t\t// internal links\n\t\t$xpath = new DOMXPath($a_domdoc);\n\t\t$nodes = $xpath->query(\"//IntLink[@Type='MediaObject']\");\t\n\t\tforeach($nodes as $node)\n\t\t{\n\t\t\t$mob_target = $node->getAttribute(\"Target\");\n\t\t\t$mob_arr = explode(\"_\", $mob_target);\n//echo \"<br>3<br>\";\n//echo $mob_target.\"<br>\";\n//var_dump($mob_arr);\n\t\t\t$mob_id = $mob_arr[count($mob_arr) - 1];\n\t\t\tif ($mob_id > 0 && $mob_arr[1] == \"\")\n\t\t\t{\n\t\t\t\t$usages[$mob_id] = true;\n\t\t\t}\n\t\t}\n\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\tilObjMediaObject::_deleteAllUsages($a_page->getParentType().\":pg\", $a_page->getId(), $a_old_nr,\n\t\t\t$a_page->getLanguage());\n\t\tforeach($usages as $mob_id => $val)\n\t\t{\n\t\t\t// save usage, if object exists...\n\t\t\tif (ilObject::_lookupType($mob_id) == \"mob\")\n\t\t\t{\n\t\t\t\tilObjMediaObject::_saveUsage($mob_id, $a_page->getParentType().\":pg\", $a_page->getId(), $a_old_nr,\n\t\t\t\t\t$a_page->getLanguage());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $usages;\n\t}", "public function generatePage_preProcessing() {}", "private function page()\n {\n $records = array();\n $uid = $this->pObj->zz_getMaxDbUid('sys_template');\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrg($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalCaddy($uid);\n\n // #61838, 140923, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCal($uid);\n\n // #61826, 140923, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalEvents($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalLocations($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgDocuments($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgDocumentsCaddy($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgHeadquarters($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgJobs($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgJobsJobsApply($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgNews($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgService($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgStaff($uid);\n\n // #67210, 150531, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgStaffVcard($uid);\n\n return $records;\n }", "abstract public function scrape();", "public function testUpdateSite()\n {\n }", "public function hasVisit(){\n return $this->_has(2);\n }", "function acadp_update_listing_views_count( $post_id ) {\n\n $user_ip = $_SERVER['REMOTE_ADDR']; // retrieve the current IP address of the visitor\n $key = $user_ip . '_acadp_' . $post_id; // combine post ID & IP to form unique key\n $value = array( $user_ip, $post_id ); // store post ID & IP as separate values (see note)\n $visited = get_transient( $key ); // get transient and store in variable\n\n // check to see if the Post ID/IP ($key) address is currently stored as a transient\n if( false === ( $visited ) ) {\n\n // store the unique key, Post ID & IP address for 12 hours if it does not exist\n set_transient( $key, $value, 60*60*12 );\n\n // now run post views function\n $count_key = 'views';\n $count = get_post_meta($post_id, $count_key, true);\n if( '' == $count ) {\n $count = 0;\n delete_post_meta( $post_id, $count_key );\n add_post_meta( $post_id, $count_key, '0' );\n } else {\n $count++;\n update_post_meta( $post_id, $count_key, $count );\n }\n\n }\n\n}" ]
[ "0.6002477", "0.5860751", "0.5849099", "0.56848073", "0.56691575", "0.55868715", "0.5526023", "0.5510092", "0.5504599", "0.544197", "0.5429733", "0.53513384", "0.533774", "0.53324854", "0.53324854", "0.53295267", "0.52952707", "0.5284257", "0.5282541", "0.5282296", "0.52560174", "0.5255939", "0.52500176", "0.5234991", "0.5222191", "0.5212134", "0.51931113", "0.5155755", "0.51452804", "0.5139959", "0.51196873", "0.511732", "0.5097461", "0.5097365", "0.5086423", "0.5084891", "0.50550383", "0.50514835", "0.5045105", "0.5041271", "0.5040391", "0.5037172", "0.5021061", "0.5014787", "0.5010471", "0.50094414", "0.50052524", "0.49942127", "0.4993939", "0.4986833", "0.49763042", "0.4965106", "0.4944207", "0.49406868", "0.4921505", "0.49109492", "0.48979753", "0.48818442", "0.48810232", "0.48754197", "0.48731878", "0.48709255", "0.48693094", "0.4867291", "0.4864897", "0.4862833", "0.48547038", "0.48536664", "0.48484123", "0.48468646", "0.48462144", "0.48375094", "0.48239303", "0.481847", "0.48184544", "0.48087847", "0.47991836", "0.4790439", "0.4776275", "0.47741815", "0.47739223", "0.47704402", "0.47619328", "0.47599012", "0.47485", "0.47476423", "0.4747011", "0.47441736", "0.47413424", "0.47375062", "0.4732971", "0.47284657", "0.47228074", "0.47202623", "0.47051576", "0.4687808", "0.46833843", "0.46830964", "0.467805", "0.46747354", "0.466325" ]
0.0
-1
How to use? etc. php 2.1.php lkjhg_99
function validateUname($data) { $pisahUnderscore = explode('_',$data); $str5=$pisahUnderscore[0]; $int2=$pisahUnderscore[1]; if ((str_word_count($str5) == 1) and (strlen((string) trim($str5)) == 5) and ((strlen((int) trim($int2)) == 2))) { echo "Terverifikasi"; } else { echo "Coba lagi"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function installPhp()\n { \n $this->span(\"Option not supported for this Linux distribution and version.\", 'error');\n }", "function versionPhp(){\r\n\t\t$test = phpversion();\r\n\t\t// on teste le premier chiffre\r\n\t\t$version = mb_substr($test, 0, 1);\r\n\t\tif ($version == 7) {\r\n\t\t\t$retour = '<span style=\"color: green;\">'.phpversion().' (Gepi nécessite php 5.2.x minimum)</span>';\r\n\t\t} elseif ($version == 5) {\r\n\t\t\t$retour = '<span style=\"color: green;\">'.phpversion().' (Gepi nécessite php 5.2.x minimum)</span>';\r\n\t\t} elseif($version == 4 AND mb_substr($test, 2, 2) >= 3){\r\n\t\t\t$retour = '<span style=\"color: green;\">'.phpversion().'(Attention, Gepi ne fonctionne pas avec cette version, elle est trop ancienne)</span>';\r\n\t\t}else{\r\n\t\t\t$retour = '<span style=\"color: red;\">'.phpversion().'(version ancienne !)</span>';\r\n\t\t}\r\n\t\treturn $retour;\r\n\t}", "function initialBasicFixes()\r\n{\r\n /**\r\n * bypass date & timezone-related warnings with php 5.1\r\n */\r\n if (function_exists('date_default_timezone_set')) {\r\n $tz= @date_default_timezone_get();\r\n date_default_timezone_set($tz);\r\n }\r\n\r\n ini_set('zend.ze1_compatibility_mode', 0);\r\n ini_set(\"pcre.backtrack_limit\", -1); # fix 5.2.0 prce bug with render_wiki\r\n if(function_exists('mb_internal_encoding')) {\r\n mb_internal_encoding(\"UTF-8\");\r\n }\r\n #ini_set(\"mbstring.func_overload\", 2);\r\n\r\n /**\r\n * add rough php-version check to at least avoid parsing errors.\r\n * fine version-check follows further down\r\n */\r\n if(phpversion() < \"5.0.0\") {\r\n echo \"Sorry, but Streber requires php5 or higher.\";\r\n exit();\r\n }\r\n}", "public function isPhp() {}", "function last1(){\n echo __FUNCTION__ . \"\\n\";\n\n if (version_compare(PHP_VERSION, '5.4.0') >= 0) {\n echo 'echo - I am at least PHP version 5.4.0, my version: ' . PHP_VERSION . \"\\n\";\n }\n\n $CurrentVer = phpversion();\n echo \"echo - Current PHP version: $CurrentVer\\n\";\n $carray = curl_version();\n\n print_r($carray,'Curl');\n switch (version_compare($CurrentVer, '5.4.0')) {\n case -1:\n print \" print - You are running an older version of PHP: $CurrentVer\\n\";\n $CurrentVer=0;\n break;\n case 0:\n print \"print - You are running PHP 5.4.0\\n\";\n break;\n case 1:\n print \"print - You are running a version of PHP after 5.4.0: $CurrentVer\\n\";\n }\n\n //if (!$CurrentVer) {\n // exit();\n //} // exit; exit (code)\n echo ' PDO:: getAvailableDrivers()<BR>';\n print_r( PDO:: getAvailableDrivers());\n\n\n echo 'end &lt;&#47;pre&gt;'.PHP_EOL;\n\n echo 'get_include_path()'.get_include_path().'<br>';\n\n}", "function parsePHPInfo()\r\n{\r\n\t/*\tnotwendig für die PHP/MySQL Supportinfos\r\n\t\r\n\t\tvon http://www.php.net/manual/en/function.phpinfo.php#70306 - parse php modules from phpinfo\r\n\t\r\n\t\talternativen:\r\n\t\t\r\n\t\tget a module setting\r\n\t\tfunction getModuleSetting($pModuleName,$pSetting)\r\n\t\t{\r\n\t\t\t$vModules = parsePHPModules();\r\n\t\t\t\r\n\t\t\treturn $vModules[$pModuleName][$pSetting];\r\n\t\t}\r\n\t\r\n\t\t// Sample Usage\r\n\t\tdebug(getModuleSetting('apache2handler','Apache Version')); // returns \"bundled (2.0.28 compatible)\"\r\n\t\tdebug(getModuleSetting('Core','register_globals'));\r\n\t\r\n\t\tob_start () ;\r\n\t\tphpinfo () ;\r\n\t\t$pinfo = ob_get_contents () ;\r\n\t\tob_end_clean () ;\r\n\t\t\r\n\t\t// the name attribute \"module_Zend Optimizer\" of an anker-tag is not xhtml valide, so replace it with \"module_Zend_Optimizer\"\r\n\t\techo '<div id=\"phpinfo\">' . ( str_replace ( \"module_Zend Optimizer\", \"module_Zend_Optimizer\", preg_replace ( '%^.*<body>(.*)</body>.*$%ms', '$1', $pinfo ) ) ) . '</div>';\r\n\t\r\n\t\thttp://www.php.net/manual/en/function.phpinfo.php#106862\r\n\t\r\n\t\tfunction phpinfo_array()\r\n\t\t{\r\n\t\t\tob_start();\r\n\t\t\tphpinfo();\r\n\t\t\t$info_arr = array();\r\n\t\t\t$info_lines = explode(\"\\n\", strip_tags(ob_get_clean(), \"<tr><td><h2>\"));\r\n\t\t\t$cat = \"General\";\r\n\t\t\tforeach($info_lines as $line)\r\n\t\t\t{\r\n\t\t\t\t// new cat?\r\n\t\t\t\tpreg_match(\"~<h2>(.*)</h2>~\", $line, $title) ? $cat = $title[1] : null;\r\n\t\t\t\tif(preg_match(\"~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~\", $line, $val))\r\n\t\t\t\t{\r\n\t\t\t\t\t$info_arr[$cat][$val[1]] = $val[2];\r\n\t\t\t\t}\r\n\t\t\t\telseif(preg_match(\"~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~\", $line, $val))\r\n\t\t\t\t{\r\n\t\t\t\t\t$info_arr[$cat][$val[1]] = array(\"local\" => $val[2], \"master\" => $val[3]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $info_arr;\r\n\t\t}\r\n\t\t\r\n\t\techo \"<pre>\".print_r(phpinfo_array(), 1).\"</pre>\";\r\n\t*/\r\n\t\r\n\tob_start();\r\n\tphpinfo();\r\n\t$s = ob_get_contents();\r\n\tob_end_clean();\r\n\t\r\n\t$s = strip_tags($s,'<h2><th><td>');\r\n\t$s = preg_replace('/<th[^>]*>([^<]+)<\\/th>/',\"<info>\\\\1</info>\",$s);\r\n\t$s = preg_replace('/<td[^>]*>([^<]+)<\\/td>/',\"<info>\\\\1</info>\",$s);\r\n\t$vTmp = preg_split('/(<h2>[^<]+<\\/h2>)/',$s,-1,PREG_SPLIT_DELIM_CAPTURE);\r\n\t\r\n\t$vModules = array();\r\n\t\r\n\tfor ( $i = 1; $i < count($vTmp); $i++ )\r\n\t{\r\n\t\tif ( preg_match('/<h2>([^<]+)<\\/h2>/',$vTmp[$i],$vMat) )\r\n\t\t{\r\n\t\t\t$vName = trim($vMat[1]);\r\n\t\t\t$vTmp2 = explode(\"\\n\",$vTmp[$i+1]);\r\n\t\t\t\r\n\t\t\tforeach ( $vTmp2 AS $vOne )\r\n\t\t\t{\r\n\t\t\t\t$vPat = '<info>([^<]+)<\\/info>';\r\n\t\t\t\t$vPat3 = \"/$vPat\\s*$vPat\\s*$vPat/\";\r\n\t\t\t\t$vPat2 = \"/$vPat\\s*$vPat/\";\r\n\t\t\t\t\r\n\t\t\t\tif ( preg_match($vPat3,$vOne,$vMat) )\r\n\t\t\t\t{\r\n\t\t\t\t\t// 3cols\r\n\t\t\t\t\t$vModules[$vName][trim($vMat[1])] = array(trim($vMat[2]),trim($vMat[3]));\r\n\t\t\t\t}\r\n\t\t\t\telse if ( preg_match($vPat2,$vOne,$vMat) )\r\n\t\t\t\t{\r\n\t\t\t\t\t// 2cols\r\n\t\t\t\t\t$vModules[$vName][trim($vMat[1])] = trim($vMat[2]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $vModules;\r\n}", "function includephp($filename) {\n // make predefined variables global, so most simple scripts can be used here\n\n // apache (names taken from PHP doc)\n global $GATEWAY_INTERFACE, $SERVER_NAME, $SERVER_SOFTWARE, $SERVER_PROTOCOL;\n global $REQUEST_METHOD, $QUERY_STRING, $DOCUMENT_ROOT, $HTTP_ACCEPT;\n global $HTTP_ACCEPT_CHARSET, $HTTP_ACCEPT_ENCODING, $HTTP_ACCEPT_LANGUAGE;\n global $HTTP_CONNECTION, $HTTP_HOST, $HTTP_REFERER, $HTTP_USER_AGENT;\n global $REMOTE_ADDR, $REMOTE_PORT, $SCRIPT_FILENAME, $SERVER_ADMIN;\n global $SERVER_PORT, $SERVER_SIGNATURE, $PATH_TRANSLATED, $SCRIPT_NAME;\n global $REQUEST_URI;\n\n // php (taken from PHP doc)\n global $argv, $argc, $PHP_SELF;\n\n // other\n global $PATH_INFO, $HTTPS, $HTTP_RAW_POST_DATA, $HTTP_X_FORWARDED_FOR;\n\n if (@file_exists($filename) ) {\n include_once($filename);\n }\n}", "public function index_get()\n\t{\n\t\tphpinfo();\n\t}", "function print_name(){\n\techo \"<h1>php is server side scripting language </h1>\";\n\t\n}", "protected static function getPhpInfo() {}", "public function getPHP()\n\t{\n\t\t//\n\t}", "function phpinfo() {\n\t\t\n\t\tob_start(); \n\t\tphpinfo(); \n\t\t$info = ob_get_contents(); \n\t\tob_end_clean(); \n\t\t\n\t\t$info = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $info);\n\t\techo $info;\n\t}", "function qa_initialize_php()\n{\n\tif (qa_php_version_below('5.1.6'))\n\t\tqa_fatal_error('Q2A requires PHP 5.1.6 or later');\n\n\terror_reporting(E_ALL); // be ultra-strict about error checking\n\n\t@ini_set('magic_quotes_runtime', 0);\n\n\t@setlocale(LC_CTYPE, 'C'); // prevent strtolower() et al affecting non-ASCII characters (appears important for IIS)\n\n\tif (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get'))\n\t\t@date_default_timezone_set(@date_default_timezone_get()); // prevent PHP notices where default timezone not set\n\n\tif (ini_get('register_globals')) {\n\t\t$checkarrays = array('_ENV', '_GET', '_POST', '_COOKIE', '_SERVER', '_FILES', '_REQUEST', '_SESSION'); // unregister globals if they're registered\n\t\t$keyprotect = array_flip(array_merge($checkarrays, array('GLOBALS')));\n\n\t\tforeach ($checkarrays as $checkarray) {\n\t\t\tif (isset(${$checkarray}) && is_array(${$checkarray})) {\n\t\t\t\tforeach (${$checkarray} as $checkkey => $checkvalue) {\n\t\t\t\t\tif (isset($keyprotect[$checkkey])) {\n\t\t\t\t\t\tqa_fatal_error('My superglobals are not for overriding');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunset($GLOBALS[$checkkey]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function check_phpversion_for_hash(){\r\n\tif (version_compare(PHP_VERSION, '5.3.7', '<')) {\r\n\t exit(\"Sorry, Simple PHP Login does not run on a PHP version smaller than 5.3.7 !\");\r\n\t} else if (version_compare(PHP_VERSION, '5.5.0', '<')) {\r\n\t // if you are using PHP 5.3 or PHP 5.4 you have to include the password_api_compatibility_library.php\r\n\t // (this library adds the PHP 5.5 password hashing functions to older versions of PHP)\r\n\t require_once(\"password_compatibility_library.php\");\r\n\t}\r\n}", "function checkPhpVersion()\n\t{\n\t\t$version = explode('.', PHP_VERSION);\n\n\t\t$message = 'Php version must be at least 5.3.7 for wpdiontheme to work. Please upgrade.';\n\n\t\tif (strnatcmp(phpversion(),'5.3.7') >= 0) \n\t { \n\t \t// do nothing\n\t } \n\t else \n\t { \n\t\t\tdie($message); \n\t } \n\t}", "function help(){\n\techo \"Usage : \\t(use --verbose for more infos)\\n\";\n\techo \"--build............................: Configure apache\\n\";\n\techo \"--apache-user --verbose............: Set Apache account in memory\\n\";\n\techo \"--sitename 'webservername'.........: Build vhost for webservername\\n\";\n\techo \"--remove-host 'webservername'......: Remove vhost for webservername\\n\";\n\techo \"--install-groupware 'webservername': Install the predefined groupware\\n\";\n\techo \"--httpd............................: Rebuild main configuration and modules\\n\";\n\techo \"--perms............................: Check files and folders permissions\\n\";\n\techo \"--failed-start.....................: Verify why Apache daemon did not want to run\\n\";\n\techo \"--resolv...........................: Verify if hostnames are in DNS\\n\";\n\techo \"--drupal...........................: Install drupal site for [servername]\\n\";\n\techo \"--drupal-infos.....................: Populate drupal informations in Artica database for [servername]\\n\";\n\techo \"--drupal-uadd......................: Create new drupal [user] for [servername]\\n\";\n\techo \"--drupal-udel......................: Delete [user] for [servername]\\n\";\n\techo \"--drupal-uact......................: Activate [user] 1/0 for [servername]\\n\";\n\techo \"--drupal-upriv.....................: set privileges [user] administrator|user|anonym for [servername]\\n\";\n\techo \"--drupal-cron......................: execute necessary cron for all drupal websites\\n\";\n\techo \"--drupal-modules...................: dump drupal modules for [servername]\\n\";\n\techo \"--drupal-modules-install...........: install pre-defined modules [servername]\\n\";\n\techo \"--drupal-schedules.................: Run artica orders on the servers\\n\";\n\techo \"--listwebs.........................: List websites currently sets\\n\";\n}", "protected function getPhpVersion() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "private static function check_php() {\n\t\treturn version_compare( phpversion(), self::MINIMUM_PHP_VERSION, '>=' );\n\t}", "function iczf_fail_php_version() {\n\n\tif ( isset( $_GET['activate'] ) ) {\n\t\tunset( $_GET['activate'] );\n\t}\n\n\t/* translators: %s: PHP version */\n\t$message = sprintf( esc_html__( 'Integration of Zoho and Caldera Forms requires PHP version %s+, plugin is currently NOT RUNNING.', 'integration-zoho-calderaforms' ), '5.6' );\n\t$html_message = sprintf( '<div class=\"error\">%s</div>', wpautop( $message ) );\n\techo wp_kses_post( $html_message );\n}", "protected function checkPhpVersion() {}", "public function main()\n\t{\n\t}", "protected function openPhp()\n\t{\n\t\tif ($this->in_php) {\n\t\t\treturn '';\n\t\t}\n\t\t$this->in_php = true;\n\t\treturn '<?php ';\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "function upgrade_290()\n {\n }", "function getPhpVersion() {\n\t\n\t$version \t\t\t\t\t= explode( \".\", PHP_VERSION );\n\n\treturn( $version[0].$version[1] );\t\n}", "function htaccess_version() {\n\n\t\t\t\t\t$server_http_version = apache_get_version();\n\n\t\t\t\t\t$server_error_code \t= '';\n\t\t\t\t\t$htaccess_version \t= '1';\n\n\t\t\t\t\tif($server_http_version != false) {\n\n\t\t\t\t\tif(stristr($server_http_version,'prod') || !stristr($server_http_version,'/')) {\n\t\t\t\t\t\t$server_error_code = 'Server is set to production, cannot determine Apache version.';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t$tmp_version = explode('/',$server_http_version);\n\t\t\t\t\t\t$c = count($tmp_version);\n\t\t\t\t\t\tif($c > 0) {\n\t\t\t\t\t\t\tfor($i=1;$i<2;$i++) {\n\t\t\t\t\t\t\t\t$server_error_code = (float)str_ireplace(['apache',' '],['',''],$tmp_version[$i]);\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$server_error_code = 'Cannot determine Apache version.';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$server_error_code = 'Cannot determine Apache version: reasons: Apache is not present, or PHP cannot determine version.';\n\t\t\t\t\t}\n\n\t\t\t\t\t$server_error_code_tmp = substr($server_error_code,0,1);\n\n\t\t\t\t\t\tswitch($server_error_code_tmp) {\n\n\t\t\t\t\t\t\tcase '0':\n\t\t\t\t\t\t\t$htaccess_version = 1;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\t\t$htaccess_version = 1;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '2':\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$sv = substr($server_error_code,0,3);\n\n\t\t\t\t\t\t\t\tswitch($sv) {\n\t\t\t\t\t\t\t\t\tcase '2':\n\t\t\t\t\t\t\t\t\tcase '2.1':\n\t\t\t\t\t\t\t\t\tcase '2.2':\n\t\t\t\t\t\t\t\t\tcase '2.3':\n\t\t\t\t\t\t\t\t\t$htaccess_version = 1;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase '2.4':\n\t\t\t\t\t\t\t\t\tcase '2.5':\n\t\t\t\t\t\t\t\t\tcase '2.6':\n\t\t\t\t\t\t\t\t\tcase '2.7':\n\t\t\t\t\t\t\t\t\tcase '2.8':\n\t\t\t\t\t\t\t\t\tcase '2.9':\n\t\t\t\t\t\t\t\t\t$htaccess_version = 2;\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase range(3,12):\n\t\t\t\t\t\t\t$htaccess_version = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$htaccess_version = 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\treturn $htaccess_version;\n\t\t\t\t}", "public function main()\r\n {\r\n \r\n }", "function upgrade_372()\n {\n }", "function usage() {\n echo \"Usage:\\n\";\n echo \" php \".__FILE__.\" FILE KEYWORD\\n\";\n}", "function Usage()\n{\n\techo \"Usage: {$_SERVER['SCRIPT_FILENAME']} [-1] regex-pattern replacement-text file\\n\";\n}", "function startedIndexPhp() {return true; }", "function wp_kses_version()\n {\n }", "abstract public function installPhp();", "function upgrade_230()\n {\n }", "public function min_php_version_check()\n {\n }", "function phpOpen() {\n return Ac_Util_Php::phpOpen();\n }", "function upgrade_590()\n {\n }", "function upgrade_280()\n {\n }", "final function whatIsGood() {\n echo \"Running is good <br>\";\n }", "private static function support()\n {\n require_once static::$root.'Support'.'/'.'FunctionArgs.php';\n }", "function adminbartweak_version() {return \"1.0.0\";}", "function upgrade_300()\n {\n }", "public function main();", "function upgrade_420()\n {\n }", "function phpBB_init()\n\t{\n\t}", "function print_html_header() {\n?><!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 TRANSITIONAL//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<title>lint_php</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n\t<meta name=\"generator\" content=\"kate\">\n\t<meta name=\"description\" content=\"An online tool to compute PHP code McCabe's cyclomatic complexity\">\n\t<meta name=\"keywords\" content=\"PHP, McCabe, Cyclomatic complexity, GPL, Pasquale Ceres, Caposele\">\n</head>\n<body>\n<?php\n}", "function upgrade_101()\n {\n }", "function php_version($string){\r\n if(empty($string)){\r\n return;\r\n }\r\n $version = str_replace('.','',$string);\r\n $std = array();\r\n for($i=0; $i < strlen($version); $i++){\r\n $std[] = $version[$i];\r\n }\r\n $php_version = implode('.',$std);\r\n return $php_version;\r\n }", "function php($php, $return = FALSE) {\n if (!$return) {\n echo '<?php ' . $php . ' ?>';\n } else {\n return '<?php ' . $php . ' ?>';\n }\n }" ]
[ "0.60529304", "0.60503143", "0.59910834", "0.59577566", "0.5944758", "0.59052", "0.59012157", "0.58909386", "0.58416253", "0.5820317", "0.5819653", "0.5809496", "0.5802113", "0.57910967", "0.5775136", "0.5768308", "0.57608306", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757943", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.5757589", "0.57028157", "0.5689536", "0.5677541", "0.567742", "0.56604", "0.5658682", "0.56527996", "0.5629614", "0.5616608", "0.5602078", "0.5601509", "0.5560829", "0.5556492", "0.5555225", "0.5542967", "0.553735", "0.5524554", "0.55138546", "0.5512645", "0.55114585", "0.5511279", "0.55", "0.547954", "0.5477892", "0.5463206", "0.5457448", "0.5456428", "0.5442446", "0.54420185", "0.54369664", "0.5427263", "0.5418038" ]
0.0
-1